Merge pull request #758 from Gravatronics/enhancement/actionInterface
authorAlexander Ebert <ebert@woltlab.com>
Sat, 13 Oct 2012 23:05:15 +0000 (16:05 -0700)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 13 Oct 2012 23:05:15 +0000 (16:05 -0700)
Adds several interfaces for dbo actions

1  2 
wcfsetup/install/files/js/WCF.js
wcfsetup/install/files/lib/data/category/CategoryAction.class.php

Simple merge
index 0d2c5833fdcb560700b0b1a88ff72797925ee664,9fab9e7974a3a9130ded2ea061af2e6fb584917b..ccc019054641e8f16698be586fb2e9b6844b602e
@@@ -1,9 -1,11 +1,12 @@@
  <?php
  namespace wcf\data\category;
  use wcf\data\AbstractDatabaseObjectAction;
+ use wcf\data\ICollapsibleContainerAction;
+ use wcf\data\IPositionAction;
+ use wcf\data\IToggleAction;
  use wcf\system\category\CategoryHandler;
  use wcf\system\exception\PermissionDeniedException;
 +use wcf\system\exception\SystemException;
  use wcf\system\exception\ValidateActionException;
  use wcf\system\user\collapsible\content\UserCollapsibleContentHandler;
  use wcf\system\WCF;
@@@ -51,15 -53,10 +54,15 @@@ class CategoryAction extends AbstractDa
        }
        
        /**
-        * Toggles the collapse status of categories.
+        * @see wcf\data\ICollapsibleContainerAction::toggleContainer()
         */
        public function toggleContainer() {
 -              $objectTypeID = UserCollapsibleContentHandler::getInstance()->getObjectTypeID($this->objects[0]->getCategoryType()->getCollapsibleObjectTypeName());
 +              $collapsibleObjectTypeName = $this->objects[0]->getCategoryType()->getObjectTypeName('com.woltlab.wcf.collapsibleContent');
 +              if ($collapsibleObjectTypeName === null) {
 +                      throw new SystemException("Categories of this type don't support collapsing");
 +              }
 +              
 +              $objectTypeID = UserCollapsibleContentHandler::getInstance()->getObjectTypeID($collapsibleObjectTypeName);
                $collapsedCategories = UserCollapsibleContentHandler::getInstance()->getCollapsedContent($objectTypeID);
                
                $categoryID = $this->objects[0]->categoryID;