getSystemMessages() public static method

Return the system messages as HTML
public static getSystemMessages ( ) : string
return string The messages HTML markup
Ejemplo n.º 1
0
 /**
  * Run the controller and parse the template
  *
  * @return Response
  */
 public function run()
 {
     /** @var BackendTemplate|object $objTemplate */
     $objTemplate = new \BackendTemplate('be_alerts');
     $objTemplate->theme = \Backend::getTheme();
     $objTemplate->base = \Environment::get('base');
     $objTemplate->language = $GLOBALS['TL_LANGUAGE'];
     $objTemplate->title = \StringUtil::specialchars($GLOBALS['TL_LANG']['MSC']['systemMessages']);
     $objTemplate->charset = \Config::get('characterSet');
     $objTemplate->messages = \Message::generateUnwrapped() . \Backend::getSystemMessages();
     return $objTemplate->getResponse();
 }
Ejemplo n.º 2
0
 /**
  * Output the template file
  *
  * @return Response
  */
 protected function output()
 {
     // Default headline
     if ($this->Template->headline == '') {
         $this->Template->headline = \Config::get('websiteTitle');
     }
     // Default title
     if ($this->Template->title == '') {
         $this->Template->title = $this->Template->headline;
     }
     /** @var SessionInterface $objSession */
     $objSession = \System::getContainer()->get('session');
     // File picker reference
     if (\Input::get('popup') && \Input::get('act') != 'show' && (\Input::get('do') == 'page' || \Input::get('do') == 'files') && $objSession->get('filePickerRef')) {
         $this->Template->managerHref = ampersand($objSession->get('filePickerRef'));
         $this->Template->manager = strpos($objSession->get('filePickerRef'), 'contao/page?') !== false ? $GLOBALS['TL_LANG']['MSC']['pagePickerHome'] : $GLOBALS['TL_LANG']['MSC']['filePickerHome'];
     }
     // Website title
     if (\Config::get('websiteTitle') != 'Contao Open Source CMS') {
         $this->Template->websiteTitle = \Config::get('websiteTitle');
     }
     $this->Template->theme = \Backend::getTheme();
     $this->Template->base = \Environment::get('base');
     $this->Template->language = $GLOBALS['TL_LANGUAGE'];
     $this->Template->title = \StringUtil::specialchars($this->Template->title);
     $this->Template->charset = \Config::get('characterSet');
     $this->Template->account = $GLOBALS['TL_LANG']['MOD']['login'][1];
     $this->Template->preview = $GLOBALS['TL_LANG']['MSC']['fePreview'];
     $this->Template->previewTitle = \StringUtil::specialchars($GLOBALS['TL_LANG']['MSC']['fePreviewTitle']);
     $this->Template->pageOffset = \Input::cookie('BE_PAGE_OFFSET');
     $this->Template->logout = $GLOBALS['TL_LANG']['MSC']['logoutBT'];
     $this->Template->logoutTitle = \StringUtil::specialchars($GLOBALS['TL_LANG']['MSC']['logoutBTTitle']);
     $this->Template->backendModules = $GLOBALS['TL_LANG']['MSC']['backendModules'];
     $this->Template->username = $GLOBALS['TL_LANG']['MSC']['user'] . ' ' . $GLOBALS['TL_USERNAME'];
     $this->Template->skipNavigation = \StringUtil::specialchars($GLOBALS['TL_LANG']['MSC']['skipNavigation']);
     $this->Template->request = ampersand(\Environment::get('request'));
     $this->Template->top = $GLOBALS['TL_LANG']['MSC']['backToTop'];
     $this->Template->modules = $this->User->navigation();
     $this->Template->home = $GLOBALS['TL_LANG']['MSC']['home'];
     $this->Template->homeTitle = $GLOBALS['TL_LANG']['MSC']['homeTitle'];
     $this->Template->backToTop = \StringUtil::specialchars($GLOBALS['TL_LANG']['MSC']['backToTopTitle']);
     $this->Template->expandNode = $GLOBALS['TL_LANG']['MSC']['expandNode'];
     $this->Template->collapseNode = $GLOBALS['TL_LANG']['MSC']['collapseNode'];
     $this->Template->loadingData = $GLOBALS['TL_LANG']['MSC']['loadingData'];
     $this->Template->isPopup = \Input::get('popup');
     $this->Template->systemMessages = $GLOBALS['TL_LANG']['MSC']['systemMessages'];
     $strSystemMessages = \Backend::getSystemMessages();
     $this->Template->systemMessagesCount = substr_count($strSystemMessages, 'class="tl_');
     $this->Template->systemErrorMessagesCount = substr_count($strSystemMessages, 'class="tl_error"');
     // Front end preview links
     if (defined('CURRENT_ID') && CURRENT_ID != '') {
         if (\Input::get('do') == 'page') {
             $this->Template->frontendFile = '?page=' . CURRENT_ID;
         } elseif (\Input::get('do') == 'article' && ($objArticle = \ArticleModel::findByPk(CURRENT_ID)) !== null) {
             $this->Template->frontendFile = '?page=' . $objArticle->pid;
         } elseif (\Input::get('do') != '') {
             $event = new PreviewUrlCreateEvent(\Input::get('do'), CURRENT_ID);
             \System::getContainer()->get('event_dispatcher')->dispatch(ContaoCoreEvents::PREVIEW_URL_CREATE, $event);
             if (($strQuery = $event->getQuery()) !== null) {
                 $this->Template->frontendFile = '?' . $strQuery;
             }
         }
     }
     return $this->Template->getResponse();
 }