noalyss Version-10
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
IText Class Reference

Html Input Text member : More...

+ Inheritance diagram for IText:
+ Collaboration diagram for IText:

Public Member Functions

 __construct ($name='', $value='', $p_id="")
 
 display ()
 print in html the readonly value of the widget
 
 get_datalist ()
 
 input ($p_name=null, $p_value=null)
 show the html input of the widget
 
 set_datalist ($datalist)
 
 set_require ($p_boolean)
 
- Public Member Functions inherited from HtmlInput
 __toString ()
 
 get_js_attr ()
 you can add attribute to this in javascript this function is a wrapper and create a script (in js) to modify "this" (in javascript) with the value of obj->attribute from PHP.
 
 get_node_attribute ()
 Insert attribute inside a INPUT TYPE, these attribute can be retrieved in javascript with element.getAttribute or changed with element.setAttribute example insert my_attribute into a checkbox <input type="checkbox" "my_attribute"="XX">
 
 get_placeholder ()
 
 get_value ()
 Return the value of input (IText, INum,...)
 
 make_object_deprecated ($p_name=null)
 Make a JSON object, this method create a javascript object with the attribute set, it returns a javascript string with the object.
 
 set_attribute ($p_name, $p_value)
 add an HTML attribute for the INPUT field
 
 set_placeholder ($placeholder)
 set HTML placeholder attribut
 
 set_value ($p_string)
 Set the value of input (IText, INum,...)
 
 setReadOnly ($p_read)
 

Static Public Member Functions

static test_me ()
 
- Static Public Member Functions inherited from HtmlInput
static anchor ($p_text, $p_url="", $p_js="", $p_style=' class="line" ', $p_title="click", array $p_attribute=[])
 Return a simple LINK with a url or a javascript if $p_js is not null then p_url will be javascript:void(0) we don't add the event onclick.
 
static anchor_action ($action, $javascript, $id=NULL, $p_class="button", $p_symbole="")
 Anchor Html with javascript.
 
static anchor_close ($div, $p_js="")
 Return a html string with an anchor which close the inside popup.
 
static anchor_empty ($p_text, $p_id, $p_title="")
 let you create only a link and set an id on it.
 
static anchor_hide ($action, $javascript)
 Return a html string with an anchor to hide a div, put it in the right corner.
 
static array_to_hidden ($array, $global_array)
 transform request data to hidden
 
static array_to_string ($array, $global_array, $start="?")
 transform request data to string
 
