public function renderInvalidPageCacheAlert()
 {
     $systemSettings = $this->settings->getSettings(Schema::MODULE_NAME);
     if ($this->acl->hasPermission('admin/system/maintenance/cache') && $systemSettings['page_cache_is_valid'] == 0) {
         $this->view->displayTemplate('System/Partials/alert_invalid_page_cache.tpl');
     }
 }
Esempio n. 2
0
 /**
  * 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 '';
 }
 /**
  * @param array $menuItem
  * @return array|null
  */
 private function modifyFormValues(array $menuItem)
 {
     $formData = $this->view->getRenderer()->getTemplateVars('form');
     if (is_array($formData) && !isset($formData['menu_item_title'])) {
         $formData['menu_item_title'] = !empty($menuItem) ? $menuItem['title'] : '';
     }
     return $formData;
 }
Esempio n. 4
0
 /**
  * @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;
 }
Esempio n. 5
0
 /**
  * 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 '';
 }
Esempio n. 6
0
File: Alerts.php Progetto: acp3/core
 /**
  * @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]);
 }
Esempio n. 7
0
File: Mailer.php Progetto: acp3/core
 /**
  * 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;
 }
Esempio n. 8
0
 /**
  * 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');
 }
Esempio n. 10
0
 /**
  * @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());
 }
Esempio n. 11
0
 public function renderFeedLinks()
 {
     $this->view->assign('available_feeds', $this->availableFeedsRegistrar->getAvailableModuleNames());
     $this->view->displayTemplate('Feeds/Partials/head.feed_links.tpl');
 }
Esempio n. 12
0
 public function renderSeoMetaTags()
 {
     $this->view->assign('META', $this->metaStatements->getMetaTags());
     $this->view->displayTemplate('Seo/Partials/meta.tpl');
 }