noalyss  Version-6.9.1.8
 All Data Structures Namespaces Files Functions Variables Pages
class_iradio.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of NOALYSS.
5  *
6  * NOALYSS is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * NOALYSS is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with NOALYSS; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  */
20 
21 // Copyright Author Dany De Bontridder danydb@aevalys.eu
22 
23 /**\file
24  * \brief Html Input
25  */
26 require_once NOALYSS_INCLUDE.'/lib/class_html_input.php';
27 
28 class IRadio extends HtmlInput
29  {
30  /**\brief show the html input of the widget */
31 
32  public function input($p_name=null, $p_value=null)
33  {
34  $this->name = ($p_name == null) ? $this->name : $p_name;
35  $this->value = ($p_value == null) ? $this->value : $p_value;
36  if ($this->readOnly == true)
37  return $this->display();
38 
39  $check = ( $this->selected == true || $this->selected == 't' ) ? "checked" : "unchecked";
40  $r = '<input type="RADIO" name="' . $this->name . '"';
41  $r.=" VALUE=\"$this->value\"";
42  $r.=' class="css-checkbox" ';
43  $r.=($this->javascript != '') ? 'onclick="' . $this->javascript . '"' : '';
44  $r.=" $check > ";
45  return $r;
46  }
47 
48  /**\brief print in html the readonly value of the widget */
49 
50  public function display()
51  {
52 
53  $check = ( $this->selected == true || $this->selected == 't' ) ? "Yes" : "no";
54  $r = $check;
55  return $r;
56  }
57 
58  /**
59  * set selected to true (checked) if the value equal the parameter
60  * @param $p_value value to compare
61  */
62  public function set_check($p_value)
63  {
64  if ($this->value == $p_value)
65  $this->selected = true;
66  }
67 
68  static public function test_me()
69  {
70 
71  }
72 
73  }
$ret javascript
for($e=0;$e< count($array);$e++) $desc readOnly
static test_me()
$from_poste name
set_check($p_value)
set selected to true (checked) if the value equal the parameter
$check
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)
show the html input of the widget
$me_code selected
display()
print in html the readonly value of the widget