/** * Controller-Processing * @return boolean */ public function process() { if (!parent::process()) { return false; } $this->view->assign('replacementsArticle', $this->getReplacementTranslations('TEMPLATE_ARTICLE_', $this->articleTemplate->getReplacementTags())); $this->view->assign('contentArticle', $this->articleTemplate->getContent()); if ($this->config->articles_template_active != $this->config->article_template_active) { $this->view->assign('replacementsArticleSingle', $this->getReplacementTranslations('TEMPLATE_ARTICLE_', $this->articleSingleTemplate->getReplacementTags())); $this->view->assign('contentArticleSingle', $this->articleSingleTemplate->getContent()); } $this->view->assign('replacementsComment', $this->getReplacementTranslations('TEMPLATE_COMMMENT_', $this->commentTemplate->getReplacementTags())); $this->view->assign('contentComment', $this->commentTemplate->getContent()); $this->view->assign('replacementsCommentForm', $this->getReplacementTranslations('TEMPLATE_COMMMENTFORM_', $this->commentFormTemplate->getReplacementTags())); $this->view->assign('contentCommentForm', $this->commentFormTemplate->getContent()); $this->view->assign('replacementsLatestNews', $this->getReplacementTranslations('TEMPLATE_ARTICLE_', $this->latestNewsTemplate->getReplacementTags())); $this->view->assign('contentLatestNews', $this->latestNewsTemplate->getContent()); $this->view->assign('replacementsTweet', $this->getReplacementTranslations('TEMPLATE_ARTICLE_', $this->tweetTemplate->getReplacementTags())); $this->view->assign('contentTweet', $this->tweetTemplate->getContent()); $this->view->assign('allowedTags', htmlentities($this->articleTemplate->getAllowedTags(', '))); $this->view->addJsVars(array('fpcmTemplateId' => 1, 'fpcmJqUploadInit' => 0)); $this->view->addJsLangVars(array('previewHeadline' => $this->lang->translate('HL_TEMPLATE_PREVIEW'))); $tplfilelist = new \fpcm\model\files\templatefilelist(); $this->view->assign('templateFiles', $tplfilelist->getFolderObjectList()); $this->view->setViewJsFiles(array(\fpcm\classes\baseconfig::$jsPath . 'filemanager.js', \fpcm\classes\baseconfig::$jsPath . 'templates.js')); $translInfo = array('{{filecount}}' => 1, '{{filesize}}' => \fpcm\classes\tools::calcSize(\fpcm\classes\baseconfig::uploadFilesizeLimit(true), 0)); $this->view->assign('maxFilesInfo', $this->lang->translate('FILE_LIST_PHPMAXINFO', $translInfo)); $this->view->assign('actionPath', \fpcm\classes\baseconfig::$rootPath . $this->getControllerLink('modules/list')); $this->view->render(); }
/** * Kommentar-Formular initialisieren * @return string */ protected function assignCommentFormData() { if (!$this->config->system_comments_enabled || !$this->article->getComments()) { return ''; } $id = $this->session->exists() ? $this->session->getUserId() : null; $author = new \fpcm\model\users\author($id); if (!$this->buttonClicked('sendComment') && is_null($this->getRequestVar('newcomment')) && $this->session->exists()) { $this->newComment->setName($author->getDisplayname()); $this->newComment->setEmail($author->getEmail()); $this->newComment->setWebsite(\fpcm\classes\http::getHttpHost()); } $replacementTags = array('{{formHeadline}}' => $this->lang->translate('COMMENTS_PUBLIC_FORMHEADLINE'), '{{submitUrl}}' => $this->article->getArticleLink(), '{{nameDescription}}' => $this->lang->translate('COMMMENT_AUTHOR'), '{{nameField}}' => '<input type="text" class="fpcm-pub-textinput" name="newcomment[name]" value="' . $this->newComment->getName() . '">', '{{emailDescription}}' => $this->lang->translate('GLOBAL_EMAIL'), '{{emailField}}' => '<input type="text" class="fpcm-pub-textinput" name="newcomment[email]" value="' . $this->newComment->getEmail() . '">', '{{websiteDescription}}' => $this->lang->translate('COMMMENT_WEBSITE'), '{{websiteField}}' => '<input type="text" class="fpcm-pub-textinput" name="newcomment[website]" value="' . $this->newComment->getWebsite() . '">', '{{textfield}}' => '<textarea class="fpcm-pub-textarea" id="newcommenttext" name="newcomment[text]">' . $this->newComment->getText() . '</textarea>', '{{smileysDescription}}' => $this->lang->translate('HL_OPTIONS_SMILEYS'), '{{smileys}}' => $this->getSmileyList(), '{{tags}}' => htmlentities(\fpcm\model\comments\comment::COMMENT_TEXT_HTMLTAGS_FORM), '{{spampluginQuestion}}' => $this->captcha->createPluginText(), '{{spampluginField}}' => $this->captcha->createPluginInput(), '{{privateCheckbox}}' => '<input type="checkbox" class="fpcm-pub-checkboxinput" name="newcomment[private]" value="1">', '{{submitButton}}' => '<button type="submit" name="btnSendComment">' . $this->lang->translate('GLOBAL_SUBMIT') . '</button>', '{{resetButton}}' => '<button type="reset">' . $this->lang->translate('GLOBAL_RESET') . '</button>'); $this->commentFormTemplate->setReplacementTags($replacementTags); $parsed = $this->commentFormTemplate->parse(); if (!$this->isUtf8) { $parsed = utf8_decode($parsed); } return $parsed; }