[TASK] Re-added the 1-2-3 bullets in the Step Installer 25/28425/4
authorErnesto Baschny <ernst@cron-it.de>
Wed, 12 Mar 2014 18:36:04 +0000 (19:36 +0100)
committerNicole Cordes <typo3@cordes.co>
Fri, 21 Mar 2014 23:34:34 +0000 (00:34 +0100)
Resolves: #56941
Releases: 6.2
Change-Id: I5dfabf2c5df8c495fbdce30cb170260d2656e6b4
Reviewed-on: https://review.typo3.org/28425
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
Reviewed-by: Nicole Cordes
Tested-by: Nicole Cordes
15 files changed:
typo3/sysext/install/Classes/Controller/Action/Step/AbstractStepAction.php
typo3/sysext/install/Classes/Controller/Action/Step/DatabaseConnect.php
typo3/sysext/install/Classes/Controller/Action/Step/DatabaseData.php
typo3/sysext/install/Classes/Controller/Action/Step/DatabaseSelect.php
typo3/sysext/install/Classes/Controller/Action/Step/DefaultConfiguration.php
typo3/sysext/install/Classes/Controller/Action/Step/EnvironmentAndFolders.php
typo3/sysext/install/Classes/Controller/Action/Step/StepInterface.php
typo3/sysext/install/Classes/Controller/StepController.php
typo3/sysext/install/Resources/Private/Partials/Action/Step/StepCounter.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Templates/Action/Step/DatabaseConnect.html
typo3/sysext/install/Resources/Private/Templates/Action/Step/DatabaseData.html
typo3/sysext/install/Resources/Private/Templates/Action/Step/DatabaseSelect.html
typo3/sysext/install/Resources/Private/Templates/Action/Step/DefaultConfiguration.html
typo3/sysext/install/Resources/Private/Templates/Action/Step/EnvironmentAndFolders.html
typo3/sysext/install/Resources/Public/Stylesheets/Action/Step/General.css

index e982079..f650bd0 100644 (file)
@@ -29,4 +29,66 @@ namespace TYPO3\CMS\Install\Controller\Action\Step;
  */
 abstract class AbstractStepAction extends \TYPO3\CMS\Install\Controller\Action\AbstractAction implements StepInterface {
 
+       /**
+        * @var int Current step position
+        */
+       protected $currentStep = 0;
+
+       /**
+        * @var int Total number of available steps
+        */
+       protected $totalSteps = 0;
+
+       /**
+        * Tell the action which position it has in the list of actions
+        *
+        * @param int $current The current position
+        * @param int $total The total number of steps
+        * @return void
+        */
+       public function setStepsCounter($current, $total) {
+               $this->currentStep = $current;
+               $this->totalSteps = $total;
+       }
+
+       /**
+        * Gets current position
+        *
+        * @return int
+        */
+       public function getCurrentStep() {
+               return $this->currentStep;
+       }
+
+       /**
+        * Gets total steps
+        *
+        * @return int
+        */
+       public function getTotalSteps() {
+               return $this->totalSteps;
+       }
+
+       /**
+        * @return void
+        */
+       protected function assignSteps() {
+               $steps = array();
+               $currentStep = $this->getCurrentStep();
+               $totalSteps = $this->getTotalSteps();
+               for ($i = 1; $i <= $totalSteps; $i++) {
+                       $class = '';
+                       if ($i == $currentStep) {
+                               $class = 'cur';
+                       } elseif ($i < $currentStep) {
+                               $class = 'prev';
+                       }
+                       $steps[] = array(
+                               'number' => $i,
+                               'class' => $class,
+                               'total' => $totalSteps,
+                       );
+               }
+               $this->view->assign('steps', $steps);
+       }
 }
index 37f3a3f..2471c5c 100644 (file)
@@ -246,6 +246,7 @@ class DatabaseConnect extends AbstractStepAction {
                                ->assign('renderConnectDetailsPort', TRUE)
                                ->assign('renderConnectDetailsSocket', TRUE);
                }
+               $this->assignSteps();
 
                return $this->view->render();
        }
index 6d3af1a..0d147ca 100644 (file)
@@ -101,6 +101,7 @@ class DatabaseData extends AbstractStepAction {
         * @return string Rendered content
         */
        protected function executeAction() {
+               $this->assignSteps();
                return $this->view->render();
        }
 
index 62d6f06..04845da 100644 (file)
@@ -131,6 +131,7 @@ class DatabaseSelect extends AbstractStepAction {
                $isInitialInstallationInProgress = $configurationManager->getConfigurationValueByPath('SYS/isInitialInstallationInProgress');
                $this->view->assign('databaseList', $this->getDatabaseList($isInitialInstallationInProgress));
                $this->view->assign('isInitialInstallationInProgress', $isInitialInstallationInProgress);
+               $this->assignSteps();
                return $this->view->render();
        }
 
index 38ce129..eb5210b 100644 (file)
@@ -99,6 +99,7 @@ class DefaultConfiguration extends AbstractStepAction {
         * @return string Rendered content
         */
        protected function executeAction() {
+               $this->assignSteps();
                return $this->view->render();
        }
 }
index 808a10f..670d842 100644 (file)
@@ -125,6 +125,7 @@ class EnvironmentAndFolders extends AbstractStepAction {
                ) {
                        $this->view->assign('errorsOrWarningsFromStatus', TRUE);
                }
+               $this->assignSteps();
 
                return $this->view->render(!empty($alerts));
        }
