_options = array(); $initDatas = SiteOptionsHelper::getBallDatas(); foreach ($initDatas as $initData) { $option = array(); $option['text']= JText::_($initData[0]); $option['completed'] = false; $option['view'] = $initData[1]; $this->_options[] = $option; $orderNumber ++; } } function SetCurrentStep($step) { $this->_currentStep = $step; } function SetCompletedStep($numCompletedStep) { $this->_numCompletedStep = $numCompletedStep; } function _isStepCompleted($step) { return $step< $this->_numCompletedStep; } function setOptions($options) { $this->_options = $options; } function _addJavascript() { $currentController = JRequest::getVar('controller'); $document =& JFactory::getDocument(); $js = " function StepSelection(step) { document.mainForm.task.value = 'gotoStep'; document.mainForm.step.value = step; document.mainForm.submit(); } function PreviousStep() { StepSelection(".($this->_currentStep-1)."); } function NextStep() { StepSelection(".($this->_currentStep+1)."); }"; $document->addScriptDeclaration($js); } function _addStyleSheet() { $document = &JFactory::getDocument(); $css = " td.balltd { font-size:12px; font-style:normal; font-weight: normal; color: black; }"; $document->addStyleDeclaration($css); } function render() { $this->_addJavascript(); $this->_addStyleSheet(); $html =''; $html.=""; for ($i = 0 ; $i < count($this->_options); $i++) { $event = ''; if ($i > ($this->_numCompletedStep) || $i < 0) { if ($this->_isStepCompleted($i)) $imgSrc= "components/com_vxc/assets/images/step_completed_disabled.png"; else $imgSrc = "components/com_vxc/assets/images/step_disabled.png"; } else { if ($i == $this->_currentStep) { if ($this->_isStepCompleted($i)) $imgSrc = "components/com_vxc/assets/images/step_selected_completed.png"; else $imgSrc = "components/com_vxc/assets/images/step_selected.png"; } else { $event = "onclick=\"StepSelection(" . $i . ");return false;\""; if ($this->_isStepCompleted($i)) $imgSrc = "components/com_vxc/assets/images/step_completed.png"; else $imgSrc = "components/com_vxc/assets/images/step.png"; } } $html.=""; } $html.=""; $html .=""; $html .=""; for ($i=0;$i_options);$i++) $html .=""; $html .=""; $html .="
"; if ($this->_currentStep > 0 ) $html .= "
<<".JText::_("Previous")."
"; else $html .= "
<< ".JText::_('Previous')."
"; $html .= "
"; if ($event!='') $html.=""; if ($imgSrc!="") $html.="
"; $html.= JText::_($this->_options[$i]['text']); if ($event!='') $html.="
"; $html .="
"; if ($this->_currentStep != count($this->_options)-1 && $this->_currentStep<=$this->_numCompletedStep) $html.="
".JText::_('Next')." >>
"; else $html.="
".JText::_('Next')." >>
"; $html .="
".($_options[$i]['text'])."
"; return $html; } } ?>