diff --git a/doc/conf/LSattribute/LSattr_html/LSattr_html_select_list.docbook b/doc/conf/LSattribute/LSattr_html/LSattr_html_select_list.docbook
index f75596e5..d28ea8aa 100644
--- a/doc/conf/LSattribute/LSattr_html/LSattr_html_select_list.docbook
+++ b/doc/conf/LSattribute/LSattr_html/LSattr_html_select_list.docbook
@@ -46,6 +46,7 @@
)
)
),
+ 'translate_labels' => [booléen],
'sort' => [Booléen],
'sortDirection' => '[ASC|DESC]'
),]]>
@@ -175,6 +176,12 @@
+
+ translate_labels
+
+ Booléen permettant d'activer/désactiver la traduction des labels (Par defaut : Vrai).
+
+
sort
diff --git a/public_html/includes/class/class.LSattr_html_select_list.php b/public_html/includes/class/class.LSattr_html_select_list.php
index 8922d325..4fdeb10f 100644
--- a/public_html/includes/class/class.LSattr_html_select_list.php
+++ b/public_html/includes/class/class.LSattr_html_select_list.php
@@ -103,19 +103,35 @@ class LSattr_html_select_list extends LSattr_html{
}
else {
$vk=$ldapObject->getFData($vk);
- $vl=$ldapObject->getFData(__($vl));
+ if (isset($options['translate_labels']) && !$options['translate_labels']) {
+ $vl=$ldapObject->getFData($vl);
+ }
+ else {
+ $vl=$ldapObject->getFData(__($vl));
+ }
$subRetInfos[$vk]=$vl;
}
}
self :: _sort($subRetInfos,$options);
+ if (isset($options['translate_labels']) && !$options['translate_labels']) {
+ $subRetLabel = $ldapObject->getFData($val_label['label']);
+ }
+ else {
+ $subRetLabel = $ldapObject->getFData(__($val_label['label']));
+ }
$retInfos[] = array (
- 'label' => $ldapObject->getFData(__($val_label['label'])),
+ 'label' => $subRetLabel,
'possible_values' => $subRetInfos
);
}
else {
$val_key=$ldapObject->getFData($val_key);
- $val_label=$ldapObject->getFData(__($val_label));
+ if (isset($options['translate_labels']) && !$options['translate_labels']) {
+ $val_label=$ldapObject->getFData($val_label);
+ }
+ else {
+ $val_label=$ldapObject->getFData(__($val_label));
+ }
$retInfos[$val_key]=$val_label;
}
}
@@ -300,8 +316,14 @@ class LSattr_html_select_list extends LSattr_html{
$attr_values = array();
elseif (!is_array($attr_values))
$attr_values = array($attr_values);
- foreach($attr_values as $attr_value)
- $retInfos[$attr_value] = __($attr_value);
+ if (isset($options['translate_labels']) && !$options['translate_labels']) {
+ foreach($attr_values as $attr_value)
+ $retInfos[$attr_value] = $attr_value;
+ }
+ else {
+ foreach($attr_values as $attr_value)
+ $retInfos[$attr_value] = __($attr_value);
+ }
}
else
LSerror :: addErrorCode('LSattr_html_select_list_02',$attr);
diff --git a/public_html/includes/class/class.LSformElement_select_box.php b/public_html/includes/class/class.LSformElement_select_box.php
index 30aad2bd..46a01f63 100644
--- a/public_html/includes/class/class.LSformElement_select_box.php
+++ b/public_html/includes/class/class.LSformElement_select_box.php
@@ -47,6 +47,7 @@ class LSformElement_select_box extends LSformElement_select {
if (!$this -> isFreeze()) {
LSsession :: addCssFile('LSformElement_select_box.css');
}
+ $this -> fetchVariables['translate_labels'] = ((isset($this -> params['translate_labels']) && !$this -> params['translate_labels'])?false:true);
return parent :: getDisplay();
}
diff --git a/public_html/lang/generate_lang_file.php b/public_html/lang/generate_lang_file.php
index 732ec7dd..b7e17565 100755
--- a/public_html/lang/generate_lang_file.php
+++ b/public_html/lang/generate_lang_file.php
@@ -217,7 +217,7 @@ if (loadDir(LS_OBJECTS_DIR) && loadDir(LS_LOCAL_DIR.LS_OBJECTS_DIR)) {
add($attr['html_options']['mail']['msg']);
// LSattr_html_select_list
- if (($attr['html_type']=='select_list' || $attr['html_type']=='select_box') && is_array($attr['html_options']['possible_values']) && !$withoutselectlist) {
+ if (($attr['html_type']=='select_list' || $attr['html_type']=='select_box') && is_array($attr['html_options']['possible_values']) && (!isset($attr['html_options']['translate_labels']) || $attr['html_options']['translate_labels']) && !$withoutselectlist) {
foreach($attr['html_options']['possible_values'] as $pkey => $pname) {
if (is_array($pname)) {
add($pname['label']);
diff --git a/public_html/templates/default/LSformElement_select_box.tpl b/public_html/templates/default/LSformElement_select_box.tpl
index f98acf99..d6ad896b 100644
--- a/public_html/templates/default/LSformElement_select_box.tpl
+++ b/public_html/templates/default/LSformElement_select_box.tpl
@@ -19,7 +19,7 @@