Index: trunk/kernel/include/modules.php =================================================================== diff -u -r3145 -r3179 --- trunk/kernel/include/modules.php (.../modules.php) (revision 3145) +++ trunk/kernel/include/modules.php (.../modules.php) (revision 3179) @@ -19,87 +19,66 @@ global $env, $var_list, $mod_prefix,$objSession, $SessionQueryString; /* parse individual sections */ - $env = isset($_GET['env']) ? $_GET['env'] : ''; - if ($env == "") + $env = GetVar('env'); + if (!$env) { - $var_list["t"] = "index"; - if(is_array($mod_prefix)) - { - - foreach($mod_prefix as $key => $value) - { - if(strlen($key)) - { - $parser_name = $key . "_ParseEnv"; - if(function_exists($parser_name)) - { - @$parser_name(); - } - } - } - - } + $var_list['t'] = 'index'; + if (is_array($mod_prefix)) + { + foreach($mod_prefix as $module_prefix => $module_name) + { + $parser_name = $module_prefix.'_ParseEnv'; + if( function_exists($parser_name) ) $parser_name(); + } + } } else { - $envsections = explode(":", $env); - foreach($mod_prefix as $key => $value) - { - if(strlen($key)) - { - $parsed=FALSE; + $env_sections = explode(':', $env); + + $main = array_shift($env_sections); + if($main) + { + list($sid, $template) = explode('-', $main, 2); + if(!$SessionQueryString) + { + if (!$sid || $sid == '_') + { + if ($sid != '_') $sid = $_COOKIE[SESSION_COOKIE_NAME]; + } + else + { + $SessionQueryString = true; + } + } + $var_list['sid'] = $sid; + $var_list['t'] = $template; + if( getArrayValue($_GET, 'dest') ) $var_list['dest'] = $_GET['dest']; + } + + foreach ($env_sections as $env_section) + { + $env_section = preg_replace("/^([a-zA-Z]+)([0-9]+)-(.*)/", "$1-$2-$3", $env_section); + $pieces = explode('-', $env_section); + $parser_name = $pieces[0].'_ParseEnv'; + if( function_exists($parser_name) ) + { + $env_section = preg_replace('/^([a-zA-Z]+)-([0-9]+)-(.*)/','\\1\\2-\\3', $env_section); + $parser_name($env_section); + } + } - $parser_name = $key . "_ParseEnv"; - for($i=1; $i\n"; if ($env != "")