Adding the new quickform element: advanced_settings in order to add the link more faster

skala
Julio Montoya 14 years ago
parent 3b189e9ad2
commit 294d540fed
  1. 260
      main/inc/lib/pear/HTML/QuickForm.php
  2. 102
      main/inc/lib/pear/HTML/QuickForm/Renderer/Default.php
  3. 89
      main/inc/lib/pear/HTML/QuickForm/advanced_settings.php
  4. 76
      main/inc/lib/pear/HTML/QuickForm/checkbox.php
  5. 78
      main/inc/lib/pear/HTML/QuickForm/group.php
  6. 74
      main/inc/lib/pear/HTML/QuickForm/html.php
  7. 72
      main/inc/lib/pear/HTML/QuickForm/radio.php

@ -1,76 +1,78 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Create, validate and process HTML forms
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Alexey Borzov <avb@php.net>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: QuickForm.php,v 1.166 2009/04/04 21:34:02 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* PEAR and PEAR_Error classes, for error handling
*/
require_once 'PEAR.php';
/**
* Base class for all HTML classes
*/
require_once 'HTML/Common.php';
/**
* Element types known to HTML_QuickForm
* @see HTML_QuickForm::registerElementType(), HTML_QuickForm::getRegisteredTypes(),
* HTML_QuickForm::isTypeRegistered()
* @global array $GLOBALS['HTML_QUICKFORM_ELEMENT_TYPES']
*/
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Create, validate and process HTML forms
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Alexey Borzov <avb@php.net>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: QuickForm.php,v 1.166 2009/04/04 21:34:02 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* PEAR and PEAR_Error classes, for error handling
*/
require_once 'PEAR.php';
/**
* Base class for all HTML classes
*/
require_once 'HTML/Common.php';
/**
* Element types known to HTML_QuickForm
* @see HTML_QuickForm::registerElementType(), HTML_QuickForm::getRegisteredTypes(),
* HTML_QuickForm::isTypeRegistered()
* @global array $GLOBALS['HTML_QUICKFORM_ELEMENT_TYPES']
*/
$GLOBALS['HTML_QUICKFORM_ELEMENT_TYPES'] =
array(
'group' =>array('HTML/QuickForm/group.php','HTML_QuickForm_group'),
'hidden' =>array('HTML/QuickForm/hidden.php','HTML_QuickForm_hidden'),
'reset' =>array('HTML/QuickForm/reset.php','HTML_QuickForm_reset'),
'checkbox' =>array('HTML/QuickForm/checkbox.php','HTML_QuickForm_checkbox'),
'file' =>array('HTML/QuickForm/file.php','HTML_QuickForm_file'),
'image' =>array('HTML/QuickForm/image.php','HTML_QuickForm_image'),
'password' =>array('HTML/QuickForm/password.php','HTML_QuickForm_password'),
'radio' =>array('HTML/QuickForm/radio.php','HTML_QuickForm_radio'),
'button' =>array('HTML/QuickForm/button.php','HTML_QuickForm_button'),
'submit' =>array('HTML/QuickForm/submit.php','HTML_QuickForm_submit'),
'select' =>array('HTML/QuickForm/select.php','HTML_QuickForm_select'),
'hiddenselect' =>array('HTML/QuickForm/hiddenselect.php','HTML_QuickForm_hiddenselect'),
'text' =>array('HTML/QuickForm/text.php','HTML_QuickForm_text'),
'textarea' =>array('HTML/QuickForm/textarea.php','HTML_QuickForm_textarea'),
'link' =>array('HTML/QuickForm/link.php','HTML_QuickForm_link'),
'advcheckbox' =>array('HTML/QuickForm/advcheckbox.php','HTML_QuickForm_advcheckbox'),
'date' =>array('HTML/QuickForm/date.php','HTML_QuickForm_date'),
'static' =>array('HTML/QuickForm/static.php','HTML_QuickForm_static'),
'header' =>array('HTML/QuickForm/header.php', 'HTML_QuickForm_header'),
'html' =>array('HTML/QuickForm/html.php', 'HTML_QuickForm_html'),
'hierselect' =>array('HTML/QuickForm/hierselect.php', 'HTML_QuickForm_hierselect'),
'autocomplete' =>array('HTML/QuickForm/autocomplete.php', 'HTML_QuickForm_autocomplete'),
'xbutton' =>array('HTML/QuickForm/xbutton.php','HTML_QuickForm_xbutton')
'group' =>array('HTML/QuickForm/group.php','HTML_QuickForm_group'),
'hidden' =>array('HTML/QuickForm/hidden.php','HTML_QuickForm_hidden'),
'reset' =>array('HTML/QuickForm/reset.php','HTML_QuickForm_reset'),
'checkbox' =>array('HTML/QuickForm/checkbox.php','HTML_QuickForm_checkbox'),
'file' =>array('HTML/QuickForm/file.php','HTML_QuickForm_file'),
'image' =>array('HTML/QuickForm/image.php','HTML_QuickForm_image'),
'password' =>array('HTML/QuickForm/password.php','HTML_QuickForm_password'),
'radio' =>array('HTML/QuickForm/radio.php','HTML_QuickForm_radio'),
'button' =>array('HTML/QuickForm/button.php','HTML_QuickForm_button'),
'submit' =>array('HTML/QuickForm/submit.php','HTML_QuickForm_submit'),
'select' =>array('HTML/QuickForm/select.php','HTML_QuickForm_select'),
'hiddenselect' =>array('HTML/QuickForm/hiddenselect.php','HTML_QuickForm_hiddenselect'),
'text' =>array('HTML/QuickForm/text.php','HTML_QuickForm_text'),
'textarea' =>array('HTML/QuickForm/textarea.php','HTML_QuickForm_textarea'),
'link' =>array('HTML/QuickForm/link.php','HTML_QuickForm_link'),
'advcheckbox' =>array('HTML/QuickForm/advcheckbox.php','HTML_QuickForm_advcheckbox'),
'date' =>array('HTML/QuickForm/date.php','HTML_QuickForm_date'),
'static' =>array('HTML/QuickForm/static.php','HTML_QuickForm_static'),
'header' =>array('HTML/QuickForm/header.php', 'HTML_QuickForm_header'),
'html' =>array('HTML/QuickForm/html.php', 'HTML_QuickForm_html'),
'hierselect' =>array('HTML/QuickForm/hierselect.php', 'HTML_QuickForm_hierselect'),
'autocomplete' =>array('HTML/QuickForm/autocomplete.php', 'HTML_QuickForm_autocomplete'),
'xbutton' =>array('HTML/QuickForm/xbutton.php','HTML_QuickForm_xbutton'),
'advanced_settings' =>array('HTML/QuickForm/advanced_settings.php','HTML_QuickForm_advanced_settings')
);
/**
* Validation rules known to HTML_QuickForm
* @see HTML_QuickForm::registerRule(), HTML_QuickForm::getRegisteredRules(),
* HTML_QuickForm::isRuleRegistered()
* @global array $GLOBALS['_HTML_QuickForm_registered_rules']
*/
/**
* Validation rules known to HTML_QuickForm
* @see HTML_QuickForm::registerRule(), HTML_QuickForm::getRegisteredRules(),
* HTML_QuickForm::isRuleRegistered()
* @global array $GLOBALS['_HTML_QuickForm_registered_rules']
*/
$GLOBALS['_HTML_QuickForm_registered_rules'] = array(
'required' => array('html_quickform_rule_required', 'HTML/QuickForm/Rule/Required.php'),
'maxlength' => array('html_quickform_rule_range', 'HTML/QuickForm/Rule/Range.php'),
@ -94,13 +96,13 @@ $GLOBALS['_HTML_QuickForm_registered_rules'] = array(
// {{{ error codes
/**#@+
* Error codes for HTML_QuickForm
*
* Codes are mapped to textual messages by errorMessage() method, if you add a
* new code be sure to add a new message for it to errorMessage()
*
* @see HTML_QuickForm::errorMessage()
/**#@+
* Error codes for HTML_QuickForm
*
* Codes are mapped to textual messages by errorMessage() method, if you add a
* new code be sure to add a new message for it to errorMessage()
*
* @see HTML_QuickForm::errorMessage()
*/
define('QUICKFORM_OK', 1);
define('QUICKFORM_ERROR', -1);
@ -112,22 +114,22 @@ define('QUICKFORM_INVALID_ELEMENT_NAME', -6);
define('QUICKFORM_INVALID_PROCESS', -7);
define('QUICKFORM_DEPRECATED', -8);
define('QUICKFORM_INVALID_DATASOURCE', -9);
/**#@-*/
/**#@-*/
// }}}
/**
* Create, validate and process HTML forms
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Alexey Borzov <avb@php.net>
* @version Release: 3.2.11
*/
class HTML_QuickForm extends HTML_Common
{
* Create, validate and process HTML forms
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Alexey Borzov <avb@php.net>
* @version Release: 3.2.11
*/
class HTML_QuickForm extends HTML_Common
{
// {{{ properties
/**
@ -422,7 +424,7 @@ class HTML_QuickForm extends HTML_Common
* @since 3.3
* @access public
* @return void
* @throws HTML_QuickForm_Error
* @throws HTML_QuickForm_Error
*/
function setDatasource(&$datasource, $defaultsFilter = null, $constantsFilter = null)
{
@ -450,7 +452,7 @@ class HTML_QuickForm extends HTML_Common
* @since 1.0
* @access public
* @return void
* @throws HTML_QuickForm_Error
* @throws HTML_QuickForm_Error
*/
function setDefaults($defaultValues = null, $filter = null)
{
@ -490,7 +492,7 @@ class HTML_QuickForm extends HTML_Common
* @since 2.0
* @access public
* @return void
* @throws HTML_QuickForm_Error
* @throws HTML_QuickForm_Error
*/
function setConstants($constantValues = null, $filter = null)
{
@ -568,7 +570,7 @@ class HTML_QuickForm extends HTML_Common
* @param string $elementType type of element to add (text, textarea, file...)
* @since 1.0
* @access public
* @return HTML_QuickForm_Element
* @return HTML_QuickForm_Element
* @throws HTML_QuickForm_Error
*/
function &createElement($elementType) {
@ -588,7 +590,7 @@ class HTML_QuickForm extends HTML_Common
* @param array $args arguments for event
* @since 2.0
* @access private
* @return HTML_QuickForm_Element
* @return HTML_QuickForm_Element
* @throws HTML_QuickForm_Error
*/
function &_loadElement($event, $type, $args)
@ -631,7 +633,7 @@ class HTML_QuickForm extends HTML_Common
*
* @param mixed $element element object or type of element to add (text, textarea, file...)
* @since 1.0
* @return HTML_QuickForm_Element a reference to newly added element
* @return HTML_QuickForm_Element a reference to newly added element
* @access public
* @throws HTML_QuickForm_Error
*/
@ -685,10 +687,10 @@ class HTML_QuickForm extends HTML_Common
*
* @access public
* @since 3.2.4
* @param HTML_QuickForm_element Element to insert
* @param string Name of the element before which the new
* one is inserted
* @return HTML_QuickForm_element reference to inserted element
* @param HTML_QuickForm_element Element to insert
* @param string Name of the element before which the new
* one is inserted
* @return HTML_QuickForm_element reference to inserted element
* @throws HTML_QuickForm_Error
*/
function &insertElementBefore(&$element, $nameAfter)
@ -753,10 +755,10 @@ class HTML_QuickForm extends HTML_Common
* @param string $separator (optional)string to separate elements
* @param string $appendName (optional)specify whether the group name should be
* used in the form element name ex: group[element]
* @return HTML_QuickForm_group reference to a newly added group
* @return HTML_QuickForm_group reference to a newly added group
* @since 2.8
* @access public
* @throws HTML_QuickForm_Error
* @throws HTML_QuickForm_Error
*/
function &addGroup($elements, $name=null, $groupLabel='', $separator=null, $appendName = true)
{
@ -779,7 +781,7 @@ class HTML_QuickForm extends HTML_Common
* @param string $element Element name
* @since 2.0
* @access public
* @return HTML_QuickForm_element reference to element
* @return HTML_QuickForm_element reference to element
* @throws HTML_QuickForm_Error
*/
function &getElement($element)
@ -1025,7 +1027,7 @@ class HTML_QuickForm extends HTML_Common
* @param boolean $removeRules True if rules for this element are to be removed too
* @access public
* @since 2.0
* @return HTML_QuickForm_element a reference to the removed element
* @return HTML_QuickForm_element a reference to the removed element
* @throws HTML_QuickForm_Error
*/
function &removeElement($elementName, $removeRules = true)
@ -1042,13 +1044,13 @@ class HTML_QuickForm extends HTML_Common
$this->_elementIndex[$elementName] = array_shift($this->_duplicateIndex[$elementName]);
}
if ($removeRules) {
$this->_required = array_diff($this->_required, array($elementName));
$this->_required = array_diff($this->_required, array($elementName));
unset($this->_rules[$elementName], $this->_errors[$elementName]);
if ('group' == $el->getType()) {
foreach (array_keys($el->getElements()) as $key) {
unset($this->_rules[$el->getElementName($key)]);
}
}
if ('group' == $el->getType()) {
foreach (array_keys($el->getElements()) as $key) {
unset($this->_rules[$el->getElementName($key)]);
}
}
}
return $el;
} // end func removeElement
@ -1248,7 +1250,7 @@ class HTML_QuickForm extends HTML_Common
* @param mixed $filter Callback, either function name or array(&$object, 'method')
* @since 2.0
* @access public
* @throws HTML_QuickForm_Error
* @throws HTML_QuickForm_Error
*/
function applyFilter($element, $filter)
{
@ -1313,7 +1315,7 @@ class HTML_QuickForm extends HTML_Common
* The main difference is that existing keys will not be renumbered
* if they are integers.
*
* @access public
* @access public
* @param array $a original array
* @param array $b array which will be merged into first one
* @return array merged array
@ -1515,7 +1517,7 @@ class HTML_QuickForm extends HTML_Common
* @access public
* @since 1.0
* @return boolean true if no error found
* @throws HTML_QuickForm_Error
* @throws HTML_QuickForm_Error
*/
function validate()
{
@ -1544,11 +1546,11 @@ class HTML_QuickForm extends HTML_Common
// Fix for bug #3501: we shouldn't validate not uploaded files, either.
// Unfortunately, we can't just use $element->isUploadedFile() since
// the element in question can be buried in group. Thus this hack.
// See also bug #12014, we should only consider a file that has
// status UPLOAD_ERR_NO_FILE as not uploaded, in all other cases
// validation should be performed, so that e.g. 'maxfilesize' rule
// will display an error if status is UPLOAD_ERR_INI_SIZE
// or UPLOAD_ERR_FORM_SIZE
// See also bug #12014, we should only consider a file that has
// status UPLOAD_ERR_NO_FILE as not uploaded, in all other cases
// validation should be performed, so that e.g. 'maxfilesize' rule
// will display an error if status is UPLOAD_ERR_INI_SIZE
// or UPLOAD_ERR_FORM_SIZE
} elseif (is_array($submitValue)) {
if (false === ($pos = strpos($target, '['))) {
$isUpload = !empty($this->_submitFiles[$target]);
@ -1563,7 +1565,7 @@ class HTML_QuickForm extends HTML_Common
) . "']";
eval("\$isUpload = isset(\$this->_submitFiles['{$base}']['name']{$idx});");
}
if ($isUpload && (!isset($submitValue['error']) || UPLOAD_ERR_NO_FILE == $submitValue['error'])) {
if ($isUpload && (!isset($submitValue['error']) || UPLOAD_ERR_NO_FILE == $submitValue['error'])) {
continue 2;
}
}
@ -1667,7 +1669,7 @@ class HTML_QuickForm extends HTML_Common
* @since 1.0
* @access public
* @throws HTML_QuickForm_Error
* @return mixed Whatever value the $callback function returns
* @return mixed Whatever value the $callback function returns
*/
function process($callback, $mergeFiles = true)
{
@ -1897,7 +1899,7 @@ class HTML_QuickForm extends HTML_Common
* @param string Name of an element
* @access public
* @return mixed
* @throws HTML_QuickForm_Error
* @throws HTML_QuickForm_Error
*/
function exportValue($element)
{
@ -1987,7 +1989,7 @@ class HTML_QuickForm extends HTML_Common
* @access public
* @param mixed result code
* @return bool whether $value is an error
* @static
* @static
*/
function isError($value)
{
@ -2003,7 +2005,7 @@ class HTML_QuickForm extends HTML_Common
* @access public
* @param int error code
* @return string error message
* @static
* @static
*/
function errorMessage($value)
{
@ -2038,15 +2040,15 @@ class HTML_QuickForm extends HTML_Common
// }}}
} // end class HTML_QuickForm
/**
* Class for errors thrown by HTML_QuickForm package
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 3.2.11
*/
/**
* Class for errors thrown by HTML_QuickForm package
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 3.2.11
*/
class HTML_QuickForm_Error extends PEAR_Error {
// {{{ properties

@ -1,43 +1,43 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* A concrete renderer for HTML_QuickForm, based on QuickForm 2.x built-in one
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Alexey Borzov <avb@php.net>
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* An abstract base class for QuickForm renderers
*/
require_once 'HTML/QuickForm/Renderer.php';
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* A concrete renderer for HTML_QuickForm, based on QuickForm 2.x built-in one
* A concrete renderer for HTML_QuickForm, based on QuickForm 2.x built-in one
*
* @category HTML
* @package HTML_QuickForm
* @author Alexey Borzov <avb@php.net>
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 3.2.11
* @since 3.0
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Alexey Borzov <avb@php.net>
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* An abstract base class for QuickForm renderers
*/
require_once 'HTML/QuickForm/Renderer.php';
/**
* A concrete renderer for HTML_QuickForm, based on QuickForm 2.x built-in one
*
* @category HTML
* @package HTML_QuickForm
* @author Alexey Borzov <avb@php.net>
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 3.2.11
* @since 3.0
*/
class HTML_QuickForm_Renderer_Default extends HTML_QuickForm_Renderer
{
@ -173,7 +173,7 @@ class HTML_QuickForm_Renderer_Default extends HTML_QuickForm_Renderer
/**
* Called when visiting a form, before processing any form elements
*
* @param HTML_QuickForm form object being visited
* @param HTML_QuickForm form object being visited
* @access public
* @return void
*/
@ -187,7 +187,7 @@ class HTML_QuickForm_Renderer_Default extends HTML_QuickForm_Renderer
* Called when visiting a form, after processing all form elements
* Adds required note, form attributes, validation javascript and form content.
*
* @param HTML_QuickForm form object being visited
* @param HTML_QuickForm form object being visited
* @access public
* @return void
*/
@ -215,7 +215,7 @@ class HTML_QuickForm_Renderer_Default extends HTML_QuickForm_Renderer
/**
* Called when visiting a header element
*
* @param HTML_QuickForm_header header element being visited
* @param HTML_QuickForm_header header element being visited
* @access public
* @return void
*/
@ -256,7 +256,7 @@ class HTML_QuickForm_Renderer_Default extends HTML_QuickForm_Renderer
$html = str_replace('<!-- BEGIN required -->', '', $html);
$html = str_replace('<!-- END required -->', '', $html);
} else {
$html = preg_replace("/([ \t\n\r]*)?<!-- BEGIN required -->.*<!-- END required -->([ \t\n\r]*)?/isU", '', $html);
$html = preg_replace("/([ \t\n\r]*)?<!-- BEGIN required -->.*<!-- END required -->([ \t\n\r]*)?/isU", '', $html);
}
if (isset($error)) {
$html = str_replace('{error}', $error, $html);
@ -265,7 +265,7 @@ class HTML_QuickForm_Renderer_Default extends HTML_QuickForm_Renderer
$html = str_replace('<!-- END error -->', '', $html);
} else {
$html = str_replace('{error_class}', '', $html);
$html = preg_replace("/([ \t\n\r]*)?<!-- BEGIN error -->.*<!-- END error -->([ \t\n\r]*)?/isU", '', $html);
$html = preg_replace("/([ \t\n\r]*)?<!-- BEGIN error -->.*<!-- END error -->([ \t\n\r]*)?/isU", '', $html);
}
if (is_array($label)) {
foreach($label as $key => $text) {
@ -276,7 +276,7 @@ class HTML_QuickForm_Renderer_Default extends HTML_QuickForm_Renderer
}
}
if (strpos($html, '{label_')) {
$html = preg_replace('/\s*<!-- BEGIN label_(\S+) -->.*<!-- END label_\1 -->\s*/is', '', $html);
$html = preg_replace('/\s*<!-- BEGIN label_(\S+) -->.*<!-- END label_\1 -->\s*/is', '', $html);
}
return $html;
} // end func _prepareTemplate
@ -285,9 +285,9 @@ class HTML_QuickForm_Renderer_Default extends HTML_QuickForm_Renderer
* Renders an element Html
* Called when visiting an element
*
* @param HTML_QuickForm_element form element being visited
* @param bool Whether an element is required
* @param string An error message associated with an element
* @param HTML_QuickForm_element form element being visited
* @param bool Whether an element is required
* @param string An error message associated with an element
* @access public
* @return void
*/
@ -303,7 +303,7 @@ class HTML_QuickForm_Renderer_Default extends HTML_QuickForm_Renderer
$html = str_replace('<!-- BEGIN required -->', '', $html);
$html = str_replace('<!-- END required -->', '', $html);
} else {
$html = preg_replace("/([ \t\n\r]*)?<!-- BEGIN required -->.*<!-- END required -->([ \t\n\r]*)?/isU", '', $html);
$html = preg_replace("/([ \t\n\r]*)?<!-- BEGIN required -->.*<!-- END required -->([ \t\n\r]*)?/isU", '', $html);
}
$this->_groupElements[] = str_replace('{element}', $element->toHtml(), $html);
@ -316,7 +316,7 @@ class HTML_QuickForm_Renderer_Default extends HTML_QuickForm_Renderer
* Renders an hidden element
* Called when visiting a hidden element
*
* @param HTML_QuickForm_element form element being visited
* @param HTML_QuickForm_element form element being visited
* @access public
* @return void
*/
@ -328,7 +328,7 @@ class HTML_QuickForm_Renderer_Default extends HTML_QuickForm_Renderer
/**
* Called when visiting a raw HTML/text pseudo-element
*
* @param HTML_QuickForm_html element being visited
* @param HTML_QuickForm_html element being visited
* @access public
* @return void
*/
@ -340,7 +340,7 @@ class HTML_QuickForm_Renderer_Default extends HTML_QuickForm_Renderer
/**
* Called when visiting a group, before processing any group elements
*
* @param HTML_QuickForm_group group being visited
* @param HTML_QuickForm_group group being visited
* @param bool Whether a group is required
* @param string An error message associated with a group
* @access public
@ -359,7 +359,7 @@ class HTML_QuickForm_Renderer_Default extends HTML_QuickForm_Renderer
/**
* Called when visiting a group, after processing all group elements
*
* @param HTML_QuickForm_group group being visited
* @param HTML_QuickForm_group group being visited
* @access public
* @return void
*/
@ -381,7 +381,7 @@ class HTML_QuickForm_Renderer_Default extends HTML_QuickForm_Renderer
if (!empty($this->_groupWrap)) {
$html = str_replace('{content}', $html, $this->_groupWrap);
}
$this->_html .= str_replace('{element}', $html, $this->_groupTemplate);
$this->_html .= str_replace('{element}', $html, $this->_groupTemplate);
$this->_inGroup = false;
} // end func finishGroup

@ -0,0 +1,89 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* A pseudo-element used for adding raw HTML to form
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Alexey Borzov <avb@php.net>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: html.php,v 1.3 2009/04/04 21:34:03 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* HTML class for static data
*/
require_once 'HTML/QuickForm/static.php';
/**
* A pseudo-element used for adding raw HTML to form
*
* Intended for use with the default renderer only, template-based
* ones may (and probably will) completely ignore this
*
* @category HTML
* @package HTML_QuickForm
* @author Alexey Borzov <avb@php.net>
* @version Release: 3.2.11
* @since 3.0
* @deprecated Please use the templates rather than add raw HTML via this element
*/
class HTML_QuickForm_advanced_settings extends HTML_QuickForm_static
{
// {{{ constructor
/**
* Class constructor
*
* @param string $text raw HTML to add
* @access public
* @return void
*/
function HTML_QuickForm_advanced_settings($text = null)
{
$this->HTML_QuickForm_static(null, null, $text);
$this->_type = 'html';
}
// }}}
// {{{ accept()
/**
* Accepts a renderer
*
* @param HTML_QuickForm_Renderer renderer object (only works with Default renderer!)
* @access public
* @return void
*/
function accept(&$renderer)
{
$renderer->renderHtml($this);
} // end func accept
function toHtml() {
return '<div class="control-group ">
<label class="control-label"></label>
<div class="controls">
'.HTML_QuickForm_static::toHtml().'
</div>
</div>
';
} //end func toHtml
// }}}
} //end class HTML_QuickForm_html

@ -1,43 +1,43 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* HTML class for a checkbox type field
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Alexey Borzov <avb@php.net>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: checkbox.php,v 1.23 2009/04/04 21:34:02 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Base class for <input /> form elements
*/
require_once 'HTML/QuickForm/input.php';
/**
* HTML class for a checkbox type field
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Alexey Borzov <avb@php.net>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: checkbox.php,v 1.23 2009/04/04 21:34:02 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Base class for <input /> form elements
*/
require_once 'HTML/QuickForm/input.php';
/**
* HTML class for a checkbox type field
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Alexey Borzov <avb@php.net>
* @version Release: 3.2.11
* @since 1.0
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Alexey Borzov <avb@php.net>
* @version Release: 3.2.11
* @since 1.0
*/
class HTML_QuickForm_checkbox extends HTML_QuickForm_input
{
@ -128,7 +128,9 @@ class HTML_QuickForm_checkbox extends HTML_QuickForm_input
} elseif ($this->_flagFrozen) {
$label = $this->_text;
} else {
$label = '<label for="' . $this->getAttribute('id') . '">' . $this->_text . '</label>';
//$label = '<label for="' . $this->getAttribute('id') . '">' . $this->_text . '</label>';
$label = '<label class="checkbox">' . HTML_QuickForm_input::toHtml().$this->_text . '</label>';
return $label;
}
return HTML_QuickForm_input::toHtml() . $label;
} //end func toHtml
@ -223,7 +225,7 @@ class HTML_QuickForm_checkbox extends HTML_QuickForm_input
*
* @param string $event Name of event
* @param mixed $arg event arguments
* @param object &$caller calling object
* @param object &$caller calling object
* @since 1.0
* @access public
* @return void
@ -244,7 +246,7 @@ class HTML_QuickForm_checkbox extends HTML_QuickForm_input
$value = $this->_findValue($caller->_defaultValues);
}
}
if (null !== $value || $caller->isSubmitted()) {
if (null !== $value || $caller->isSubmitted()) {
$this->setChecked($value);
}
break;

@ -1,43 +1,43 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* HTML class for a form element group
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Alexey Borzov <avb@php.net>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: group.php,v 1.40 2009/04/04 21:34:03 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Base class for form elements
*/
require_once 'HTML/QuickForm/element.php';
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* HTML class for a form element group
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Alexey Borzov <avb@php.net>
* @version Release: 3.2.11
* @since 1.0
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Alexey Borzov <avb@php.net>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: group.php,v 1.40 2009/04/04 21:34:03 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Base class for form elements
*/
require_once 'HTML/QuickForm/element.php';
/**
* HTML class for a form element group
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Alexey Borzov <avb@php.net>
* @version Release: 3.2.11
* @since 1.0
*/
class HTML_QuickForm_group extends HTML_QuickForm_element
{
@ -388,7 +388,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
*
* @param string $event Name of event
* @param mixed $arg event arguments
* @param object &$caller calling object
* @param object &$caller calling object
* @since 1.0
* @access public
* @return void
@ -428,9 +428,9 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
/**
* Accepts a renderer
*
* @param HTML_QuickForm_Renderer renderer object
* @param bool Whether a group is required
* @param string An error message associated with a group
* @param HTML_QuickForm_Renderer renderer object
* @param bool Whether a group is required
* @param string An error message associated with a group
* @access public
* @return void
*/

@ -1,29 +1,29 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* A pseudo-element used for adding raw HTML to form
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Alexey Borzov <avb@php.net>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: html.php,v 1.3 2009/04/04 21:34:03 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* HTML class for static data
*/
/**
* A pseudo-element used for adding raw HTML to form
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Alexey Borzov <avb@php.net>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: html.php,v 1.3 2009/04/04 21:34:03 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* HTML class for static data
*/
require_once 'HTML/QuickForm/static.php';
/**
@ -32,12 +32,12 @@ require_once 'HTML/QuickForm/static.php';
* Intended for use with the default renderer only, template-based
* ones may (and probably will) completely ignore this
*
* @category HTML
* @package HTML_QuickForm
* @author Alexey Borzov <avb@php.net>
* @version Release: 3.2.11
* @since 3.0
* @deprecated Please use the templates rather than add raw HTML via this element
* @category HTML
* @package HTML_QuickForm
* @author Alexey Borzov <avb@php.net>
* @version Release: 3.2.11
* @since 3.0
* @deprecated Please use the templates rather than add raw HTML via this element
*/
class HTML_QuickForm_html extends HTML_QuickForm_static
{
@ -62,7 +62,7 @@ class HTML_QuickForm_html extends HTML_QuickForm_static
/**
* Accepts a renderer
*
* @param HTML_QuickForm_Renderer renderer object (only works with Default renderer!)
* @param HTML_QuickForm_Renderer renderer object (only works with Default renderer!)
* @access public
* @return void
*/
@ -70,8 +70,14 @@ class HTML_QuickForm_html extends HTML_QuickForm_static
{
$renderer->renderHtml($this);
} // end func accept
function toHtml()
{
return HTML_QuickForm_static::toHtml();
} //end func toHtml
// }}}
} //end class HTML_QuickForm_html
?>
// }}}
} //end class HTML_QuickForm_html

@ -1,41 +1,41 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* HTML class for a radio type element
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: radio.php,v 1.20 2009/04/04 21:34:04 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Base class for <input /> form elements
*/
require_once 'HTML/QuickForm/input.php';
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* HTML class for a radio type element
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 3.2.11
* @since 1.0
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: radio.php,v 1.20 2009/04/04 21:34:04 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Base class for <input /> form elements
*/
require_once 'HTML/QuickForm/input.php';
/**
* HTML class for a radio type element
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 3.2.11
* @since 1.0
*/
class HTML_QuickForm_radio extends HTML_QuickForm_input
{
@ -128,7 +128,9 @@ class HTML_QuickForm_radio extends HTML_QuickForm_input
} elseif ($this->_flagFrozen) {
$label = $this->_text;
} else {
$label = '<label for="' . $this->getAttribute('id') . '">' . $this->_text . '</label>';
///$label = '<label for="' . $this->getAttribute('id') . '">' . $this->_text . '</label>';
$label = '<label class="radio">' .HTML_QuickForm_input::toHtml().$this->_text . '</label>';
return $label;
}
return HTML_QuickForm_input::toHtml() . $label;
} //end func toHtml
@ -192,7 +194,7 @@ class HTML_QuickForm_radio extends HTML_QuickForm_input
*
* @param string $event Name of event
* @param mixed $arg event arguments
* @param object &$caller calling object
* @param object &$caller calling object
* @since 1.0
* @access public
* @return void

Loading…
Cancel
Save