From e251878913993e301065202b90f2223054c0b9eb Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Fri, 22 Dec 2017 16:31:00 +0100 Subject: [PATCH] LSatt_html :: jsonCompositeAttributeFix : fix possible values ajax loading --- ...s.LSformElement_jsonCompositeAttribute.php | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/public_html/includes/class/class.LSformElement_jsonCompositeAttribute.php b/public_html/includes/class/class.LSformElement_jsonCompositeAttribute.php index ee061617..2a480939 100644 --- a/public_html/includes/class/class.LSformElement_jsonCompositeAttribute.php +++ b/public_html/includes/class/class.LSformElement_jsonCompositeAttribute.php @@ -94,31 +94,33 @@ class LSformElement_jsonCompositeAttribute extends LSformElement { } } - $components = $this -> components; - foreach($components as $c => $cconf) { - if ($cconf['type']=='select_list') { - $components[$c]['possible_values']=$this -> getSelectListComponentPossibleValues($c); - } - } - $return['html'] = $this -> fetchTemplate(NULL, array( 'parseValues' => $parseValues, - 'components' => $components ) ); LSsession :: addCssFile('LSformElement_jsonCompositeAttribute.css'); return $return; } - /** - * Return HTML code of an empty field + * Retournne un template Smarty compilé dans le contexte d'un LSformElement * - * @retval string HTML code of an empty field. + * @param[in] string $template Le template à retourner + * @param[in] array $variables Variables Smarty à assigner avant l'affichage + * + * @retval string Le HTML compilé du template */ - function getEmptyField() { - return $this -> fetchTemplate($this -> fieldTemplate,array('components' => $this -> components)); + function fetchTemplate($template=NULL,$variables=array()) { + $components = $this -> components; + foreach($components as $c => $cconf) { + if ($cconf['type']=='select_list') { + $components[$c]['possible_values']=$this -> getSelectListComponentPossibleValues($c); + } + } + $variables['components'] = $components; + + return parent::fetchTemplate($template, $variables); } /**