Fixes user search form
authorMatthias Schmidt <gravatronics@live.com>
Fri, 2 Mar 2012 08:55:30 +0000 (09:55 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Fri, 2 Mar 2012 08:55:30 +0000 (09:55 +0100)
wcfsetup/install/files/lib/acp/form/UserSearchForm.class.php

index 58e804038e9a53e9767e026e5c5d606352e92fcc..46973858190e38fe5566fba8927089f5990e42c0 100755 (executable)
@@ -148,9 +148,16 @@ class UserSearchForm extends UserOptionListForm {
         * @see wcf\page\IPage::readData()
         */
        public function readData() {
+               $this->readOptionTree();
+       
                parent::readData();
-               
-               $this->optionTree = $this->getCategoryOptions('profile');
+       }
+       
+       /**
+        * Reads option tree on page init.
+        */
+       protected function readOptionTree() {
+               $this->optionTree = $this->optionHandler->getOptionTree();
        }
        
        /**
@@ -183,9 +190,6 @@ class UserSearchForm extends UserOptionListForm {
                // set active menu item
                ACPMenu::getInstance()->setActiveMenuItem($this->menuItemName);
                
-               // get user options and categories from cache
-               $this->readCache();
-               
                // show form
                parent::show();
        }
@@ -289,7 +293,7 @@ class UserSearchForm extends UserOptionListForm {
         * Builds the dynamic conditions.
         */
        protected function buildDynamicConditions() {
-               foreach ($this->options as $option) {
+               foreach ($this->optionTree as $option) {
                        $value = isset($this->values[$option->optionName]) ? $this->values[$option->optionName] : null;
                        $condition = $this->getTypeObject($option->optionType)->getCondition($option, $value);
                        if ($condition !== false) $this->conditions->add($condition);
@@ -305,6 +309,7 @@ class UserSearchForm extends UserOptionListForm {
        
        /**
         * @see wcf\acp\form\DynamicOptionListForm::checkOption()
+        * @todo        deprecated?
         */
        protected static function checkOption(Option $option) {
                return ($option->searchable == 1 && !$option->disabled && ($option->visible == 3 || $option->visible < 2));