コード例 #1
0
 /**
  * @see	\wcf\system\menu\user\profile\content\IUserProfileMenuContent::getContent()
  */
 public function getContent($userID)
 {
     if ($this->optionHandler === null) {
         $this->optionHandler = new UserOptionHandler(false, '', 'profile');
         $this->optionHandler->enableEditMode(false);
         $this->optionHandler->showEmptyOptions(false);
     }
     $user = new User($userID);
     $this->optionHandler->setUser($user);
     WCF::getTPL()->assign(array('options' => $this->optionHandler->getOptionTree(), 'userID' => $user->userID));
     return WCF::getTPL()->fetch('userProfileAbout');
 }
コード例 #2
0
 /**
  * @see	\wcf\page\AbstractPage::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (!empty($_REQUEST['category'])) {
         $this->category = $_REQUEST['category'];
         // validate category
         if (UserOptionCategory::getCategoryByName('settings.' . $this->category) === null) {
             throw new IllegalLinkException();
         }
     }
     $this->optionHandler = new UserOptionHandler(false, '', 'settings.' . $this->category);
     $this->optionHandler->setUser(WCF::getUser());
     if ($this->category == 'general') {
         $this->availableContentLanguages = LanguageFactory::getInstance()->getContentLanguages();
         $this->availableLanguages = LanguageFactory::getInstance()->getLanguages();
         $this->availableStyles = StyleHandler::getInstance()->getAvailableStyles();
     }
 }
コード例 #3
0
 /**
  * Returns the user option handler object.
  * 
  * @param	\wcf\data\user\User	$user
  * @param	boolean			$editMode
  * @return	\wcf\system\option\user\UserOptionHandler
  */
 protected function getOptionHandler(User $user, $editMode = true)
 {
     $optionHandler = new UserOptionHandler(false, '', 'profile');
     if (!$editMode) {
         $optionHandler->showEmptyOptions(false);
         $optionHandler->enableEditMode(false);
     }
     $optionHandler->setUser($user);
     return $optionHandler;
 }