public function run()
{
$packages = System::getContainer()->getParameter('kernel.packages');
$this->Template = new \BackendTemplate('be_main');
$this->Template->version = $packages['contao/core-bundle'];
$this->Template->main = '';
// Ajax request
if ($_POST && \Environment::get('isAjaxRequest')) {
$this->objAjax = new \Ajax(\Input::post('action'));
$this->objAjax->executePreActions();
}
// Error
if (\Input::get('act') == 'error') {
$this->Template->error = $GLOBALS['TL_LANG']['ERR']['general'];
$this->Template->title = $GLOBALS['TL_LANG']['ERR']['general'];
@trigger_error('Using act=error has been deprecated and will no longer work in Contao 5.0. Throw an exception instead.', E_USER_DEPRECATED);
} elseif (!\Input::get('do') && !\Input::get('act')) {
$this->Template->main .= $this->welcomeScreen();
$this->Template->title = $GLOBALS['TL_LANG']['MSC']['home'];
} elseif (\Input::get('do')) {
$this->Template->main .= $this->getBackendModule(\Input::get('do'));
$this->Template->title = $this->Template->headline;
}
return $this->output();
}