LSobject : Add possibility to add extra displayed columns in search result
[ldapsaisie.git] / public_html / includes / class / class.LSsearchEntry.php
index 00e6806..35c492e 100644 (file)
@@ -174,6 +174,20 @@ class LSsearchEntry {
       }
       return;
     }
+    elseif (is_array($this->LSsearch->extraDisplayedColumns) && array_key_exists($key,$this->LSsearch->extraDisplayedColumns)) {
+      if(isset($this -> cache[$key])) {
+        return $this -> cache[$key];
+      }
+      $ret=$this -> getFData($this->LSsearch->extraDisplayedColumns[$key]['LSformat']);
+      if (empty($ret) && is_array($this->LSsearch->extraDisplayedColumns[$key]['alternativeLSformats'])) {
+        foreach($this->LSsearch->extraDisplayedColumns[$key]['alternativeLSformats'] as $format) {
+          $ret=$this -> getFData($format);
+          if (!empty($ret)) break;
+        }
+      }
+      $this -> cache[$key] = $ret;
+      return $ret;
+    }
     elseif (in_array($key,array_keys($this -> attrs))) {
       return $this -> attrs[$key];
     }