TrFormElement Class Reference

display a tr html tag in a form using corresponding template More...

Inheritance diagram for TrFormElement:

Inheritance graph
[legend]
Collaboration diagram for TrFormElement:

Collaboration graph
[legend]

Public Member Functions

 display ()
 display ($arrParam=array())
 display input Element $arrParam accept ["value"] to corresponding value
 displayHide ($arrParam)
 displayRo ($arrParam)
 FormElement ($desc, $tpl)
 hasBeenPopped ()
 HtmlElement ()
 setCssError ($name)
 setOptions ($options)
 TrFormElement ($desc, $tpl, $extraInfo=array())

Data Fields

 $cssErrorName
 $desc
 $options
 $template
 $tooltip

Detailed Description

display a tr html tag in a form using corresponding template

Definition at line 871 of file FormGenerator.php.


Member Function Documentation

HtmlElement::display (  )  [inherited]

TrFormElement::display ( arrParam = array()  ) 

display input Element $arrParam accept ["value"] to corresponding value

Reimplemented from FormElement.

Definition at line 890 of file FormGenerator.php.

References displayErrorCss(), and print.

00890                                           {
00891         if (empty($arrParam)) $arrParam = $this->options;
00892         if (!isset($this->cssErrorName)) $this->cssErrorName = $this->template->name;
00893 
00894         printf('<tr><td class="label" width="%s" ', $this->firstColWidth);
00895         print displayErrorCss($this->cssErrorName);
00896         print 'style = "text-align: right;">';
00897 
00898         //if we got a tooltip, we show it
00899         if ($this->tooltip) {
00900             print "<a href=\"#\" class=\"tooltip\">".$this->desc."<span>".$this->tooltip."</span></a>";
00901         } else {
00902             print $this->desc;
00903         }
00904         print '</td><td>';
00905 
00906         // set hidden form with old_value for each TrFormElement field
00907         if(isset($arrParam["value"])) {
00908             // if checkbox
00909             if ($arrParam["value"] == "checked")
00910                 $old_value = "on";
00911             else
00912                 $old_value = $arrParam["value"];
00913         }
00914         else {
00915             $old_value = "";
00916         }
00917         if(is_object($this->template)) {
00918             $field_name = $this->template->name;
00919         }
00920         else if(is_array($this->template)) {
00921             $field_name = $this->template["name"];
00922         }
00923         else {
00924             $field_name = "";
00925         }
00926         if ($field_name) {
00927             print '<input type="hidden" name="old_'.$field_name.'" value="'.$old_value.'" />';
00928         }
00929 
00930         // display real field
00931         parent::display($arrParam);
00932 
00933         if (isset($arrParam["extra"])) {
00934             print "&nbsp;" . $arrParam["extra"];
00935         }
00936         print "</td></tr>";
00937 
00938     }

Here is the call graph for this function:

FormElement::displayHide ( arrParam  )  [inherited]

Definition at line 759 of file FormGenerator.php.

00759                                     {
00760         $this->template->displayHide($arrParam);
00761     }

TrFormElement::displayRo ( arrParam  ) 

Reimplemented from FormElement.

Definition at line 940 of file FormGenerator.php.

References displayErrorCss(), and print.

00940                                   {
00941 
00942         printf('<tr><td width="%s" ', $this->firstColWidth);
00943         print displayErrorCss($this->cssErrorName);
00944         print 'style = "text-align: right;">';
00945 
00946         //if we got a tooltip, we show it
00947         if ($this->tooltip) {
00948             print "<a href=\"#\" class=\"tooltip\">".$this->desc."<span>".$this->tooltip."</span></a>";
00949         } else {
00950             print $this->desc;
00951         }
00952         print '</td><td>';
00953 
00954         parent::displayRo($arrParam);
00955 
00956         print '</td></tr>';
00957     }

Here is the call graph for this function:

FormElement::FormElement ( desc,
tpl 
) [inherited]

Definition at line 713 of file FormGenerator.php.

References FormElement::$desc.

00713                                      {
00714         $this->desc = $desc;
00715         $this->template = &$tpl;
00716         $this->tooltip = False;
00717     }

HtmlElement::hasBeenPopped (  )  [inherited]

Definition at line 1912 of file PageGenerator.php.

01912                              {
01913         return True;
01914     }

HtmlElement::HtmlElement (  )  [inherited]

Definition at line 1904 of file PageGenerator.php.

01904                            {
01905         $this->options = array();
01906     }

FormElement::setCssError ( name  )  [inherited]

Definition at line 719 of file FormGenerator.php.

References $name.

00719                                 {
00720         $this->cssErrorName=$name;
00721     }

HtmlElement::setOptions ( options  )  [inherited]

Definition at line 1908 of file PageGenerator.php.

01908                                   {
01909         $this->options = $options;
01910     }

TrFormElement::TrFormElement ( desc,
tpl,
extraInfo = array() 
)

Definition at line 876 of file FormGenerator.php.

References $value.

00876                                                               {
00877         $this->desc=$desc;
00878         $this->template=&$tpl;
00879         $this->tooltip = False;
00880         $this->firstColWidth = "40%";
00881         foreach ($extraInfo as $key => $value) {
00882             $this->$key = $value;
00883         }
00884     }


Field Documentation

TrFormElement::$cssErrorName

Reimplemented from FormElement.

Definition at line 874 of file FormGenerator.php.

TrFormElement::$desc

Reimplemented from FormElement.

Definition at line 873 of file FormGenerator.php.

HtmlElement::$options [inherited]

Definition at line 1902 of file PageGenerator.php.

Referenced by getSubnetOptions().

TrFormElement::$template

Reimplemented from FormElement.

Definition at line 872 of file FormGenerator.php.

FormElement::$tooltip [inherited]

Definition at line 711 of file FormGenerator.php.


The documentation for this class was generated from the following file:

Generated on Tue May 4 11:48:20 2010 for MMC web interface by  doxygen 1.5.8