Fixes button label for native BBCodes
authorMatthias Schmidt <gravatronics@live.com>
Sun, 2 Jun 2013 12:49:23 +0000 (14:49 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 2 Jun 2013 12:49:23 +0000 (14:49 +0200)
wcfsetup/install/files/lib/acp/form/BBCodeAddForm.class.php
wcfsetup/install/files/lib/acp/form/BBCodeEditForm.class.php

index c22883f59c19f8e8b26839d5729db4d629d89898..3492f14534934cd23642204d76c4831dd1f7f498 100644 (file)
@@ -133,6 +133,13 @@ class BBCodeAddForm extends AbstractForm {
                }
                
                I18nHandler::getInstance()->readValues();
+               $this->readButtonLabelFormParameter();
+       }
+       
+       /**
+        * Reads the form parameter for the button label.
+        */
+       protected function readButtonLabelFormParameter() {
                if (I18nHandler::getInstance()->isPlainValue('buttonLabel')) $this->buttonLabel = I18nHandler::getInstance()->getValue('buttonLabel');
        }
        
index cddc35c06f72276852ba10a33e7c64024aebf352..7925813f517c3cc53ac98a9fa7f0179070b524d4 100644 (file)
@@ -53,7 +53,7 @@ class BBCodeEditForm extends BBCodeAddForm {
         * @see wcf\page\IPage::readParameters()
         */
        public function readParameters() {
-               parent::readParameters();
+               AbstractForm::readParameters();
                
                if (isset($_REQUEST['id'])) $this->bbcodeID = intval($_REQUEST['id']);
                $this->bbcode = new BBCode($this->bbcodeID);
@@ -62,6 +62,15 @@ class BBCodeEditForm extends BBCodeAddForm {
                }
        }
        
+       /**
+        * @see wcf\acp\form\BBCodeAddForm::readButtonLabelFormParameter()
+        */
+       protected function readButtonLabelFormParameter() {
+               if (!in_array($this->bbcode->bbcodeTag, self::$nativeBBCodes)) {
+                       parent::readButtonLabelFormParameter();
+               }
+       }
+       
        /**
         * @see wcf\form\IForm::save()
         */