[TASK] Use fully qualified name resolution in PHP 5.5
[Packages/TYPO3.CMS.git] / typo3 / sysext / install / Classes / Controller / Action / Step / AbstractStepAction.php
1 <?php
2 namespace TYPO3\CMS\Install\Controller\Action\Step;
3
4 /**
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 /**
18 * General purpose Step controller action
19 */
20 abstract class AbstractStepAction extends \TYPO3\CMS\Install\Controller\Action\AbstractAction implements StepInterface {
21
22 /**
23 * @var int Current step position
24 */
25 protected $currentStep = 0;
26
27 /**
28 * @var int Total number of available steps
29 */
30 protected $totalSteps = 0;
31
32 /**
33 * Tell the action which position it has in the list of actions
34 *
35 * @param int $current The current position
36 * @param int $total The total number of steps
37 * @return void
38 */
39 public function setStepsCounter($current, $total) {
40 $this->currentStep = $current;
41 $this->totalSteps = $total;
42 }
43
44 /**
45 * Gets current position
46 *
47 * @return int
48 */
49 public function getCurrentStep() {
50 return $this->currentStep;
51 }
52
53 /**
54 * Gets total steps
55 *
56 * @return int
57 */
58 public function getTotalSteps() {
59 return $this->totalSteps;
60 }
61
62 /**
63 * @return void
64 */
65 protected function assignSteps() {
66 $steps = array();
67 $currentStep = $this->getCurrentStep();
68 $totalSteps = $this->getTotalSteps();
69 for ($i = 1; $i <= $totalSteps; $i++) {
70 $class = '';
71 if ($i == $currentStep) {
72 $class = 'cur';
73 } elseif ($i < $currentStep) {
74 $class = 'prev';
75 }
76 $steps[] = array(
77 'number' => $i,
78 'class' => $class,
79 'total' => $totalSteps,
80 );
81 }
82 $this->view->assign('steps', $steps);
83 }
84 }