00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00026 class main extends WebObject
00027 {
00028 function init()
00029 {
00030 WebApp::addSVar('interface', 'goc');
00031 WebApp::addSVar('interface_file', 'goc/goc.html');
00032 WebApp::addSVar('language', 'sq_AL');
00033 }
00034
00035 function on_select($event_args)
00036 {
00037 $interface = $event_args['interface'];
00038 switch ($interface)
00039 {
00040 default:
00041 case 'goc':
00042 $interface_file = 'goc/goc.html';
00043 break;
00044 case 'roc':
00045 $interface_file = 'roc/roc.html';
00046 $roc_id = $event_args['roc_id'];
00047 WebApp::setSVar('roc->id', $roc_id);
00048 WebApp::setSVar('roc->mode', 'view');
00049 break;
00050 case 'country':
00051 $interface_file = 'country/country.html';
00052 $country_id = $event_args['country_id'];
00053 WebApp::setSVar('country->id', $country_id);
00054 WebApp::setSVar('country->mode', 'view');
00055 break;
00056 case 'site':
00057 $interface_file = 'site/site.html';
00058 $site_id = $event_args['site_id'];
00059 WebApp::setSVar('site->id', $site_id);
00060 WebApp::setSVar('site->mode', 'view');
00061 break;
00062 }
00063 WebApp::setSVar('interface', $interface);
00064 WebApp::setSVar('interface_file', $interface_file);
00065 }
00066
00067 function on_language($event_args)
00068 {
00069 $lng = $event_args['lng'];
00070 WebApp::setSVar('language', $lng);
00071 }
00072
00073 function onParse()
00074 {
00075 $lng = WebApp::getSVar('language');
00076 global $l10n;
00077 $l10n->set_lng($lng);
00078 }
00079
00080 function onRender()
00081 {
00082
00083 $rs_langs = new EditableRS('languages', $query);
00084 $rs_langs->addRec( array('id'=>'en', 'label'=>'English') );
00085 $rs_langs->addRec( array('id'=>'sq_AL', 'label'=>'Albanian') );
00086
00087
00088 global $webPage;
00089 $webPage->addRecordset($rs_langs);
00090 }
00091 }
00092 ?>