[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;
- [Noalyss-commit] [noalyss] 14/35: Translation, (continued)
- [Noalyss-commit] [noalyss] 14/35: Translation, Dany De Bontridder, 2016/05/24
- [Noalyss-commit] [noalyss] 17/35: Limit email : fix small bugs, Dany De Bontridder, 2016/05/24
- [Noalyss-commit] [noalyss] 01/35: fid.php : retrieve parameters with safe function, Dany De Bontridder, 2016/05/24
- [Noalyss-commit] [noalyss] 22/35: Acc_Ledger_Sold : avoid message when undefined variable, Dany De Bontridder, 2016/05/24
- [Noalyss-commit] [noalyss] 12/35: Translation, Dany De Bontridder, 2016/05/24
- [Noalyss-commit] [noalyss] 18/35: Documentation sorttable_nosort, Dany De Bontridder, 2016/05/24
- [Noalyss-commit] [noalyss] 15/35: Bug : wrong url to update folders, Dany De Bontridder, 2016/05/24
- [Noalyss-commit] [noalyss] 27/35: Merge branch 'master' of ssh://ns2git/srv/git/noalyss, Dany De Bontridder, 2016/05/24
- [Noalyss-commit] [noalyss] 05/35: Add defined value OFFICE and GENERATE_PDF, Dany De Bontridder, 2016/05/24
- [Noalyss-commit] [noalyss] 02/35: Extension : fix path, Dany De Bontridder, 2016/05/24
- [Noalyss-commit] [noalyss] 26/35: Import IText,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 23/35: Fix several small bugs, Dany De Bontridder, 2016/05/24
- [Noalyss-commit] [noalyss] 35/35: Impress JRN Fix bug with qcode, Dany De Bontridder, 2016/05/24
- [Noalyss-commit] [noalyss] 13/35: translation, Dany De Bontridder, 2016/05/24
- [Noalyss-commit] [noalyss] 19/35: CFGPLUGIN : Add filter to plugin table, Dany De Bontridder, 2016/05/24
- [Noalyss-commit] [noalyss] 20/35: Fiche : détail fiche , change taille id fiche, Dany De Bontridder, 2016/05/24
- [Noalyss-commit] [noalyss] 25/35: Fix several small bugs, Dany De Bontridder, 2016/05/24
- [Noalyss-commit] [noalyss] 24/35: Cosmetic change CSS for mobile, Dany De Bontridder, 2016/05/24
- [Noalyss-commit] [noalyss] 11/35: Anc_Operation :fix undefined offset in Anc_Operation::save_form_plan, Dany De Bontridder, 2016/05/24
- [Noalyss-commit] [noalyss] 32/35: Fix problem with orphan_lob_clean instead of clean_orphan_lob and fix problem when checking analytic when amount == 0, Dany De Bontridder, 2016/05/24
- [Noalyss-commit] [noalyss] 07/35: Improve : Admin/user for admin , no database details since he can connect all of them, Dany De Bontridder, 2016/05/24