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;
}
$data = $this -> ldap -> getDisplayValue(
$data !== false ? $data : $this -> getValue()
);
if ($data !== false) {
$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');
if ($onDisplay) {

View file

@ -1079,29 +1079,24 @@ class LSldapObject extends LSlog_staticLoggerClass {
}
/**
* Return an objet displayed value
*
* 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
* Retourne une valeur d'affichage de l'objet
*
* @author Benjamin Renard <brenard@easter-eggs.com>
*
* @param string $val The requested value
* @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 = ' ')
* @param string $val Le nom de la valeur demandee
*
* @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=' ') {
$return = $default;
if(isset($this -> attrs[$val]) && method_exists($this -> attrs[$val], 'getDisplayValue'))
$return = ensureIsArray($this -> attrs[$val] -> getDisplayValue());
if (is_array($return) && $first)
$return = (count($return) >= 1?$return[0]:null);
return $return;
public function getDisplayValue($val) {
if(isset($this -> attrs[$val])){
if (method_exists($this -> attrs[$val],'getDisplayValue'))
return $this -> attrs[$val] -> getDisplayValue();
else
return ' ';
}
else {
return $this -> getValue($val);
}
}
/**