[FEATURE] Install tool: Left menu at fixed position 98/23798/10
authorErnesto Baschny <ernst@cron-it.de>
Fri, 13 Sep 2013 17:26:09 +0000 (19:26 +0200)
committerErnesto Baschny <ernst@cron-it.de>
Fri, 13 Sep 2013 20:57:19 +0000 (22:57 +0200)
* Streamlines install tool main template.
* Adds a ContextService and use that in the templates.
  No more huge if/then/else constructs to differentiate
  standalone and backend modes.
* Fixes the left menu (and TYPO3 logo), letting the
  rest scroll up and down.
* In backend mode the menu and content starts right on top
  (no further headers to make scrolling look good)

Releases: 6.2
Resolves: #50910
Change-Id: Ie2ec277026a82332b533af51a37e7f308dd24e8c
Reviewed-on: https://review.typo3.org/23798
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Ernesto Baschny
Tested-by: Ernesto Baschny
typo3/sysext/install/Classes/Controller/Action/AbstractAction.php
typo3/sysext/install/Classes/Service/ContextService.php [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Layouts/ToolAuthenticated.html
typo3/sysext/install/Resources/Private/Partials/Action/Common/Head.html
typo3/sysext/install/Resources/Private/Templates/Action/Common/Login.html
typo3/sysext/install/Resources/Private/Templates/Action/Tool/Welcome.html
typo3/sysext/install/Resources/Public/Stylesheets/Action/Common/Install.css [changed mode: 0755->0644]
typo3/sysext/install/Resources/Public/Stylesheets/Action/Common/Login.css

index bb3ef82..b56ea7c 100644 (file)
@@ -79,6 +79,7 @@ abstract class AbstractAction {
                $statusObjects = $statusCheck->getStatus();
                $statusUtility = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\StatusUtility');
                $statusObjectsWithErrorStatus = $statusUtility->filterBySeverity($statusObjects, 'error');
+               $contextService = $this->objectManager->get('TYPO3\\CMS\\Install\\Service\\ContextService');
 
                $viewRootPath = GeneralUtility::getFileAbsFileName('EXT:install/Resources/Private/');
                $controllerActionDirectoryName = ucfirst($this->controller);
@@ -92,7 +93,8 @@ abstract class AbstractAction {
                        ->assign('action', $this->action)
                        ->assign('controller', $this->controller)
                        ->assign('token', $this->token)
-                       ->assign('context', $this->getContext())
+                       ->assign('context', $contextService->getContextString())
+                       ->assign('contextService', $contextService)
                        ->assign('messages', $this->messages)
                        ->assign('typo3Version', TYPO3_version)
                        ->assign('siteName', $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'])
diff --git a/typo3/sysext/install/Classes/Service/ContextService.php b/typo3/sysext/install/Classes/Service/ContextService.php
new file mode 100644 (file)
index 0000000..9b774b5
--- /dev/null
@@ -0,0 +1,76 @@
+<?php
+namespace TYPO3\CMS\Install\Service;
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Ernesto Baschny <ernst@cron-it.de>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+/**
+ * Service for determining the current context (as a backend module or in standalone mode)
+ */
+class ContextService {
+
+       /**
+        * @var bool
+        */
+       private $backendContext = FALSE;
+
+       /**
+        * Constructor, prepare the context information
+        */
+       public function __construct() {
+               $formValues = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('install');
+               if (isset($formValues['context'])) {
+                       $this->backendContext = ($formValues['context'] === 'backend');
+               }
+       }
+
+       /**
+        * Is the install tool running in the backend?
+        *
+        * @return boolean
+        */
+       public function isBackendContext() {
+               return $this->backendContext;
+       }
+
+       /**
+        * Is the install tool running as a standalone application?
+        *
+        * @return boolean
+        */
+       public function isStandaloneContext() {
+               return !$this->backendContext;
+       }
+
+       /**
+        * Is the install tool running as a standalone application?
+        *
+        * @return boolean
+        */
+       public function getContextString() {
+               return ( $this->isBackendContext() ? 'backend' : 'standalone' );
+       }
+}
+
+?>
\ No newline at end of file
index f6ce8b8..29e75fe 100644 (file)
@@ -1,55 +1,36 @@
-<f:if condition="{context} == 'backend'">
-       <f:then>
-               <!DOCTYPE html>
-               <html>
-                       <head>
-                               <title>Install tool on site {siteName}</title>
-                               <f:render partial="Action/Common/Headers" arguments="{_all}" />
+<!DOCTYPE html>
+<html>
+       <head>
+               <title>Install tool on site {siteName}</title>
+               <f:render partial="Action/Common/Headers" arguments="{_all}" />
+               <f:if condition="{contextService.backendContext}">
+                       <f:then>
                                <link rel="stylesheet" type="text/css" href="../../../sysext/t3skin/Resources/Public/Css/visual/element_docheader.css?{time}" />
                                <link rel="stylesheet" type="text/css" href="../../../sysext/t3skin/Resources/Public/Css/structure/element_docheader.css?{time}" />
                                <link rel="stylesheet" type="text/css" href="../../../sysext/t3skin/Resources/Public/Css/structure/main_body.css?{time}" />
-                       </head>
-                       <body>
-                               <div id="typo3-docheader">
-                                       <div class="typo3-docheader-functions"></div>
-                                       <div class="typo3-docheader-buttons"></div>
-                               </div>
-                               <div id="typo3-docbody">
-                                       <div id="typo3-inner-docbody">
-                                               <div id="t3-install-outer">
-                                                       <f:render partial="Action/Common/Head" arguments="{_all}" />
-                                                       <f:render partial="Action/Common/Left" arguments="{_all}" />
-                                                       <div id="t3-install-right">
-                                                               <div id="t3-install-box-body">
-                                                                       <f:render section="Content" />
-                                                               </div>
-                                                       </div>
-                                                       <f:render partial="Action/Common/Copyright" arguments="{_all}" />
-                                               </div>
-                                       </div>
-                               </div>
-                       </body>
-               </html>
-       </f:then>
-       <f:else>
-               <!DOCTYPE html>
-               <html>
-                       <head>
-                               <title>Install tool on site {siteName}</title>
-                               <f:render partial="Action/Common/Headers" arguments="{_all}" />
-                       </head>
-                       <body class="standalone">
-                               <div id="t3-install-outer">
-                                       <f:render partial="Action/Common/Head" arguments="{_all}" />
-                                       <f:render partial="Action/Common/Left" arguments="{_all}" />
-                                       <div id="t3-install-right">
-                                               <div id="t3-install-box-body">
-                                                       <f:render section="Content" />
-                                               </div>
+                       </f:then>
+               </f:if>
+       </head>
+       <body class="{context}">
+       <f:if condition="{contextService.backendContext}">
+               <div id="typo3-docheader">
+                       <div class="typo3-docheader-functions"></div>
+                       <div class="typo3-docheader-buttons"></div>
+               </div>
+       </f:if>
+       <div id="typo3-docbody">
+               <div id="t3-install-outer">
+                       <f:render partial="Action/Common/Head" arguments="{_all}" />
+                       <div id="t3-install-center">
+                               <f:render partial="Action/Common/Left" arguments="{_all}" />
+                               <div id="t3-install-right">
+                                       <div id="t3-install-box-body">
+                                               <f:render section="Content" />
                                        </div>
                                        <f:render partial="Action/Common/Copyright" arguments="{_all}" />
                                </div>
-                       </body>
-               </html>
-       </f:else>
-</f:if>
\ No newline at end of file
+                       </div>
+               </div>
+       </div>
+       </body>
+</html>
index a128473..6a9598f 100644 (file)
@@ -1,2 +1,8 @@
-<h1>TYPO3 {typo3Version}</h1>
-<h2>TYPO3 CMS {typo3Version} Install tool on site: {siteName}</h2>
\ No newline at end of file
+<div id="t3-install-head">
+   <div id="t3-install-logo">
+               <h1>TYPO3 CMS {typo3Version}</h1>
+       </div>
+       <div id="t3-install-headline">
+               <h2>TYPO3 CMS {typo3Version} Install tool on site: {siteName}</h2>
+       </div>
+</div>
\ No newline at end of file
index 1502b62..0032d4b 100644 (file)
@@ -7,46 +7,29 @@
        if called by the backend, or a the standalone content if not.
 </f:comment>
 
-<f:if condition="{context} == 'backend'">
-       <f:then>
-               <!DOCTYPE html>
-               <html>
-               <head>
-                       <title>Install tool login</title>
-                       <f:render partial="Action/Common/Headers" arguments="{_all}" />
-                       <link rel="stylesheet" type="text/css" href="../Resources/Public/Stylesheets/Action/Common/Login.css?{time}" />
-                       <link rel="stylesheet" type="text/css" href="../../../sysext/t3skin/Resources/Public/Css/visual/element_docheader.css?{time}" />
-                       <link rel="stylesheet" type="text/css" href="../../../sysext/t3skin/Resources/Public/Css/structure/element_docheader.css?{time}" />
-                       <link rel="stylesheet" type="text/css" href="../../../sysext/t3skin/Resources/Public/Css/structure/main_body.css?{time}" />
-               </head>
-               <body>
+<!DOCTYPE html>
+<html>
+<head>
+       <title>Install tool login</title>
+       <f:render partial="Action/Common/Headers" arguments="{_all}" />
+       <link rel="stylesheet" type="text/css" href="../Resources/Public/Stylesheets/Action/Common/Login.css?{time}" />
+       <f:if condition="{contextService.backendContext}">
+               <link rel="stylesheet" type="text/css" href="../../../sysext/t3skin/Resources/Public/Css/visual/element_docheader.css?{time}" />
+               <link rel="stylesheet" type="text/css" href="../../../sysext/t3skin/Resources/Public/Css/structure/element_docheader.css?{time}" />
+               <link rel="stylesheet" type="text/css" href="../../../sysext/t3skin/Resources/Public/Css/structure/main_body.css?{time}" />
+       </f:if>
+</head>
+<body class="{context}">
+       <f:if condition="{contextService.backendContext}">
                <div id="typo3-docheader">
                        <div class="typo3-docheader-functions"></div>
                        <div class="typo3-docheader-buttons"></div>
                </div>
-               <div id="typo3-docbody">
-                       <div id="typo3-inner-docbody">
-                               <div id="t3-install-outer" class="t3-install-login">
-                                       <f:render partial="Action/Common/LoginForm.html" arguments="{_all}" />
-                               </div>
-                       </div>
-               </div>
-               </body>
-               </html>
-       </f:then>
-       <f:else>
-               <!DOCTYPE html>
-               <html>
-               <head>
-                       <title>Install tool login</title>
-                       <f:render partial="Action/Common/Headers" arguments="{_all}" />
-                       <link rel="stylesheet" type="text/css" href="../Resources/Public/Stylesheets/Action/Common/Login.css?{time}" />
-               </head>
-               <body class="standalone">
+       </f:if>
+       <div id="typo3-docbody">
                <div id="t3-install-outer" class="t3-install-login">
                        <f:render partial="Action/Common/LoginForm.html" arguments="{_all}" />
                </div>
-               </body>
-               </html>
-       </f:else>
-</f:if>
\ No newline at end of file
+       </div>
+</body>
+</html>
index 8a9c7de..2ffa655 100644 (file)
@@ -3,7 +3,14 @@
 <f:layout name="ToolAuthenticated" />
 
 <f:section name="Content">
-       <h3>Welcome</h3>
+       <f:if condition="{contextService.standaloneContext}">
+               <f:then>
+                       <h3>Welcome</h3>
+               </f:then>
+               <f:else>
+                       <h3>TYPO3 CMS {typo3Version} Install tool on site: {siteName}
+               </f:else>
+       </f:if>
 
        <h4>How to configure TYPO3</h4>
        <p>
old mode 100755 (executable)
new mode 100644 (file)
index 56539b9..eef3ac8
@@ -23,6 +23,12 @@ table, caption, tbody, tfoot, thead, tr, th, td {
 body {
        line-height: 1;
 }
+body.standalone {
+       overflow-y: scroll;
+}
+body.backend #typo3-docbody {
+       overflow-y: scroll;
+}
 ol, ul {
        list-style: none;
 }
@@ -256,14 +262,38 @@ button span.t3-install-form-button-icon-negative {
        margin: 1em auto;
 }
 
-#t3-install-left {
-       float: left;
+#t3-install-head {
+       position: fixed;
+}
+
+#t3-install-logo {
        width: 19em;
+       float: left;
+       height: 100px;
+}
+
+#t3-install-headline {
+       width: 57em;
+       float: left;
+}
+
+#t3-install-center {
+       position: absolute;
        clear: both;
 }
 
