From aa58a6932c5e3398ee03e3842bdfaa1328d80430 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Thu, 20 Jan 2011 12:13:46 +0100 Subject: [PATCH] LSldapObject : Added getDisplayValue() method --- .../includes/class/class.LSldapObject.php | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/public_html/includes/class/class.LSldapObject.php b/public_html/includes/class/class.LSldapObject.php index b8f36dd3..52a2d1e2 100644 --- a/public_html/includes/class/class.LSldapObject.php +++ b/public_html/includes/class/class.LSldapObject.php @@ -1073,6 +1073,27 @@ class LSldapObject { } } + /** + * Retourne une valeur d'affichage de l'objet + * + * @author Benjamin Renard + * + * @param[in] $val string Le nom de la valeur demandee + * + * @retval mixed la valeur demandee ou ' ' si celle-ci est inconnue. + */ + 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); + } + } + /** * Ajoute une valeur dans le tableau $this -> other_values *