From: Alexander Ebert Date: Tue, 8 Oct 2013 12:58:45 +0000 (+0200) Subject: Added ability to modify 'selectOptions' of options X-Git-Tag: 2.0.0_Beta_11~62 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=cc0167437cbd4969b2f0d10cd918edc95e3abec1;p=GitHub%2FWoltLab%2FWCF.git Added ability to modify 'selectOptions' of options --- diff --git a/wcfsetup/install/files/lib/data/option/Option.class.php b/wcfsetup/install/files/lib/data/option/Option.class.php index 1c67cfab6b..6b57c47ba1 100644 --- a/wcfsetup/install/files/lib/data/option/Option.class.php +++ b/wcfsetup/install/files/lib/data/option/Option.class.php @@ -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; + } } diff --git a/wcfsetup/install/files/lib/system/option/OptionHandler.class.php b/wcfsetup/install/files/lib/system/option/OptionHandler.class.php index f0af9e56b8..133b35c9f1 100644 --- a/wcfsetup/install/files/lib/system/option/OptionHandler.class.php +++ b/wcfsetup/install/files/lib/system/option/OptionHandler.class.php @@ -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'); } /**