+.standalone #t3-install-center {
+       top: 100px;
+}
+
+#t3-install-left {
+       width: 19em;
+       position: fixed;
+}
+
 #t3-install-right {
        padding-left: 19em;
+       margin-bottom: 1em;
        width: 57em;
 }
 
@@ -480,7 +510,7 @@ body {
        background-color: #f2f2f2;
 }
 
-h1,
+#t3-install-head,
 #t3-install-menu-border-top,
 #t3-install-menu-bottom,
 #t3-install-links,
@@ -575,7 +605,7 @@ body.standalone #t3-install-outer {
        margin: 0 auto;
 }
 
-body.standalone h1,
+body.standalone #t3-install-head,
 body.standalone #t3-install-menu-border-top,
 body.standalone #t3-install-menu-bottom,
 body.standalone #t3-install-links,
@@ -598,15 +628,15 @@ body.standalone #t3-install-form-login .t3-install-form-submit {
 body.standalone h1 {
        background: url('../../../Images/Background/Logo.gif') no-repeat scroll 0 0 transparent;
        text-indent:-999em;
-       margin: 2em 0 3.7em 0;
+       margin: 2.5em 0 3.7em 0;
        height: 34px;
        width: 19em;
        float: left;
 }
 
 body.standalone h2 {
-       padding: 3.3em 0 3.7em 17.5em;
-       margin: 0;
+       margin: 3.3em 0 0 1.8em;
+       padding: 0;
        height: auto;
        color: #ffffff;
 }
index 45d4259..1122361 100644 (file)
@@ -9,7 +9,6 @@ body {
        margin: 7em auto auto auto;
 }
 
-h1,
 #t3-install-box-border-top,
 #t3-install-box-border-bottom {
        display: none;