From 49f7a2f39c3ce2812cbcbb63866a38f93db49c47 Mon Sep 17 00:00:00 2001 From: sparkyx Date: Sun, 3 Aug 2025 11:09:11 +0200 Subject: [PATCH] Improve ISELECT can use OPTGROUP --- include/lib/iselect.class.php | 36 ++++++++++++++- scenario/LIB/HtmlInput.test.php | 82 ++++++++++++++++++++++++++++++++- 2 files changed, 116 insertions(+), 2 deletions(-) diff --git a/include/lib/iselect.class.php b/include/lib/iselect.class.php index fa516971e..de295469f 100644 --- a/include/lib/iselect.class.php +++ b/include/lib/iselect.class.php @@ -54,7 +54,26 @@ class ISelect extends HtmlInput $this->value=$p_value; } } - /*!\brief show the html input of the widget*/ + /*! + * \brief show the html input of the widget + * \note to use a OPTGROUP, the key "value" must be null , it is important + * to note that it is needed to use for opening and closing the element + * \code + $select->value=array( + array ("value"=>null,"label"=>"Groupe 1"), + array ("value"=>1,"label"=>"Element 1"), + array ("value"=>2,"label"=>"Element 2"), + array ("value"=>null,"label"=>"END Groupe 1"), // not displaid + array ("value"=>null,"label"=>"Groupe 2"), + array ("value"=>1,"label"=>"Element 1"), + array ("value"=>2,"label"=>"Element 2"), + array ("value"=>null,"label"=>"END group Groupe 1")// not displaid + ); + * + * \endcode + + * + * */ public function input($p_name=null,$p_value=null) { $this->name=($p_name==null)?$this->name:$p_name; @@ -70,9 +89,24 @@ class ISelect extends HtmlInput $a="