Contao\ModuleLogin::compile PHP Метод

compile() защищенный Метод

Generate the module
protected compile ( )
    protected function compile()
    {
        // Show logout form
        if (FE_USER_LOGGED_IN) {
            $this->import('FrontendUser', 'User');
            $this->Template->logout = true;
            $this->Template->formId = 'tl_logout_' . $this->id;
            $this->Template->slabel = \StringUtil::specialchars($GLOBALS['TL_LANG']['MSC']['logout']);
            $this->Template->loggedInAs = sprintf($GLOBALS['TL_LANG']['MSC']['loggedInAs'], $this->User->username);
            $this->Template->action = ampersand(\Environment::get('indexFreeRequest'));
            if ($this->User->lastLogin > 0) {
                /** @var PageModel $objPage */
                global $objPage;
                $this->Template->lastLogin = sprintf($GLOBALS['TL_LANG']['MSC']['lastLogin'][1], \Date::parse($objPage->datimFormat, $this->User->lastLogin));
            }
            return;
        }
        $flashBag = \System::getContainer()->get('session')->getFlashBag();
        if ($flashBag->has($this->strFlashType)) {
            $this->Template->hasError = true;
            $this->Template->message = $flashBag->get($this->strFlashType)[0];
        }
        $this->Template->username = $GLOBALS['TL_LANG']['MSC']['username'];
        $this->Template->password = $GLOBALS['TL_LANG']['MSC']['password'][0];
        $this->Template->action = ampersand(\Environment::get('indexFreeRequest'));
        $this->Template->slabel = \StringUtil::specialchars($GLOBALS['TL_LANG']['MSC']['login']);
        $this->Template->value = \StringUtil::specialchars(\Input::post('username'));
        $this->Template->formId = 'tl_login_' . $this->id;
        $this->Template->autologin = $this->autologin && \Config::get('autologin') > 0;
        $this->Template->autoLabel = $GLOBALS['TL_LANG']['MSC']['autologin'];
    }