index 5e0cf47..e3291d3 100644 (file)
@@ -43,4 +43,27 @@ interface StepInterface {
         * @return boolean TRUE if this step needs to be executed
         */
        public function needsExecution();
+
+       /**
+        * Tell the action which position it has in the list of actions
+        *
+        * @param int $current The current position
+        * @param int $total The total number of steps
+        * @return void
+        */
+       public function setStepsCounter($current, $total);
+
+       /**
+        * Gets current position
+        *
+        * @return int
+        */
+       public function getCurrentStep();
+
+       /**
+        * Gets total steps
+        *
+        * @return int
+        */
+       public function getTotalSteps();
 }
index 7142679..6496a29 100644 (file)
@@ -123,6 +123,11 @@ class StepController extends AbstractController {
                }
 
                if ($needsExecution) {
+                       if ($this->isInitialInstallationInProgress()) {
+                               $currentStep = (array_search($action, $this->authenticationActions) + 1);
+                               $totalSteps = count($this->authenticationActions);
+                               $stepAction->setStepsCounter($currentStep, $totalSteps);
+                       }
                        $stepAction->setMessages($this->session->getMessagesAndFlush());
                        $this->output($stepAction->handle());
                } else {
@@ -387,6 +392,11 @@ class StepController extends AbstractController {
                ) {
                        /** @var \TYPO3\CMS\Install\Controller\Action\Step\StepInterface $action */
                        $action = $this->objectManager->get('TYPO3\\CMS\\Install\\Controller\\Action\\Step\\EnvironmentAndFolders');
+                       if ($this->isInitialInstallationInProgress()) {
+                               $currentStep = (array_search('environmentAndFolders', $this->authenticationActions) + 1);
+                               $totalSteps = count($this->authenticationActions);
+                               $action->setStepsCounter($currentStep, $totalSteps);
+                       }
                        $action->setController('step');
                        $action->setAction('environmentAndFolders');
                        if (count($errorMessagesFromExecute) > 0) {
diff --git a/typo3/sysext/install/Resources/Private/Partials/Action/Step/StepCounter.html b/typo3/sysext/install/Resources/Private/Partials/Action/Step/StepCounter.html
new file mode 100644 (file)
index 0000000..5388ffa
--- /dev/null
@@ -0,0 +1,5 @@
+<ul class="steps_123">
+       <f:for each="{steps}" as="step">
+               <li class="{step.class}"><span>{step.number}</span></li>
+       </f:for>
+</ul>
index da5a160..83f2eec 100644 (file)
@@ -3,7 +3,9 @@
 <f:layout name="Step" />
 
 <f:section name="Content">
-       <h3>Database connection:</h3>
+       <f:render partial="Action/Step/StepCounter.html" arguments="{steps: steps}" />
+
+       <h3>Database connection</h3>
 
        <p>
                If you have not already created a username and password to access the database, please do so now.
index 5d747a4..38ba850 100644 (file)
@@ -3,6 +3,7 @@
 <f:layout name="Step" />
 
 <f:section name="Content">
+       <f:render partial="Action/Step/StepCounter.html" arguments="{steps: steps}" />
 
        <h3>Create user and import base data</h3>
 
index a39b4a4..858b743 100644 (file)
@@ -3,6 +3,8 @@
 <f:layout name="Step" />
 
 <f:section name="Content">
+       <f:render partial="Action/Step/StepCounter.html" arguments="{steps: steps}" />
+
        <h3>Select database</h3>
 
        <f:if condition="{isInitialInstallationInProgress}">
index a88df95..fbf52a5 100644 (file)
@@ -3,6 +3,8 @@
 <f:layout name="Step" />
 
 <f:section name="Content">
+       <f:render partial="Action/Step/StepCounter.html" arguments="{steps: steps}" />
+
        <h3>Installation done!</h3>
 
        <p>
index ce3e1a5..7d96247 100644 (file)
@@ -3,6 +3,8 @@
 <f:layout name="Step" />
 
 <f:section name="Content">
+       <f:render partial="Action/Step/StepCounter.html" arguments="{steps: steps}" />
+
        <h3>System environment check</h3>
 
        <p>
index 8162b73..079661e 100644 (file)
@@ -288,7 +288,8 @@ button span.t3-install-form-button-icon-negative {
 }
 
 #t3-install-box-body h3 {
-       margin: 0.75em 0 2em;
+       margin: 0.75em 0 1em;
+       clear: left;
 }
 
 .t3-install-login #t3-install-box-body h3 {
@@ -427,3 +428,34 @@ h3 {
 #stepInstaller-databaseSelect ul li input.radio {
        vertical-align: top;
 }
+
+#t3-install-box-body .steps_123 {
+       list-style: none;
+       padding: 0;
+       margin: 0.5em 0 0 0;
+       font-size: 25px;
+}
+#t3-install-box-body .steps_123 li {
+       float: left;
+       text-align: center;
+       width: 40px;
+       height: 30px;
+       margin-right: 10px;
+       padding-bottom: 1em;
+}
+#t3-install-box-body .steps_123 li span {
+       background-color: #d1d1d1;
+       padding-top: 10px;
+       width: 100%;
+       height: 100%;
+       display: block;
+       text-decoration: none !important;
+       color: #fff !important;
+       border-radius: 50px;
+}
+#t3-install-box-body .steps_123 li.cur span {
+       background-color: #FF8700;
+}
+#t3-install-box-body .steps_123 li.prev span {
+       background-color: #585858;
+}