/** * Erzeugt das Captchafeld für das Template * * @param integer $captchaLength * @param string $formFieldId * @param bool $inputOnly * @param string $path * * @return string */ public function captcha($captchaLength = self::CAPTCHA_DEFAULT_LENGTH, $formFieldId = self::CAPTCHA_DEFAULT_INPUT_ID, $inputOnly = false, $path = '') { if ($this->user->isAuthenticated() === false) { $path = sha1($this->router->route(empty($path) === true ? $this->request->getQuery() : $path)); $this->sessionHandler->set('captcha_' . $path, $this->secureHelper->salt($captchaLength)); $this->view->assign('captcha', ['width' => $captchaLength * 25, 'id' => $formFieldId, 'height' => 30, 'input_only' => $inputOnly, 'path' => $path]); return $this->view->fetchTemplate('Captcha/Partials/captcha.tpl'); } return ''; }
/** * Generates the table of contents * * @param array $pages * @param string $baseUrlPath * @param boolean $titlesFromDb * @param boolean $customUris * * @return string */ public function generateTOC(array $pages, $baseUrlPath = '', $titlesFromDb = false, $customUris = false) { if (!empty($pages)) { $baseUrlPath = $baseUrlPath === '' ? $this->request->getUriWithoutPages() : $baseUrlPath; $toc = []; $i = 0; foreach ($pages as $page) { $pageNumber = $i + 1; $toc[$i]['title'] = $this->fetchTocPageTitle($page, $pageNumber, $titlesFromDb); $toc[$i]['uri'] = $this->fetchTocPageUri($customUris, $page, $pageNumber, $baseUrlPath); $toc[$i]['selected'] = $this->isCurrentPage($customUris, $page, $pageNumber, $i); if ($toc[$i]['selected'] === true) { $this->title->setPageTitlePostfix($toc[$i]['title']); } ++$i; } $this->view->assign('toc', $toc); return $this->view->fetchTemplate('System/Partials/toc.tpl'); } return ''; }
/** * Generates the E-mail body * * @return $this */ private function generateBody() { if (!empty($this->htmlBody) && !empty($this->template)) { $mail = ['charset' => 'UTF-8', 'title' => $this->subject, 'body' => $this->htmlBody, 'signature' => $this->getHtmlSignature(), 'url_web_view' => $this->urlWeb]; $this->view->assign('mail', $mail); $htmlDocument = new InlineStyle($this->view->fetchTemplate($this->template)); $htmlDocument->applyStylesheet($htmlDocument->extractStylesheets()); $this->phpMailer->msgHTML($htmlDocument->getHTML()); // Fallback for E-mail clients which don't support HTML E-mails if (!empty($this->body)) { $this->phpMailer->AltBody = $this->decodeHtmlEntities($this->body . $this->getTextSignature()); } else { $this->phpMailer->AltBody = $this->phpMailer->html2text($this->htmlBody . $this->getHtmlSignature(), true); } } else { $this->phpMailer->Body = $this->decodeHtmlEntities($this->body . $this->getTextSignature()); } return $this; }
/** * Erzeugt eine Auflistung der Emoticons * * @param string $formFieldId * Die ID des Eingabefeldes, in welches die Emoticons eingefügt werden sollen * * @return string */ public function emoticonsList($formFieldId = '') { $this->view->assign('emoticons_field_id', empty($formFieldId) ? 'message' : $formFieldId); $this->view->assign('emoticons', $this->emoticonsCache->getCache()); return $this->view->fetchTemplate('emoticons/emoticons.tpl'); }
/** * Returns the pretty printed form errors * * @param string|array $errors * @return string */ public function errorBox($errors) { $this->view->assign('CONTENT_ONLY', $this->request->isXmlHttpRequest() === true); return $this->view->fetchTemplate($this->errorBoxContent($errors)); }