public function process() { if (!parent::process()) { return false; } $mode = (int) $this->getRequestVar('mode'); if ($mode == 2) { $this->view->setShowHeader(0); $this->view->setShowFooter(0); } $this->view->setViewJsFiles(array(\fpcm\classes\loader::libGetFileUrl('tinymce4', 'tinymce.min.js'), \fpcm\classes\baseconfig::$jsPath . 'editor_comments.js')); $this->view->addJsVars(array('fpcmTinyMceLang' => $this->config->system_lang, 'fpcmTinyMcePlugins' => 'autolink charmap code image link lists media nonbreaking wordcount fpcm_emoticons autoresize', 'fpcmTinyMceToolbar' => 'fontsizeselect | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist blockquote | link unlink anchor image media emoticons charmap | undo redo removeformat searchreplace fullscreen code', 'fpcmNavigationActiveItemId' => 'itemnav-item-editcomments')); if ($this->comment->getChangeuser() && $this->comment->getChangetime()) { $changeUser = new \fpcm\model\users\author($this->comment->getChangeuser()); $this->view->assign('changeInfo', $this->lang->translate('COMMMENT_LASTCHANGE', array('{{username}}' => $changeUser->exists() ? $changeUser->getDisplayname() : $this->lang->translate('GLOBAL_NOTFOUND'), '{{time}}' => date($this->config->system_dtmask, $this->comment->getChangetime())))); } else { $this->view->assign('changeInfo', $this->lang->translate('GLOBAL_NOCHANGE')); } $this->view->assign('ipWhoisLink', substr($this->comment->getIpaddress(), -1) === '*' ? false : true); $this->view->assign('comment', $this->comment); $this->view->assign('commentsMode', $mode); $this->view->assign('permApprove', $this->approve); $this->view->assign('permPrivate', $this->private); $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; }