Index: trunk/core/kernel/event_manager.php =================================================================== diff -u -r937 -r939 --- trunk/core/kernel/event_manager.php (.../event_manager.php) (revision 937) +++ trunk/core/kernel/event_manager.php (.../event_manager.php) (revision 939) @@ -11,7 +11,7 @@ * from config, that are represented * in enviroment variable * - * @var unknown_type + * @var Array */ var $queryMaps=Array(); @@ -45,6 +45,18 @@ */ var $afterHooks=Array(); + /** + * Set's new enviroment parameter mappings + * between their names as application vars + * + * @param Array $new_query_maps + * @access public + */ + function setQueryMaps($new_query_maps) + { + $this->queryMaps=$new_query_maps; + } + function registerBuildEvent($pseudo_class,$build_event_name) { $this->buildEvents[$pseudo_class]=$build_event_name; @@ -80,64 +92,6 @@ $event_handler->processEvent(&$event); } - function getTemplateName($querystring_template) - { - $t_from_post=$this->Application->GetVar('t'); - $t=$t_from_post?$t_from_post:$querystring_template; - return $t; - } - - /** - * Process QueryString only, create - * events, ids, based on config - * set template name and sid in - * desired application variables. - * - * @access public - */ - function processQueryString() - { - // env=SID:TEMPLATE:m-1-1-1-1:l0-0-0:n-0-0-0:bb-0-0-1-1-1-0 - - $env_var =& $this->Application->GetVar(ENV_VAR_NAME); - if($env_var) - { - $parts=explode(':',$env_var); - - // Save Session ID - $sid=array_shift($parts); - if($sid) $this->Application->SetVar('sid',$sid); - - // Save Template Name - $t=$this->getTemplateName( array_shift($parts) ); - if(!$t) $t='index'; - $this->Application->SetVar('t',$t); - - if($parts) - { - foreach($parts as $mixed_part) - { - $mixed_part=explode('-',$mixed_part); - $prefix_special=array_shift($mixed_part); // l.pick, l - list($prefix)=explode('.',$prefix_special); - - $this->queryMaps[$prefix_special]=$this->Application->getUnitOption($prefix,'QueryString'); - foreach($this->queryMaps[$prefix_special] as $index => $var_name) - { - // l_id, l_page, l_bla-bla-bla - $this->Application->SetVar($prefix_special.'_'.$var_name,$mixed_part[$index-1]); - } - } - } - } - else - { - $t=$this->getTemplateName('index'); - $this->Application->SetVar('t',$t); - } - } - - function ProcessRequest() { // 1. get events from $_POST @@ -158,7 +112,6 @@ } //print_pre($events); - //$t=$this->Application->GetVar('t'); foreach($events as $prefix_special => $event_name) { if(!$event_name) continue;