From cc0167437cbd4969b2f0d10cd918edc95e3abec1 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 8 Oct 2013 14:58:45 +0200 Subject: [PATCH] Added ability to modify 'selectOptions' of options --- wcfsetup/install/files/lib/data/option/Option.class.php | 9 +++++++++ .../files/lib/system/option/OptionHandler.class.php | 4 ++++ 2 files changed, 13 insertions(+) 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'); } /** -- 2.20.1