public function onInit($param) { $sql = "SELECT * FROM hr_user_action WHERE type='userWizardTpl'"; $cmd = $this->db->createCommand($sql); $data = $cmd->query(); $data = $data->readAll(); $step = 4; if (count($data) > 0) { $this->Step3->StepType = "Step"; for ($i = 0; $i < count($data); $i++) { $wizardStep = new TWizardStep(); $wizardStep->setTitle(Prado::localize('Step') . ' ' . $step . ': ' . Prado::localize($data[$i]['name'], array(), $data[$i]['catalog'])); if ($i + 1 == count($data)) { $wizardStep->setStepType("Finish"); } else { $wizardStep->setStepType("Step"); } $wizardStep->setID('Step' . $step); $steps = $this->Wizard1->getWizardSteps(); $tpl = $this->Service->TemplateManager->getTemplateByFileName($data[$i]['page']); $tpl->instantiateIn($wizardStep); $steps->insertAt($steps->getCount() - 1, $wizardStep); $step++; } } else { $this->Step3->StepType = 'Finish'; } parent::onInit($param); }
/** * Ensures child controls are created. * @param mixed event parameter */ public function onInit($param) { parent::onInit($param); $this->ensureChildControls(); }