Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 require_once('class_html_input.php');
00026 class IButton extends HtmlInput
00027 {
00028 var $label;
00029
00030 public function input($p_name=null,$p_value=null,$p_class="")
00031 {
00032 $this->name=($p_name==null)?$this->name:$p_name;
00033 $this->value=($p_value==null)?$this->value:$p_value;
00034 $this->label=(trim($this->label) != '')?$this->label:$this->value;
00035 $class=($p_class=="")?"smallbutton ":$this->class;
00036 if ( $this->readOnly==true) return $this->display();
00037 $extra= ( isset($this->extra))?$this->extra:"";
00038 $this->id=($this->id=="")?$this->name:$this->id;
00039 $tab=(isset($this->tabindex))?' tabindex="'.$this->tabindex.'"':"";
00040 $r='<input type="BUTTON" name="'.$this->name.'"'.
00041 ' class="'.$class.'" '.
00042 $this->extra.
00043 $tab.
00044 ' id="'.$this->id.'"'.
00045 ' value="'.$this->label.'"'.
00046 ' onClick="'.$this->javascript.'"'.$extra.'>';
00047 $attr=$this->get_js_attr();
00048 $r.=$attr;
00049 return $r;
00050
00051 }
00052
00053
00054 public function display()
00055 {
00056 return "";
00057 }
00058 static function tooggle_checkbox($p_form)
00059 {
00060 $select_all=new IButton('select_all');
00061 $select_all->label=_('Inverser la sélection');
00062 $select_all->javascript="toggle_checkbox('$p_form')";
00063 return $select_all->input();
00064 }
00065 static function select_checkbox($p_form)
00066 {
00067 $select_all=new IButton('select_all');
00068 $select_all->label=_('Cocher tous');
00069 $select_all->javascript="select_checkbox('$p_form')";
00070 return $select_all->input();
00071 }
00072 static function unselect_checkbox($p_form)
00073 {
00074 $select_all=new IButton('select_all');
00075 $select_all->label=_('Décocher tous');
00076 $select_all->javascript="unselect_checkbox('$p_form')";
00077 return $select_all->input();
00078 }
00079 static function show_calc()
00080 {
00081 $calc=new IButton('shcalc');
00082 $calc->label=_('Calculatrice');
00083 $calc->javascript="show_calc()";
00084 return $calc->input();
00085
00086 }
00087 static public function test_me()
00088 {
00089 }
00090 }
00091 class ISmallButton extends IButton
00092 {
00093 var $label;
00094
00095 public function input($p_name=null,$p_value=null,$p_style=null)
00096 {
00097 $this->name=($p_name==null)?$this->name:$p_name;
00098 $this->value=($p_value==null)?$this->value:$p_value;
00099 $this->label=(trim($this->label) != '')?$this->label:$this->value;
00100 if ( $this->readOnly==true) return $this->display();
00101 $extra= ( isset($this->extra))?$this->extra:"";
00102 $this->id=($this->id=="")?$this->name:$this->id;
00103 $tab=(isset($this->tabindex))?' tabindex="'.$this->tabindex.'"':"";
00104 $r='<input type="BUTTON" name="'.$this->name.'"'.
00105 ' class="smallbutton" '.
00106 $this->extra.
00107 $tab.
00108 ' id="'.$this->id.'"'.
00109 ' value="'.$this->label.'"'.
00110 ' onClick="'.$this->javascript.'"'.$extra.'>';
00111 $attr=$this->get_js_attr();
00112 $r.=$attr;
00113 return $r;
00114
00115 }
00116 }