LSformElement_select_object : fixed, completed and translated comments

This commit is contained in:
Benjamin Renard 2010-04-26 16:31:57 +02:00
parent 1e32b94ac7
commit 3b51ec7268

View file

@ -23,18 +23,17 @@
LSsession :: loadLSclass('LSformElement'); LSsession :: loadLSclass('LSformElement');
/** /**
* Element select d'un formulaire pour LdapSaisie * Select object element for LdapSaisie form
* *
* Cette classe définis les éléments select des formulaires. * This class define select elements for form. It extends the generic class LSformElement.
* Elle étant la classe basic LSformElement.
* *
* Options HTML : * HTML options :
* // ************************************* * // *************************************
* 'html_options' => array ( * 'html_options' => array (
* selectable_object => array ( * selectable_object => array (
* 'object_type' => '[Type d'LSobject selectionnable]', * 'object_type' => '[Type of LSobject witch is selectable]',
* 'display_name_format' => '[LSformat du nom d'affichage des LSobjects]', * 'display_name_format' => '[LSformat of the display name of the LSobjects]',
* 'value_attribute' => '[LSformat de la valeur clé référant à un LSobject donnée]' * 'value_attribute' => '[The attribute name whitch is used as the key value of one LSobject]'
* ) * )
* ), * ),
* // ************************************* * // *************************************
@ -48,9 +47,9 @@ class LSformElement_select_object extends LSformElement {
var $template = 'LSformElement_select_object.tpl'; var $template = 'LSformElement_select_object.tpl';
/** /**
* Retourn les infos d'affichage de l'élément * Return display informations of the element
* *
* Cette méthode retourne les informations d'affichage de l'élement * This method return the display informations of the element.
* *
* @retval array * @retval array
*/ */
@ -94,16 +93,16 @@ class LSformElement_select_object extends LSformElement {
} }
/* /*
* Retourne les valeurs de l'objet à partir de la variable Session * Return the values of the object form the session variable
*/ */
function getValuesFromSession() { function getValuesFromSession() {
return $this -> attr_html -> getValuesFromSession(); return $this -> attr_html -> getValuesFromSession();
} }
/** /**
* Défini le type d'objet sélectionnable * Defined the type of object witch is selectionable
* *
* @param[in] $object string Le type d'object * @param[in] $object string The type of object
* *
* @retval void * @retval void
**/ **/
@ -112,9 +111,9 @@ class LSformElement_select_object extends LSformElement {
} }
/** /**
* Exporte les valeurs de l'élément * Export the values of the element
* *
* @retval Array Les valeurs de l'élement * @retval Array The values of the element
*/ */
function exportValues(){ function exportValues(){
$values = $this -> attr_html -> getValuesFromFormValues($this -> values); $values = $this -> attr_html -> getValuesFromFormValues($this -> values);
@ -122,17 +121,13 @@ class LSformElement_select_object extends LSformElement {
} }
/** /**
* Définis la valeur de l'élément à partir des données * Defined the value of the element from the data sent in POST with the form.
* envoyées en POST du formulaire
*
* Cette méthode définis la valeur de l'élément à partir des données
* envoyées en POST du formulaire.
* *
* @author Benjamin Renard <brenard@easter-eggs.com> * @author Benjamin Renard <brenard@easter-eggs.com>
* *
* @param[in] [<b>required</b>] string or array La futur valeur de l'élément * @param[in] [<b>required</b>] string or array The new value of the element
* *
* @retval boolean Retourne True * @retval boolean Return True
*/ */
function setValueFromPostData($data) { function setValueFromPostData($data) {
LSformElement::setValueFromPostData($data); LSformElement::setValueFromPostData($data);
@ -141,11 +136,11 @@ class LSformElement_select_object extends LSformElement {
} }
/** /**
* Recherche les objets sélectionnables à partir du pattern fournis * Search the selectionable objects with a pattern
* *
* @param[in] $pattern Pattern de recherche * @param[in] $pattern The pattern of the search
* *
* @retval array(dn -> displayName) Les objets trouvés * @retval array(dn -> displayName) Found objects
*/ */
function searchAdd ($pattern) { function searchAdd ($pattern) {
if (is_array($this -> params['html_options']['selectable_object'])) { if (is_array($this -> params['html_options']['selectable_object'])) {
@ -160,6 +155,14 @@ class LSformElement_select_object extends LSformElement {
return array(); return array();
} }
/**
* This ajax method is used to refresh the value display
* in the form element after the modify window is closed.
*
* @param[in] $data The address to the array of data witch will be return by the ajax request
*
* @retval void
**/
public static function ajax_refresh(&$data) { public static function ajax_refresh(&$data) {
if ((isset($_REQUEST['attribute'])) && (isset($_REQUEST['objecttype'])) && (isset($_REQUEST['objectdn'])) && (isset($_REQUEST['idform'])) ) { if ((isset($_REQUEST['attribute'])) && (isset($_REQUEST['objecttype'])) && (isset($_REQUEST['objectdn'])) && (isset($_REQUEST['idform'])) ) {
if (LSsession ::loadLSobject($_REQUEST['objecttype'])) { if (LSsession ::loadLSobject($_REQUEST['objecttype'])) {
@ -176,6 +179,13 @@ class LSformElement_select_object extends LSformElement {
} }
} }
/**
* This ajax method is used by the search-and-add function of the form element.
*
* @param[in] $data The address to the array of data witch will be return by the ajax request
*
* @retval void
**/
public static function ajax_searchAdd(&$data) { public static function ajax_searchAdd(&$data) {
if ((isset($_REQUEST['attribute'])) && (isset($_REQUEST['objecttype'])) && (isset($_REQUEST['pattern'])) && (isset($_REQUEST['idform'])) ) { if ((isset($_REQUEST['attribute'])) && (isset($_REQUEST['objecttype'])) && (isset($_REQUEST['pattern'])) && (isset($_REQUEST['idform'])) ) {
if (LSsession ::loadLSobject($_REQUEST['objecttype'])) { if (LSsession ::loadLSobject($_REQUEST['objecttype'])) {