Fixed bug #14365: Bug: Install Tool skin is sometimes wrong (thanks to Lars Houmark)
authorSteffen Kamper <info@sk-typo3.de>
Thu, 13 May 2010 12:24:22 +0000 (12:24 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Thu, 13 May 2010 12:24:22 +0000 (12:24 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7587 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/install/Resources/Public/Javascript/install.js
typo3/sysext/install/Resources/Public/Stylesheets/install.css
typo3/sysext/install/Resources/Public/Stylesheets/install_standalone.css [deleted file]
typo3/sysext/install/mod/class.tx_install.php
typo3/sysext/install/mod/class.tx_install_session.php

index 488b53d..d0b6aef 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2010-05-13  Steffen Kamper  <info@sk-typo3.de>
 
+       * Fixed bug #14365: Bug: Install Tool skin is sometimes wrong (thanks to Lars Houmark)
        * Fixed bug #14336: Merge modules "Cleanup and typo3temp/" of the Install Tool (thanks to Steffen Gebert)
 
 2010-05-13  Patrick Broens  <patrick@patrickbroens.nl>
index c2e3abf..f9b9f22 100644 (file)
@@ -1,10 +1,10 @@
 /***************************************************************
 *
-*  Javascript functions to provide AJAX calls for install tool
+*  Various JavaScript functions for the Install Tool
 *
 *  Copyright notice
 *
-*  (c) 2009 Marcus Krause, Helmut Hummel <security@typo3.org>
+*  (c) 2009-2010 Marcus Krause, Helmut Hummel, Lars Houmark
 *  All rights reserved
 *
 *  This script is part of the TYPO3 backend provided by
@@ -22,8 +22,9 @@
 
 
 /**
+ * Javascript class to provide AJAX calls for Install Tool
  *
- * @author     Marcus Krause
+ * @author Marcus Krause, Helmut Hummel <security@typo3.org>
  */
 var EncryptionKey = {
        thisScript: '../../index.php',
@@ -47,3 +48,19 @@ var EncryptionKey = {
                });
        }
 };
+
+/**
+ * Prototype method to detect if the Install Tool is loaded
+ * in the backend or as a standalone.
+ *
+ * If it standalone, a class is added to the body tag in order
+ * to different the CSS style for that version.
+ *
+ * @author Lars Houmark <lars@houmark.com>
+ */
+document.observe("dom:loaded", function() {
+       if (top.location === document.location) {
+                       // standalone-mode, add class to the body tag
+                       $(document.body).addClassName('standalone');
+       }
+});
index e1468b9..29575af 100644 (file)
@@ -383,4 +383,82 @@ h1,
        padding: 0;
 }
 
