/** * @param TemplateEvent $event */ public function renderManageMenuItem(TemplateEvent $event) { $parameters = $event->getParameters(); if ($this->acl->hasPermission('admin/menus/items/create') === true) { $menuItem = $this->fetchMenuItems(!empty($parameters['path']) ? $parameters['path'] : ''); $this->view->assign('options', $this->fetchCreateMenuItemOption(!empty($menuItem) ? 1 : 0))->assign('form', $this->modifyFormValues($menuItem))->assign($this->addFormFields($menuItem)); $this->view->displayTemplate('Menus/Partials/manage_menu_item.tpl'); } }
/** * 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 ''; }
/** * @return $this * @throws Core\ACL\Exception\AccessForbiddenException */ public function preDispatch() { $path = $this->request->getArea() . '/' . $this->request->getFullPathWithoutArea(); if ($this->acl->hasPermission($path) === false) { throw new Core\ACL\Exception\AccessForbiddenException(); } $this->view->assign(['PHP_SELF' => $this->appPath->getPhpSelf(), 'ROOT_DIR' => $this->appPath->getWebRoot(), 'HOST_NAME' => $this->request->getHttpHost(), 'ROOT_DIR_ABSOLUTE' => $this->request->getScheme() . '://' . $this->request->getHttpHost() . $this->appPath->getWebRoot(), 'DESIGN_PATH' => $this->appPath->getDesignPathWeb(), 'DESIGN_PATH_ABSOLUTE' => $this->appPath->getDesignPathAbsolute(), 'LANG_DIRECTION' => $this->translator->getDirection(), 'LANG' => $this->translator->getShortIsoCode()]); return $this; }
/** * 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 ''; }
/** * @param string|array $errors */ protected function setErrorBoxData($errors) { $hasNonIntegerKeys = false; $errors = $this->prepareErrorBoxData($errors); foreach (array_keys($errors) as $key) { if (is_numeric($key) === false) { $hasNonIntegerKeys = true; break; } } $this->view->assign('error_box', ['non_integer_keys' => $hasNonIntegerKeys, 'errors' => $errors]); }
/** * 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'); }
/** * @param TemplateEvent $event */ public function renderSeoFormFields(TemplateEvent $event) { $parameters = $event->getParameters(); $formFields = array_merge($this->metaFormFields->formFields(isset($parameters['path']) ? $parameters['path'] : ''), ['uri_pattern' => isset($parameters['uri_pattern']) ? $parameters['uri_pattern'] : '']); $this->view->assign('seo', $formFields)->displayTemplate('Seo/Partials/tab_seo_fields.tpl'); }
/** * @inheritdoc */ protected function addCustomTemplateVarsBeforeOutput() { $this->view->assign('PAGE_TITLE', $this->translator->t('install', 'acp3_installation')); $this->view->assign('TITLE', $this->translator->t($this->request->getModule(), $this->request->getController() . '_' . $this->request->getAction())); $this->view->assign('LAYOUT', $this->request->isXmlHttpRequest() ? 'layout.ajax.tpl' : $this->getLayout()); }
public function renderFeedLinks() { $this->view->assign('available_feeds', $this->availableFeedsRegistrar->getAvailableModuleNames()); $this->view->displayTemplate('Feeds/Partials/head.feed_links.tpl'); }
public function renderSeoMetaTags() { $this->view->assign('META', $this->metaStatements->getMetaTags()); $this->view->displayTemplate('Seo/Partials/meta.tpl'); }