Compare commits

..

No commits in common. "11a8448b0ae0c61fda3e18819654e1c9bbc806ae" and "961740c85538291f59b25e1caef6439976d6f0c2" have entirely different histories.

2 changed files with 22 additions and 21 deletions

View file

@ -256,9 +256,15 @@ class LSattribute extends LSlog_staticLoggerClass {
return false; return false;
} }
$data = $this -> ldap -> getDisplayValue( if ($data !== false) {
$data !== false ? $data : $this -> getValue() $data = $this -> ldap -> getDisplayValue($data);
); }
elseif ($this -> isUpdate()) {
$data = $this -> ldap -> getDisplayValue($this -> updateData);
}
else {
$data = $this -> ldap -> getDisplayValue($this -> data);
}
$onDisplay = $this -> getConfig('onDisplay'); $onDisplay = $this -> getConfig('onDisplay');
if ($onDisplay) { if ($onDisplay) {

View file

@ -1079,29 +1079,24 @@ class LSldapObject extends LSlog_staticLoggerClass {
} }
/** /**
* Return an objet displayed value * Retourne une valeur d'affichage de l'objet
*
* The value returned depends of the $val parameter. If the requested value is unknown, the returned value
* will be $default (default: a space caracter = ' ').
*
* Supported values:
* - [attribute name] : the displayed value of the corresponding attribute
* *
* @author Benjamin Renard <brenard@easter-eggs.com> * @author Benjamin Renard <brenard@easter-eggs.com>
* *
* @param string $val The requested value * @param string $val Le nom de la valeur demandee
* @param boolean $first If true and the result is an array, return only the first value (optional, default: false)
* @param string $default Default value if unknown (optional, default: a space caracter = ' ')
* *
* @return mixed The requested value or $default if unknown * @return string la valeur demandee ou ' ' si celle-ci est inconnue.
*/ */
public function getDisplayValue($val, $first=false, $default=' ') { public function getDisplayValue($val) {
$return = $default; if(isset($this -> attrs[$val])){
if(isset($this -> attrs[$val]) && method_exists($this -> attrs[$val], 'getDisplayValue')) if (method_exists($this -> attrs[$val],'getDisplayValue'))
$return = ensureIsArray($this -> attrs[$val] -> getDisplayValue()); return $this -> attrs[$val] -> getDisplayValue();
if (is_array($return) && $first) else
$return = (count($return) >= 1?$return[0]:null); return ' ';
return $return; }
else {
return $this -> getValue($val);
}
} }
/** /**