Fixed bug #14144: Positioning of toolbar elements broken, especially in Safari (thank...
[Packages/TYPO3.CMS.git] / typo3 / index.php
index b361b24..8dfca62 100644 (file)
@@ -165,7 +165,7 @@ class SC_index {
                if ($this->L == 'OUT' && is_object($GLOBALS['BE_USER'])) {
                        $GLOBALS['BE_USER']->logoff();
                        if ($this->redirect_url) {
-                               t3lib_div::redirect($this->redirect_url);
+                               t3lib_utility_Http::redirect($this->redirect_url);
                        }
                        exit;
                }
@@ -249,6 +249,8 @@ class SC_index {
                        $content = t3lib_parsehtml::substituteSubpart($content, '###LOGIN_ERROR###', '');
                } else {
                        $markers['ERROR_MESSAGE'] = $GLOBALS['LANG']->getLL('error.login', true);
+                       $markers['ERROR_LOGIN_TITLE'] = $GLOBALS['LANG']->getLL('error.login.title', true);
+                       $markers['ERROR_LOGIN_DESCRIPTION'] = $GLOBALS['LANG']->getLL('error.login.description', true);
                }
 
 
@@ -312,20 +314,28 @@ class SC_index {
                        'NEWS'             => $this->makeLoginNews(),
                        'COPYRIGHT'        => $this->makeCopyrightNotice(),
                        'CSS_ERRORCLASS'   => ($this->commandLI ? ' class="error"' : ''),
+                       'CSS_OPENIDCLASS'  => 't3-login-openid-' . (t3lib_extMgm::isLoaded('openid') ? 'enabled' : 'disabled'),
 
                                // the labels will be replaced later on, thus the other parts above
                                // can use these markers as well and it will be replaced
                        'HEADLINE'         => $GLOBALS['LANG']->getLL('headline', true),
                        'INFO_ABOUT'       => $GLOBALS['LANG']->getLL('info.about', true),
                        'INFO_RELOAD'      => $GLOBALS['LANG']->getLL('info.reset', true),
+                       'INFO'             => $GLOBALS['LANG']->getLL('info.cookies_and_js', true),
                        'ERROR_JAVASCRIPT' => $GLOBALS['LANG']->getLL('error.javascript', true),
                        'ERROR_COOKIES'    => $GLOBALS['LANG']->getLL('error.cookies', true),
                        'ERROR_COOKIES_IGNORE' => $GLOBALS['LANG']->getLL('error.cookies_ignore', true),
                        'ERROR_CAPSLOCK'   => $GLOBALS['LANG']->getLL('error.capslock', true),
+                       'ERROR_FURTHERHELP' => $GLOBALS['LANG']->getLL('error.furtherInformation', true),
                        'LABEL_DONATELINK' => $GLOBALS['LANG']->getLL('labels.donate', true),
                        'LABEL_USERNAME'   => $GLOBALS['LANG']->getLL('labels.username', true),
+                       'LABEL_OPENID'     => $GLOBALS['LANG']->getLL('labels.openId', true),
                        'LABEL_PASSWORD'   => $GLOBALS['LANG']->getLL('labels.password', true),
+                       'LABEL_WHATISOPENID' => $GLOBALS['LANG']->getLL('labels.whatIsOpenId', true),
+                       'LABEL_SWITCHOPENID' => $GLOBALS['LANG']->getLL('labels.switchToOpenId', true),
+                       'LABEL_SWITCHDEFAULT' => $GLOBALS['LANG']->getLL('labels.switchToDefault', true),
                        'CLEAR'            => $GLOBALS['LANG']->getLL('clear', true),
+                       'LOGIN_PROCESS'    => $GLOBALS['LANG']->getLL('login_process', true),
                        'SITELINK'         => '<a href="/">###SITENAME###</a>',
 
                                // global variables will now be replaced (at last)
@@ -384,16 +394,19 @@ class SC_index {
 
                                // If there is a redirect URL AND if loginRefresh is not set...
                        if (!$this->loginRefresh)       {
-                               t3lib_div::redirect($this->redirectToURL);
+                               t3lib_utility_Http::redirect($this->redirectToURL);
                        } else {
                                $TBE_TEMPLATE->JScode.=$TBE_TEMPLATE->wrapScriptTags('
-                                       if (parent.opener && parent.opener.busy)        {
-                                               parent.opener.busy.loginRefreshed();
+                                       if (parent.opener && (parent.opener.busy || parent.opener.TYPO3.loginRefresh)) {
+                                               if (parent.opener.TYPO3.loginRefresh) {
+                                                       parent.opener.TYPO3.loginRefresh.startTimer();
+                                               } else {
+                                                       parent.opener.busy.loginRefreshed();
+                                               }
                                                parent.close();
                                        }
                                ');
                        }
-
                } elseif (!$BE_USER->user['uid'] && $this->commandLI) {
                        sleep(5);       // Wrong password, wait for 5 seconds
                }
@@ -418,12 +431,11 @@ class SC_index {
                        if (count($parts)>1)    {       // Only if more than one interface is defined will we show the selector:
 
                                        // Initialize:
-                               $tempLabels = t3lib_div::trimExplode(',', $GLOBALS['LANG']->getLL('availableInterfaces'));
                                $labels=array();
 
-                               $labels['backend']     = $tempLabels[0];
-                               $labels['backend_old'] = $tempLabels[2];
-                               $labels['frontend']    = $tempLabels[1];
+                               $labels['backend']     = $GLOBALS['LANG']->getLL('interface.backend');
+                               $labels['backend_old'] = $GLOBALS['LANG']->getLL('interface.backend_old');
+                               $labels['frontend']    = $GLOBALS['LANG']->getLL('interface.frontend');
 
                                $jumpScript=array();
                                $jumpScript['backend']     = 'backend.php';
@@ -554,12 +566,22 @@ class SC_index {
                        $newsItemTemplate = t3lib_parsehtml::getSubpart($newsContent, '###NEWS_ITEM###');
 
                        $newsItemContent = '';
+                       $count = 1;
                        foreach ($GLOBALS['TYPO3_CONF_VARS']['BE']['loginNews'] as $newsItem) {
+                               $additionalClass = '';
+                               if ($count == 1) {
+                                       $additionalClass = ' first-item';
+                               } elseif($count == count($GLOBALS['TYPO3_CONF_VARS']['BE']['loginNews'])) {
+                                       $additionalClass = ' last-item';
+                               }
                                $newsItemMarker = array(
                                        '###HEADER###'  => htmlspecialchars($newsItem['header']),
                                        '###DATE###'    => htmlspecialchars($newsItem['date']),
-                                       '###CONTENT###' => trim($newsItem['content'])
+                                       '###CONTENT###' => trim($newsItem['content']),
+                                       '###CLASS###'   => $additionalClass
                                );
+                               
+                               $count++;
                                $newsItemContent .= t3lib_parsehtml::substituteMarkerArray($newsItemTemplate, $newsItemMarker);
                        }
 
@@ -641,8 +663,13 @@ class SC_index {
                $JSCode .= $GLOBALS['TBE_TEMPLATE']->wrapScriptTags('
                        function startUp() {
                                        // If the login screen is shown in the login_frameset window for re-login, then try to get the username of the current/former login from opening windows main frame:
-                               if (parent.opener && parent.opener.TS && parent.opener.TS.username && document.loginform && document.loginform.username)        {
-                                       document.loginform.username.value = parent.opener.TS.username;
+                               try {
+                                       if (parent.opener && parent.opener.TS && parent.opener.TS.username && document.loginform && document.loginform.username)        {
+                                               document.loginform.username.value = parent.opener.TS.username;
+                                       }
+                               }
+                               catch(error) {
+                                       //continue
                                }
 
                                        // Wait a few millisecons before calling checkFocus(). This might be necessary because some browsers need some time to auto-fill in the form fields