Ejemplo n.º 1
0
 /**
  * Add the welcome screen
  *
  * @return string
  */
 protected function welcomeScreen()
 {
     \System::loadLanguageFile('explain');
     /** @var \BackendTemplate|object $objTemplate */
     $objTemplate = new \BackendTemplate('be_welcome');
     $objTemplate->messages = \Message::generate(false, true);
     // HOOK: add custom messages
     if (isset($GLOBALS['TL_HOOKS']['getSystemMessages']) && is_array($GLOBALS['TL_HOOKS']['getSystemMessages'])) {
         $arrMessages = array();
         foreach ($GLOBALS['TL_HOOKS']['getSystemMessages'] as $callback) {
             $this->import($callback[0]);
             $strBuffer = $this->{$callback[0]}->{$callback[1]}();
             if ($strBuffer != '') {
                 $arrMessages[] = $strBuffer;
             }
         }
         if (!empty($arrMessages)) {
             $objTemplate->messages .= "\n" . implode("\n", $arrMessages);
         }
     }
     // Add the versions overview
     \Versions::addToTemplate($objTemplate);
     $objTemplate->welcome = sprintf($GLOBALS['TL_LANG']['MSC']['welcomeTo'], \Config::get('websiteTitle'));
     $objTemplate->showDifferences = specialchars(str_replace("'", "\\'", $GLOBALS['TL_LANG']['MSC']['showDifferences']));
     $objTemplate->systemMessages = $GLOBALS['TL_LANG']['MSC']['systemMessages'];
     $objTemplate->shortcuts = $GLOBALS['TL_LANG']['MSC']['shortcuts'][0];
     $objTemplate->shortcutsLink = $GLOBALS['TL_LANG']['MSC']['shortcuts'][1];
     $objTemplate->editElement = specialchars($GLOBALS['TL_LANG']['MSC']['editElement']);
     return $objTemplate->parse();
 }