/**
* @see WCF.Collapsible.Remote.init()
*/
- init: function(className, objectTypeID) {
- this._objectTypeID = objectTypeID;
-
+ init: function(className) {
var sortButton = $('.formSubmit > button[data-type="submit"]');
if (sortButton) {
sortButton.click($.proxy(this._sort, this));
this._super(className);
},
- /**
- * @see WCF.Collapsible.Remote._getAdditionalParameters()
- */
- _getAdditionalParameters: function(containerID) {
- return {objectTypeID : this._objectTypeID};
- },
-
/**
* @see WCF.Collapsible.Remote._getButtonContainer()
*/
use wcf\data\AbstractDatabaseObjectAction;
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;
* Toggles the collapse status of categories.
*/
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;