{foreach from=$objects item=templateGroup}
<tr class="jsTemplateGroupRow">
<td class="columnIcon">
- <a href="{link controller='TemplateGroupEdit' id=$templateGroup->templateGroupID}{/link}" title="{lang}wcf.global.button.edit{/lang}" class="jsTooltip"><span class="icon icon16 fa-pencil"></span></a>
- <span class="icon icon16 fa-times jsDeleteButton jsTooltip pointer" title="{lang}wcf.global.button.delete{/lang}" data-object-id="{@$templateGroup->templateGroupID}" data-confirm-message-html="{lang __encode=true}wcf.acp.template.group.delete.sure{/lang}"></span>
+ {if !$templateGroup->isImmutable()}
+ <a href="{link controller='TemplateGroupEdit' id=$templateGroup->templateGroupID}{/link}" title="{lang}wcf.global.button.edit{/lang}" class="jsTooltip"><span class="icon icon16 fa-pencil"></span></a>
+ <span class="icon icon16 fa-times jsDeleteButton jsTooltip pointer" title="{lang}wcf.global.button.delete{/lang}" data-object-id="{@$templateGroup->templateGroupID}" data-confirm-message-html="{lang __encode=true}wcf.acp.template.group.delete.sure{/lang}"></span>
+ {else}
+ <span class="icon icon16 fa-pencil disabled" title="{lang}wcf.global.button.edit{/lang}"></span>
+ <span class="icon icon16 fa-times disabled" title="{lang}wcf.global.button.delete{/lang}"></span>
+ {/if}
{event name='rowButtons'}
</td>
<td class="columnID">{@$templateGroup->templateGroupID}</td>
- <td class="columnTitle columnTemplateGroupName"><a href="{link controller='TemplateGroupEdit' id=$templateGroup->templateGroupID}{/link}">{$templateGroup->templateGroupName}</a></td>
+ <td class="columnTitle columnTemplateGroupName">
+ {if !$templateGroup->isImmutable()}
+ <a href="{link controller='TemplateGroupEdit' id=$templateGroup->templateGroupID}{/link}">
+ {$templateGroup->getName()}
+ </a>
+ {else}
+ {$templateGroup->getName()}
+ {/if}
+ </td>
<td class="columnText columnTemplateGroupFolderName">{$templateGroup->templateGroupFolderName}</td>
<td class="columnDigits columnTemplates">{#$templateGroup->templates}</td>
// TODO:
// 1. update label's show order
+// 2. If a template group uses '_wcf_email' as the folder: Move it!
$templateGroupList = new TemplateGroupList();
$templateGroupList->sqlOrderBy = "templateGroupName";
+ $templateGroupList->getConditionBuilder()->add('templateGroupPath <> ?', ['_wcf_email/']);
$templateGroupList->readObjects();
$this->availableTemplateGroups = $templateGroupList->getObjects();
* @inheritDoc
*/
public function readData() {
- $this->availableTemplateGroups = TemplateGroup::getSelectList([], 1);
-
+ $this->availableTemplateGroups = TemplateGroup::getSelectList([-1], 1);
+
parent::readData();
}
use wcf\data\template\group\TemplateGroupAction;
use wcf\form\AbstractForm;
use wcf\system\exception\IllegalLinkException;
+use wcf\system\exception\PermissionDeniedException;
use wcf\system\WCF;
/**
if (!$this->templateGroup->templateGroupID) {
throw new IllegalLinkException();
}
+ if ($this->templateGroup->isImmutable()) {
+ throw new PermissionDeniedException();
+ }
}
/**
* @inheritDoc
*/
public function readData() {
- $this->availableTemplateGroups = TemplateGroup::getSelectList([$this->templateGroupID], 1);
+ $this->availableTemplateGroups = TemplateGroup::getSelectList([$this->templateGroupID, -1], 1);
AbstractForm::readData();
protected static $templateGroupStructure = null;
protected static $selectList = null;
+ /**
+ * Returns whether the template group is immutable (i.e. whether it's the email
+ * template group).
+ *
+ * @return boolean
+ */
+ public function isImmutable() {
+ return $this->templateGroupFolderName === '_wcf_email/';
+ }
+
+ /**
+ * Returns the localized name of the template group.
+ *
+ * @return string
+ */
+ public function getName() {
+ return WCF::getLanguage()->get($this->templateGroupName);
+ }
+
/**
* Creates a select list of all template groups.
*
- * @param integer[] $ignore Array of template group ids that should be excluded with all of their children
+ * @param integer[] $ignore Array of template group ids that should be excluded with all of their children.
+ * -1 denotes that all immutable groups should be ignored.
* @param integer $initialDepth Specifies the initial indentation depth of the list
* @return array
*/
if (self::$templateGroupStructure === null) {
self::$templateGroupStructure = [];
- $sql = "SELECT templateGroupID, templateGroupName, parentTemplateGroupID
+ $sql = "SELECT *
FROM wcf".WCF_N."_template_group
ORDER BY templateGroupName ASC";
$statement = WCF::getDB()->prepareStatement($sql);
foreach (self::$templateGroupStructure[$parentID ?: 0] as $templateGroup) {
if (!empty($ignore) && in_array($templateGroup->templateGroupID, $ignore)) continue;
+ if (in_array(-1, $ignore) && $templateGroup->isImmutable()) continue;
// we must encode html here because the htmloptions plugin doesn't do it
- $title = StringUtil::encodeHTML($templateGroup->templateGroupName);
+ $title = StringUtil::encodeHTML($templateGroup->getName());
if ($depth > 0) $title = str_repeat(' ', $depth). ' ' . $title;
self::$selectList[$templateGroup->templateGroupID] = $title;
<item name="wcf.acp.template.list"><![CDATA[Templates]]></item>
<item name="wcf.acp.template.group"><![CDATA[Templategruppe]]></item>
<item name="wcf.acp.template.group.default"><![CDATA[Standardtemplates]]></item>
+ <item name="wcf.acp.template.group.email"><![CDATA[E-Mail-Templates]]></item>
<item name="wcf.acp.template.application"><![CDATA[Anwendung]]></item>
<item name="wcf.acp.template.add"><![CDATA[Template hinzufügen]]></item>
<item name="wcf.acp.template.edit"><![CDATA[Template bearbeiten]]></item>
<item name="wcf.acp.template.list"><![CDATA[Templates]]></item>
<item name="wcf.acp.template.group"><![CDATA[Template Group]]></item>
<item name="wcf.acp.template.group.default"><![CDATA[Default Templates]]></item>
+ <item name="wcf.acp.template.group.email"><![CDATA[Email Templates]]></item>
<item name="wcf.acp.template.application"><![CDATA[Application]]></item>
<item name="wcf.acp.template.add"><![CDATA[Add Template]]></item>
<item name="wcf.acp.template.edit"><![CDATA[Edit Template]]></item>
INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfTooltipBackground', 'rgba(0, 0, 0, .8)');
INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfTooltipText', 'rgba(255, 255, 255, 1)');
+-- Email template group
+INSERT INTO wcf1_template_group (parentTemplateGroupID, templateGroupName, templateGroupFolderName) VALUES (NULL, 'wcf.acp.template.group.email', '_wcf_email/');
+
-- media providers
-- Videos
-- Youtube