{foreach from=$availableLanguages item=availableLanguage}
<div id="language{@$availableLanguage->languageID}" class="tabMenuContent">
- <div>
+ <div class="section">
{if $__wcf->session->getPermission('admin.content.cms.canUseMedia')}
<dl{if $errorField == 'image'|concat:$availableLanguage->languageID} class="formError"{/if}>
<dt><label for="image{@$availableLanguage->languageID}">{lang}wcf.acp.box.image{/lang}</label></dt>
else if ($this->boxType == 'menu') {
return $this->getMenu()->getContent();
}
+ else if ($this->boxType == 'tpl') {
+ return WCF::getTPL()->fetch($this->getTplName(WCF::getLanguage()->languageID), 'wcf', [], true);
+ }
$boxContent = $this->getBoxContent();
$content = '';
return false;
}
+ /**
+ * Returns the template name of this box.
+ *
+ * @param integer $languageID
+ * @return string
+ */
+ public function getTplName($languageID = null) {
+ if ($this->boxType == 'tpl') {
+ if ($this->isMultilingual) {
+ return '__cms_box_' . $this->boxID . '_' . $languageID;
+ }
+
+ return '__cms_box_' . $this->boxID;
+ }
+
+ return '';
+ }
+
/**
* Returns box to page assignments.
*
}
}
+ // save template
+ if ($box->boxType == 'tpl') {
+ if (!empty($this->parameters['content'])) {
+ foreach ($this->parameters['content'] as $languageID => $content) {
+ file_put_contents(WCF_DIR . 'templates/' . $box->getTplName(($languageID ?: null)) . '.tpl', $content['content']);
+ }
+ }
+ }
+
return $box;
}
$content['imageID']
]);
}
+
+ // save template
+ if ($box->boxType == 'tpl') {
+ foreach ($this->parameters['content'] as $languageID => $content) {
+ file_put_contents(WCF_DIR . 'templates/' . $box->getTplName(($languageID ?: null)) . '.tpl', $content['content']);
+ }
+ }
}
}
}
}
}
+
+ /**
+ * @inheritDoc
+ */
+ public function delete() {
+ foreach ($this->objects as $box) {
+ if ($box->boxType == 'tpl') {
+ foreach ($box->getBoxContent() as $languageID => $content) {
+ $file = WCF_DIR . 'templates/' . $box->getTplName(($languageID ?: null)) . '.tpl';
+ if (file_exists($file)) {
+ @unlink($file);
+ }
+ }
+ }
+ }
+
+ parent::delete();
+ }
}