Browse Source

Removing unused style_reset_button.php element.

Julio Montoya 11 years ago
parent
commit
698cdc4161

+ 0 - 89
main/inc/lib/formvalidator/Element/style_reset_button.php

@@ -1,89 +0,0 @@
-<?php
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * HTML class for a submit 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-2007 The PHP Group
- * @license     http://www.php.net/license/3_01.txt PHP License 3.01
- * @version     CVS: $Id: submit.php 17344 2008-12-17 08:55:29Z Scara84 $
- * @link        http://pear.php.net/package/HTML_QuickForm
- */
-
-/**
- * Base class for <input /> form elements
- */
-require_once 'style_button.php';
-
-/**
- * HTML class for a submit type element
- *
- * @category    HTML
- * @package     HTML_QuickForm
- * @author      Adam Daniel <adaniel1@eesus.jnj.com>
- * @author      Bertrand Mansion <bmansion@mamasam.com>
- * @version     Release: 3.2.10
- * @since       1.0
- */
-class HTML_QuickForm_styleresetbutton extends HTML_QuickForm_stylebutton
-{
-    // {{{ constructor
-
-    /**
-     * Class constructor
-     *
-     * @param     string    Input field name attribute
-     * @param     string    Input field value
-     * @param     mixed     Either a typical HTML attribute string or an associative array
-     * @since     1.0
-     * @access    public
-     * @return    void
-     */
-    function HTML_QuickForm_styleresetbutton($elementName=null, $value=null, $attributes=null)
-    {
-        HTML_QuickForm_stylebutton::HTML_QuickForm_stylebutton($elementName, null, $attributes, $value);
-        $this->setValue($value);
-        $this->setType('reset');
-    } //end constructor
-
-    // }}}
-    // {{{ freeze()
-
-    /**
-     * Freeze the element so that only its value is returned
-     *
-     * @access    public
-     * @return    void
-     */
-    function freeze()
-    {
-        return false;
-    } //end func freeze
-
-    // }}}
-    // {{{ exportValue()
-
-   /**
-    * Only return the value if it is found within $submitValues (i.e. if
-    * this particular submit button was clicked)
-    */
-    function exportValue(&$submitValues, $assoc = false)
-    {
-        return $this->_prepareValue($this->_findValue($submitValues), $assoc);
-    }
-
-    // }}}
-} //end class HTML_QuickForm_submit
-?>

+ 25 - 13
main/inc/lib/formvalidator/FormValidator.class.php

@@ -131,7 +131,6 @@ class FormValidator extends HTML_QuickForm
         $this->registerElementType('select_language', $dir . 'Element/select_language.php', 'HTML_QuickForm_Select_Language');
         $this->registerElementType('select_theme', $dir . 'Element/select_theme.php', 'HTML_QuickForm_Select_Theme');
         $this->registerElementType('style_submit_button', $dir . 'Element/style_submit_button.php', 'HTML_QuickForm_stylesubmitbutton');
-        $this->registerElementType('style_reset_button', $dir . 'Element/style_reset_button.php', 'HTML_QuickForm_styleresetbutton');
         $this->registerElementType('button', $dir . 'Element/style_submit_button.php', 'HTML_QuickForm_stylesubmitbutton');
 
         $this->registerElementType('captcha', 'HTML/QuickForm/CAPTCHA.php', 'HTML_QuickForm_CAPTCHA');
@@ -150,16 +149,11 @@ class FormValidator extends HTML_QuickForm
         $this->registerRule('CAPTCHA', 'rule', 'HTML_QuickForm_Rule_CAPTCHA', 'HTML/QuickForm/Rule/CAPTCHA.php');
 
         // Modify the default templates
+        /** @var  HTML_QuickForm_Renderer_Default $renderer */
         $renderer = & $this->defaultRenderer();
 
-        //Form template
-        $form_template = '<form{attributes}>
-<fieldset>
-	{content}
-</fieldset>
-{hidden}
-</form>';
-        $renderer->setFormTemplate($form_template);
+        // Form template
+        $renderer->setFormTemplate($this->getFormTemplate());
 
         //Element template
         if (isset($attributes['class']) && $attributes['class'] == 'well form-inline') {
@@ -169,11 +163,14 @@ class FormValidator extends HTML_QuickForm
             $element_template = ' {label}  {element} ';
             $renderer->setElementTemplate($element_template);
         } else {
+
             if ($attributes['class'] == 'form-inline') {
                 $element_template = $this->getDefaultInlineElementTemplate();
             } else {
                 $element_template = $this->getDefaultElementTemplate();
             }
+            //$renderer->setGroupElementTemplate($this->getGroupTemplate());
+
             $renderer->setElementTemplate($element_template);
 
             //Display a gray div in the buttons
@@ -202,7 +199,21 @@ EOT;
         $renderer->setRequiredNoteTemplate($required_note_template);
     }
 
-    function getDefaultElementTemplate()
+    /**
+     * @return string
+     */
+    private function getFormTemplate()
+    {
+        return '<form{attributes}>
+                <fieldset>{content}</fieldset>
+                {hidden}
+                </form>';
+    }
+
+    /**
+     * @return string
+     */
+    private function getDefaultElementTemplate()
     {
         return '
             <div class="form-group {error_class}">
@@ -231,7 +242,10 @@ EOT;
             </div>';
     }
 
-    function getDefaultInlineElementTemplate()
+    /**
+     * @return string
+     */
+    private function getDefaultInlineElementTemplate()
     {
         return '
             <div class="form-group {error_class}">
@@ -376,8 +390,6 @@ EOT;
             $el = $this->getElement($name);
             $el->fullPage = true;
         }
-        // Add rule to check not-allowed HTML
-        //$this->addRule($name, get_lang('SomeHTMLNotAllowed'), 'html', $html_type);
     }
 
     /**

+ 0 - 1
vendor/composer/autoload_classmap.php

@@ -330,7 +330,6 @@ return array(
     'HTML_QuickForm_select' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/select.php',
     'HTML_QuickForm_static' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/static.php',
     'HTML_QuickForm_stylebutton' => $baseDir . '/main/inc/lib/formvalidator/Element/style_button.php',
-    'HTML_QuickForm_styleresetbutton' => $baseDir . '/main/inc/lib/formvalidator/Element/style_reset_button.php',
     'HTML_QuickForm_stylesubmitbutton' => $baseDir . '/main/inc/lib/formvalidator/Element/style_submit_button.php',
     'HTML_QuickForm_submit' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/submit.php',
     'HTML_QuickForm_text' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/text.php',