static button ($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
 
static button_action ($action, $javascript, $id=NULL, $p_class="button", $p_symbole="")
 button Html with javascript
 
static button_action_add ()
 
static button_action_remove_operation ($p_operation)
 
static button_anchor ($p_label, $p_value, $p_name="", $p_javascript="", $p_class="smallbutton")
 create a button with a ref
 
static button_choice_ledger ($p_array)
 
static button_close ($div_name, $class='smallbutton')
 close button for the HTML popup
 
static button_hide ($div_name, $class='smallbutton')
 Hide the HTML popup.
 
static button_image ($javascript, $id="xx", $p_class='class="button"', $p_image="")
 button Html image
 
static calendar_zoom ($obj)
 Zoom the calendar.
 
static card_detail ($p_qcode, $pname='', $p_style="", $p_nohistory=false, $nofollowup=false)
 show the detail of a card
 
static default_value ($ind, $default, $array)
 return default if the value if the value doesn't exist in the array
 
static default_value_get ($ind, $default)
 return default if the value if the value doesn't exist in $_GET use HttpInput instead
 
static default_value_post ($ind, $default)
 return default if the value if the value doesn't exist in $_POST use HttpInput instead
 
static default_value_request ($ind, $default)
 return default if the value if the value doesn't exist in $_REQUEST use HttpInput instead
 
static detail_action ($ag_id, $p_mesg, $p_modify=1)
 return an anchor to view the detail of an action
 
static detail_modele_document_deprecated ($p_id, $p_mesg)
 return a string containing the html code for calling the modifyModeleDocument
 
static detail_op ($p_jr_id, $p_mesg)
 return a string containing the html code for calling the modifyOperation
 
static display_periode ($p_id)
 
static errorbulle ($p_comment)
 
static extension ()
 
static filter_list ($p_list_id)
 Display a field for searching an element in a list, the searchable text must be in an element with the className search-content.
 
static filter_table ($p_table_id, $p_col, $start_row)
 filter the rows in a table and keep the colored row in alternance
 
static filter_table_DOM ($p_table_id, $p_col, $start_row, $p_name, $domid)
 filter the rows in a table and keep the colored row in alternance
 
static filter_table_form ($p_table_id, $p_col, $start_row, $p_name, $p_old_value)
 filter the rows in a table and keep the colored row in alternance
 
static followup_card_button ($f_id, $p_mesg)
 display a div with the history of the card
 
static generate_id ($p_prefix)
 generate an unique id for a widget,
 
static get_to_hidden ($array)
 transform $_GET data to hidden
 
static get_to_string ($array, $start="?")
 transform $_GET data to string
 
static hidden ($p_name, $p_value, $p_id="")
 
static history_account ($p_account, $p_mesg, $p_style="", $p_exercice="")
 display a div with the history of the account
 
static history_anc_account ($p_account, $p_mesg, $p_style="", $p_exercice="")
 display a div with the history of the analytic account
 
static history_card ($f_id, $p_mesg, $p_style="", $p_exercice="")
 display a div with the history of the card
 
static history_card_button ($f_id, $p_mesg, $p_exercice="")
 display a div with the history of the card
 
static image_click ($p_image, $p_js, $p_message, $p_class="")
 Image to click ,.
 
static json_to_hidden ($p_json)
 transform a json to hidden
 
static post_to_hidden ($array)
 transform $_POST data to hidden
 
static post_to_string ($array)
 transform $_POST data to string
 
static print_window ()
 Javascript to print the current window.
 
static remove_stock ($p_id, $p_mesg)
 return a string containing the html code for calling the removeStock
 
static request_to_hidden (array $array)
 transform $_REQUEST data to hidden
 
static request_to_string ($array, $start="?")
 transform $_REQUEST data to string
 
static reset ($p_value, $p_class="smallbutton")
 
static select_cat ($array_cat)
 create a hidden plus button to select the cat of ledger
 
static select_stock ($p_cn, $p_name, $p_mode)
 Create an ISelect object containing the available repository for reading or writing.
 
static show_receipt_document ($p_jr_id, $p_name="")
 Returns HTML code for displaying a icon with a link to a receipt document from the ledger.
 
static show_reconcile ($p_div, $let, $span="")
 
static simple_array_to_hidden ($array)
 Transform a double array as a HTML string with hidden html value array has the formarray ["name"]="x",array['value']="y") the key name will be the hidden input name;.
 
