noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 26/35: Import IText


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 26/35: Import IText
Date: Tue, 24 May 2016 21:25:40 +0000 (UTC)

sparkyx pushed a commit to branch master
in repository noalyss.

commit f535ac5f37e15f48d5b0485a6fe000850b3af270
Author: Dany De Bontridder <address@hidden>
Date:   Fri May 6 22:37:19 2016 +0200

    Import IText
---
 include/lib/class_html_input.php |    7 ++---
 include/lib/class_itext.php      |   53 +++++++++++++++++++++++++++-----------
 2 files changed, 42 insertions(+), 18 deletions(-)

diff --git a/include/lib/class_html_input.php b/include/lib/class_html_input.php
index c3d8eb3..ea00a49 100755
--- a/include/lib/class_html_input.php
+++ b/include/lib/class_html_input.php
@@ -64,9 +64,9 @@ class HtmlInput
     var $disabled;                  /*!<  $disabled poss. value == true or 
nothing, to disable INPUT*/
     var $extra;                     /*!<  $extra different usage, it depends 
of the $type */
     var $extra2;                    /*!<  $extra2 different usage,
-                                                                               
it depends of the $type */
-    var $javascript;                              /*!< $javascript  is the 
javascript to add to the widget */
-    var $ctrl;                                         /*!<$ctrl is the 
control to update (see js_search_card_control) */
+                                            it depends of the $type */
+    var $javascript;                /*!< $javascript  is the javascript to add 
to the widget */
+    var $ctrl;                 /*!<$ctrl is the control to update (see 
js_search_card_control) */
 
     var $tabindex;
     function __construct($p_name="",$p_value="",$p_id="")
@@ -81,6 +81,7 @@ class HtmlInput
         $this->table=0;
         $this->disabled=false;
         $this->javascript="";
+        $this->extra="";
         $this->extra2="all";
         $this->attribute=array();
         $this->id=$p_id;
diff --git a/include/lib/class_itext.php b/include/lib/class_itext.php
index c249462..de639ef 100644
--- a/include/lib/class_itext.php
+++ b/include/lib/class_itext.php
@@ -25,10 +25,17 @@
 require_once NOALYSS_INCLUDE.'/lib/class_html_input.php';
 class IText extends HtmlInput
 {
+    var $placeholder; 
+    var $title;
+    var $autofocus;
     function __construct($name='',$value='',$p_id="")
     {
         parent::__construct($name,$value,$p_id);
+        $this->title="";
+        $this->placeholder="";
+        $this->extra="";
         $this->style=' class="input_text" ';
+        $this->autofocus=false;
     }
     /*!\brief show the html  input of the widget*/
     public function input($p_name=null,$p_value=null)
@@ -36,28 +43,44 @@ class IText extends HtmlInput
         $this->name=($p_name==null)?$this->name:$p_name;
         $this->value=($p_value==null)?$this->value:$p_value;
         if ( $this->readOnly==true) return $this->display();
-               $this->id=($this->id=="")?$this->name:$this->id;
-
-        $t= ((isset($this->title)))?'title="'.$this->title.'"   ':' ';
-
-        $extra=(isset($this->extra))?$this->extra:"";
+       $this->id=($this->id=="")?$this->name:$this->id;
 
+        $t= 'title="'.$this->title.'" ';
+        $autofocus=($this->autofocus)?" autofocus ":"";
         $this->value=str_replace('"','',$this->value);
         if ( ! isset ($this->css_size))
         {
-        $r='<INPUT '.$this->style.' TYPE="TEXT" id="'.
-           $this->id.'"'.$t.
-           'NAME="'.$this->name.'" VALUE="'.$this->value.'"  '.
-           'SIZE="'.$this->size.'" '.$this->javascript."  $this->extra >";
-        /* add tag for column if inside a table */
+            
+            $r=  sprintf('<INPUT TYPE="TEXT" %s id="%s" name="%s" value="%s" 
placeholder="%s" title="%s"
+                     Size="%s"  %s %s  %s>
+                    ',$this->style,
+                    $this->id,
+                    $this->name,
+                    $this->value,
+                    $this->placeholder,
+                    $this->title,
+                    $this->size,
+                    $this->javascript,
+                    $this->extra,
+                    $autofocus
+                    );
         } else {
-           $r='<INPUT '.$this->style.' TYPE="TEXT" id="'.
-           $this->id.'"'.$t.
-           'NAME="'.$this->name.'" VALUE="'.$this->value.'"  '.
-           ' style="width:'.$this->css_size.';" '.$this->javascript."  
$this->extra >";
-
+            $r=  sprintf('<INPUT TYPE="TEXT" %s id="%s" name="%s" value="%s" 
placeholder="%s" title="%s"
+                     style="width:%s;"  %s %s  %s>
+                    ',$this->style,
+                    $this->id,
+                    $this->name,
+                    $this->value,
+                    $this->placeholder,
+                    $this->title,
+                    $this->css_size,
+                    $this->javascript,
+                    $this->extra,
+                    $autofocus
+                    );
         }
 
+        /* add tag for column if inside a table */
         if ( $this->table == 1 )                 $r='<td>'.$r.'</td>';
 
         return $r;



reply via email to

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