cvs: pear /HTML_QuickForm_Renderer_Tableless package2.xml /HTML_QuickForm_Renderer_Tableless/HTML/QuickForm/Renderer Tableless.php
/HTML_QuickForm_Renderer_Tableless/data stylesheet.css /HTML_QuickForm_Renderer_Tableless/docs/examples contact.php
| From: | Mark Wiesemann | Date: | Sun, 29 Oct 2006 19:02:06 +0000 |
| Subject: | cvs: pear /HTML_QuickForm_Renderer_Tableless package2.xml /HTML_QuickForm_Renderer_Tableless/HTML/QuickForm/Renderer Tableless.php /HTML_QuickForm_Renderer_Tableless/data stylesheet.css /HTML_QuickForm_Renderer_Tableless/docs/examples contact.php |
||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-42880@lists.php.net to get a copy of this message | ||
wiesemann Sun Oct 29 19:02:06 2006 UTC
Modified files:
/pear/HTML_QuickForm_Renderer_Tableless package2.xml
/pear/HTML_QuickForm_Renderer_Tableless/HTML/QuickForm/Renderer
Tableless.php
/pear/HTML_QuickForm_Renderer_Tableless/data stylesheet.css
/pear/HTML_QuickForm_Renderer_Tableless/docs/examples contact.php
Log:
- bugfix, layout optimizations etc. (see changes in package2.xml for more
details about the changes in this commit)
http://cvs.php.net/viewvc.cgi/pear/HTML_QuickForm_Renderer_Tableless/package2.xml?r1=1.16&r2=1.17&diff_format=u Index: pear/HTML_QuickForm_Renderer_Tableless/package2.xml diff -u pear/HTML_QuickForm_Renderer_Tableless/package2.xml:1.16 pear/HTML_QuickForm_Renderer_Tableless/package2.xml:1.17 --- pear/HTML_QuickForm_Renderer_Tableless/package2.xml:1.16 Sun Oct 22 11:39:47 2006 +++ pear/HTML_QuickForm_Renderer_Tableless/package2.xml Sun Oct 29 19:02:06 2006 @@ -34,11 +34,32 @@ - this package is now in beta status, i.e. the API can be considered as stable - this package is now licensed under the New BSD license - end-user documentation is now available in the manual -- fixed indentation of the closing div tag in the form template +- bugfix: for real groups (e.g. groups of checkboxes) the "id" attribute was + set two times (and an invalid "for" attribute was added to the label + element) +- changes in the div tag (in the form template) for the hidden elements: + * added a line break (\n) after the opening div tag + * added a tab (\t) before the closing div tag +- changes in the templates: rows (consisting of a label and an element) are not + put anymore into a div tag, but in a li element (and all li elements in an ol + element); this adds also a more semantical meaning to the generated forms + (a full list of changes to the templates is available on + http://pear.markwiesemann.eu/template-changes-0.4.0.txt) +- example file: added three hidden form elements - added "id" attribute also to group elements (and the "for" attribute to the label tag for groups) - removed "qf" prefix from CSS class names (exception: "label.qflabel" was renamed into "label.element") +- adjusted the layout in the example file and the bundled stylesheet to the + layout of the default renderer: + * fieldsets now don't have a border and no top or bottom margin, and the + fieldset legends have gotten a grey background (in Firefox not for the whole + width of the fieldset) + * element labels are now in a bold font + * the required note is now horizontally aligned like the form elements, and + not as before on the left margin + (a comparison of all changes to the stylesheet is available on + http://pear.markwiesemann.eu/stylesheet-comparison-0.4.0.txt) </notes> <contents> <dir name="/"> http://cvs.php.net/viewvc.cgi/pear/HTML_QuickForm_Renderer_Tableless/HTML/QuickForm/Renderer/Tableless.php?r1=1.16&r2=1.17&diff_format=u Index: pear/HTML_QuickForm_Renderer_Tableless/HTML/QuickForm/Renderer/Tableless.php diff -u pear/HTML_QuickForm_Renderer_Tableless/HTML/QuickForm/Renderer/Tableless.php:1.16 pear/HTML_QuickForm_Renderer_Tableless/HTML/QuickForm/Renderer/Tableless.php:1.17 --- pear/HTML_QuickForm_Renderer_Tableless/HTML/QuickForm/Renderer/Tableless.php:1.16 Sun Oct 22 11:39:47 2006 +++ pear/HTML_QuickForm_Renderer_Tableless/HTML/QuickForm/Renderer/Tableless.php Sun Oct 29 19:02:06 2006 @@ -21,7 +21,7 @@ * @author Mark Wiesemann <wiesemann@php.net> * @copyright 2005-2006 The PHP Group * @license http://www.opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Tableless.php,v 1.16 2006/10/22 11:39:47 wiesemann Exp $ + * @version CVS: $Id: Tableless.php,v 1.17 2006/10/29 19:02:06 wiesemann Exp $ * @link http://pear.php.net/package/HTML_QuickForm_Renderer_Tableless */ @@ -51,8 +51,7 @@ * @var string * @access private */ - var $_headerTemplate = - "\n\t\t<legend>{header}</legend>"; + var $_headerTemplate = "\n\t\t<legend>{header}</legend>\n\t\t<ol>"; /** * Element template string @@ -60,7 +59,7 @@ * @access private */ var $_elementTemplate = - "\n\t\t<div class=\"row\"><label class=\"element\"><!-- BEGIN required --><span class=\"required\">*</span><!-- END required -->{label}</label><div class=\"element<!-- BEGIN error --> error<!-- END error -->\"><!-- BEGIN error --><span class=\"error\">{error}</span><br /><!-- END error -->{element}</div></div><br />"; + "\n\t\t\t<li><label class=\"element\"><!-- BEGIN required --><span class=\"required\">*</span><!-- END required -->{label}</label><div class=\"element<!-- BEGIN error --> error<!-- END error -->\"><!-- BEGIN error --><span class=\"error\">{error}</span><br /><!-- END error -->{element}</div></li>"; /** * Form template string @@ -68,7 +67,7 @@ * @access private */ var $_formTemplate = - "\n<form{attributes}>\n\t<div style=\"display: none;\">{hidden}\t</div>\n{content}\n</form>"; + "\n<form{attributes}>\n\t<div style=\"display: none;\">\n{hidden}\t</div>\n{content}\n</form>"; /** * Template used when opening a fieldset @@ -83,14 +82,14 @@ * @var string * @access private */ - var $_openHiddenFieldsetTemplate = "\n\t<fieldset class=\"hidden\">"; + var $_openHiddenFieldsetTemplate = "\n\t<fieldset class=\"hidden\">\n\t\t<ol>"; /** * Template used when closing a fieldset * @var string * @access private */ - var $_closeFieldsetTemplate = "\n\t</fieldset>"; + var $_closeFieldsetTemplate = "\n\t\t</ol>\n\t</fieldset>"; /** * Required Note template string @@ -98,7 +97,7 @@ * @access private */ var $_requiredNoteTemplate = - "\n\t\t<div class=\"reqnote\">{requiredNote}</div>"; + "\n\t\t\t<li class=\"reqnote\"><label class=\"element\"> </label>{requiredNote}</li>"; /** * How many fieldsets are open @@ -242,13 +241,7 @@ $id = $group->getName(); } $groupTemplate = $this->_groupTemplate; - if (!empty($id)) { - $groupTemplate = str_replace('<label', '<label for="' . $id . '"', $groupTemplate); - $html = preg_replace('#name="' . $id . '#', - 'id="' . $id . '" name="' . $id . '', - $html, - 1); - } + $this->_html .= str_replace('{element}', $html, $groupTemplate); $this->_inGroup = false; } // end func finishGroup http://cvs.php.net/viewvc.cgi/pear/HTML_QuickForm_Renderer_Tableless/data/stylesheet.css?r1=1.6&r2=1.7&diff_format=u Index: pear/HTML_QuickForm_Renderer_Tableless/data/stylesheet.css diff -u pear/HTML_QuickForm_Renderer_Tableless/data/stylesheet.css:1.6 pear/HTML_QuickForm_Renderer_Tableless/data/stylesheet.css:1.7 --- pear/HTML_QuickForm_Renderer_Tableless/data/stylesheet.css:1.6 Sat Oct 21 13:25:44 2006 +++ pear/HTML_QuickForm_Renderer_Tableless/data/stylesheet.css Sun Oct 29 19:02:06 2006 @@ -6,8 +6,7 @@ width: 560px; } form fieldset { - border: 1px solid black; - padding: 10px 0; + border: 0; margin: 0; width: 560px; } @@ -15,7 +14,22 @@ border: 0; } form fieldset legend { + white-space: nowrap; + background-color: #CCCCCC; font-weight: bold; + width: 560px; + padding: 1px; + border: 1px solid green; + display: block; +} +form fieldset ol { + margin: 0; + padding: 0; +} +form fieldset li { + list-style: none; + margin: 0; + clear: both; } form label { margin: 0 0 0 5px; @@ -26,6 +40,7 @@ width: 150px; padding: 0; margin: 5px 0 0 0; + font-weight: bold; text-align: right; } form input, form textarea, form select { @@ -43,8 +58,9 @@ margin: 5px 0 0 10px; padding: 0; } -form div.reqnote { +form li.reqnote { font-size: 80%; + margin: 5px 0 0 10px; } form span.error, form span.required { color: red; http://cvs.php.net/viewvc.cgi/pear/HTML_QuickForm_Renderer_Tableless/docs/examples/contact.php?r1=1.8&r2=1.9&diff_format=u Index: pear/HTML_QuickForm_Renderer_Tableless/docs/examples/contact.php diff -u pear/HTML_QuickForm_Renderer_Tableless/docs/examples/contact.php:1.8 pear/HTML_QuickForm_Renderer_Tableless/docs/examples/contact.php:1.9 --- pear/HTML_QuickForm_Renderer_Tableless/docs/examples/contact.php:1.8 Sat Oct 21 13:25:44 2006 +++ pear/HTML_QuickForm_Renderer_Tableless/docs/examples/contact.php Sun Oct 29 19:02:06 2006 @@ -20,8 +20,7 @@ width: 560px; } form fieldset { - border: 1px solid black; - padding: 10px 0; + border: 0; margin: 0; width: 560px; } @@ -29,7 +28,22 @@ border: 0; } form fieldset legend { + white-space: nowrap; + background-color: #CCCCCC; font-weight: bold; + width: 560px; + padding: 1px; + border: 1px solid green; + display: block; +} +form fieldset ol { + margin: 0; + padding: 0; +} +form fieldset li { + list-style: none; + margin: 0; + clear: both; } form label { margin: 0 0 0 5px; @@ -40,6 +54,7 @@ width: 150px; padding: 0; margin: 5px 0 0 0; + font-weight: bold; text-align: right; } form input, form textarea, form select { @@ -57,8 +72,9 @@ margin: 5px 0 0 10px; padding: 0; } -form div.reqnote { +form li.reqnote { font-size: 80%; + margin: 5px 0 0 10px; } form span.error, form span.required { color: red; @@ -135,6 +151,10 @@ $form->addElement('textarea', 'message', 'Your message:', array('style' => 'width: 300px;', 'cols' => 50, 'rows' => '7')); $form->addElement('submit', 'submit', 'Submit'); +$form->addElement('hidden', 'hidden1', 'x'); +$form->addElement('hidden', 'hidden2', 'y'); +$form->addElement('hidden', 'hidden3', 'z'); + $form->addRule('name', 'Please enter your name', 'required', null, 'client'); $form->addRule('email', 'Please enter your email address.', 'required', null, 'client'); $form->addRule('email', 'Please enter a valid email address.', 'email', null, 'client');
http://cvs.php.net/viewvc.cgi/pear/HTML_QuickForm_Renderer_Tableless/package2.xml?r1=1.16&r2=1.17&diff_format=u Index: pear/HTML_QuickForm_Renderer_Tableless/package2.xml diff -u pear/HTML_QuickForm_Renderer_Tableless/package2.xml:1.16 pear/HTML_QuickForm_Renderer_Tableless/package2.xml:1.17 --- pear/HTML_QuickForm_Renderer_Tableless/package2.xml:1.16 Sun Oct 22 11:39:47 2006 +++ pear/HTML_QuickForm_Renderer_Tableless/package2.xml Sun Oct 29 19:02:06 2006 @@ -34,11 +34,32 @@ - this package is now in beta status, i.e. the API can be considered as stable - this package is now licensed under the New BSD license - end-user documentation is now available in the manual -- fixed indentation of the closing div tag in the form template +- bugfix: for real groups (e.g. groups of checkboxes) the "id" attribute was + set two times (and an invalid "for" attribute was added to the label + element) +- changes in the div tag (in the form template) for the hidden elements: + * added a line break (\n) after the opening div tag + * added a tab (\t) before the closing div tag +- changes in the templates: rows (consisting of a label and an element) are not + put anymore into a div tag, but in a li element (and all li elements in an ol + element); this adds also a more semantical meaning to the generated forms + (a full list of changes to the templates is available on + http://pear.markwiesemann.eu/template-changes-0.4.0.txt) +- example file: added three hidden form elements - added "id" attribute also to group elements (and the "for" attribute to the label tag for groups) - removed "qf" prefix from CSS class names (exception: "label.qflabel" was renamed into "label.element") +- adjusted the layout in the example file and the bundled stylesheet to the + layout of the default renderer: + * fieldsets now don't have a border and no top or bottom margin, and the + fieldset legends have gotten a grey background (in Firefox not for the whole + width of the fieldset) + * element labels are now in a bold font + * the required note is now horizontally aligned like the form elements, and + not as before on the left margin + (a comparison of all changes to the stylesheet is available on + http://pear.markwiesemann.eu/stylesheet-comparison-0.4.0.txt) </notes> <contents> <dir name="/"> http://cvs.php.net/viewvc.cgi/pear/HTML_QuickForm_Renderer_Tableless/HTML/QuickForm/Renderer/Tableless.php?r1=1.16&r2=1.17&diff_format=u Index: pear/HTML_QuickForm_Renderer_Tableless/HTML/QuickForm/Renderer/Tableless.php diff -u pear/HTML_QuickForm_Renderer_Tableless/HTML/QuickForm/Renderer/Tableless.php:1.16 pear/HTML_QuickForm_Renderer_Tableless/HTML/QuickForm/Renderer/Tableless.php:1.17 --- pear/HTML_QuickForm_Renderer_Tableless/HTML/QuickForm/Renderer/Tableless.php:1.16 Sun Oct 22 11:39:47 2006 +++ pear/HTML_QuickForm_Renderer_Tableless/HTML/QuickForm/Renderer/Tableless.php Sun Oct 29 19:02:06 2006 @@ -21,7 +21,7 @@ * @author Mark Wiesemann <wiesemann@php.net> * @copyright 2005-2006 The PHP Group * @license http://www.opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Tableless.php,v 1.16 2006/10/22 11:39:47 wiesemann Exp $ + * @version CVS: $Id: Tableless.php,v 1.17 2006/10/29 19:02:06 wiesemann Exp $ * @link http://pear.php.net/package/HTML_QuickForm_Renderer_Tableless */ @@ -51,8 +51,7 @@ * @var string * @access private */ - var $_headerTemplate = - "\n\t\t<legend>{header}</legend>"; + var $_headerTemplate = "\n\t\t<legend>{header}</legend>\n\t\t<ol>"; /** * Element template string @@ -60,7 +59,7 @@ * @access private */ var $_elementTemplate = - "\n\t\t<div class=\"row\"><label class=\"element\"><!-- BEGIN required --><span class=\"required\">*</span><!-- END required -->{label}</label><div class=\"element<!-- BEGIN error --> error<!-- END error -->\"><!-- BEGIN error --><span class=\"error\">{error}</span><br /><!-- END error -->{element}</div></div><br />"; + "\n\t\t\t<li><label class=\"element\"><!-- BEGIN required --><span class=\"required\">*</span><!-- END required -->{label}</label><div class=\"element<!-- BEGIN error --> error<!-- END error -->\"><!-- BEGIN error --><span class=\"error\">{error}</span><br /><!-- END error -->{element}</div></li>"; /** * Form template string @@ -68,7 +67,7 @@ * @access private */ var $_formTemplate = - "\n<form{attributes}>\n\t<div style=\"display: none;\">{hidden}\t</div>\n{content}\n</form>"; + "\n<form{attributes}>\n\t<div style=\"display: none;\">\n{hidden}\t</div>\n{content}\n</form>"; /** * Template used when opening a fieldset @@ -83,14 +82,14 @@ * @var string * @access private */ - var $_openHiddenFieldsetTemplate = "\n\t<fieldset class=\"hidden\">"; + var $_openHiddenFieldsetTemplate = "\n\t<fieldset class=\"hidden\">\n\t\t<ol>"; /** * Template used when closing a fieldset * @var string * @access private */ - var $_closeFieldsetTemplate = "\n\t</fieldset>"; + var $_closeFieldsetTemplate = "\n\t\t</ol>\n\t</fieldset>"; /** * Required Note template string @@ -98,7 +97,7 @@ * @access private */ var $_requiredNoteTemplate = - "\n\t\t<div class=\"reqnote\">{requiredNote}</div>"; + "\n\t\t\t<li class=\"reqnote\"><label class=\"element\"> </label>{requiredNote}</li>"; /** * How many fieldsets are open @@ -242,13 +241,7 @@ $id = $group->getName(); } $groupTemplate = $this->_groupTemplate; - if (!empty($id)) { - $groupTemplate = str_replace('<label', '<label for="' . $id . '"', $groupTemplate); - $html = preg_replace('#name="' . $id . '#', - 'id="' . $id . '" name="' . $id . '', - $html, - 1); - } + $this->_html .= str_replace('{element}', $html, $groupTemplate); $this->_inGroup = false; } // end func finishGroup http://cvs.php.net/viewvc.cgi/pear/HTML_QuickForm_Renderer_Tableless/data/stylesheet.css?r1=1.6&r2=1.7&diff_format=u Index: pear/HTML_QuickForm_Renderer_Tableless/data/stylesheet.css diff -u pear/HTML_QuickForm_Renderer_Tableless/data/stylesheet.css:1.6 pear/HTML_QuickForm_Renderer_Tableless/data/stylesheet.css:1.7 --- pear/HTML_QuickForm_Renderer_Tableless/data/stylesheet.css:1.6 Sat Oct 21 13:25:44 2006 +++ pear/HTML_QuickForm_Renderer_Tableless/data/stylesheet.css Sun Oct 29 19:02:06 2006 @@ -6,8 +6,7 @@ width: 560px; } form fieldset { - border: 1px solid black; - padding: 10px 0; + border: 0; margin: 0; width: 560px; } @@ -15,7 +14,22 @@ border: 0; } form fieldset legend { + white-space: nowrap; + background-color: #CCCCCC; font-weight: bold; + width: 560px; + padding: 1px; + border: 1px solid green; + display: block; +} +form fieldset ol { + margin: 0; + padding: 0; +} +form fieldset li { + list-style: none; + margin: 0; + clear: both; } form label { margin: 0 0 0 5px; @@ -26,6 +40,7 @@ width: 150px; padding: 0; margin: 5px 0 0 0; + font-weight: bold; text-align: right; } form input, form textarea, form select { @@ -43,8 +58,9 @@ margin: 5px 0 0 10px; padding: 0; } -form div.reqnote { +form li.reqnote { font-size: 80%; + margin: 5px 0 0 10px; } form span.error, form span.required { color: red; http://cvs.php.net/viewvc.cgi/pear/HTML_QuickForm_Renderer_Tableless/docs/examples/contact.php?r1=1.8&r2=1.9&diff_format=u Index: pear/HTML_QuickForm_Renderer_Tableless/docs/examples/contact.php diff -u pear/HTML_QuickForm_Renderer_Tableless/docs/examples/contact.php:1.8 pear/HTML_QuickForm_Renderer_Tableless/docs/examples/contact.php:1.9 --- pear/HTML_QuickForm_Renderer_Tableless/docs/examples/contact.php:1.8 Sat Oct 21 13:25:44 2006 +++ pear/HTML_QuickForm_Renderer_Tableless/docs/examples/contact.php Sun Oct 29 19:02:06 2006 @@ -20,8 +20,7 @@ width: 560px; } form fieldset { - border: 1px solid black; - padding: 10px 0; + border: 0; margin: 0; width: 560px; } @@ -29,7 +28,22 @@ border: 0; } form fieldset legend { + white-space: nowrap; + background-color: #CCCCCC; font-weight: bold; + width: 560px; + padding: 1px; + border: 1px solid green; + display: block; +} +form fieldset ol { + margin: 0; + padding: 0; +} +form fieldset li { + list-style: none; + margin: 0; + clear: both; } form label { margin: 0 0 0 5px; @@ -40,6 +54,7 @@ width: 150px; padding: 0; margin: 5px 0 0 0; + font-weight: bold; text-align: right; } form input, form textarea, form select { @@ -57,8 +72,9 @@ margin: 5px 0 0 10px; padding: 0; } -form div.reqnote { +form li.reqnote { font-size: 80%; + margin: 5px 0 0 10px; } form span.error, form span.required { color: red; @@ -135,6 +151,10 @@ $form->addElement('textarea', 'message', 'Your message:', array('style' => 'width: 300px;', 'cols' => 50, 'rows' => '7')); $form->addElement('submit', 'submit', 'Submit'); +$form->addElement('hidden', 'hidden1', 'x'); +$form->addElement('hidden', 'hidden2', 'y'); +$form->addElement('hidden', 'hidden3', 'z'); + $form->addRule('name', 'Please enter your name', 'required', null, 'client'); $form->addRule('email', 'Please enter your email address.', 'required', null, 'client'); $form->addRule('email', 'Please enter a valid email address.', 'email', null, 'client');