Added ability to modify 'selectOptions' of options
authorAlexander Ebert <ebert@woltlab.com>
Tue, 8 Oct 2013 12:58:45 +0000 (14:58 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 8 Oct 2013 12:58:45 +0000 (14:58 +0200)
wcfsetup/install/files/lib/data/option/Option.class.php
wcfsetup/install/files/lib/system/option/OptionHandler.class.php

index 1c67cfab6bf53b9e3265026cdcfe793c0b986f1a..6b57c47ba1421293bb87cdb5062116442d1a915a 100644 (file)
@@ -175,4 +175,13 @@ class Option extends DatabaseObject {
        public function getConstantName() {
                return strtoupper($this->optionName);
        }
+       
+       /**
+        * Allows modifications of select options.
+        * 
+        * @param       string          $selectOptions
+        */
+       public function modifySelectOptions($selectOptions) {
+               $this->data['selectOptions'] = $selectOptions;
+       }
 }
index f0af9e56b8ec3e43a9a8a2d076b29f54c6a5541b..133b35c9f163147cadf72c274f05a9b65338d8dc 100644 (file)
@@ -5,6 +5,7 @@ use wcf\data\option\Option;
 use wcf\system\application\ApplicationHandler;
 use wcf\system\exception\SystemException;
 use wcf\system\exception\UserInputException;
+use wcf\system\event\EventHandler;
 use wcf\system\language\I18nHandler;
 use wcf\system\WCF;
 use wcf\util\ClassUtil;
@@ -393,6 +394,9 @@ class OptionHandler implements IOptionHandler {
                $this->cachedOptions = $cache->getData(array(), 'options');
                $this->cachedCategoryStructure = $cache->getData(array(), 'categoryStructure');
                $this->cachedOptionToCategories = $cache->getData(array(), 'optionToCategories');
+               
+               // allow option manipulation
+               EventHandler::getInstance()->fireAction($this, 'afterReadCache');
        }
        
        /**