noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
class_iradio.php
Go to the documentation of this file.
00001 <?php
00002 
00003 /*
00004  *   This file is part of NOALYSS.
00005  *
00006  *   NOALYSS is free software; you can redistribute it and/or modify
00007  *   it under the terms of the GNU General Public License as published by
00008  *   the Free Software Foundation; either version 2 of the License, or
00009  *   (at your option) any later version.
00010  *
00011  *   NOALYSS is distributed in the hope that it will be useful,
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *   GNU General Public License for more details.
00015  *
00016  *   You should have received a copy of the GNU General Public License
00017  *   along with NOALYSS; if not, write to the Free Software
00018  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  */
00020 
00021 // Copyright Author Dany De Bontridder danydb@aevalys.eu
00022 
00023 /**\file
00024  * \brief Html Input 
00025  */
00026 require_once('class_html_input.php');
00027 
00028 class IRadio extends HtmlInput
00029     {
00030     /**\brief show the html  input of the widget */
00031 
00032     public function input($p_name=null, $p_value=null)
00033         {
00034         $this->name = ($p_name == null) ? $this->name : $p_name;
00035         $this->value = ($p_value == null) ? $this->value : $p_value;
00036         if ($this->readOnly == true)
00037             return $this->display();
00038 
00039         $check = ( $this->selected == true || $this->selected == 't' ) ? "checked" : "unchecked";
00040         $r = '<input type="RADIO" name="' . $this->name . '"';
00041         $r.=" VALUE=\"$this->value\"";
00042         $r.=' class="css-checkbox" ';
00043         $r.=($this->javascript != '') ? 'onclick="' . $this->javascript . '"' : '';
00044         $r.="  $check > ";
00045         return $r;
00046         }
00047 
00048     /**\brief print in html the readonly value of the widget */
00049 
00050     public function display()
00051         {
00052 
00053         $check = ( $this->selected == true || $this->selected == 't' ) ? "Yes" : "no";
00054         $r = $check;
00055         return $r;
00056         }
00057 
00058     /**
00059      * set selected to true (checked) if the value equal the parameter
00060      * @param $p_value value to compare
00061      */
00062     public function set_check($p_value)
00063         {
00064         if ($this->value == $p_value)
00065             $this->selected = true;
00066         }
00067 
00068     static public function test_me()
00069         {
00070         
00071         }
00072        
00073     }
 All Data Structures Namespaces Files Functions Variables Enumerations