static submit ($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
 
static title_box ($p_name, $p_div, $p_mod="close", $p_js="", $p_draggable="n", $p_enlarge='n', $raw="", $refresh='')
 Title for boxes, you can customize the symbol thanks symbol with the mode "custom".
 
static warnbulle ($p_comment)
 

Data Fields

 $autofocus
 
 $css_size
 
 $maxlength
 
 $pattern
 
 $require
 
 $title
 
- Data Fields inherited from HtmlInput
 $attribute
 
 $css_size
 
 $ctrl
 
 $disabled
 
 $extra
 
 $extra2
 
 $heigh
 
 $id
 
 $javascript
 
 $label
 
 $name
 
 $placeholder
 
 $readOnly
 
 $require
 
 $selected
 
 $size
 
 $style
 
 $tabindex
 
 $table
 
 $type
 
 $value
 
 $width
 

Protected Member Functions

 make_datalist ()
 add a datalist
 

Protected Attributes

 $datalist
 

Detailed Description

Html Input Text member :

  • placeholder (string) placeholder
  • title (string) title of the HTML ELT
  • autofocus (bool) true to have an autofocus
  • css_size (string) size in the specified unit ex: 20%
  • pattern (string) pattern for HTML
  • maxlength (int) max length of the fied
  • size (int) size without unit
  • require (bool) is element require
Examples
inplace_edit.test.php.

Definition at line 38 of file itext.class.php.

Constructor & Destructor Documentation

◆ __construct()

IText::__construct ( $name = '',
$value = '',
$p_id = "" )

Reimplemented from HtmlInput.

Reimplemented in INum.

Definition at line 49 of file itext.class.php.

50 {
51 parent::__construct($name,$value,$p_id);
52 $this->title="";
53 $this->placeholder="";
54 $this->extra="";
55 $this->style=' class="input_text" ';
56 $this->autofocus=false;
57 $this->require=false;
58 $this->css_size="";
59 $this->pattern="";
60 $this->maxlength="";
61 $this->datalist=null;
62 }
$opd_description style
$anc_filter placeholder
$anc_filter title
$poste extra
$name css_size

References HtmlInput\$name, $p_id, HtmlInput\$value, css_size, extra, placeholder, style, and title.

Member Function Documentation

◆ display()

IText::display ( )

print in html the readonly value of the widget

Reimplemented in INum.

Definition at line 152 of file itext.class.php.

153 {
154 $t= ((isset($this->title)))?'title="'.$this->title.'" ':' ';
155
156 $extra=(isset($this->extra))?$this->extra:"";
157 $strAttribute=$this->get_node_attribute();
158 $readonly=" readonly ";
159 $this->value=htmlentities($this->value??"", ENT_COMPAT|ENT_QUOTES, "UTF-8");
160 $this->style=' class="input_text_ro" ';
161 if ( ! isset ($this->css_size))
162 {
163 $r='<INPUT '.$this->style.' TYPE="TEXT" id="'.
164 $this->id.'"'.$t.
165 'NAME="'.$this->name.'" VALUE="'.$this->value.'" '.
166 'SIZE="'.$this->size.'" '.$this->javascript." $readonly $this->extra $strAttribute>";
167 } else {
168 $r='<INPUT '.$this->style.' TYPE="TEXT" id="'.
169 $this->id.'"'.$t.
170 'NAME="'.$this->name.'" VALUE="'.$this->value.'" '.
171 ' style="width:'.$this->css_size.'" '.$this->javascript." $readonly $this->extra $strAttribute>";
172 }
173
174 /* add tag for column if inside a table */
175 if ($this->table == 1) {
176 $r = '<td>' . $r . '</td>';
177 }
178
179 return $r;
180
181 }
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
$ret javascript
get_node_attribute()
Insert attribute inside a INPUT TYPE, these attribute can be retrieved in javascript with element....
$all table
$t
Definition compute.php:46

References HtmlInput\$extra, $r, $readonly, $t, css_size, ENT_QUOTES, extra, HtmlInput\get_node_attribute(), javascript, style, table, title, and value.

Referenced by input().

+ Here is the call graph for this function:

◆ get_datalist()

IText::get_datalist ( )

Definition at line 142 of file itext.class.php.

142 {
143 return $this->datalist;
144 }

References $datalist.

◆ input()

IText::input ( $p_name = null,
$p_value = null )

show the html input of the widget

Reimplemented in INum.

Definition at line 66 of file itext.class.php.

67 {
68 $this->name=($p_name==null)?$this->name:$p_name;
69 $this->value=($p_value==null)?$this->value:$p_value;
70 if ( $this->readOnly==true) return $this->display();
71 $this->id=($this->id=="")?$this->name:$this->id;
72
73 // Double quote makes troubles
74 $this->value=noalyss_str_replace('"','',$this->value);
75
76 // compute attribute used by javascript
77 $strAttribute=$this->get_node_attribute();
78 $t= 'title="'.$this->title.'" ';
79 $autofocus=($this->autofocus)?" autofocus ":"";
80 $require=($this->require)?"required":"";
81
82 // var $pattern regex to match the INPUT TEXT
83 $pattern="";
84 if ($this->pattern != "") {
85 $pattern= sprintf( 'pattern="%s"',$this->pattern);
86 }
87
88 // var maxlength HTML attribute
89 $maxlength = "";
90 if ($this->maxlength !="" ) {
91 $maxlength=sprintf(' maxlength="%s" ',$this->maxlength);
92 }
93 $datalist=(empty($this->datalist ))?"":sprintf('list="dl_%s"',$this->id);
94 if ( ! isset ($this->css_size) || empty ($this->css_size))
95 {
96
97 $r= sprintf('<INPUT TYPE="TEXT" %s id="%s" name="%s" value="%s" placeholder="%s" title="%s"
98 size="%s" %s %s %s %s %s %s %s %s>
99 ',$this->style,
100 $this->id,
101 $this->name,
102 htmlentities($this->value, ENT_COMPAT|ENT_QUOTES, "UTF-8"),
103 $this->placeholder,
104 $this->title,
105 $this->size,
106 $this->javascript,
107 $this->extra,
109 $require,
110 $strAttribute,
111 $pattern,
114 );
115 } else {
116 $r= sprintf('<INPUT TYPE="TEXT" %s id="%s" name="%s" value="%s" placeholder="%s" title="%s"
117 style="width:%s ;" %s %s %s %s %s %s>
118 ',$this->style,
119 $this->id,
120 $this->name,
121 htmlentities($this->value, ENT_COMPAT|ENT_QUOTES, "UTF-8"),
122 $this->placeholder,
123 $this->title,
124 $this->css_size,
125 $this->javascript,
126 $this->extra,
128 $require,
129 $strAttribute,
130 $pattern,
133 );
134 }
135
136 /* add tag for column if inside a table */
137 if ( $this->table == 1 ) $r='<td>'.$r.'</td>';
138 $r.=$this->make_datalist();
139 return $r;
140
141 }
noalyss_str_replace($search, $replace, $string)
$name size
$from_poste name
$input_from id
display()
print in html the readonly value of the widget
$icard readOnly

References $autofocus, $datalist, HtmlInput\$id, $maxlength, $pattern, $r, $require, $t, css_size, display(), ENT_QUOTES, extra, HtmlInput\get_node_attribute(), javascript, make_datalist(), name, noalyss_str_replace(), placeholder, readOnly, size, style, table, title, and value.

+ Here is the call graph for this function:

◆ make_datalist()

IText::make_datalist ( )
protected

add a datalist

Parameters
$array(double array) each row has 2 keys 0 => stored value 1=>label
Returns
string

Definition at line 194 of file itext.class.php.

195 {
196 if ( empty($this->datalist)) return "";
197 $r=sprintf('<datalist id="dl_%s"">',$this->id);
198 foreach ($this->datalist as $item) {
199 $r.=sprintf('<option value="%s">%s %s</option>'
200 ,$item[0],$item[1]
201 ,htmlentities($item[1]));
202 }
203 $r.='</datalist>';
204 return $r;
205 }

References $r.

Referenced by input().

◆ set_datalist()

IText::set_datalist ( $datalist)

Definition at line 146 of file itext.class.php.

146 {
147 $this->datalist = $datalist;
148 return $this;
149 }

References $datalist.

◆ set_require()

IText::set_require ( $p_boolean)

Definition at line 182 of file itext.class.php.

183 {
184 $this->require=$p_boolean;
185 }

◆ test_me()

static IText::test_me ( )
static

Definition at line 186 of file itext.class.php.

187 {
188 }

Field Documentation

◆ $autofocus

IText::$autofocus

Definition at line 41 of file itext.class.php.

Referenced by input().

◆ $css_size

IText::$css_size

Definition at line 42 of file itext.class.php.

◆ $datalist

IText::$datalist
protected

$datalist (double array) each row has a key (value) and a label used with make_datalist

Definition at line 46 of file itext.class.php.

Referenced by get_datalist(), input(), and set_datalist().

◆ $maxlength

IText::$maxlength

HTML maxlength

Definition at line 44 of file itext.class.php.

Referenced by input().

◆ $pattern

IText::$pattern

$pattern HTML pattern

Definition at line 43 of file itext.class.php.

Referenced by input().

◆ $require

IText::$require

$require (bool)

Definition at line 45 of file itext.class.php.

Referenced by input().

◆ $title

IText::$title

Definition at line 40 of file itext.class.php.


The documentation for this class was generated from the following file: