Index: branches/unlabeled/unlabeled-1.29.2/core/units/categories/categories_tag_processor.php =================================================================== diff -u -r6123 -r6308 --- branches/unlabeled/unlabeled-1.29.2/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 6123) +++ branches/unlabeled/unlabeled-1.29.2/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 6308) @@ -190,6 +190,8 @@ } unset($params['cat_id']); + $params['pass_category'] = 1; + $main_processor =& $this->Application->recallObject('m_TagProcessor'); return $main_processor->T($params); } Index: branches/unlabeled/unlabeled-1.14.2/core/units/general/main_event_handler.php =================================================================== diff -u -r6102 -r6308 --- branches/unlabeled/unlabeled-1.14.2/core/units/general/main_event_handler.php (.../main_event_handler.php) (revision 6102) +++ branches/unlabeled/unlabeled-1.14.2/core/units/general/main_event_handler.php (.../main_event_handler.php) (revision 6308) @@ -83,10 +83,14 @@ $ret .= $theme_name.'/'; } - if ($processed_params['m_cat_id'] > 0) { + if ($processed_params['m_cat_id'] > 0 && isset($url_params['pass_category']) && $url_params['pass_category']) { $ret .= $this->Application->getFilename('c', $processed_params['m_cat_id']).'/'; $url_params['category_processed'] = true; } + else { +// $url_params['no_category'] = 1; // for debugging + } + unset($url_params['pass_category']); // unset it just in case $force_page_adding = false; if (getArrayValue($url_params, 'reset')) Index: branches/unlabeled/unlabeled-1.14.2/kernel/units/general/main_event_handler.php =================================================================== diff -u -r6102 -r6308 --- branches/unlabeled/unlabeled-1.14.2/kernel/units/general/main_event_handler.php (.../main_event_handler.php) (revision 6102) +++ branches/unlabeled/unlabeled-1.14.2/kernel/units/general/main_event_handler.php (.../main_event_handler.php) (revision 6308) @@ -83,10 +83,14 @@ $ret .= $theme_name.'/'; } - if ($processed_params['m_cat_id'] > 0) { + if ($processed_params['m_cat_id'] > 0 && isset($url_params['pass_category']) && $url_params['pass_category']) { $ret .= $this->Application->getFilename('c', $processed_params['m_cat_id']).'/'; $url_params['category_processed'] = true; } + else { +// $url_params['no_category'] = 1; // for debugging + } + unset($url_params['pass_category']); // unset it just in case $force_page_adding = false; if (getArrayValue($url_params, 'reset')) Index: branches/unlabeled/unlabeled-1.12.2/kernel/units/general/cat_tag_processor.php =================================================================== diff -u -r6221 -r6308 --- branches/unlabeled/unlabeled-1.12.2/kernel/units/general/cat_tag_processor.php (.../cat_tag_processor.php) (revision 6221) +++ branches/unlabeled/unlabeled-1.12.2/kernel/units/general/cat_tag_processor.php (.../cat_tag_processor.php) (revision 6308) @@ -46,7 +46,7 @@ function ItemLink($params, $id_prefix) { $params = array_merge($params, Array('pass' => 'm,'.$this->Prefix) ); - + $item_id = isset($params[$id_prefix.'_id']) && $params[$id_prefix.'_id']; if (!$item_id) { $item_id = $this->Application->GetVar($this->getPrefixSpecial().'_id'); @@ -55,10 +55,11 @@ } } $params[$this->Prefix.'_id'] = $item_id; - + $object =& $this->getObject($params); $params['m_cat_id'] = $object->GetDBField('CategoryId'); - + $params['pass_category'] = 1; + return $this->Application->ProcessParsedTag('m', 't', $params); } Index: branches/unlabeled/unlabeled-1.156.2/core/kernel/application.php =================================================================== diff -u -r6264 -r6308 --- branches/unlabeled/unlabeled-1.156.2/core/kernel/application.php (.../application.php) (revision 6264) +++ branches/unlabeled/unlabeled-1.156.2/core/kernel/application.php (.../application.php) (revision 6308) @@ -1106,6 +1106,7 @@ } else { + unset($params['pass_category']); // we don't need to pass it when mod_rewrite is off $env = $this->BuildEnv($t, $params, $pass, $pass_events); $ret = $this->BaseURL($prefix, $ssl).$index_file.'?'.$env.$map_link; } @@ -1223,6 +1224,7 @@ $env .= ':'.$this->BuildModuleEnv($pass_element, $params, $pass_events); } } + if (!$m_only) $params['pass_category'] = 1; $ret = $this->BuildModuleEnv_NEW('m', $params, $pass_events).$ret; $cat_processed = isset($params['category_processed']) && $params['category_processed']; if ($cat_processed) { Index: branches/unlabeled/unlabeled-1.12.2/core/units/general/cat_tag_processor.php =================================================================== diff -u -r6221 -r6308 --- branches/unlabeled/unlabeled-1.12.2/core/units/general/cat_tag_processor.php (.../cat_tag_processor.php) (revision 6221) +++ branches/unlabeled/unlabeled-1.12.2/core/units/general/cat_tag_processor.php (.../cat_tag_processor.php) (revision 6308) @@ -46,7 +46,7 @@ function ItemLink($params, $id_prefix) { $params = array_merge($params, Array('pass' => 'm,'.$this->Prefix) ); - + $item_id = isset($params[$id_prefix.'_id']) && $params[$id_prefix.'_id']; if (!$item_id) { $item_id = $this->Application->GetVar($this->getPrefixSpecial().'_id'); @@ -55,10 +55,11 @@ } } $params[$this->Prefix.'_id'] = $item_id; - + $object =& $this->getObject($params); $params['m_cat_id'] = $object->GetDBField('CategoryId'); - + $params['pass_category'] = 1; + return $this->Application->ProcessParsedTag('m', 't', $params); } Index: branches/unlabeled/unlabeled-1.101.2/kernel/parser.php =================================================================== diff -u -r6095 -r6308 --- branches/unlabeled/unlabeled-1.101.2/kernel/parser.php (.../parser.php) (revision 6095) +++ branches/unlabeled/unlabeled-1.101.2/kernel/parser.php (.../parser.php) (revision 6308) @@ -44,7 +44,13 @@ global $m_var_list, $m_var_list_update; $module_vars = Array( 'cat' => 'm_cat_id', 'p' => 'm_cat_page', 'lang' => 'm_lang', 'theme' => 'm_theme', 'opener' => 'm_opener'); + if (isset($m_var_list_update['cat'])) { + $pass_cat = 1; + } $ret = GenerateModuleEnv_NEW('m', $module_vars); + if ($pass_cat) { + $ret['pass_category'] = 1; + } if( isset($GLOBALS['m_var_list_update']['cat']) ) unset($GLOBALS['m_var_list_update']['cat']); return $ret; } Index: branches/unlabeled/unlabeled-1.5.2/core/units/general/helpers/mod_rewrite_helper.php =================================================================== diff -u -r6257 -r6308 --- branches/unlabeled/unlabeled-1.5.2/core/units/general/helpers/mod_rewrite_helper.php (.../mod_rewrite_helper.php) (revision 6257) +++ branches/unlabeled/unlabeled-1.5.2/core/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; 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; Index: branches/unlabeled/unlabeled-1.51.2/kernel/include/modules.php =================================================================== diff -u -r6235 -r6308 --- branches/unlabeled/unlabeled-1.51.2/kernel/include/modules.php (.../modules.php) (revision 6235) +++ branches/unlabeled/unlabeled-1.51.2/kernel/include/modules.php (.../modules.php) (revision 6308) @@ -226,6 +226,15 @@ if ( substr($t, 0, strlen('kernel4:') ) == 'kernel4:' ) $t = substr($t, strlen('kernel4:') ); $url_params = Array('t' => $t); + // sicne 1.3.0 the category is not passed by default when mod_rewrite is on + // enable pass category for module templates (they usually need it) and suggest_cat. + // platform templates usually do not need category + if ( + preg_match('/^inlink|^inbulletin|^innews/', $t) || + in_array(preg_replace('/\.tpl$/', '', $t), array('suggest_cat')) + ) { + $url_params['pass_category'] = 1; + } $app =& kApplication::Instance(); $app->SetVar('prefixes_passed', Array() ); Index: branches/unlabeled/unlabeled-1.62.2/core/kernel/processors/main_processor.php =================================================================== diff -u -r6205 -r6308 --- branches/unlabeled/unlabeled-1.62.2/core/kernel/processors/main_processor.php (.../main_processor.php) (revision 6205) +++ branches/unlabeled/unlabeled-1.62.2/core/kernel/processors/main_processor.php (.../main_processor.php) (revision 6308) @@ -375,6 +375,9 @@ else { $o .= "\n"; } + if ($this->Application->GetVar('admin') == 1) { + $o .= "\n"; + } return $o; } Index: branches/unlabeled/unlabeled-1.1.2/admin/install/upgrades/changelog_1_3_0.txt =================================================================== diff -u -r6291 -r6308 --- branches/unlabeled/unlabeled-1.1.2/admin/install/upgrades/changelog_1_3_0.txt (.../changelog_1_3_0.txt) (revision 6291) +++ branches/unlabeled/unlabeled-1.1.2/admin/install/upgrades/changelog_1_3_0.txt (.../changelog_1_3_0.txt) (revision 6308) @@ -24,8 +24,9 @@ File in-portal/admin/install/inportal_data.sql changed File in-portal/admin/install/inportal_remove.sql changed File in-portal/admin/install/install_lib.php changed -File in-portal/admin/install/upgrades/changelog_1_3_0.txt is new; release_1_3_0 revision 1.1.2.4 +File in-portal/admin/install/upgrades/changelog_1_3_0.txt is new; release_1_3_0 revision 1.1.2.5 File in-portal/admin/install/upgrades/inportal_upgrade_v1.3.0.sql is new; release_1_3_0 revision 1.1.2.1 +File in-portal/kernel/parser.php changed File in-portal/kernel/admin/advanced_view.php is removed; release_1_2_1 revision 1.4 File in-portal/kernel/admin/include/toolbar/advanced_view.php is removed; release_1_2_1 revision 1.11.2.1 File in-portal/kernel/admin/include/toolbar/browse.php is removed; release_1_2_1 revision 1.17.2.1 @@ -42,11 +43,13 @@ File in-portal/kernel/include/image.php changed File in-portal/kernel/include/modules.php changed File in-portal/kernel/units/admin/admin_config.php changed +File in-portal/kernel/units/categories/categories_tag_processor.php changed File in-portal/kernel/units/configuration/configuration_event_handler.php changed File in-portal/kernel/units/email_events/email_events_event_handler.php changed File in-portal/kernel/units/general/cat_event_handler.php changed File in-portal/kernel/units/general/cat_tag_processor.php changed File in-portal/kernel/units/general/inp_ses_storage.php changed +File in-portal/kernel/units/general/main_event_handler.php changed File in-portal/kernel/units/general/helpers/mod_rewrite_helper.php changed File in-portal/kernel/units/general/helpers/permissions_helper.php changed File in-portal/kernel/units/users/users_event_handler.php changed @@ -55,6 +58,7 @@ File kernel4_dev/kernel4/startup.php changed File kernel4_dev/kernel4/db/db_event_handler.php changed File kernel4_dev/kernel4/db/db_tag_processor.php changed +File kernel4_dev/kernel4/db/dblist.php changed File kernel4_dev/kernel4/processors/main_processor.php changed File kernel4_dev/kernel4/session/session.php changed File kernel4_dev/kernel4/utility/debugger.php changed Index: branches/unlabeled/unlabeled-1.29.2/kernel/units/categories/categories_tag_processor.php =================================================================== diff -u -r6123 -r6308 --- branches/unlabeled/unlabeled-1.29.2/kernel/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 6123) +++ branches/unlabeled/unlabeled-1.29.2/kernel/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 6308) @@ -190,6 +190,8 @@ } unset($params['cat_id']); + $params['pass_category'] = 1; + $main_processor =& $this->Application->recallObject('m_TagProcessor'); return $main_processor->T($params); }