Index: trunk/core/kernel/utility/http_query.php =================================================================== diff -u -r932 -r939 --- trunk/core/kernel/utility/http_query.php (.../http_query.php) (revision 932) +++ trunk/core/kernel/utility/http_query.php (.../http_query.php) (revision 939) @@ -67,8 +67,10 @@ */ function HTTPQuery($order='CGPF') { + parent::Params(); $this->Order = $order; $this->AddAllVars(); + $this->processQueryString(); ini_set("magic_quotes_gpc", 0); } @@ -107,6 +109,75 @@ } } + /** + * Process QueryString only, create + * events, ids, based on config + * set template name and sid in + * desired application variables. + * + * @access private + */ + 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->Get(ENV_VAR_NAME); + if($env_var) + { + $parts=explode(':',$env_var); + + // Save Session ID + $sid=array_shift($parts); + if($sid) $this->Set('sid',$sid); + + // Save Template Name + $t=$this->getTemplateName( array_shift($parts) ); + if(!$t) $t='index'; + $this->Set('t',$t); + + if($parts) + { + $query_maps=Array(); + $event_manger =& $this->Application->recallObject('EventManager'); + + foreach($parts as $mixed_part) + { + $mixed_part=explode('-',$mixed_part); + $prefix_special=array_shift($mixed_part); // l.pick, l + list($prefix)=explode('.',$prefix_special); + + $query_maps[$prefix_special]=$this->Application->getUnitOption($prefix,'QueryString'); + foreach($query_maps[$prefix_special] as $index => $var_name) + { + // l_id, l_page, l_bla-bla-bla + $this->Set($prefix_special.'_'.$var_name,$mixed_part[$index-1]); + } + } + $event_manger->setQueryMaps($query_maps); + } + } + else + { + $t=$this->getTemplateName('index'); + $this->Set('t',$t); + } + } + + /** + * Decides what template name to + * use from $_GET or from $_POST + * + * @param string $querystring_template + * @return string + * @access private + */ + function getTemplateName($querystring_template) + { + $t_from_post=$this->Get('t'); + $t=$t_from_post?$t_from_post:$querystring_template; + return $t; + } + function post_convert($array) { $out = Array();