Pārlūkot izejas kodu

Add missing function

Julio Montoya 9 gadi atpakaļ
vecāks
revīzija
60ef4ed854
1 mainītis faili ar 23 papildinājumiem un 0 dzēšanām
  1. 23 0
      main/inc/lib/formvalidator/FormValidator.class.php

+ 23 - 0
main/inc/lib/formvalidator/FormValidator.class.php

@@ -303,6 +303,7 @@ EOT;
      * @param string $label Text appearing on the button
      * @param string $name Element name (for form treatment purposes)
      * @param bool $createElement Whether to use the create or add method
+     *
      * @return HTML_QuickForm_button
      */
     public function addButtonSave($label, $name = 'submit', $createElement = false)
@@ -319,6 +320,28 @@ EOT;
         );
     }
 
+    /**
+     * Returns a cancel button
+     * @param string $label Text appearing on the button
+     * @param string $name Element name (for form treatment purposes)
+     * @param bool $createElement Whether to use the create or add method
+     *
+     * @return HTML_QuickForm_button
+     */
+    public function addButtonCancel($label, $name = 'submit', $createElement = false)
+    {
+        return $this->addButton(
+            $name,
+            $label,
+            'times',
+            'btn',
+            null,
+            null,
+            array(),
+            $createElement
+        );
+    }
+
     /**
      * Returns a button with the primary color and a "plus" icon
      * @param string $label Text appearing on the button