Fixed bug #14144: Positioning of toolbar elements broken, especially in Safari (thank...
[Packages/TYPO3.CMS.git] / typo3 / index.php
index 7b27e03..8dfca62 100644 (file)
@@ -335,6 +335,7 @@ class SC_index {
                        '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)
@@ -565,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);
                        }
 
@@ -652,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