noalyss Version-9
iradio.class.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/*!\class IRadio
27 * \brief Html Input
28 */
29class IRadio extends HtmlInput
30 {
31 /**\brief show the html input of the widget */
32
33 public function input($p_name=null, $p_value=null)
34 {
35 $this->name = ($p_name == null) ? $this->name : $p_name;
36 $this->value = ($p_value == null) ? $this->value : $p_value;
37 if ($this->readOnly == true)
38 return $this->display();
39
40 $check = ( $this->selected == true || $this->selected == 't' ) ? "checked" : "unchecked";
41 $r = '<input type="RADIO" name="' . $this->name . '"';
42 $r.=" VALUE=\"$this->value\"";
43 $r.=' class="css-checkbox" ';
44 $r.=($this->javascript != '') ? 'onclick="' . $this->javascript . '"' : '';
45 $r.=" $check > ";
46 return $r;
47 }
48
49 /**\brief print in html the readonly value of the widget */
50
51 public function display()
52 {
53
54 $check = ( $this->selected == true || $this->selected == 't' ) ? "Yes" : "no";
55 $r = $check;
56 return $r;
57 }
58
59 /**
60 * set selected to true (checked) if the value equal the parameter
61 * @param $p_value value to compare
62 */
63 public function set_check($p_value)
64 {
65 if ($this->value == $p_value)
66 $this->selected = true;
67 }
68
69 static public function test_me()
70 {
71
72 }
73
74 }
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
$select selected
$ret javascript
$from_poste name
class widget This class is used to create all the HTML INPUT TYPE and some specials which works with ...
Html Input.
set_check($p_value)
set selected to true (checked) if the value equal the parameter
static test_me()
display()
print in html the readonly value of the widget
input($p_name=null, $p_value=null)
show the html input of the widget
$icard readOnly
$check