Index: trunk/core/units/general/inp1_parser.php =================================================================== diff -u -N -r2725 -r3174 --- trunk/core/units/general/inp1_parser.php (.../inp1_parser.php) (revision 2725) +++ trunk/core/units/general/inp1_parser.php (.../inp1_parser.php) (revision 3174) @@ -14,7 +14,7 @@ if($var_list['t'] != $this->Application->GetVar('t')) { $get = $_GET; - unset($get['env'], $get['Action']); + unset($get['env'], $get['Action'], $get['url'], $get['rewrite']); $this->Application->StoreVar('K4_Template_Referer', $this->Application->GetVar('t') ); $this->Application->Redirect($var_list['t'], $get); Index: trunk/core/kernel/utility/http_query.php =================================================================== diff -u -N -r3170 -r3174 --- trunk/core/kernel/utility/http_query.php (.../http_query.php) (revision 3170) +++ trunk/core/kernel/utility/http_query.php (.../http_query.php) (revision 3174) @@ -417,7 +417,8 @@ $module_event = new kEvent($module_prefix.':ParseEnv', Array('url_parts' => $url_parts) ); $this->Application->HandleEvent($module_event); $module_object =& $module_event->getObject(); - $module_params = Array($module_prefix.'_id' => $module_object->GetID() ); + $item_id = $module_object->GetID(); + $module_params = Array($module_prefix.'_id' => $item_id ? $item_id : '0' ); } $this->Set('passed', implode(',', $passed) ); Index: trunk/core/kernel/event_handler.php =================================================================== diff -u -N -r3162 -r3174 --- trunk/core/kernel/event_handler.php (.../event_handler.php) (revision 3162) +++ trunk/core/kernel/event_handler.php (.../event_handler.php) (revision 3174) @@ -156,7 +156,7 @@ //if pass events is off and event is not implicity passed if ( !$event->getEventParam('pass_events') && !isset($url_params[$prefix_special.'_event']) ) { - $url_params[$prefix_special.'_event'] = ''; // remove event from url if requested + unset($url_params[$prefix_special.'_event']); // remove event from url if requested //otherwise it will use value from get_var } @@ -192,7 +192,8 @@ if($processed_params[$prefix_special.'_Reviews_Page'] > 1) { - $ret = rtrim($ret, '/').'_'.$processed_params[$prefix_special.'_Reviews_Page'].'/'; + if($processed_params[$prefix_special.'_id']) $ret = rtrim($ret, '/'); + $ret .= '_'.$processed_params[$prefix_special.'_Reviews_Page'].'/'; } $event->setEventParam('url_params', $url_params); Index: trunk/core/units/general/main_event_handler.php =================================================================== diff -u -N -r3162 -r3174 --- trunk/core/units/general/main_event_handler.php (.../main_event_handler.php) (revision 3162) +++ trunk/core/units/general/main_event_handler.php (.../main_event_handler.php) (revision 3174) @@ -52,7 +52,7 @@ $processed_params[$var_name] = isset( $url_params[$var_name] ) ? $url_params[$var_name] : $this->Application->GetVar($var_name); if ( isset($url_params[$var_name]) ) unset( $url_params[$var_name] ); } - + $ret = ''; $default_language_id = $this->Application->GetDefaultLanguageId(); if( $processed_params['m_lang'] != $default_language_id ) @@ -77,7 +77,18 @@ WHERE CategoryId = '.$processed_params['m_cat_id']).'/'; } - if( $processed_params['m_cat_page'] > 1 ) $ret .= '_'.$processed_params['m_cat_page'].'/'; + $force_page_adding = false; + if( getArrayValue($url_params, 'reset') ) + { + unset($url_params['reset']); + $processed_params['m_cat_page'] = 1; + $force_page_adding = true; + } + + if( $processed_params['m_cat_page'] > 1 || $force_page_adding ) + { + $ret = preg_replace('/(.*)\//', '\\1', $ret).'_'.$processed_params['m_cat_page'].'/'; + } $ret .= $event->getEventParam('t').'/'; Index: trunk/kernel/include/category.php =================================================================== diff -u -N -r3162 -r3174 --- trunk/kernel/include/category.php (.../category.php) (revision 3162) +++ trunk/kernel/include/category.php (.../category.php) (revision 3174) @@ -1008,9 +1008,11 @@ $t = $path . $target_template; } else + { $t = $element->GetAttributeByName('_template'); - - + } + + $url_params = Array(); if(strlen($t)) { $var_list_update["t"] = $t; @@ -1020,7 +1022,9 @@ $var_list_update["t"] = $var_list["t"]; } $m_var_list_update["cat"] = $this->Get("CategoryId"); - $ret = HREF_Wrapper(); + if( $element->GetAttributeByName('reset') ) $url_params['reset'] = 1; + + $ret = HREF_Wrapper('', $url_params); unset($m_var_list_update["cat"], $var_list_update["t"]); break; case "adminlink": Index: trunk/kernel/units/general/main_event_handler.php =================================================================== diff -u -N -r3162 -r3174 --- trunk/kernel/units/general/main_event_handler.php (.../main_event_handler.php) (revision 3162) +++ trunk/kernel/units/general/main_event_handler.php (.../main_event_handler.php) (revision 3174) @@ -52,7 +52,7 @@ $processed_params[$var_name] = isset( $url_params[$var_name] ) ? $url_params[$var_name] : $this->Application->GetVar($var_name); if ( isset($url_params[$var_name]) ) unset( $url_params[$var_name] ); } - + $ret = ''; $default_language_id = $this->Application->GetDefaultLanguageId(); if( $processed_params['m_lang'] != $default_language_id ) @@ -77,7 +77,18 @@ WHERE CategoryId = '.$processed_params['m_cat_id']).'/'; } - if( $processed_params['m_cat_page'] > 1 ) $ret .= '_'.$processed_params['m_cat_page'].'/'; + $force_page_adding = false; + if( getArrayValue($url_params, 'reset') ) + { + unset($url_params['reset']); + $processed_params['m_cat_page'] = 1; + $force_page_adding = true; + } + + if( $processed_params['m_cat_page'] > 1 || $force_page_adding ) + { + $ret = preg_replace('/(.*)\//', '\\1', $ret).'_'.$processed_params['m_cat_page'].'/'; + } $ret .= $event->getEventParam('t').'/'; Index: trunk/kernel/units/general/inp1_parser.php =================================================================== diff -u -N -r2725 -r3174 --- trunk/kernel/units/general/inp1_parser.php (.../inp1_parser.php) (revision 2725) +++ trunk/kernel/units/general/inp1_parser.php (.../inp1_parser.php) (revision 3174) @@ -14,7 +14,7 @@ if($var_list['t'] != $this->Application->GetVar('t')) { $get = $_GET; - unset($get['env'], $get['Action']); + unset($get['env'], $get['Action'], $get['url'], $get['rewrite']); $this->Application->StoreVar('K4_Template_Referer', $this->Application->GetVar('t') ); $this->Application->Redirect($var_list['t'], $get); Index: trunk/themes/default/categories/catlist_element.tpl =================================================================== diff -u -N -r105 -r3174 --- trunk/themes/default/categories/catlist_element.tpl (.../catlist_element.tpl) (revision 105) +++ trunk/themes/default/categories/catlist_element.tpl (.../catlist_element.tpl) (revision 3174) @@ -4,7 +4,7 @@ ">

- &reset=1"> ( ) + "> ( ) <inp:m_language _Phrase=" /> <inp:m_language _Phrase=" />