diff --git a/typo3/sysext/install/Classes/Controller/Action/Step/AbstractStepAction.php b/typo3/sysext/install/Classes/Controller/Action/Step/AbstractStepAction.php index e982079056ca0970489b075a6edadcc4127eabe9..f650bd0af821f5e21f340a6a3bd927284d277297 100644 --- a/typo3/sysext/install/Classes/Controller/Action/Step/AbstractStepAction.php +++ b/typo3/sysext/install/Classes/Controller/Action/Step/AbstractStepAction.php @@ -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); + } } diff --git a/typo3/sysext/install/Classes/Controller/Action/Step/DatabaseConnect.php b/typo3/sysext/install/Classes/Controller/Action/Step/DatabaseConnect.php index 37f3a3f108ffdacc88c0804b6b9a66564130622a..2471c5c76d55c5adc5ea716e3a18d706dcbd0eaa 100644 --- a/typo3/sysext/install/Classes/Controller/Action/Step/DatabaseConnect.php +++ b/typo3/sysext/install/Classes/Controller/Action/Step/DatabaseConnect.php @@ -246,6 +246,7 @@ class DatabaseConnect extends AbstractStepAction { ->assign('renderConnectDetailsPort', TRUE) ->assign('renderConnectDetailsSocket', TRUE); } + $this->assignSteps(); return $this->view->render(); } diff --git a/typo3/sysext/install/Classes/Controller/Action/Step/DatabaseData.php b/typo3/sysext/install/Classes/Controller/Action/Step/DatabaseData.php index 6d3af1a39d93435859234165022f90dc8ae9a5ef..0d147ca5ae96dca9182daae65461f47618add858 100644 --- a/typo3/sysext/install/Classes/Controller/Action/Step/DatabaseData.php +++ b/typo3/sysext/install/Classes/Controller/Action/Step/DatabaseData.php @@ -101,6 +101,7 @@ class DatabaseData extends AbstractStepAction { * @return string Rendered content */ protected function executeAction() { + $this->assignSteps(); return $this->view->render(); } diff --git a/typo3/sysext/install/Classes/Controller/Action/Step/DatabaseSelect.php b/typo3/sysext/install/Classes/Controller/Action/Step/DatabaseSelect.php index 62d6f0625f09b790941a7b59bbd25a85ce07b11e..04845da24d08556dc81644f9a9565787ddc331af 100644 --- a/typo3/sysext/install/Classes/Controller/Action/Step/DatabaseSelect.php +++ b/typo3/sysext/install/Classes/Controller/Action/Step/DatabaseSelect.php @@ -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(); } diff --git a/typo3/sysext/install/Classes/Controller/Action/Step/DefaultConfiguration.php b/typo3/sysext/install/Classes/Controller/Action/Step/DefaultConfiguration.php index 38ce12949a65c609077dbbd1d05886f554122d5a..eb5210b8f254b3a76e44ca800908f2e0c7d51095 100644 --- a/typo3/sysext/install/Classes/Controller/Action/Step/DefaultConfiguration.php +++ b/typo3/sysext/install/Classes/Controller/Action/Step/DefaultConfiguration.php @@ -99,6 +99,7 @@ class DefaultConfiguration extends AbstractStepAction { * @return string Rendered content */ protected function executeAction() { + $this->assignSteps(); return $this->view->render(); } } diff --git a/typo3/sysext/install/Classes/Controller/Action/Step/EnvironmentAndFolders.php b/typo3/sysext/install/Classes/Controller/Action/Step/EnvironmentAndFolders.php index 808a10f3e20432baf9880b70313aadf04102b290..670d8422d4091dccfbcdb3addbe2ea29d809185e 100644 --- a/typo3/sysext/install/Classes/Controller/Action/Step/EnvironmentAndFolders.php +++ b/typo3/sysext/install/Classes/Controller/Action/Step/EnvironmentAndFolders.php @@ -125,6 +125,7 @@ class EnvironmentAndFolders extends AbstractStepAction { ) { $this->view->assign('errorsOrWarningsFromStatus', TRUE); } + $this->assignSteps(); return $this->view->render(!empty($alerts)); } diff --git a/typo3/sysext/install/Classes/Controller/Action/Step/StepInterface.php b/typo3/sysext/install/Classes/Controller/Action/Step/StepInterface.php index 5e0cf47de2d9b43c47dcc56ba8d840463c41d98f..e3291d37b0831c5d373883d6452a22731f7d4070 100644 --- a/typo3/sysext/install/Classes/Controller/Action/Step/StepInterface.php +++ b/typo3/sysext/install/Classes/Controller/Action/Step/StepInterface.php @@ -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(); } diff --git a/typo3/sysext/install/Classes/Controller/StepController.php b/typo3/sysext/install/Classes/Controller/StepController.php index 71426797d735b41172f29da625aa121c17285fe2..6496a2915463a917f7a8523d02600bcef2d0ebf8 100644 --- a/typo3/sysext/install/Classes/Controller/StepController.php +++ b/typo3/sysext/install/Classes/Controller/StepController.php @@ -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 index 0000000000000000000000000000000000000000..5388ffa037636f317322c437764a06634ca46dc7 --- /dev/null +++ b/typo3/sysext/install/Resources/Private/Partials/Action/Step/StepCounter.html @@ -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> diff --git a/typo3/sysext/install/Resources/Private/Templates/Action/Step/DatabaseConnect.html b/typo3/sysext/install/Resources/Private/Templates/Action/Step/DatabaseConnect.html index da5a160e75c7ef40897921aa31f68f4aa2f93dd5..83f2eec98d494fc709d8df6014513b38f3d452f3 100644 --- a/typo3/sysext/install/Resources/Private/Templates/Action/Step/DatabaseConnect.html +++ b/typo3/sysext/install/Resources/Private/Templates/Action/Step/DatabaseConnect.html @@ -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. diff --git a/typo3/sysext/install/Resources/Private/Templates/Action/Step/DatabaseData.html b/typo3/sysext/install/Resources/Private/Templates/Action/Step/DatabaseData.html index 5d747a48fbebb2c3f4f664740414048d68e3d6a8..38ba85048689c98b4f47c20e5a89e13356dd434a 100644 --- a/typo3/sysext/install/Resources/Private/Templates/Action/Step/DatabaseData.html +++ b/typo3/sysext/install/Resources/Private/Templates/Action/Step/DatabaseData.html @@ -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> diff --git a/typo3/sysext/install/Resources/Private/Templates/Action/Step/DatabaseSelect.html b/typo3/sysext/install/Resources/Private/Templates/Action/Step/DatabaseSelect.html index a39b4a4614b46a0a289fa2985005ff5b476e577e..858b7437cf0c68e021085e6fbae150e9ef19ca27 100644 --- a/typo3/sysext/install/Resources/Private/Templates/Action/Step/DatabaseSelect.html +++ b/typo3/sysext/install/Resources/Private/Templates/Action/Step/DatabaseSelect.html @@ -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}"> diff --git a/typo3/sysext/install/Resources/Private/Templates/Action/Step/DefaultConfiguration.html b/typo3/sysext/install/Resources/Private/Templates/Action/Step/DefaultConfiguration.html index a88df95f0ffe494e13592a3d4005e790b7c605ac..fbf52a5ff86b50b2e56c1896375fc5ae670587bd 100644 --- a/typo3/sysext/install/Resources/Private/Templates/Action/Step/DefaultConfiguration.html +++ b/typo3/sysext/install/Resources/Private/Templates/Action/Step/DefaultConfiguration.html @@ -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> diff --git a/typo3/sysext/install/Resources/Private/Templates/Action/Step/EnvironmentAndFolders.html b/typo3/sysext/install/Resources/Private/Templates/Action/Step/EnvironmentAndFolders.html index ce3e1a53bf1c55a5376c9e46c3b2a7c7c9fdbda7..7d962470e24831f18be38a4ae770cf8a1fd04ce2 100644 --- a/typo3/sysext/install/Resources/Private/Templates/Action/Step/EnvironmentAndFolders.html +++ b/typo3/sysext/install/Resources/Private/Templates/Action/Step/EnvironmentAndFolders.html @@ -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> diff --git a/typo3/sysext/install/Resources/Public/Stylesheets/Action/Step/General.css b/typo3/sysext/install/Resources/Public/Stylesheets/Action/Step/General.css index 8162b7328b8ac532af16cfc9e41a74073f0fee4f..079661ee9cac9aa9978caabce239495dca90d239 100644 --- a/typo3/sysext/install/Resources/Public/Stylesheets/Action/Step/General.css +++ b/typo3/sysext/install/Resources/Public/Stylesheets/Action/Step/General.css @@ -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; +}