Index: branches/unlabeled/unlabeled-1.5.2/kernel/units/general/helpers/mod_rewrite_helper.php =================================================================== diff -u -r6257 -r6308 --- branches/unlabeled/unlabeled-1.5.2/kernel/units/general/helpers/mod_rewrite_helper.php (.../mod_rewrite_helper.php) (revision 6257) +++ branches/unlabeled/unlabeled-1.5.2/kernel/units/general/helpers/mod_rewrite_helper.php (.../mod_rewrite_helper.php) (revision 6308) @@ -34,7 +34,7 @@ $res = true; } - $this->Application->VerifyLanguageId(); +// $this->Application->VerifyLanguageId(); if (!$res) { array_unshift($url_parts, $url_part); } @@ -54,7 +54,7 @@ $vars['m_theme'] = $theme_id; $res = true; } - $this->Application->VerifyThemeId(); // verify anyway - will set default if not found!!! +// $this->Application->VerifyThemeId(); // verify anyway - will set default if not found!!! if (!$res) { array_unshift($url_parts, $url_part); } @@ -98,6 +98,20 @@ return $res; } + function ProcessPage(&$url_parts, &$vars) + { + if (!is_numeric($url_parts[0]) || count($url_parts) > 1) return false; + + // set module pages for all modules, since we don't know which module will need it + foreach ($this->Application->ModuleInfo as $module_name => $module_data) + { + $vars[ $module_data['Var'].'_id'] = 0; + $vars[ $module_data['Var'].'_Page'] = $url_parts[0]; + $vars[ $module_data['Var'].'_Reviews_Page'] = 0; + } + return true; + } + function ProcessModuleIndex(&$url_parts, &$vars) { if ( count($url_parts) > 1) return false; // if no more parts or only 1 part left @@ -107,14 +121,7 @@ if( $url_parts ) { // if parts are left, it can only be module page if (!is_numeric($url_parts[0])) return false; - - // set module pages for all modules, since we don't know which module will need it - foreach ($this->Application->ModuleInfo as $module_name => $module_data) - { - $vars[ $module_data['Var'].'_id'] = 0; - $vars[ $module_data['Var'].'_Page'] = $url_parts[0]; - $vars[ $module_data['Var'].'_Reviews_Page'] = 0; - } + $this->ProcessPage($url_parts, $vars); } // try to find CMS index page of the category @@ -326,15 +333,15 @@ { $this->HTTPQuery->Set($name,$value); } - if ($restored) { +// if ($restored) { $this->InitAll(); - } +// } $this->HTTPQuery->finalizeParsing($passed); } function InitAll() { - $this->Application->Phrases = new PhrasesCache(); +// $this->Application->Phrases = new PhrasesCache(); $this->Application->VerifyLanguageId(); $this->Application->Phrases->Init('phrases'); $this->Application->VerifyThemeId(); @@ -421,6 +428,10 @@ } } + if ( $this->ProcessPage($url_parts, $vars) ) { + return $vars; + } + if ( $module_prefix = $this->ProcessModuleItem($url_parts, $vars, false) ) { $passed[] = $module_prefix; return $vars;