ValidatingForm Class Reference

Inheritance diagram for ValidatingForm:

Inheritance graph
[legend]
Collaboration diagram for ValidatingForm:

Collaboration graph
[legend]

Public Member Functions

 add ($element, $options=array())
 addButton ($name, $value, $klass="btnPrimary", $extra="", $type="submit")
 addCancelButton ($name)
 addExpertButton ($name, $value)
 addOnClickButton ($text, $url)
 addSummary ($msg)
 addValidateButton ($name)
 begin ()
 display ()
 end ()
 Form ($options=array())
 getButtonString ($name, $value, $klass="btnPrimary", $extra="", $type="submit")
 hasBeenPopped ()
 HtmlContainer ()
 pop ()
 push ($element)
 ValidatingForm ($options=array())

Data Fields

 $debug
 $elements
 $index
 $popped

Detailed Description

Definition at line 2181 of file PageGenerator.php.


Member Function Documentation

HtmlContainer::add ( element,
options = array() 
) [inherited]

Definition at line 1999 of file PageGenerator.php.

01999                                                {
02000         $element->setOptions($options);
02001         $this->push($element);
02002     }

Form::addButton ( name,
value,
klass = "btnPrimary",
extra = "",
type = "submit" 
) [inherited]

Definition at line 2098 of file PageGenerator.php.

02098                                                                                             {
02099         $b = new Button();
02100         $this->buttons[] = $b->getButtonString($name, $value, $klass, $extra, $type);
02101     }

Form::addCancelButton ( name  )  [inherited]

Reimplemented in PopupForm.

Definition at line 2108 of file PageGenerator.php.

02108                                     {
02109         $b = new Button();
02110         $this->buttons[] = $b->getCancelButtonString($name, "btnSecondary");
02111     }

Form::addExpertButton ( name,
value 
) [inherited]

Definition at line 2113 of file PageGenerator.php.

02113                                             {
02114         $d = new DivExpertMode();
02115         $b = new Button();
02116         $this->buttons[] = $d->begin() . $b->getButtonString($name, $value) . $d->end();
02117     }

Form::addOnClickButton ( text,
url 
) [inherited]

Definition at line 2128 of file PageGenerator.php.

02128                                            {
02129         $b = new Button();
02130         $this->buttons[] = $b->getOnClickButton($text, $url);
02131     }

Form::addSummary ( msg  )  [inherited]

Definition at line 2119 of file PageGenerator.php.

02119                               {
02120         $this->summary = $msg;
02121     }

Form::addValidateButton ( name  )  [inherited]

Definition at line 2103 of file PageGenerator.php.

02103                                       {
02104         $b = new Button();
02105         $this->buttons[] = $b->getValidateButtonString($name);
02106     }

Form::begin (  )  [inherited]

Reimplemented from HtmlContainer.

Reimplemented in PopupForm.

Definition at line 2081 of file PageGenerator.php.

02081                      {
02082         $str = "";
02083         foreach($this->options as $key => $value) $str.= " $key=\"$value\"";
02084         $ret = "<form$str>";
02085         if (isset($this->summary)) {
02086             $ret = "<p>" . $this->summary . "</p>\n" . $ret;
02087         }
02088         return $ret;
02089     }

HtmlContainer::display (  )  [inherited]

Definition at line 1993 of file PageGenerator.php.

01993                        {
01994         print "\n" . $this->begin() . "\n";
01995         foreach($this->elements as $element) $element->display();
01996         print "\n" . $this->end() . "\n";
01997     }

ValidatingForm::end (  ) 

Reimplemented from Form.

Definition at line 2189 of file PageGenerator.php.

02189                    {
02190         $str = parent::end();
02191         $str .= "
02192         <script type=\"text/javascript\">
02193             if(Form.findFirstElement(\"".$this->options["id"]."\")) {
02194                 Form.focusFirstElement(\"".$this->options["id"]."\");
02195             }
02196         </script>\n";
02197         return $str;
02198     }

Form::Form ( options = array()  )  [inherited]

Definition at line 2073 of file PageGenerator.php.

02073                                       {
02074         $this->HtmlContainer();
02075         if (!isset($options["method"])) $options["method"] = "post";
02076         $this->options = $options;
02077         $this->buttons = array();
02078         $this->summary = NULL;
02079     }

Form::getButtonString ( name,
value,
klass = "btnPrimary",
extra = "",
type = "submit" 
) [inherited]

Definition at line 2123 of file PageGenerator.php.

02123                                                                                                   {
02124         $b = new Button();
02125         return $b->getButtonString($name, $value, $klass, $extra, $type);
02126     }

HtmlContainer::hasBeenPopped (  )  [inherited]

Definition at line 2023 of file PageGenerator.php.

02023                              {
02024 
02025         if ($this->popped) $ret = True;
02026         else if ($this->index == -1) $ret = False;
02027         else $ret = False;
02028         return $ret;
02029     }

HtmlContainer::HtmlContainer (  )  [inherited]

Definition at line 1979 of file PageGenerator.php.

01979                              {
01980         $this->elements = array();
01981         $this->popped = False;
01982         $this->index = -1;
01983     }

HtmlContainer::pop (  )  [inherited]

Definition at line 2031 of file PageGenerator.php.

02031                    {
02032         if (!$this->popped) {
02033             if ($this->index == -1)
02034                 $this->popped = True;
02035             else if ($this->elements[$this->index]->hasBeenPopped())
02036                 $this->popped = True;
02037             else $this->elements[$this->index]->pop();
02038             //if ($this->popped) print "popping " . $this->options["id"] . "<br>";
02039         } else die("Nothing more to pop");
02040     }

HtmlContainer::push ( element  )  [inherited]

Definition at line 2004 of file PageGenerator.php.

02004                             {
02005         if ($this->index == -1) {
02006             /* Add first element to container */
02007             $this->index++;
02008             $this->elements[$this->index] = $element;
02009             //print "pushing " . $element->options["id"] . " into " . $this->options["id"] . "<br>";
02010         } else {
02011             if ($this->elements[$this->index]->hasBeenPopped()) {
02012                 /* All the contained elements have been popped, so add the new element in the list */
02013                 $this->index++;
02014                 $this->elements[$this->index] = $element;
02015                 //print "pushing " . $element->options["id"] . " into " . $this->options["id"] . "<br>";
02016             } else {
02017                 /* Recursively push a new element into the container */
02018                 $this->elements[$this->index]->push($element);
02019             }
02020         }
02021     }

ValidatingForm::ValidatingForm ( options = array()  ) 

Definition at line 2183 of file PageGenerator.php.

02183                                                 {
02184         $this->Form($options);
02185         $this->options["id"] = "edit";
02186         $this->options["onsubmit"] = "return validateForm();";
02187     }


Field Documentation

HtmlContainer::$debug [inherited]

Definition at line 1977 of file PageGenerator.php.

HtmlContainer::$elements [inherited]

Definition at line 1974 of file PageGenerator.php.

HtmlContainer::$index [inherited]

Definition at line 1975 of file PageGenerator.php.

HtmlContainer::$popped [inherited]

Definition at line 1976 of file PageGenerator.php.


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

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