From 8da99989f7446a19fb161a664ee7773040351487 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 21 Nov 2011 11:53:18 +0100 Subject: [PATCH] Debug commit --- .../user/option/ViewableUserOption.class.php | 17 +++++++++-------- .../option/user/UserOptionHandler.class.php | 4 ++++ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/wcfsetup/install/files/lib/data/user/option/ViewableUserOption.class.php b/wcfsetup/install/files/lib/data/user/option/ViewableUserOption.class.php index b388a077ad..fa1cfab972 100644 --- a/wcfsetup/install/files/lib/data/user/option/ViewableUserOption.class.php +++ b/wcfsetup/install/files/lib/data/user/option/ViewableUserOption.class.php @@ -2,6 +2,7 @@ namespace wcf\data\user\option; use wcf\data\user\User; use wcf\data\DatabaseObjectDecorator; +use wcf\system\exception\SystemException; use wcf\system\option\user\IUserOptionOutputContactInformation; use wcf\util\ClassUtil; use wcf\util\StringUtil; @@ -41,7 +42,7 @@ class ViewableUserOption extends DatabaseObjectDecorator { // use output class if ($this->outputClass) { - $outputObj = $this->getOutputObject($this->outputClass); + $outputObj = $this->getOutputObject(); if ($outputObj instanceof IUserOptionOutputContactInformation) { $this->outputData = $outputObj->getOutputData($user, $this->getDecoratedObject(), $optionValue); @@ -62,20 +63,20 @@ class ViewableUserOption extends DatabaseObjectDecorator { * @return wcf\system\option\user\IUserOptionOutput */ public function getOutputObject() { - if (!isset(self::$outputObjects[$this->className])) { + if (!isset(self::$outputObjects[$this->outputClass])) { // create instance - if (!class_exists($this->className)) { - throw new SystemException("unable to find class '".$this->className."'"); + if (!class_exists($this->outputClass)) { + throw new SystemException("unable to find class '".$this->outputClass."'"); } // validate interface - if (!ClassUtil::isInstanceOf($this->className, 'wcf\system\user\option\IUserOptionOutput')) { - throw new SystemException("'".$this->className."' should implement wcf\system\user\option\IUserOptionOutput"); + if (!ClassUtil::isInstanceOf($this->outputClass, 'wcf\system\option\user\IUserOptionOutput')) { + throw new SystemException("'".$this->outputClass."' should implement wcf\system\option\user\IUserOptionOutput"); } - self::$outputObjects[$this->className] = new $this->className(); + self::$outputObjects[$this->outputClass] = new $this->outputClass(); } - return self::$outputObjects[$this->className]; + return self::$outputObjects[$this->outputClass]; } } 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 62c7502547..c692513f3c 100644 --- a/wcfsetup/install/files/lib/system/option/user/UserOptionHandler.class.php +++ b/wcfsetup/install/files/lib/system/option/user/UserOptionHandler.class.php @@ -51,6 +51,10 @@ class UserOptionHandler extends OptionHandler { public function getCategoryOptions($categoryName = '', $inherit = true) { $options = parent::getCategoryOptions($categoryName, $inherit); + foreach ($options as $optionData) { + $optionData['object'] = new ViewableUserOption($optionData['object']); + $optionData['object']->setOptionValue($this->user); + } die('
'.print_r($options, true));
 	}
 	
-- 
2.20.1