-/* 10: About */
\ No newline at end of file
+/* 10: About */
+
+
+/* Stylesheet for the standalone version of the Install Tool */
+
+body.standalone {
+       background: #4f4f4f url('../Images/body-background.jpg') repeat-x fixed;
+}
+
+body.standalone #t3-install-outer {
+       margin: 0 auto;
+}
+
+body.standalone h1,
+body.standalone #t3-install-menu-border-top,
+body.standalone #t3-install-menu-bottom,
+body.standalone #t3-install-links,
+body.standalone #t3-install-box-border-top,
+body.standalone #t3-install-box-border-bottom,
+body.standalone #t3-install-copyright {
+       display: block;
+}
+
+body.standalone h1 {
+       background: url('../Images/logo.gif') no-repeat scroll 0 0 transparent;
+       text-indent:-999em;
+       margin: 2em 0 3.7em 0;
+       height: 34px;
+       width: 19em;
+       float: left;
+}
+
+body.standalone h2 {
+       padding: 3.3em 0 3.7em 17.5em;
+       margin: 0;
+       height: auto;
+       color: #ffffff;
+}
+
+body.standalone #t3-install-box-border-top {
+       height: 3px;
+       background: #3e3e3e url('../Images/content-top.png') no-repeat center bottom;
+}
+
+body.standalone #t3-install-box-body {
+       background-color: #eeeeee;
+}
+
+body.standalone #t3-install-box-border-bottom {
+       height: 3px;
+       background: #4d4c4d url('../Images/content-bottom.png') no-repeat center top;
+}
+
+body.standalone #t3-install-menu,
+body.standalone #t3-install-box-body {
+       border: 0;
+}
+
+body.standalone #t3-install-menu-border-top {
+       width: 17.6em;
+       height: 3px;
+       background: #3e3e3e url('../Images/content-top.png') no-repeat center bottom;
+}
+
+body.standalone #t3-install-menu {
+       background: #ebebeb url('../Images/menuBackground.gif') repeat-x left bottom;
+}
+
+body.standalone #t3-install-menu-bottom {
+       width: 17.6em;
+       height: 3px;
+       background: #3e3e3e url('../Images/content-top.png') no-repeat center bottom;
+}
+
+body.standalone .t3-install-login h2 {
+       clear: both;
+       margin: 0;
+       padding: 0.5em 0 0.5em 3.35em;
+}
\ No newline at end of file
diff --git a/typo3/sysext/install/Resources/Public/Stylesheets/install_standalone.css b/typo3/sysext/install/Resources/Public/Stylesheets/install_standalone.css
deleted file mode 100644 (file)
index 080dd22..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-@CHARSET "UTF-8";
-
-body {
-       background: #4f4f4f url('../Images/body-background.jpg') repeat-x fixed;
-}
-
-#t3-install-outer {
-       margin: 0 auto;
-}
-
-h1,
-#t3-install-menu-border-top,
-#t3-install-menu-bottom,
-#t3-install-links,
-#t3-install-box-border-top,
-#t3-install-box-border-bottom,
-#t3-install-copyright {
-       display: block;
-}
-
-h1 {
-       background: url('../Images/logo.gif') no-repeat scroll 0 0 transparent;
-       text-indent:-999em;
-       margin: 2em 0 3.7em 0;
-       height: 34px;
-       width: 19em;
-       float: left;
-}
-
-h2 {
-       padding: 3.3em 0 3.7em 17.5em;
-       margin: 0;
-       height: auto;
-       color: #ffffff;
-}
-
-#t3-install-box-border-top {
-       height: 3px;
-       background: #3e3e3e url('../Images/content-top.png') no-repeat center bottom;
-}
-
-#t3-install-box-body {
-       background-color: #eeeeee;
-}
-
-#t3-install-box-border-bottom {
-       height: 3px;
-       background: #4d4c4d url('../Images/content-bottom.png') no-repeat center top;
-}
-
-#t3-install-menu,
-#t3-install-box-body {
-       border: 0;
-}
-
-#t3-install-menu-border-top {
-       width: 17.6em;
-       height: 3px;
-       background: #3e3e3e url('../Images/content-top.png') no-repeat center bottom;
-}
-
-#t3-install-menu {
-       background: #ebebeb url('../Images/menuBackground.gif') repeat-x left bottom;
-}
-
-#t3-install-menu-bottom {
-       width: 17.6em;
-       height: 3px;
-       background: #3e3e3e url('../Images/content-top.png') no-repeat center bottom;
-}
\ No newline at end of file
index 5b7d433..1e07538 100755 (executable)
@@ -418,11 +418,6 @@ REMOTE_ADDR was '".t3lib_div::getIndpEnv('REMOTE_ADDR')."' (".t3lib_div::getIndp
        function loginForm() {
                $password = t3lib_div::_GP('password');
                $redirect_url = $this->redirect_url ? $this->redirect_url : $this->action;
-                       // Add prototype to javascript array for output
-               $this->javascript[] = '<script type="text/javascript" src="' .
-                       t3lib_div::createVersionNumberedFilename(
-                               '../contrib/prototype/prototype.js'
-                       ) . '"></script>';
                        // Get the template file
                $templateFile = @file_get_contents(
                        PATH_site . $this->templateFilePath . 'LoginForm.html'
@@ -540,6 +535,7 @@ REMOTE_ADDR was '".t3lib_div::getIndpEnv('REMOTE_ADDR')."' (".t3lib_div::getIndp
                if ($this->step) {
                        $this->output($this->outputWrapper($this->stepOutput()));
                } else {
+                       
                                // Menu...
                        switch($this->INSTALL['type']) {
                                case 'images':
@@ -3357,14 +3353,6 @@ REMOTE_ADDR was '".t3lib_div::getIndpEnv('REMOTE_ADDR')."' (".t3lib_div::getIndp
                                );
 
                                if ($this->mode!='123') {
-                                       $this->javascript[] = '<script type="text/javascript" src="' .
-                                               t3lib_div::createVersionNumberedFilename(
-                                                       '../contrib/prototype/prototype.js'
-                                               ) . '"></script>';
-                                       $this->javascript[] = '<script type="text/javascript" src="' .
-                                               t3lib_div::createVersionNumberedFilename(
-                                                       '../sysext/install/Resources/Public/Javascript/install.js'
-                                               ) . '"></script>';
                                                // Get the subpart for the regular mode
                                        $regularModeSubpart = t3lib_parsehtml::getSubpart($form, '###REGULARMODE###');
                                                // Define the markers content
@@ -5393,10 +5381,6 @@ REMOTE_ADDR was '".t3lib_div::getIndpEnv('REMOTE_ADDR')."' (".t3lib_div::getIndp
         * @return void
         */
        function checkTheDatabase() {
-               $this->javascript[] = '<script type="text/javascript" src="' .
-                       t3lib_div::createVersionNumberedFilename(
-                               '../contrib/prototype/prototype.js'
-                       ) . '"></script>';
                if (!$this->config_array['mysqlConnect']) {
                        $this->message('Database Analyser', 'Your database connection failed', '
                                <p>
@@ -7589,6 +7573,18 @@ $out="
                        $this->template = @file_get_contents(PATH_site . $this->templateFilePath . 'Install.html');
                }
 
+                       // Add prototype to javascript array for output
+               $this->javascript[] = '<script type="text/javascript" src="' .
+                       t3lib_div::createVersionNumberedFilename(
+                               '../contrib/prototype/prototype.js'
+                       ) . '"></script>';
+                       
+                       // Add JS functions for output
+               $this->javascript[] = '<script type="text/javascript" src="' .
+                       t3lib_div::createVersionNumberedFilename(
+                               '../sysext/install/Resources/Public/Javascript/install.js'
+                       ) . '"></script>';
+
                        // Include the default stylesheets
                $this->stylesheets[] = '<link rel="stylesheet" type="text/css" href="' .
                        t3lib_div::createVersionNumberedFilename($this->backPath .
@@ -7630,24 +7626,16 @@ $out="
                                t3lib_div::createVersionNumberedFilename($this->backPath .
                                        'sysext/install/Resources/Public/Stylesheets/install.css'
                                ) . '" />';
-                       if (!$this->session->inBackend()) {
+               } else {                        
                                $this->stylesheets[] = '<link rel="stylesheet" type="text/css" href="' .
                                        t3lib_div::createVersionNumberedFilename($this->backPath .
-                                               'sysext/install/Resources/Public/Stylesheets/install_standalone.css'
+                                       'sysext/install/Resources/Public/Stylesheets/install.css'
                                        ) . '" />';
-                       }
-               } else {
                        $this->stylesheets[] = '<link rel="stylesheet" type="text/css" href="' .
                                t3lib_div::createVersionNumberedFilename($this->backPath .
                                        'sysext/install/Resources/Public/Stylesheets/install_login.css'
                                ) . '" />';
-                       if (!$this->session->inBackend()) {
-                               $this->stylesheets[] = '<link rel="stylesheet" type="text/css" href="' .
-                                       t3lib_div::createVersionNumberedFilename($this->backPath .
-                                               'sysext/install/Resources/Public/Stylesheets/install_standalone.css'
-                                       ) . '" />';
                        }
-               }
 
                        // Include javascript message
                $this->javascript[] = $this->JSmessage ?
index 248f0eb..a47113e 100644 (file)
@@ -144,13 +144,6 @@ class tx_install_session {
        public function startSession() {
                $_SESSION['created'] = time();
 
-               $referer = parse_url(t3lib_div::getIndpEnv('HTTP_REFERER'));
-               if (strpos($referer['path'], $this->backendFile)) {
-                       $_SESSION['backend'] = TRUE;
-               } else {
-                       $_SESSION['backend'] = FALSE;
-               }
-
                return session_id();
        }
 
@@ -255,18 +248,6 @@ class tx_install_session {
        }
 
        /**
-        * Check if the install tool is called in the backend
-        *
-        * @return boolean True if the install tool has been called from the backend
-        */
-       public function inBackend() {
-               if ($_SESSION['backend']) {
-                       return TRUE;
-               }
-               return FALSE;
-       }
-
-       /**
         * Refreshes our session information, rising the expire time.
         * Also generates a new session ID every 5 minutes to minimize the risk of
         * session hijacking.