variables = array( 'CDN' => false, 'cdn' ); } public function RunScript(){ $cmd = \gp\tool::GetCommand(); switch($cmd){ case 'save_config': $this->SaveConfig(); break; } $this->showForm(); } /** * Get possible cdn values * */ protected function getPossible(){ global $langmessage; $possible = array(); $possible['cdn'] = array(); foreach(\gp\tool\Output\Combine::$scripts as $key => $script_info){ if( !isset($script_info['cdn']) ){ continue; } foreach($script_info['cdn'] as $cdn => $url){ $possible['cdn'][] = $cdn; } } $possible['cdn'] = array_combine($possible['cdn'],$possible['cdn']); $possible['cdn'][''] = $langmessage['None']; return $possible; } /** * Show CDN Options * */ protected function ShowForm(){ global $config; $possible = $this->getPossible(); echo '
'; echo '

CDN

'; echo ''; foreach($possible['cdn'] as $cdn_val => $cdn){ $checked = ( $cdn_val === $config['cdn'] ) ? 'checked' : ''; echo ''; } echo ''; //display which scripts can be served bythe cdn foreach(\gp\tool\Output\Combine::$scripts as $key => $script_info){ if( !isset($script_info['cdn']) || !isset($script_info['label']) ){ continue; } $code = '\\gp\\tool::LoadComponents(\''.$key.'\');'; echo ''; foreach($possible['cdn'] as $cdn){ echo ''; } echo ''; } echo '
'; echo ' '; echo '
'; echo $script_info['label']; echo ''; if( isset($script_info['cdn'][$cdn]) ){ echo ''; } echo '
'; $this->SaveButtons(); echo '
'; } }