use wcf\system\exception\UserInputException;
use wcf\system\language\I18nHandler;
use wcf\system\WCF;
+use wcf\util\ArrayUtil;
use wcf\util\StringUtil;
/**
*/
public $addController = '';
+ /**
+ * additional category data
+ * @var array
+ */
+ public $additionalData = array();
+
/**
* list with the category nodes
* @var wcf\data\category\CategoryNodeList
I18nHandler::getInstance()->readValues();
+ if (isset($_POST['additionalData'])) {
+ $this->additionalData = ArrayUtil::trim($_POST['additionalData']);
+ }
if (isset($_POST['description'])) {
$this->description = StringUtil::trim($_POST['description']);
}
$this->objectAction = new CategoryAction(array(), 'create', array(
'data' => array(
+ 'additionalData' => serialize($this->additionalData),
'description' => $this->description,
'isDisabled' => $this->isDisabled,
'objectTypeID' => $this->objectType->objectTypeID,
I18nHandler::getInstance()->setOptions('description', $this->packageID, $this->category->description, $this->objectType->getProcessor()->getI18nLangVarPrefix().'.description.category\d+');
I18nHandler::getInstance()->setOptions('title', $this->packageID, $this->category->title, $this->objectType->getProcessor()->getI18nLangVarPrefix().'.title.category\d+');
+ $this->additionalData = $this->category->additionalData;
$this->isDisabled = $this->category->isDisabled;
$this->parentCategoryID = $this->category->parentCategoryID;
$this->showOrder = $this->category->showOrder;
// update category
$this->objectAction = new CategoryAction(array($this->category), 'update', array(
'data' => array(
+ 'additionalData' => serialize($this->additionalData),
'description' => $this->description,
'isDisabled' => $this->isDisabled,
'parentCategoryID' => $this->parentCategoryID,
// handle additionalData
if (!isset($parameters['additionalData'])) {
- $parameters['additionalData'] = array();
+ $parameters['additionalData'] = serialize(array());
}
- $parameters['additionalData'] = serialize($parameters['additionalData']);
return parent::create($parameters);
}