cvs: pear /HTML_QuickForm/docs QuickForm_example.php QuickForm_example7.php

From: Date: Tue, 18 Feb 2003 13:51:23 +0000
Subject: cvs: pear /HTML_QuickForm/docs QuickForm_example.php QuickForm_example7.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-8937@lists.php.net to get a copy of this message
mansion Tue Feb 18 08:51:23 2003 EDT Modified files: /pear/HTML_QuickForm/docs QuickForm_example.php QuickForm_example7.php Log: Reflect use of addGroup() instead of addElementGroup() which is now deprecated. Index: pear/HTML_QuickForm/docs/QuickForm_example.php diff -u pear/HTML_QuickForm/docs/QuickForm_example.php:1.8 pear/HTML_QuickForm/docs/QuickForm_example.php:1.9 --- pear/HTML_QuickForm/docs/QuickForm_example.php:1.8 Sat Jan 11 15:11:32 2003 +++ pear/HTML_QuickForm/docs/QuickForm_example.php Tue Feb 18 08:51:23 2003 @@ -5,7 +5,10 @@ * @author Adam Daniel <adaniel1@eesus.jnj.com> * @author Bertrand Mansion <bmansion@mamasam.com> * @version 2.0 +* +* $Id: QuickForm_example.php,v 1.9 2003/02/18 13:51:23 mansion Exp $ */ + require_once ("HTML/QuickForm.php"); $form = new HTML_QuickForm('frmTest', 'GET'); // Fills with some defaults values @@ -58,7 +61,7 @@ $name['last']->setSize(30); $name['first'] = &HTML_QuickForm::createElement('text', 'first'); $name['first']->setSize(20); -$form->addElementGroup($name, 'Name (last, first):', 'name', ',&nbsp;'); +$form->addGroup($name, 'name', 'Name (last, first):', ',&nbsp;'); // Creates a group of text inputs $areaCode = &HTML_QuickForm::createElement('text', ''); $areaCode->setSize(3); @@ -69,22 +72,22 @@ $phoneNo2 = &HTML_QuickForm::createElement('text', ''); $phoneNo2->setSize(4); $phoneNo2->setMaxLength(4); -$form->addElementGroup(array($areaCode, $phoneNo1, $phoneNo2), 'Telephone:', 'phoneNo', '-'); +$form->addGroup(array($areaCode, $phoneNo1, $phoneNo2), 'phoneNo', 'Telephone:', '-'); // Creates a radio buttons group $radio[] = &HTML_QuickForm::createElement('radio', null, null, 'Yes', 'Y'); $radio[] = &HTML_QuickForm::createElement('radio', null, null, 'No', 'N'); -$form->addElementGroup($radio, 'Yes/No:', 'iradYesNo'); +$form->addGroup($radio, 'iradYesNo', 'Yes/No:'); // Creates a checkboxes group $checkbox[] = &HTML_QuickForm::createElement('checkbox', 'A', null, 'A'); $checkbox[] = &HTML_QuickForm::createElement('checkbox', 'B', null, 'B'); $checkbox[] = &HTML_QuickForm::createElement('checkbox', 'C', null, 'C'); -$form->addElementGroup($checkbox, 'ABC:', 'ichkABC', '<br>'); +$form->addGroup($checkbox, 'ichkABC', 'ABC:', '<br />'); // Creates a group of buttons to be displayed at the bottom of the form $buttons[] = &HTML_QuickForm::createElement('submit', null, 'Submit'); $buttons[] = &HTML_QuickForm::createElement('reset', null, 'Reset'); $buttons[] = &HTML_QuickForm::createElement('image', 'iimgTest', '/images/apache_pb.gif'); $buttons[] = &HTML_QuickForm::createElement('button', 'ibutTest', 'Test Button'); -$form->addElementGroup($buttons); +$form->addGroup($buttons); $form->addHeader('Using the form element classes directly'); $text = new HTML_QuickForm_text('QFText', 'QuickForm Text:'); $form->addElement($text); Index: pear/HTML_QuickForm/docs/QuickForm_example7.php diff -u pear/HTML_QuickForm/docs/QuickForm_example7.php:1.2 pear/HTML_QuickForm/docs/QuickForm_example7.php:1.3 --- pear/HTML_QuickForm/docs/QuickForm_example7.php:1.2 Sat Feb 15 15:13:53 2003 +++ pear/HTML_QuickForm/docs/QuickForm_example7.php Tue Feb 18 08:51:23 2003 @@ -5,7 +5,7 @@ * @author Bertrand Mansion <bmansion@mamasam.com> * @version 2.5 */ -// $Id: QuickForm_example7.php,v 1.2 2003/02/15 20:13:53 mansion Exp $ +// $id:$ require_once ("HTML/QuickForm.php"); $form = new HTML_QuickForm('frmTest', 'GET'); @@ -31,7 +31,7 @@ $id['code'] = &HTML_QuickForm::createElement('text', 'code', 'Code'); $id['code']->setSize(5); $id['code']->setMaxLength(4); -$form->addElementGroup($id, 'ID:', 'id', ',&nbsp'); +$form->addGroup($id, 'id', 'ID:', ',&nbsp'); $idGrp =& $form->getElement('id'); $idGrp->setGroupTemplate('<table><tr>{content}</tr></table>'); @@ -47,24 +47,24 @@ $phoneNo2 = &HTML_QuickForm::createElement('text', ''); $phoneNo2->setSize(5); $phoneNo2->setMaxLength(4); -$form->addElementGroup(array($areaCode, $phoneNo1, $phoneNo2), 'Telephone:', 'phoneNo', '-'); +$form->addGroup(array($areaCode, $phoneNo1, $phoneNo2), 'phoneNo', 'Telephone:', '-'); // Creates a standard radio buttons group $radio[] = &HTML_QuickForm::createElement('radio', null, null, 'Yes', 'Y'); $radio[] = &HTML_QuickForm::createElement('radio', null, null, 'No', 'N'); -$form->addElementGroup($radio, 'Yes/No:', 'iradYesNo'); +$form->addGroup($radio, 'iradYesNo', 'Yes/No:'); // Creates a checkboxes group using an array of separators $checkbox[] = &HTML_QuickForm::createElement('checkbox', 'A', null, 'A'); $checkbox[] = &HTML_QuickForm::createElement('checkbox', 'B', null, 'B'); $checkbox[] = &HTML_QuickForm::createElement('checkbox', 'C', null, 'C'); $checkbox[] = &HTML_QuickForm::createElement('checkbox', 'D', null, 'D'); -$form->addElementGroup($checkbox, 'ABCD:', 'ichkABC', array('&nbsp;', '<br />')); +$form->addGroup($checkbox, 'ichkABC', 'ABCD:', array('&nbsp;', '<br />')); // Creates a group of buttons to be displayed at the bottom of the form $buttons[] = &HTML_QuickForm::createElement('submit', null, 'Submit'); $buttons[] = &HTML_QuickForm::createElement('reset', null, 'Reset'); -$form->addElementGroup($buttons); +$form->addGroup($buttons); // Adds validation rules for groups $form->addGroupRule('phoneNo', 'Please fill all phone fields', 'required');

« previous php.pear.cvs (#8937) next »