LSformElement : add displayAttrName parameter
authorBenjamin Renard <brenard@easter-eggs.com>
Fri, 19 Nov 2010 17:41:10 +0000 (18:41 +0100)
committerBenjamin Renard <brenard@easter-eggs.com>
Fri, 19 Nov 2010 17:41:10 +0000 (18:41 +0100)
public_html/includes/class/class.LSformElement.php

index 64c7c1a..cdf0732 100644 (file)
@@ -189,9 +189,17 @@ class LSformElement {
         $return['required']=true;
     }
     $return['label'] = $this -> getLabel();
+    $help_info = "";
+    if ( (isset($this -> params['displayAttrName']) && $this -> params['displayAttrName']) || (isset($this -> attr_html -> attribute -> ldapObject -> config['displayAttrName']) && $this -> attr_html -> attribute -> ldapObject -> config['displayAttrName']) ) {
+      $help_info=_("Attribute")." : ".$this -> name."\n";
+    }
     if (isset($this -> params['help_info'])) {
-      $return['help_info']=__($this -> params['help_info']);
+      if (!empty($help_info)) $help_info .= " - ";
+      $help_info.=__($this -> params['help_info']);
     }
+    if (!empty($help_info))
+      $return['help_info'] = $help_info;
+
     return $return;
   }