{if $aclObjectTypeID}
new WCF.ACL.List($('#groupPermissions'), {@$aclObjectTypeID}{if $category|isset}, '', {@$category->categoryID}{/if});
{/if}
-
- var $availableLanguages = { {implode from=$availableLanguages key=languageID item=languageName}{@$languageID}: '{$languageName}'{/implode} };
-
- var $titleValues = { {implode from=$i18nValues['title'] key=languageID item=value}'{@$languageID}': '{$value}'{/implode} };
- new WCF.MultipleLanguageInput('title', false, $titleValues, $availableLanguages);
-
- var $descriptionValues = { {implode from=$i18nValues['description'] key=languageID item=value}'{@$languageID}': '{$value}'{/implode} };
- new WCF.MultipleLanguageInput('description', false, $descriptionValues, $availableLanguages);
});
//]]>
</script>
+{include file='multipleLanguageInputJavascript' elementIdentifier='title'}
+{if $objectType->getProcessor()->supportsDescriptions()}
+ {include file='multipleLanguageInputJavascript' elementIdentifier='description'}
+{/if}
+
<header class="boxHeadline">
<hgroup>
<h1>{@$objectType->getProcessor()->getLanguageVariable($action)}</h1>
</dd>
</dl>
- <dl{if $errorField == 'description'} class="formError"{/if}>
- <dt><label for="description">{@$objectType->getProcessor()->getLanguageVariable('description')}</label></dt>
- <dd>
- <textarea cols="40" rows="10" id="description" name="description">{$i18nPlainValues['description']}</textarea>
- {if $errorField == 'description'}
- <small class="innerError">
- {if $errorType == 'empty'}
- {lang}wcf.global.form.error.empty{/lang}
- {else}
- {assign var=__languageVariable value='description.error.'|concat:$errorType}
- {@$objectType->getProcessor()->getLanguageVariable($__languageVariable)}
- {/if}
- </small>
- {/if}
- {hascontent}<small>{content}{@$objectType->getProcessor()->getLanguageVariable('description.description', true)}{/content}</small>{/hascontent}
- </dd>
- </dl>
+ {if $objectType->getProcessor()->supportsDescriptions()}
+ <dl{if $errorField == 'description'} class="formError"{/if}>
+ <dt><label for="description">{@$objectType->getProcessor()->getLanguageVariable('description')}</label></dt>
+ <dd>
+ <textarea cols="40" rows="10" id="description" name="description">{$i18nPlainValues['description']}</textarea>
+ {if $errorField == 'description'}
+ <small class="innerError">
+ {if $errorType == 'empty'}
+ {lang}wcf.global.form.error.empty{/lang}
+ {else}
+ {assign var=__languageVariable value='description.error.'|concat:$errorType}
+ {@$objectType->getProcessor()->getLanguageVariable($__languageVariable)}
+ {/if}
+ </small>
+ {/if}
+ {hascontent}<small>{content}{@$objectType->getProcessor()->getLanguageVariable('description.description', true)}{/content}</small>{/hascontent}
+ </dd>
+ </dl>
+ {/if}
<dl{if $errorField == 'isDisabled'} class="formError"{/if}>
<dt class="reversed"><label for="isDisabled">{@$objectType->getProcessor()->getLanguageVariable('isDisabled')}</label></dt>
</dd>
</dl>
- {if $aclObjectTypeID}
- <dl id="groupPermissions">
+ {event name='dataFields'}
+ </fieldset>
+
+ {if $aclObjectTypeID}
+ <fieldset>
+ <legend>{lang}wcf.acp.acl.permissions{/lang}</legend>
+
+ <dl id="groupPermissions" class="wide">
<dt>{lang}wcf.acp.acl.permissions{/lang}</dt>
<dd></dd>
</dl>
- {/if}
-
- {event name='fields'}
- </fieldset>
+
+ {event name='permissionFields'}
+ </fieldset>
+ {/if}
{event name='fieldsets'}
</div>
$this->packageID = $this->objectType->packageID;
}
+ if ($this->objectType->getProcessor()->supportsDescriptions()) {
+ I18nHandler::getInstance()->register('description');
+ }
+ I18nHandler::getInstance()->register('title');
+
parent::readData();
$this->readCategories();
if (isset($_POST['additionalData'])) {
$this->additionalData = ArrayUtil::trim($_POST['additionalData']);
}
- if (isset($_POST['description'])) {
+ if ($this->objectType->getProcessor()->supportsDescriptions() && isset($_POST['description'])) {
$this->description = StringUtil::trim($_POST['description']);
}
if (isset($_POST['isDisabled'])) {
}
}
- /**
- * @see wcf\page\IPage::readParameters()
- */
- public function readParameters() {
- parent::readParameters();
-
- I18nHandler::getInstance()->register('description');
- I18nHandler::getInstance()->register('title');
- }
-
/**
* @see wcf\page\IForm::save()
*/
$this->objectAction->executeAction();
$returnValues = $this->objectAction->getReturnValues();
- if (!I18nHandler::getInstance()->isPlainValue('description') || !I18nHandler::getInstance()->isPlainValue('title')) {
+ if (($this->objectType->getProcessor()->supportsDescriptions() && !I18nHandler::getInstance()->isPlainValue('description')) || !I18nHandler::getInstance()->isPlainValue('title')) {
$categoryID = $returnValues['returnValues']->categoryID;
$updateData = array();
- if (!I18nHandler::getInstance()->isPlainValue('description')) {
+ if ($this->objectType->getProcessor()->supportsDescriptions() && !I18nHandler::getInstance()->isPlainValue('description')) {
$updateData['description'] = $this->objectType->getProcessor()->getI18nLangVarPrefix().'.description.category'.$categoryID;
I18nHandler::getInstance()->save('description', $updateData['description'], $this->objectType->getProcessor()->getDescriptionLangVarCategory(), $this->packageID);
}
throw new UserInputException('title');
}
- if (!I18nHandler::getInstance()->validateValue('description')) {
+ if ($this->objectType->getProcessor()->supportsDescriptions() && !I18nHandler::getInstance()->validateValue('description')) {
throw new UserInputException('description');
}
}
parent::readData();
if (empty($_POST)) {
- I18nHandler::getInstance()->setOptions('description', $this->packageID, $this->category->description, $this->objectType->getProcessor()->getI18nLangVarPrefix().'.description.category\d+');
+ if ($this->objectType->getProcessor()->supportsDescriptions()) {
+ 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;
ACPForm::save();
// handle description
- $this->description = $this->objectType->getProcessor()->getI18nLangVarPrefix().'.description.category'.$this->category->categoryID;
- if (I18nHandler::getInstance()->isPlainValue('description')) {
- I18nHandler::getInstance()->remove($this->description, $this->packageID);
- $this->description = I18nHandler::getInstance()->getValue('description');
- }
- else {
- I18nHandler::getInstance()->save('description', $this->description, $this->objectType->getProcessor()->getDescriptionLangVarCategory(), $this->packageID);
+ if ($this->objectType->getProcessor()->supportsDescriptions()) {
+ $this->description = $this->objectType->getProcessor()->getI18nLangVarPrefix().'.description.category'.$this->category->categoryID;
+ if (I18nHandler::getInstance()->isPlainValue('description')) {
+ I18nHandler::getInstance()->remove($this->description, $this->packageID);
+ $this->description = I18nHandler::getInstance()->getValue('description');
+ }
+ else {
+ I18nHandler::getInstance()->save('description', $this->description, $this->objectType->getProcessor()->getDescriptionLangVarCategory(), $this->packageID);
+ }
}
// handle title
*/
protected $permissionPrefix = '';
+ /**
+ * indicates if the category type supports descriptions
+ * @var boolean
+ */
+ protected $supportsDescriptions = true;
+
/**
* @see wcf\system\category\ICategoryType::afterDeletion()
*/
public function getTitleLangVarCategory() {
return $this->i18nLangVarCategory;
}
+
+ /**
+ * @see wcf\system\category\ICategoryType::supportsDescriptions()
+ */
+ public function supportsDescriptions() {
+ return $this->supportsDescriptions;
+ }
}
* @return string
*/
public function getTitleLangVarCategory();
+
+ /**
+ * Returns true if categories of this type support descriptions.
+ *
+ * @return boolean
+ */
+ public function supportsDescriptions();
}