noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
class_itext.php
Go to the documentation of this file.
00001 <?php
00002 /*
00003  *   This file is part of NOALYSS.
00004  *
00005  *   NOALYSS is free software; you can redistribute it and/or modify
00006  *   it under the terms of the GNU General Public License as published by
00007  *   the Free Software Foundation; either version 2 of the License, or
00008  *   (at your option) any later version.
00009  *
00010  *   NOALYSS is distributed in the hope that it will be useful,
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *   GNU General Public License for more details.
00014  *
00015  *   You should have received a copy of the GNU General Public License
00016  *   along with NOALYSS; if not, write to the Free Software
00017  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 */
00019 
00020 // Copyright Author Dany De Bontridder danydb@aevalys.eu
00021 
00022 /*!\file
00023  * \brief Html Input
00024  */
00025 require_once('class_html_input.php');
00026 class IText extends HtmlInput
00027 {
00028     function __construct($name='',$value='',$p_id="")
00029     {
00030         parent::__construct($name,$value,$p_id);
00031         $this->style=' class="input_text" ';
00032     }
00033     /*!\brief show the html  input of the widget*/
00034     public function input($p_name=null,$p_value=null)
00035     {
00036         $this->name=($p_name==null)?$this->name:$p_name;
00037         $this->value=($p_value==null)?$this->value:$p_value;
00038         if ( $this->readOnly==true) return $this->display();
00039                 $this->id=($this->id=="")?$this->name:$this->id;
00040 
00041         $t= ((isset($this->title)))?'title="'.$this->title.'"   ':' ';
00042 
00043         $extra=(isset($this->extra))?$this->extra:"";
00044 
00045         $this->value=str_replace('"','',$this->value);
00046         if ( ! isset ($this->css_size))
00047         {
00048         $r='<INPUT '.$this->style.' TYPE="TEXT" id="'.
00049            $this->id.'"'.$t.
00050            'NAME="'.$this->name.'" VALUE="'.$this->value.'"  '.
00051            'SIZE="'.$this->size.'" '.$this->javascript."  $this->extra >";
00052         /* add tag for column if inside a table */
00053         } else {
00054            $r='<INPUT '.$this->style.' TYPE="TEXT" id="'.
00055            $this->id.'"'.$t.
00056            'NAME="'.$this->name.'" VALUE="'.$this->value.'"  '.
00057            ' style="width:'.$this->css_size.';" '.$this->javascript."  $this->extra >";
00058 
00059         }
00060 
00061         if ( $this->table == 1 )                  $r='<td>'.$r.'</td>';
00062 
00063         return $r;
00064 
00065     }
00066     /*!\brief print in html the readonly value of the widget*/
00067     public function display()
00068     {
00069         $t= ((isset($this->title)))?'title="'.$this->title.'"   ':' ';
00070 
00071         $extra=(isset($this->extra))?$this->extra:"";
00072 
00073         $readonly=" readonly ";
00074         $this->value=str_replace('"','',$this->value);
00075                  $this->style=' class="input_text_ro" ';
00076          if ( ! isset ($this->css_size))
00077         {
00078         $r='<INPUT '.$this->style.' TYPE="TEXT" id="'.
00079            $this->id.'"'.$t.
00080            'NAME="'.$this->name.'" VALUE="'.$this->value.'"  '.
00081            'SIZE="'.$this->size.'" '.$this->javascript." $readonly $this->extra >";
00082         } else {
00083                $r='<INPUT '.$this->style.' TYPE="TEXT" id="'.
00084            $this->id.'"'.$t.
00085            'NAME="'.$this->name.'" VALUE="'.$this->value.'"  '.
00086            ' style="width:'.$this->css_size.'" '.$this->javascript." $readonly  $this->extra >";
00087         }
00088 
00089         /* add tag for column if inside a table */
00090         if ( $this->table == 1 )                  $r='<td>'.$r.'</td>';
00091 
00092         return $r;
00093 
00094     }
00095     static public function test_me()
00096     {
00097     }
00098 }
 All Data Structures Namespaces Files Functions Variables Enumerations