Index: trunk/kernel/units/categories/categories_event_handler.php =================================================================== diff -u -r3031 -r3427 --- trunk/kernel/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 3031) +++ trunk/kernel/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 3427) @@ -219,6 +219,16 @@ return parent::getPassedID($event); } + + /** + * Rebuilds category cache + * + * @param kEvent $event + */ + function OnRebuildCache(&$event) + { + $event->SetRedirectParam('index_file', 'category/category_maint.php'); + } } ?> \ No newline at end of file Index: trunk/core/kernel/application.php =================================================================== diff -u -r3418 -r3427 --- trunk/core/kernel/application.php (.../application.php) (revision 3418) +++ trunk/core/kernel/application.php (.../application.php) (revision 3427) @@ -792,7 +792,11 @@ if ( $this->IsAdmin() && $prefix == '_FRONT_END_') $prefix = ''; $index_file = isset($index_file) ? $index_file : (defined('INDEX_FILE') ? INDEX_FILE : basename($_SERVER['SCRIPT_NAME'])); - if( isset($params['index_file']) ) $index_file = $params['index_file']; + if( isset($params['index_file']) ) + { + $index_file = $params['index_file']; + unset($params['index_file']); + } $ssl = isset($params['__SSL__']) ? $params['__SSL__'] : null; if ($ssl !== null) { Index: trunk/core/units/categories/categories_event_handler.php =================================================================== diff -u -r3031 -r3427 --- trunk/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 3031) +++ trunk/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 3427) @@ -219,6 +219,16 @@ return parent::getPassedID($event); } + + /** + * Rebuilds category cache + * + * @param kEvent $event + */ + function OnRebuildCache(&$event) + { + $event->SetRedirectParam('index_file', 'category/category_maint.php'); + } } ?> \ No newline at end of file Index: trunk/kernel/admin/include/toolbar/browse.php =================================================================== diff -u -r3305 -r3427 --- trunk/kernel/admin/include/toolbar/browse.php (.../browse.php) (revision 3305) +++ trunk/kernel/admin/include/toolbar/browse.php (.../browse.php) (revision 3427) @@ -272,6 +272,10 @@ case 'decline': k4_action = 'decine_items("'+prefix_special+'")'; break; + + case 'm_rebuild_cache': + k4_action = 'rebuild_cache("c")'; + break; case 'copy': k4_action = 'copy_items("'+prefix_special+'")'; @@ -350,6 +354,11 @@ { Grids[prefix_special].ClearSelection(null,'Inp_AdvancedView.Unselect'); } + + function rebuild_cache(prefix_special) + { + submit_event(prefix_special,'OnRebuildCache','') + } // K4 code for handling toolbar operations: end @@ -398,7 +407,7 @@ AddButtonAction('import',"check_submit('$admin/browse','import');"); // import AddButtonAction('export',"check_submit('$admin/browse','export');"); // export - AddButtonAction('rebuild_cache',"check_submit('$admin/category/category_maint', '[prefix=m_]rebuild_cache');"); // rebuild_cache + AddButtonAction('rebuild_cache',"check_submit('$admin/category/category_maint', 'm_rebuild_cache');"); // rebuild_cache AddButtonAction('cut',"check_submit('$admin/browse','cut');"); //cut AddButtonAction('copy',"check_submit('$admin/browse','copy');"); //copy @@ -519,12 +528,13 @@ if(page.length==0) page = activeTab.getAttribute("EditURL"); - if ( action_prefix.match("k4:(.*)") ) { + if ( action_prefix.match("k4:(.*)") ) + { act = RegExp.$1; act = act.replace('$\$event$$', actionValue); act = act.replace('$\$prefix$$', activeTab.getAttribute("PrefixSpecial") ); - eval(act); - return; + eval(act); + return; } } else @@ -538,9 +548,9 @@ if(f) { - if ( actionValue.match(/\[prefix=(.*)\](.*)/) ) + if (actionValue.substring(0,2) == 'm_') { - f.Action.value = RegExp.$1 + RegExp.$2; + f.Action.value = actionValue; } else {