TYPO3 CMS  TYPO3_6-2
AbstractStepAction.php
Go to the documentation of this file.
1 <?php
3 
21 
25  protected $currentStep = 0;
26 
30  protected $totalSteps = 0;
31 
39  public function setStepsCounter($current, $total) {
40  $this->currentStep = $current;
41  $this->totalSteps = $total;
42  }
43 
49  public function getCurrentStep() {
50  return $this->currentStep;
51  }
52 
58  public function getTotalSteps() {
59  return $this->totalSteps;
60  }
61 
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 }