return $this->boxIDs;
}
+ /**
+ * Returns the template name of this page.
+ *
+ * @param integer $languageID
+ * @return string
+ */
+ public function getTplName($languageID = null) {
+ if ($this->pageType == 'tpl') {
+ if ($this->isMultilingual) {
+ return '__cms_page_' . $this->pageID . '_' . $languageID;
+ }
+
+ return '__cms_page_' . $this->pageID;
+ }
+
+ return '';
+ }
+
/**
* Returns the page with the given identifier.
*
}
}
+ // save template
+ if ($page->pageType == 'tpl') {
+ if (!empty($this->parameters['content'])) {
+ foreach ($this->parameters['content'] as $languageID => $content) {
+ file_put_contents(WCF_DIR . 'templates/' . $page->getTplName(($languageID ?: null)) . '.tpl', $content['content']);
+ }
+ }
+ }
+
return $page;
}
$content['customURL']
]);
}
+
+ // save template
+ if ($page->pageType == 'tpl') {
+ foreach ($this->parameters['content'] as $languageID => $content) {
+ file_put_contents(WCF_DIR . 'templates/' . $page->getTplName(($languageID ?: null)) . '.tpl', $content['content']);
+ }
+ }
}
}
public function getSearchResultList() {
return $this->pageEditor->getHandler()->lookup($this->parameters['data']['searchString']);
}
+
+ /**
+ * @inheritDoc
+ */
+ public function delete() {
+ foreach ($this->objects as $page) {
+ if ($page->pageType == 'tpl') {
+ foreach ($page->getPageContent() as $languageID => $content) {
+ $file = WCF_DIR . 'templates/' . $page->getTplName(($languageID ?: null)) . '.tpl';
+ if (file_exists($file)) {
+ @unlink($file);
+ }
+ }
+ }
+ }
+
+ parent::delete();
+ }
}