From a33e86dae66bc18fe99809e40a915c4e3f90a65b Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 4 Feb 2013 21:42:21 +0100 Subject: [PATCH] Fixed option handling --- .../lib/acp/form/AbstractOptionListForm.class.php | 10 ++-------- .../files/lib/acp/form/UserGroupAddForm.class.php | 2 +- .../files/lib/acp/form/UserOptionListForm.class.php | 10 +++++----- .../files/lib/system/option/IOptionHandler.class.php | 6 ++---- .../files/lib/system/option/OptionHandler.class.php | 5 ++--- .../lib/system/option/user/UserOptionHandler.class.php | 7 ++++++- .../option/user/group/UserGroupOptionHandler.class.php | 7 ++++++- 7 files changed, 24 insertions(+), 23 deletions(-) diff --git a/wcfsetup/install/files/lib/acp/form/AbstractOptionListForm.class.php b/wcfsetup/install/files/lib/acp/form/AbstractOptionListForm.class.php index dee75cf445..11c2daf902 100755 --- a/wcfsetup/install/files/lib/acp/form/AbstractOptionListForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/AbstractOptionListForm.class.php @@ -7,7 +7,7 @@ use wcf\system\exception\UserInputException; * This class provides default implementations for a list of options. * * @author Marcel Werk - * @copyright 2001-2012 WoltLab GmbH + * @copyright 2001-2013 WoltLab GmbH * @license GNU Lesser General Public License * @package com.woltlab.wcf * @subpackage acp.form @@ -24,12 +24,6 @@ abstract class AbstractOptionListForm extends AbstractForm { */ public $errorType = array(); - /** - * cache class name - * @var string - */ - public $cacheClass = 'wcf\system\cache\builder\OptionCacheBuilder'; - /** * name of the active option category * @var string @@ -66,7 +60,7 @@ abstract class AbstractOptionListForm extends AbstractForm { public function readParameters() { parent::readParameters(); - $this->optionHandler = new $this->optionHandlerClassName($this->cacheClass, $this->supportI18n, $this->languageItemPattern, $this->categoryName); + $this->optionHandler = new $this->optionHandlerClassName($this->supportI18n, $this->languageItemPattern, $this->categoryName); $this->initOptionHandler(); } diff --git a/wcfsetup/install/files/lib/acp/form/UserGroupAddForm.class.php b/wcfsetup/install/files/lib/acp/form/UserGroupAddForm.class.php index 22b37a2157..abb59a9eb4 100755 --- a/wcfsetup/install/files/lib/acp/form/UserGroupAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserGroupAddForm.class.php @@ -13,7 +13,7 @@ use wcf\system\WCFACP; * Shows the group add form. * * @author Marcel Werk - * @copyright 2001-2012 WoltLab GmbH + * @copyright 2001-2013 WoltLab GmbH * @license GNU Lesser General Public License * @package com.woltlab.wcf * @subpackage acp.form diff --git a/wcfsetup/install/files/lib/acp/form/UserOptionListForm.class.php b/wcfsetup/install/files/lib/acp/form/UserOptionListForm.class.php index d7cc1c9a9c..adc542e4fa 100644 --- a/wcfsetup/install/files/lib/acp/form/UserOptionListForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserOptionListForm.class.php @@ -7,7 +7,7 @@ use wcf\system\language\LanguageFactory; * This class provides default implementations for a list of dynamic user options. * * @author Marcel Werk - * @copyright 2001-2012 WoltLab GmbH + * @copyright 2001-2013 WoltLab GmbH * @license GNU Lesser General Public License * @package com.woltlab.wcf * @subpackage acp.form @@ -15,14 +15,14 @@ use wcf\system\language\LanguageFactory; */ abstract class UserOptionListForm extends AbstractOptionListForm { /** - * @see wcf\acp\form\AbstractOptionListForm::$supportI18n + * @see wcf\acp\form\AbstractOptionListForm::$optionHandlerClassName */ - public $supportI18n = false; + public $optionHandlerClassName = 'wcf\system\option\user\UserOptionHandler'; /** - * @see wcf\acp\form\AbstractOptionListForm::$optionHandlerClassName + * @see wcf\acp\form\AbstractOptionListForm::$supportI18n */ - public $optionHandlerClassName = 'wcf\system\option\user\UserOptionHandler'; + public $supportI18n = false; /** * Returns a list of all available user groups. diff --git a/wcfsetup/install/files/lib/system/option/IOptionHandler.class.php b/wcfsetup/install/files/lib/system/option/IOptionHandler.class.php index 71f08b4c21..51a9eb3aaa 100644 --- a/wcfsetup/install/files/lib/system/option/IOptionHandler.class.php +++ b/wcfsetup/install/files/lib/system/option/IOptionHandler.class.php @@ -5,7 +5,7 @@ namespace wcf\system\option; * Every option handler has to implement this interface. * * @author Alexander Ebert - * @copyright 2001-2012 WoltLab GmbH + * @copyright 2001-2013 WoltLab GmbH * @license GNU Lesser General Public License * @package com.woltlab.wcf * @subpackage system.option @@ -15,13 +15,11 @@ interface IOptionHandler { /** * Creates a new option handler instance. * - * @param string $cacheName - * @param string $cacheClass * @param boolean $supportI18n * @param string $languageItemPattern * @param string $categoryName */ - public function __construct($cacheName, $cacheClass, $supportI18n, $languageItemPattern = '', $categoryName = ''); + public function __construct($supportI18n, $languageItemPattern = '', $categoryName = ''); /** * Reads user input from given source array. diff --git a/wcfsetup/install/files/lib/system/option/OptionHandler.class.php b/wcfsetup/install/files/lib/system/option/OptionHandler.class.php index 6cc683d1f4..7656518e86 100644 --- a/wcfsetup/install/files/lib/system/option/OptionHandler.class.php +++ b/wcfsetup/install/files/lib/system/option/OptionHandler.class.php @@ -31,7 +31,7 @@ class OptionHandler implements IOptionHandler { * cache class name * @var string */ - public $cacheClass = ''; + protected $cacheClass = 'wcf\system\cache\builder\OptionCacheBuilder'; /** * list of all option categories @@ -108,8 +108,7 @@ class OptionHandler implements IOptionHandler { /** * @see wcf\system\option\IOptionHandler::__construct() */ - public function __construct($cacheClass, $supportI18n, $languageItemPattern = '', $categoryName = '') { - $this->cacheClass = $cacheClass; + public function __construct($supportI18n, $languageItemPattern = '', $categoryName = '') { $this->categoryName = $categoryName; $this->languageItemPattern = $languageItemPattern; $this->supportI18n = $supportI18n; diff --git a/wcfsetup/install/files/lib/system/option/user/UserOptionHandler.class.php b/wcfsetup/install/files/lib/system/option/user/UserOptionHandler.class.php index 7dfffe5b2b..e6f0998990 100644 --- a/wcfsetup/install/files/lib/system/option/user/UserOptionHandler.class.php +++ b/wcfsetup/install/files/lib/system/option/user/UserOptionHandler.class.php @@ -11,13 +11,18 @@ use wcf\system\option\OptionHandler; * Handles user options. * * @author Alexander Ebert - * @copyright 2001-2012 WoltLab GmbH + * @copyright 2001-2013 WoltLab GmbH * @license GNU Lesser General Public License * @package com.woltlab.wcf * @subpackage system.option.user * @category Community Framework */ class UserOptionHandler extends OptionHandler { + /** + * @see wcf\system\option\OptionHandler::$cacheClass + */ + protected $cacheClass = 'wcf\system\cache\builder\UserOptionCacheBuilder'; + /** * true, if within registration process * @var boolean diff --git a/wcfsetup/install/files/lib/system/option/user/group/UserGroupOptionHandler.class.php b/wcfsetup/install/files/lib/system/option/user/group/UserGroupOptionHandler.class.php index 871ccfad29..535ee5a7c2 100644 --- a/wcfsetup/install/files/lib/system/option/user/group/UserGroupOptionHandler.class.php +++ b/wcfsetup/install/files/lib/system/option/user/group/UserGroupOptionHandler.class.php @@ -9,13 +9,18 @@ use wcf\util\ClassUtil; * Handles user group options. * * @author Alexander Ebert - * @copyright 2001-2012 WoltLab GmbH + * @copyright 2001-2013 WoltLab GmbH * @license GNU Lesser General Public License * @package com.woltlab.wcf * @subpackage system.option.user.group * @category Community Framework */ class UserGroupOptionHandler extends OptionHandler { + /** + * @see wcf\system\option\OptionHandler::$cacheClass + */ + protected $cacheClass = 'wcf\system\cache\builder\UserGroupOptionCacheBuilder'; + /** * user group object * @var wcf\data\user\group\UserGroup -- 2.20.1