/** * Konstruktor */ public function __construct() { parent::__construct(); $this->checkPermission = array('system' => 'templates'); $this->view = new \fpcm\model\view\acp('overview', 'templates'); $fileLib = new \fpcm\model\system\fileLib(); $this->view->setViewJsFiles($fileLib->getCmJsFiles()); $this->view->setViewCssFiles($fileLib->getCmCssFiles()); $this->articleTemplate = new \fpcm\model\pubtemplates\article($this->config->articles_template_active); if ($this->config->articles_template_active != $this->config->article_template_active) { $this->articleSingleTemplate = new \fpcm\model\pubtemplates\article($this->config->article_template_active); } $this->commentTemplate = new \fpcm\model\pubtemplates\comment($this->config->comments_template_active); $this->commentFormTemplate = new \fpcm\model\pubtemplates\commentform(); $this->latestNewsTemplate = new \fpcm\model\pubtemplates\latestnews(); $this->tweetTemplate = new \fpcm\model\pubtemplates\tweet(); }
public function process() { if (!parent::process()) { return false; } $eventResult = $this->events->runEvent('articleReplaceEditorPlugin'); if (is_a($eventResult, '\\fpcm\\model\\abstracts\\articleEditor')) { $this->editorPlugin = $eventResult; } elseif ($this->config->system_editor) { $this->editorPlugin = new \fpcm\model\editor\htmlEditor(); } else { $this->editorPlugin = new \fpcm\model\editor\tinymceEditor(); } $this->view->setViewJsFiles($this->editorPlugin->getJsFiles()); $this->view->setViewCssFiles($this->editorPlugin->getCssFiles()); $viewVars = $this->editorPlugin->getViewVars(); foreach ($viewVars as $key => $value) { $this->view->assign($key, $value); } $changeAuthor = $this->permissions->check(array('article' => 'authors')); $this->view->assign('changeAuthor', $changeAuthor); if ($changeAuthor) { $userlist = new \fpcm\model\users\userList(); $changeuserList = array($this->lang->translate('EDITOR_CHANGEAUTHOR') => '') + $userlist->getUsersNameList(); $this->view->assign('changeuserList', $changeuserList); } $this->view->assign('editorFile', $this->editorPlugin->getEditorTemplate()); $this->view->assign('article', $this->article); $this->view->assign('categories', $this->categoryList->getCategoriesCurrentUser()); $this->view->assign('commentEnabledGlobal', $this->config->system_comments_enabled); $this->view->assign('showArchiveStatus', true); $this->view->assign('showDraftStatus', true); $this->view->assign('isRevision', false); $this->view->assign('timesMode', false); $this->view->assign('userfields', $this->getUserFields()); $twitter = new \fpcm\model\system\twitter(); $this->view->assign('showTwitter', $twitter->checkRequirements()); $this->jsVars = $this->editorPlugin->getJsVars(); $this->jsVars += array('fpcmFileManagerUrl' => \fpcm\classes\baseconfig::$rootPath . 'index.php?module=files/list&mode=', 'fpcmFileManagerUrlMode' => 2); $jsLangVars = array('fileManagerHeadline' => $this->lang->translate('HL_FILES_MNG')); $this->view->addJsLangVars(array_merge($jsLangVars, $this->editorPlugin->getJsLangVars())); $this->view->addJsVars($this->jsVars); return true; }