namespace Combodo\iTop\Application\WebPage; use ExecutionKPI; use utils; /** * Class iTopWizardWebPage * * @copyright Copyright (C) 2010-2024 Combodo SAS * @license http://opensource.org/licenses/AGPL-3.0 */ /** * Web page to display a wizard in the iTop framework */ class iTopWizardWebPage extends iTopWebPage { public $m_iCurrentStep; public $m_aSteps; public function __construct($sTitle, $currentOrganization, $iCurrentStep, $aSteps) { $oKpi = new ExecutionKPI(); parent::__construct($sTitle." - step $iCurrentStep of ".count($aSteps)." - ".$aSteps[$iCurrentStep - 1], $currentOrganization); $this->m_iCurrentStep = $iCurrentStep; $this->m_aSteps = $aSteps; $oKpi->ComputeStats(get_class($this).' creation', 'iTopWizardWebPage'); } public function output() { $aSteps = []; $iIndex = 0; foreach ($this->m_aSteps as $sStepTitle) { $iIndex++; $sStyle = ($iIndex == $this->m_iCurrentStep) ? 'wizActiveStep' : 'wizStep'; $aSteps[] = "
$sStepTitle
"; } $sWizardHeader = "

".utils::EscapeHtml($this->s_title)."

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