* @author Romain Quetiez * @author Denis Flaven * @license http://www.opensource.org/licenses/gpl-3.0.html LGPL */ require_once('itopwebpage.class.inc.php'); /** * Web page to display a wizard in the iTop framework */ class iTopWizardWebPage extends iTopWebPage { var $m_iCurrentStep; var $m_aSteps; public function __construct($sTitle, $currentOrganization, $iCurrentStep, $aSteps) { parent::__construct($sTitle." - step $iCurrentStep of ".count($aSteps)." - ".$aSteps[$iCurrentStep - 1], $currentOrganization); $this->m_iCurrentStep = $iCurrentStep; $this->m_aSteps = $aSteps; } public function output() { $aSteps = array(); $iIndex = 0; foreach($this->m_aSteps as $sStepTitle) { $iIndex++; $sStyle = ($iIndex == $this->m_iCurrentStep) ? 'wizActiveStep' : 'wizStep'; $aSteps[] = "
$sStepTitle
"; } $sWizardHeader = "

{$this->s_title}

\n".implode("
", $aSteps)."
\n"; $this->s_content = "$sWizardHeader
".$this->s_content."
"; parent::output(); } } ?>