Fix button code to allow createElement instead of addElement.

Depending if buttons are added in a group.
1.10.x
Julio Montoya 11 years ago
parent dda3cd3575
commit 66d4eb4327
  1. 35
      main/admin/settings.lib.php
  2. 6
      main/admin/settings.php
  3. 2
      main/glossary/index.php
  4. 2
      main/gradebook/lib/fe/evalform.class.php
  5. 175
      main/inc/lib/formvalidator/FormValidator.class.php
  6. 2
      main/inc/lib/pear/HTML/Common.php
  7. 6
      main/inc/lib/pear/HTML/QuickForm.php
  8. 4
      main/inc/lib/pear/HTML/QuickForm/advanced_settings.php
  9. 98
      main/inc/lib/pear/HTML/QuickForm/button.php
  10. 6
      main/inc/lib/pear/HTML/QuickForm/element.php
  11. 99
      main/inc/lib/pear/HTML/QuickForm/group.php
  12. 5
      main/inc/lib/pear/HTML/QuickForm/header.php
  13. 25
      main/inc/lib/pear/HTML/QuickForm/html.php
  14. 2
      main/inc/lib/pear/HTML/QuickForm/label.php
  15. 7
      main/inc/lib/pear/HTML/QuickForm/static.php
  16. 2
      main/inc/lib/pear/HTML/QuickForm/submit.php
  17. 2
      main/inc/lib/pear/HTML/QuickForm/text.php
  18. 2
      main/inc/lib/pear/HTML/QuickForm/textarea.php
  19. 2
      main/inc/lib/pear/HTML/Table.php
  20. 2
      main/inc/lib/pear/HTML/Table/Storage.php

