noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 01/11: For 7.2 , $p_value must be initialized


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 01/11: For 7.2 , $p_value must be initialized to an array in ISelect
Date: Fri, 18 Jan 2019 12:24:26 -0500 (EST)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 63230cce792d63cc953d4b51c80749d7835d3294
Author: Dany De Bontridder <address@hidden>
Date:   Thu Oct 11 20:04:25 2018 +0200

    For 7.2 , $p_value must be initialized to an array in ISelect
---
 include/lib/iselect.class.php | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/include/lib/iselect.class.php b/include/lib/iselect.class.php
index 2008735..1a91055 100644
--- a/include/lib/iselect.class.php
+++ b/include/lib/iselect.class.php
@@ -29,6 +29,17 @@
 require_once NOALYSS_INCLUDE.'/lib/html_input.class.php';
 class ISelect extends HtmlInput
 {
+    function __construct($p_name="", $p_value="", $p_id="")
+    {
+        parent::__construct($p_name,$p_value,$p_id);
+        $this->name=$p_name;
+        if ( $p_value == "" || ! is_array($p_value))  {
+            $this->value=array();
+        } else {
+            $this->value=$p_value;
+        }
+        $this->id=$p_id;
+    }
     /*!\brief show the html  input of the widget*/
     public function input($p_name=null,$p_value=null)
     {
@@ -69,7 +80,7 @@ class ISelect extends HtmlInput
             }
         }
       // $r='<span class="input_text_ro">'.$r.'</span>';
-       if ( $this->table == 1 )                  $a='<td>'.$r.'</td>';
+       if ( $this->table == 1 )                  $r='<td>'.$r.'</td>';
         return $r;
     }
     /*!\brief print in html the readonly value of the widget*/
@@ -96,11 +107,10 @@ class ISelect extends HtmlInput
     * // will be turned into 
     * array( array("value"=>'M,"label"=>"Mister")...)
     * @endcode
-    * @param type $p_array
-    * @return type
+    * @param array $p_array
     */
    public function transform($p_array) {
-        if (count($p_array)==0) return array();
+        if (! is_array($p_array) || count($p_array)==0) return ;
         $a_ret=array();
         foreach ($p_array as $key=>$value) {
             $a_ret['value']=$key;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]