From 19dbf9561f0a0d59d9734d879c12106e80501813 Mon Sep 17 00:00:00 2001 From: Alan Garcia Date: Thu, 20 Mar 2014 11:53:32 +0000 Subject: [PATCH] Bugfix affichage rawhtml des variables Debut de changement pour variable_get --- bureau/class/m_admin.php | 2 +- bureau/class/m_variables.php | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/bureau/class/m_admin.php b/bureau/class/m_admin.php index 89e43f42..6c8249a5 100644 --- a/bureau/class/m_admin.php +++ b/bureau/class/m_admin.php @@ -587,7 +587,7 @@ class m_admin { */ function hook_admin_add_member() { global $err, $cuid, $L_FQDN, $L_HOSTING; - $dest = variable_get('new_email', 0, 'An email will be sent to this address when new accounts are created if set.'); + $dest = variable_get('new_email', '0', 'An email will be sent to this address when new accounts are created if set.', array(array('desc'=>'Enabled','type'=>'boolean'))); if (!$dest) { return false; } diff --git a/bureau/class/m_variables.php b/bureau/class/m_variables.php index e7aaf616..c16efdff 100644 --- a/bureau/class/m_variables.php +++ b/bureau/class/m_variables.php @@ -248,11 +248,19 @@ class m_variables { echo "$k"; } else { if ( !isset($this->variables_list()['DEFAULT'][null][$varname]['type'][$k]) || is_array( $this->variables_list()['DEFAULT'][null][$varname]['type'][$k] ) ) { - echo $k; + if (isset($this->variables_list()['DEFAULT'][null][$varname]['type'][$k]['desc'])) { + echo $this->variables_list()['DEFAULT'][null][$varname]['type'][$k]['desc']; + } else { + echo $k; + } } else { echo $this->variables_list()['DEFAULT'][null][$varname]['type'][$k]; } } + } else { + if (isset($this->variables_list()['DEFAULT'][null][$varname]['type'][$k]['desc'] )) { + echo $this->variables_list()['DEFAULT'][null][$varname]['type'][$k]['desc']; + } } if (is_array($l)) { echo ""; } // empty $v - } else if (empty($v)) { + } else if (empty($v) && $v != '0') { echo ""._("Empty").""; } else { echo $v;