@ -226,7 +226,7 @@ function handle_stylesheets()
$form->addRule('new_stylesheet', get_lang('InvalidExtension').' ('.implode(',', $allowed_file_types).')', 'filetype', $allowed_file_types);
$form->addRule('new_stylesheet', get_lang('ThisFieldIsRequired'), 'required');
$form->addElement('style_submit_button', 'stylesheet_upload', get_lang('Upload'), array('class'=>'save'));
$form->addButtonUpload(get_lang('Upload'), 'stylesheet_upload');
$show_upload_form = false;
@ -346,9 +346,20 @@ function handle_stylesheets()
}
if ($is_style_changeable) {
$group[] = $form_change->createElement('button', 'save', get_lang('SaveSettings'), array('class' => 'btn btn-primary'));
$group[] = $form_change->createElement('button', 'preview', get_lang('Preview'), array('class' => 'btn'));
$group[] = $form_change->createElement('button', 'download', get_lang('Download'), array('class' => 'btn'));
/*$group = [
$form_change->createElement('button', 'save', get_lang('SaveSettings')),
$form_change->createElement('button', 'preview', get_lang('Preview')),
$form_change->createElement('button', 'download', get_lang('Download'))
];*/
//var_dump($group);
$group = [
$form_change->addButtonSave(get_lang('SaveSettings'), 'save', true),
$form_change->addButtonPreview(get_lang('Preview'), 'preview', true),
$form_change->addButtonDownload(get_lang('Download'), 'download', true)
];
$form_change->addGroup($group);
if ($show_upload_form) {
@ -357,7 +368,10 @@ function handle_stylesheets()
$( "#tabs" ).tabs();
});
</script>';
echo Display::tabs(array(get_lang('Update'), get_lang('UploadNewStylesheet')), array($form_change->return_form(), $form->return_form()));
echo Display::tabs(
array(get_lang('Update'), get_lang('UploadNewStylesheet')),
array($form_change->return_form(), $form->return_form())
);
} else {
$form_change->display();
}
@ -633,12 +647,11 @@ function handle_search()
$form->addElement('select', 'search_prefilter_prefix', array(get_lang('SearchPrefilterPrefix'), $url), $sf_values, '');
$default_values['search_prefilter_prefix'] = api_get_setting('search_prefilter_prefix');
}
}
$default_values['search_enabled'] = $search_enabled;
$form->addElement('style_submit_button', 'submit', get_lang('Save'),'class="save"');
$form->addButtonSave(get_lang('Save'));
$form->setDefaults($default_values);
echo '<div id="search-options-form">';
@ -933,7 +946,7 @@ function add_edit_template() {
$form->setDefaults($defaults);
}
// Setting the form elements: the submit button.
$form->addElement('style_submit_button' , 'submit', get_lang('Ok') ,'class="save"');
$form->addButtonSave(get_lang('Ok'));
// Setting the rules: the required fields.
$form->addRule('title', get_lang('ThisFieldIsRequired'), 'required');
@ -1125,7 +1138,9 @@ function generate_settings_form($settings, $settings_by_access_list) {
$i = 0;
foreach ($settings as $row) {
if (in_array($row['variable'], array_keys($settings_to_avoid))) { continue; }
if (in_array($row['variable'], array_keys($settings_to_avoid))) {
continue;
}
if (!empty($_configuration['multiple_access_urls'])) {
if (api_is_global_platform_admin()) {
@ -1340,7 +1355,7 @@ function generate_settings_form($settings, $settings_by_access_list) {
if (!empty($settings)) {
$form->setDefaults($default_values);
}
$form->addElement('button', 'submit_fixed_in_bottom', get_lang('SaveSettings'), 'class="save"');
$form->addButtonSave(get_lang('SaveSettings'));
return $form;
}

@ -73,11 +73,11 @@ if (isset($_GET['action']) && $_GET['action'] == 'delete_grading') {
api_delete_setting_option($id);
}
$form_search = new FormValidator('search_settings', 'get', api_get_self() , null, array('class'=>'well form-inline'));
$form_search = new FormValidator('search_settings', 'get', api_get_self() , null, array(), FormValidator::LAYOUT_INLINE);
$form_search->addElement('text', 'search_field');
$form_search->addElement('hidden', 'category', 'search_setting');
$form_search->addElement('style_submit_button', 'submit_button', get_lang('Search'), 'value="submit_button", class="search"');
$form_search->setDefaults(array('search_field' => (isset($_REQUEST['search_field'])?$_REQUEST['search_field']:null)));
$form_search->addButtonSearch(get_lang('Search'), 'submit_button');
$form_search->setDefaults(array('search_field' => isset($_REQUEST['search_field'])?$_REQUEST['search_field']:null));
$form_search_html = $form_search->return_form();

@ -105,7 +105,7 @@ if (api_is_allowed_to_edit(null, true)) {
$form->addElement('header', '', get_lang('TermAddNew'));
$form->addElement('text', 'glossary_title', get_lang('TermName'), array('size'=>'80', 'id'=>'glossary_title'));
//$form->applyFilter('glossary_title', 'html_filter');
$form->addElement('html_editor', 'glossary_comment', get_lang('TermDefinition'), null, array('ToolbarSet' => 'Glossary', 'Width' => '90%', 'Height' => '300'));
$form->addElement('html_editor', 'glossary_comment', get_lang('TermDefinition'), null, array('ToolbarSet' => 'Glossary', 'Height' => '300'));
$form->addElement('style_submit_button', 'SubmitGlossary', get_lang('TermAddButton'), 'class="save"');
// setting the rules
$form->addRule('glossary_title',get_lang('ThisFieldIsRequired'), 'required');

@ -109,7 +109,7 @@ class EvalForm extends FormValidator
$select->addoption($user[1] . ' ' . $user[2] . ' (' . $user[3] . ')', $user[0]);
}
}
$this->addElement('submit', 'submit_button', get_lang('AddUserToEval'));
$this->addButtonCreate(get_lang('AddUserToEval'), 'submit_button');
}
/**

@ -239,8 +239,22 @@ EOT;
$style = 'default',
$size = 'default',
$class = null,
$attributes = array()
$attributes = array(),
$createElement = false
) {
if ($createElement) {
return $this->createElement(
'button',
$name,
$label,
$icon,
$style,
$size,
$class,
$attributes
);
}
return $this->addElement(
'button',
$name,
@ -256,44 +270,89 @@ EOT;
/**
* @param string $label
*/
public function addButtonSave($label, $name = 'submit')
public function addButtonSave($label, $name = 'submit', $createElement = false)
{
return $this->addButton($name, $label, 'check', 'primary');
return $this->addButton(
$name,
$label,
'check',
'primary',
null,
null,
array(),
$createElement
);
}
/**
* @param string $label
*/
public function addButtonCreate($label, $name = 'submit')
public function addButtonCreate($label, $name = 'submit', $createElement = false)
{
return $this->addButton($name, $label, 'plus', 'primary');
return $this->addButton(
$name,
$label,
'plus',
'primary',
null,
null,
array(),
$createElement
);
}
/**
* Shortcut to create/add button
* @param string $label
*/
public function addButtonUpdate($label, $name = 'submit')
public function addButtonUpdate($label, $name = 'submit', $createElement = false)
{
return $this->addButton($name, $label, 'pencil', 'primary');
return $this->addButton(
$name,
$label,
'pencil',
'primary',
null,
null,
array(),
$createElement
);
}
/**
* Shortcut to delete button
* @param string $label
*/
public function addButtonDelete($label, $name = 'submit')
public function addButtonDelete($label, $name = 'submit', $createElement = false)
{
return $this->addButton($name, $label, 'trash', 'danger');
return $this->addButton(
$name,
$label,
'trash',
'danger',
null,
null,
array(),
$createElement
);
}
/**
* Shortcut to "send" button
* @param string $label
*/
public function addButtonSend($label, $name = 'submit')
public function addButtonSend($label, $name = 'submit', $createElement = false)
{
return $this->addButton($name, $label, 'paper-plane', 'primary');
return $this->addButton(
$name,
$label,
'paper-plane',
'primary',
null,
null,
array(),
$createElement
);
}
/**
@ -321,27 +380,108 @@ EOT;
* Shortcut to import button
* @param string $label
*/
public function addButtonImport($label, $name = 'submit')
public function addButtonImport($label, $name = 'submit', $createElement = false)
{
return $this->addButton($name, $label, 'check', 'primary');
return $this->addButton(
$name,
$label,
'check',
'primary',
null,
null,
array(),
$createElement
);
}
/**
* Shortcut to export button
* @param string $label
*/
public function addButtonExport($label, $name = 'submit')
public function addButtonExport($label, $name = 'submit', $createElement = false)
{
return $this->addButton($name, $label, 'check', 'primary');
return $this->addButton(
$name,
$label,
'check',
'primary',
null,
null,
array(),
$createElement
);
}
/**
* Shortcut to filter button
* @param string $label
*/
public function addButtonFilter($label, $name = 'submit')
public function addButtonFilter($label, $name = 'submit', $createElement = false)
{
return $this->addButton($name, $label, 'filter', 'primary');
return $this->addButton(
$name,
$label,
'filter',
'primary',
null,
null,
array(),
$createElement
);
}
/**
* Shortcut to upload button
* @param string $label
*/
public function addButtonUpload($label, $name = 'submit', $createElement = false)
{
return $this->addButton(
$name,
$label,
'upload',
'primary',
null,
null,
array(),
$createElement
);
}
/**
* Shortcut to upload button
* @param string $label
*/
public function addButtonDownload($label, $name = 'submit', $createElement = false)
{
return $this->addButton(
$name,
$label,
'download',
'primary',
null,
null,
array(),
$createElement
);
}
/**
* Shortcut to preview button
* @param string $label
*/
public function addButtonPreview($label, $name = 'submit', $createElement = false)
{
return $this->addButton(
$name,
$label,
'search',
'primary',
null,
null,
array(),
$createElement
);
}
/**
@ -482,6 +622,7 @@ EOT;
* @param int $delay (optional) The number of seconds between the moment the user
* @param string $label (optional) Custom label to be shown
* submits the form and the start of the progress bar.
* @deprecated ?
*/
public function add_progress_bar($delay = 2, $label = '')
{

@ -77,7 +77,7 @@ class HTML_Common
* @param int $tabOffset Indent offset in tabs
* @access public
*/
public function HTML_Common($attributes = null, $tabOffset = 0)
public function __construct($attributes = null, $tabOffset = 0)
{
$this->setAttributes($attributes);
$this->setTabOffset($tabOffset);

@ -250,7 +250,7 @@ class HTML_QuickForm extends HTML_Common
*/
public function __construct($formName='', $method='post', $action='', $target='', $attributes=null, $trackSubmit = false)
{
HTML_Common::HTML_Common($attributes);
parent::__construct($attributes);
$method = (strtoupper($method) == 'GET') ? 'get' : 'post';
$action = ($action == '') ? api_get_self() : $action;
$target = empty($target) ? array() : array('target' => $target);
@ -547,8 +547,8 @@ class HTML_QuickForm extends HTML_Common
*/
public function &createElement($elementType)
{
$args = func_get_args();
$element =& HTML_QuickForm::_loadElement('createElement', $elementType, array_slice($args, 1));
$args = func_get_args();
$element = HTML_QuickForm::_loadElement('createElement', $elementType, array_slice($args, 1));
return $element;
} // end func createElement

@ -30,7 +30,7 @@ class HTML_QuickForm_advanced_settings extends HTML_QuickForm_static
*/
public function HTML_QuickForm_advanced_settings($text = null)
{
$this->HTML_QuickForm_static(null, null, $text);
parent::__construct(null, null, $text);
$this->_type = 'html';
}
@ -52,7 +52,7 @@ class HTML_QuickForm_advanced_settings extends HTML_QuickForm_static
<label class="control-label col-sm-2"></label>
<div class="col-sm-10">
<div class="form-control-static">
'.HTML_QuickForm_static::toHtml().'
'.parent::toHtml().'
</div>
</div>
</div>

@ -39,22 +39,6 @@ class HTML_QuickForm_button extends HTML_QuickForm_input
private $size;
private $class;
/**
* @return mixed
*/
public function getClass()
{
return $this->class;
}
/**
* @param mixed $class
*/
public function setClass($class)
{
$this->class = $class;
}
/**
* @param string $name input name example 'submit'
* @param string $text button text to show
@ -64,7 +48,7 @@ class HTML_QuickForm_button extends HTML_QuickForm_input
* @param string $class
* @param array $attributes
*/
public function HTML_QuickForm_button(
public function __construct(
$name,
$text,
$icon = 'check',
@ -78,7 +62,7 @@ class HTML_QuickForm_button extends HTML_QuickForm_input
$this->setSize($size);
$this->setClass($class);
HTML_QuickForm_input::HTML_QuickForm_input(
parent::__construct(
$name,
null,
$attributes
@ -88,6 +72,55 @@ class HTML_QuickForm_button extends HTML_QuickForm_input
$this->setType('submit');
}
/**
* @return string
*/
public function toHtml()
{
if ($this->_flagFrozen) {
return $this->getFrozenHtml();
} else {
$value = null;
if (isset($this->_attributes['value'])) {
$value = $this->_attributes['value'];
unset($this->_attributes['value']);
}
unset($this->_attributes['class']);
$icon = $this->getIcon();
if (!empty($icon)) {
$icon = '<i class="' . $this->getIcon() . '"></i> ';
}
$class = $this->getClass().' '.$this->getStyle().' '.$this->getSize();
return
$this->_getTabs() . '
<button class="'.$class.'" ' . $this->_getAttrString($this->_attributes) . ' />'.
$icon.
$value.
'</button>';
}
}
/**
* @return mixed
*/
public function getClass()
{
return $this->class;
}
/**
* @param mixed $class
*/
public function setClass($class)
{
$this->class = $class;
}
/**
* @return mixed
*/
@ -153,35 +186,6 @@ class HTML_QuickForm_button extends HTML_QuickForm_input
$this->size = $size;
}
/**
* @return string
*/
public function toHtml()
{
if ($this->_flagFrozen) {
return $this->getFrozenHtml();
} else {
$value = $this->_attributes['value'];
unset($this->_attributes['value']);
unset($this->_attributes['class']);
$icon = $this->getIcon();
if (!empty($icon)) {
$icon = '<i class="' . $this->getIcon() . '"></i> ';
}
$class = $this->getClass().' '.$this->getStyle().' '.$this->getSize();
return
$this->_getTabs() . '
<button class="'.$class.'" ' . $this->_getAttrString($this->_attributes) . ' />'.
$icon.$value.
'</button>';
}
}
/**
* Freeze the element so that only its value is returned
*

@ -90,18 +90,18 @@ class HTML_QuickForm_element extends HTML_Common
*/
function HTML_QuickForm_element($elementName = null, $elementLabel = null, $attributes = null)
{
HTML_Common::HTML_Common($attributes);
parent::__construct($attributes);
if (isset($elementName)) {
$this->setName($elementName);
}
if (isset($elementLabel)) {
$labelFor = "";
//Default Inputs generate this
// Default Inputs generate this
if (!empty($attributes['id'])) {
$labelFor = $attributes['id'];
}
//Default Labels generate this
// Default Labels generate this
if (!empty($attributes['for'])) {
$labelFor = $attributes['for'];
}

@ -36,8 +36,6 @@
*/
class HTML_QuickForm_group extends HTML_QuickForm_element
{
// {{{ properties
/**
* Name of the element
* @var string
@ -78,9 +76,6 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
*/
var $_appendName = true;
// }}}
// {{{ constructor
/**
* Class constructor
*
@ -98,7 +93,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
*/
function HTML_QuickForm_group($elementName=null, $elementLabel=null, $elements=null, $separator=null, $appendName = true)
{
$this->HTML_QuickForm_element($elementName, $elementLabel);
parent::__construct($elementName, $elementLabel);
$this->_type = 'group';
if (isset($elements) && is_array($elements)) {
$this->setElements($elements);
@ -109,10 +104,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
if (isset($appendName)) {
$this->_appendName = $appendName;
}
} //end constructor
// }}}
// {{{ setName()
}
/**
* Sets the group name
@ -125,10 +117,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
function setName($name)
{
$this->_name = $name;
} //end func setName
// }}}
// {{{ getName()
}
/**
* Returns the group name
@ -140,10 +129,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
function getName()
{
return $this->_name;
} //end func getName
// }}}
// {{{ setValue()
}
/**
* Sets values for group's elements
@ -175,10 +161,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
}
}
}
} //end func setValue
// }}}
// {{{ getValue()
}
/**
* Returns the value of the group
@ -219,10 +202,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
}
}
return $value;
} // end func getValue
// }}}
// {{{ setElements()
}
/**
* Sets the grouped elements
@ -238,10 +218,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
if ($this->_flagFrozen) {
$this->freeze();
}
} // end func setElements
// }}}
// {{{ getElements()
}
/**
* Gets the grouped elements
@ -254,10 +231,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
{
$this->_createElementsIfNotExist();
return $this->_elements;
} // end func getElements
// }}}
// {{{ getGroupType()
}
/**
* Gets the group type based on its elements
@ -279,10 +253,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
$prevType = $type;
}
return $type;
} // end func getGroupType
// }}}
// {{{ toHtml()
}
/**
* Returns Html for the group
@ -291,20 +262,14 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
* @access public
* @return string
*/
function toHtml()
public function toHtml()
{
include_once('HTML/QuickForm/Renderer/Default.php');
// Modified by Ivan Tcholakov, 16-MAR-2010. Suppressing a deprecation warning on PHP 5.3
//$renderer =& new HTML_QuickForm_Renderer_Default();
$renderer = new HTML_QuickForm_Renderer_Default();
//
$renderer->setElementTemplate('{element}');
$this->accept($renderer);
return $renderer->toHtml();
} //end func toHtml
// }}}
// {{{ getElementName()
return $renderer->toHtml();
}
/**
* Returns the element name inside the group such as found in the html form
@ -345,10 +310,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
}
}
return $elementName;
} //end func getElementName
// }}}
// {{{ getFrozenHtml()
}
/**
* Returns the value of field without HTML tags
@ -373,10 +335,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
}
}
return $html;
} //end func getFrozenHtml
// }}}
// {{{ onQuickFormEvent()
}
/**
* Called by HTML_QuickForm whenever form event is made on this element
@ -415,10 +374,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
parent::onQuickFormEvent($event, $arg, $caller);
}
return true;
} // end func onQuickFormEvent
// }}}
// {{{ accept()
}
/**
* Accepts a renderer
@ -456,10 +412,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
}
}
$renderer->finishGroup($this);
} // end func accept
// }}}
// {{{ exportValue()
}
/**
* As usual, to get the group's value we access its elements and call
@ -507,9 +460,6 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
return $value;
}
// }}}
// {{{ _createElements()
/**
* Creates the group's elements.
*
@ -526,9 +476,6 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
// abstract
}
// }}}
// {{{ _createElementsIfNotExist()
/**
* A wrapper around _createElements()
*
@ -548,9 +495,6 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
}
}
// }}}
// {{{ freeze()
function freeze()
{
parent::freeze();
@ -559,9 +503,6 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
}
}
// }}}
// {{{ unfreeze()
function unfreeze()
{
parent::unfreeze();
@ -570,9 +511,6 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
}
}
// }}}
// {{{ setPersistantFreeze()
function setPersistantFreeze($persistant = false)
{
parent::setPersistantFreeze($persistant);
@ -580,7 +518,4 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
$this->_elements[$key]->setPersistantFreeze($persistant);
}
}
// }}}
} //end class HTML_QuickForm_group
?>
}

@ -42,11 +42,12 @@ class HTML_QuickForm_header extends HTML_QuickForm_static
* @access public
* @return void
*/
function HTML_QuickForm_header($elementName = null, $text = null) {
function HTML_QuickForm_header($elementName = null, $text = null)
{
if (!empty($elementName)) {
$text = $elementName;
}
$this->HTML_QuickForm_static($elementName, null, $text);
parent::__construct($elementName, null, $text);
$this->_type = 'header';
}

@ -36,7 +36,6 @@
*/
class HTML_QuickForm_html extends HTML_QuickForm_static
{
// {{{ constructor
/**
* Class constructor
@ -45,34 +44,26 @@ class HTML_QuickForm_html extends HTML_QuickForm_static
* @access public
* @return void
*/
function HTML_QuickForm_html($text = null)
function _construct($text = null)
{
$this->HTML_QuickForm_static(null, null, $text);
parent::__construct(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, $required = false, $error = null)
{
$renderer->renderHtml($this);
} // end func accept
}
function toHtml()
{
return HTML_QuickForm_static::toHtml();
} //end func toHtml
// }}}
} //end class HTML_QuickForm_html
return parent::toHtml();
}
}

@ -33,7 +33,7 @@ class HTML_QuickForm_label extends HTML_QuickForm_static
$text = null,
$attributes = null
) {
$this->HTML_QuickForm_static(null, $label, $text, $attributes);
parent::__construct(null, $label, $text, $attributes);
$this->_type = 'html';
}

@ -52,7 +52,7 @@ class HTML_QuickForm_static extends HTML_QuickForm_element {
* @access public
* @return void
*/
function HTML_QuickForm_static($elementName = null, $elementLabel = null, $text = null, $attributes = null)
public function __construct($elementName = null, $elementLabel = null, $text = null, $attributes = null)
{
HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = false;
@ -190,7 +190,4 @@ class HTML_QuickForm_static extends HTML_QuickForm_element {
{
return null;
}
// }}}
} //end class HTML_QuickForm_static
?>
}

@ -46,7 +46,7 @@ class HTML_QuickForm_submit extends HTML_QuickForm_input
* @access public
* @return void
*/
function HTML_QuickForm_submit($elementName=null, $value=null, $attributes=null)
public function __construct($elementName=null, $value=null, $attributes=null)
{
HTML_QuickForm_input::HTML_QuickForm_input($elementName, null, $attributes);
$this->setValue($value);

@ -45,7 +45,7 @@ class HTML_QuickForm_text extends HTML_QuickForm_input
* @access public
* @return void
*/
public function HTML_QuickForm_text(
public function __construct(
$elementName = null,
$elementLabel = null,
$attributes = array()

@ -57,7 +57,7 @@ class HTML_QuickForm_textarea extends HTML_QuickForm_element
* @access public
* @return void
*/
public function HTML_QuickForm_textarea($elementName=null, $elementLabel=null, $attributes=null)
public function __construct($elementName=null, $elementLabel=null, $attributes=null)
{
$attributes['class'] = isset($attributes['class']) ? $attributes['class'] : 'form-control';
HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes);

@ -172,7 +172,7 @@ class HTML_Table extends HTML_Common {
*/
function HTML_Table($attributes = null, $tabOffset = 0, $useTGroups = false)
{
HTML_Common::HTML_Common($attributes, (int)$tabOffset);
parent::__construct($attributes, (int)$tabOffset);
$this->_useTGroups = (boolean)$useTGroups;
$this->addBody();
if ($this->_useTGroups) {

@ -128,7 +128,7 @@ class HTML_Table_Storage extends HTML_Common {
*/
function HTML_Table_Storage($tabOffset = 0, $useTGroups = false)
{
HTML_Common::HTML_Common(null, (int)$tabOffset);
parent::__construct(null, (int)$tabOffset);
$this->_useTGroups = (boolean)$useTGroups;
}

Loading…
Cancel
Save