itopwizardwebpage.class.inc.php 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. require_once('itopwebpage.class.inc.php');
  3. /**
  4. * Web page to display a wizard in the iTop framework
  5. */
  6. class iTopWizardWebPage extends iTopWebPage
  7. {
  8. var $m_iCurrentStep;
  9. var $m_aSteps;
  10. public function __construct($sTitle, $currentOrganization, $iCurrentStep, $aSteps)
  11. {
  12. parent::__construct($sTitle." - step $iCurrentStep of ".count($aSteps)." - ".$aSteps[$iCurrentStep - 1], $currentOrganization);
  13. $this->m_iCurrentStep = $iCurrentStep;
  14. $this->m_aSteps = $aSteps;
  15. }
  16. public function output()
  17. {
  18. $aSteps = array();
  19. $iIndex = 0;
  20. foreach($this->m_aSteps as $sStepTitle)
  21. {
  22. $iIndex++;
  23. $sStyle = ($iIndex == $this->m_iCurrentStep) ? 'wizActiveStep' : 'wizStep';
  24. $aSteps[] = "<div class=\"$sStyle\"><span>$sStepTitle</span></div>";
  25. }
  26. $sWizardHeader = "<div class=\"wizHeader\"><h1>{$this->s_title}</h1>\n".implode("<div class=\"wizSeparator\"><img align=\"bottom\" src=\"/images/wizArrow.gif\"></div>", $aSteps)."<br style=\"clear:both;\"/></div>\n";
  27. $this->s_content = "$sWizardHeader<div class=\"wizContainer\">".$this->s_content."</div>";
  28. parent::output();
  29. }
  30. }
  31. ?>