noalyss  Version-6.9.1.8
 All Data Structures Namespaces Files Functions Variables Pages
class_ibutton.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 IButton extends HtmlInput
27 {
28  var $label;
29  var $class;
30  /*!\brief show the html input of the widget*/
31  public function input($p_name=null,$p_value=null,$p_class="")
32  {
33  $this->name=($p_name==null)?$this->name:$p_name;
34  $this->value=($p_value==null)?$this->value:$p_value;
35  $this->label=(trim($this->label) != '')?$this->label:$this->value;
36  $this->class=($p_class != "")?$p_class:$this->class;
37  $this->class=($this->class=="")?"smallbutton ":$this->class;
38  if ( $this->readOnly==true) return $this->display();
39  $extra= ( isset($this->extra))?$this->extra:"";
40  $this->id=($this->id=="")?$this->name:$this->id;
41  $tab=(isset($this->tabindex))?' tabindex="'.$this->tabindex.'"':"";
42  $r='<input type="BUTTON" name="'.$this->name.'"'.
43  ' class="'.$this->class.'" '.
44  $this->extra.
45  $tab.
46  ' id="'.$this->id.'"'.
47  ' value="'.$this->label.'"'.
48  ' onClick="'.$this->javascript.'"'.$extra.'>';
49  $attr=$this->get_js_attr();
50  $r.=$attr;
51  return $r;
52 
53  }
54 
55  /*!\brief print in html the readonly value of the widget*/
56  public function display()
57  {
58  return "";
59  }
60  static function tooggle_checkbox($p_form)
61  {
62  $select_all=new IButton('select_all');
63  $select_all->label=_('Inverser la sélection');
64  $select_all->javascript="toggle_checkbox('$p_form')";
65  return $select_all->input();
66  }
67  static function select_checkbox($p_form)
68  {
69  $select_all=new IButton('select_all');
70  $select_all->label=_('Cocher tous');
71  $select_all->javascript="select_checkbox('$p_form')";
72  return $select_all->input();
73  }
74  static function unselect_checkbox($p_form)
75  {
76  $select_all=new IButton('select_all');
77  $select_all->label=_('Décocher tous');
78  $select_all->javascript="unselect_checkbox('$p_form')";
79  return $select_all->input();
80  }
81  static function show_calc()
82  {
83  $calc=new IButton('shcalc');
84  $calc->label=_('Calculatrice');
85  $calc->javascript="show_calc()";
86  return $calc->input();
87 
88  }
89  static public function test_me()
90  {
91  }
92 }
93 class ISmallButton extends IButton
94 {
95  var $label;
96  /*!\brief show the html input of the widget*/
97  public function input($p_name=null,$p_value=null,$p_style=null)
98  {
99  $this->name=($p_name==null)?$this->name:$p_name;
100  $this->value=($p_value==null)?$this->value:$p_value;
101  $this->label=(trim($this->label) != '')?$this->label:$this->value;
102  if ( $this->readOnly==true) return $this->display();
103  $extra= ( isset($this->extra))?$this->extra:"";
104  $this->id=($this->id=="")?$this->name:$this->id;
105  $tab=(isset($this->tabindex))?' tabindex="'.$this->tabindex.'"':"";
106  $r='<input type="BUTTON" name="'.$this->name.'"'.
107  ' class="smallbutton" '.
108  $this->extra.
109  $tab.
110  ' id="'.$this->id.'"'.
111  ' value="'.$this->label.'"'.
112  ' onClick="'.$this->javascript.'"'.$extra.'>';
113  $attr=$this->get_js_attr();
114  $r.=$attr;
115  return $r;
116 
117  }
118 }
static tooggle_checkbox($p_form)
input($p_name=null, $p_value=null, $p_style=null)
show the html input of the widget
display()
print in html the readonly value of the widget
static show_calc()
for($e=0;$e< count($array);$e++) $desc readOnly
$ret label
$poste extra
$from_poste name
static test_me()
function trim(s)
remove trailing and heading space
Definition: scripts.js:95
static select_checkbox($p_form)
class widget This class is used to create all the HTML INPUT TYPE and some specials which works with ...
input($p_name=null, $p_value=null, $p_class="")
show the html input of the widget
static unselect_checkbox($p_form)