noalyss
Version-6.9.1.8
Main Page
Related Pages
Packages
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Pages
include
lib
class_itext.php
Go to the documentation of this file.
1
<?php
2
/*
3
* This file is part of NOALYSS.
4
*
5
* NOALYSS is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
9
*
10
* NOALYSS is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with NOALYSS; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
*/
19
20
// Copyright Author Dany De Bontridder danydb@aevalys.eu
21
22
/*!\file
23
* \brief Html Input
24
*/
25
require_once NOALYSS_INCLUDE.
'/lib/class_html_input.php'
;
26
class
IText
extends
HtmlInput
27
{
28
var
$placeholder
;
29
var
$title
;
30
var
$autofocus
;
31
function
__construct
(
$name
=
''
,
$value
=
''
,
$p_id
=
""
)
32
{
33
parent::__construct(
$name
,
$value
,
$p_id
);
34
$this->title=
""
;
35
$this->placeholder=
""
;
36
$this->
extra
=
""
;
37
$this->
style
=
' class="input_text" '
;
38
$this->autofocus=
false
;
39
}
40
/*!\brief show the html input of the widget*/
41
public
function
input
($p_name=null,$p_value=null)
42
{
43
$this->
name
=($p_name==null)?$this->
name
:$p_name;
44
$this->
value
=($p_value==null)?$this->
value
:$p_value;
45
if
( $this->
readOnly
==
true
)
return
$this->
display
();
46
$this->
id
=($this->
id
==
""
)?$this->
name
:$this->
id
;
47
48
$t=
'title="'
.$this->title.
'" '
;
49
$autofocus
=(
$this->autofocus
)?
" autofocus "
:
""
;
50
$this->
value
=str_replace(
'"'
,
''
,$this->
value
);
51
if
( ! isset ($this->
css_size
))
52
{
53
54
$r
= sprintf(
'<INPUT TYPE="TEXT" %s id="%s" name="%s" value="%s" placeholder="%s" title="%s"
55
Size="%s" %s %s %s>
56
'
,$this->
style
,
57
$this->
id
,
58
$this->
name
,
59
htmlentities($this->
value
, ENT_COMPAT,
"UTF-8"
),
60
$this->placeholder,
61
$this->title,
62
$this->
size
,
63
$this->
javascript
,
64
$this->
extra
,
65
$autofocus
66
);
67
}
else
{
68
$r
= sprintf(
'<INPUT TYPE="TEXT" %s id="%s" name="%s" value="%s" placeholder="%s" title="%s"
69
style="width:%s;" %s %s %s>
70
'
,$this->
style
,
71
$this->
id
,
72
$this->
name
,
73
htmlentities($this->
value
, ENT_COMPAT,
"UTF-8"
),
74
$this->placeholder,
75
$this->title,
76
$this->
css_size
,
77
$this->
javascript
,
78
$this->
extra
,
79
$autofocus
80
);
81
}
82
83
/* add tag for column if inside a table */
84
if
( $this->
table
== 1 )
$r
=
'<td>'
.$r.
'</td>'
;
85
86
return
$r
;
87
88
}
89
/*!\brief print in html the readonly value of the widget*/
90
public
function
display
()
91
{
92
$t= ((isset($this->title)))?
'title="'
.$this->title.
'" '
:
' '
;
93
94
$extra
=(isset($this->
extra
))?$this->
extra
:
""
;
95
96
$readonly=
" readonly "
;
97
$this->
value
=str_replace(
'"'
,
''
,$this->
value
);
98
$this->
style
=
' class="input_text_ro" '
;
99
if
( ! isset ($this->
css_size
))
100
{
101
$r
=
'<INPUT '
.$this->style.
' TYPE="TEXT" id="'
.
102
$this->
id
.
'"'
.$t.
103
'NAME="'
.$this->name.
'" VALUE="'
.$this->
value
.
'" '
.
104
'SIZE="'
.$this->size.
'" '
.$this->
javascript
.
" $readonly $this->extra >"
;
105
}
else
{
106
$r
=
'<INPUT '
.$this->style.
' TYPE="TEXT" id="'
.
107
$this->
id
.
'"'
.$t.
108
'NAME="'
.$this->name.
'" VALUE="'
.$this->
value
.
'" '
.
109
' style="width:'
.$this->css_size.
'" '
.$this->
javascript
.
" $readonly $this->extra >"
;
110
}
111
112
/* add tag for column if inside a table */
113
if
( $this->
table
== 1 )
$r
=
'<td>'
.$r.
'</td>'
;
114
115
return
$r
;
116
117
}
118
static
public
function
test_me
()
119
{
120
}
121
}
$r
$r
Definition:
ajax_add_concerned_card.php:32
IText\$title
$title
Definition:
class_itext.php:29
style
$opd_description style
Definition:
ajax_mod_predf_op.php:41
HtmlInput\$name
$name
Definition:
class_html_input.php:57
IText\display
display()
print in html the readonly value of the widget
Definition:
class_itext.php:90
javascript
$ret javascript
Definition:
ajax_display_letter.php:35
IText\test_me
static test_me()
Definition:
class_itext.php:118
HtmlInput\$extra
$extra
Definition:
class_html_input.php:65
readOnly
for($e=0;$e< count($array);$e++) $desc readOnly
Definition:
card_attr.inc.php:148
HtmlInput\$value
$value
Definition:
class_html_input.php:58
size
$name size
Definition:
ajax_mod_predf_op.php:38
extra
$poste extra
Definition:
lettering.card.inc.php:41
name
$from_poste name
Definition:
balance.inc.php:151
css_size
$description css_size
Definition:
anc_key_input.php:43
value
$q value
Definition:
ajax_add_concerned_card.php:36
$p_id
$p_id
Definition:
ajax_display_submenu.php:36
IText
Definition:
class_itext.php:26
IText\__construct
__construct($name='', $value='', $p_id="")
Definition:
class_itext.php:31
IText\$autofocus
$autofocus
Definition:
class_itext.php:30
IText\$placeholder
$placeholder
Definition:
class_itext.php:28
HtmlInput
class widget This class is used to create all the HTML INPUT TYPE and some specials which works with ...
Definition:
class_html_input.php:53
IText\input
input($p_name=null, $p_value=null)
show the html input of the widget
Definition:
class_itext.php:41
table
$select_type table
Definition:
card_attr.inc.php:69