Name = 'ThemesForm'; $this->ValidActions = array('Themes', 'ProcessThemes'); $this->Constructor($Context); if( $this->IsPostBack ) { $RedirectUrl = ''; $this->Context->PageTitle = $this->Context->GetDefinition('VcalThemesManagement'); $SettingsFile = $this->Context->Configuration['APPLICATION_PATH'].'conf/settings.php'; $this->ConfigurationManager = $this->Context->ObjectFactory->NewContextObject($this->Context, 'ConfigurationManager'); if ($this->PostBackAction == 'ProcessThemes') { $this->ConfigurationManager->GetSettingsFromForm($SettingsFile); $this->ConfigurationManager->DefineSetting('VCAL_DEFAULT_THEME', ForceIncomingString('VCAL_DEFAULT_THEME', ''), ''); if ($this->ConfigurationManager->SaveSettingsToFile($SettingsFile)) { $RedirectUrl = GetUrl( $this->Context->Configuration, $this->Context->SelfUrl, '', '', '', '', 'PostBackAction=Themes&Success=1'); } else { $this->PostBackAction = 'Themes'; } } if ($RedirectUrl) { //@todo: should the process die here? Redirect($RedirectUrl, '302', '', 0); } } $this->CallDelegate('Constructor'); } function GetChecked ($Theme) { if ($this->ConfigurationManager->GetSetting('VCAL_DEFAULT_THEME') == $Theme) return 'checked="checked"'; } function GetEnabled ($Theme) { if ($this->ConfigurationManager->GetSetting('VCAL_DEFAULT_THEME') == $Theme) return 'class="Enabled"'; else return 'class="Disabled"'; } function Render() { if ($this->IsPostBack) { $this->CallDelegate('PreRender'); $this->PostBackParams->Clear(); if ($this->PostBackAction == 'Themes') { $this->PostBackParams->Set('PostBackAction', 'ProcessThemes'); echo '
'; if (ForceIncomingInt('Success', 0)) echo '
'.$this->Context->GetDefinition('VcalChangesSaved').'
'; echo '
'.$this->Context->GetDefinition("VcalThemesSettings").' '.$this->Get_Warnings().' '.$this->Get_PostBackForm('frmThemes').'

'.$this->Context->GetDefinition("VcalThemesNotes").'


'; } $this->CallDelegate('PostRender'); } } } ?>