Index: trunk/core/admin_templates/js/catalog.js =================================================================== diff -u -r5009 -r5018 --- trunk/core/admin_templates/js/catalog.js (.../catalog.js) (revision 5009) +++ trunk/core/admin_templates/js/catalog.js (.../catalog.js) (revision 5018) @@ -70,6 +70,14 @@ $cat_id = get_hidden_field('m_cat_id'); } + // set all item tabs counters to "?" before quering catagories + var $i = 1; + while ($i < this.TabRegistry.length) { + this.setItemCount(this.TabRegistry[$i]['prefix'], '?'); + $i++; + } + + // query sub categories of $cat_id var $url = this.URLMask.replace('#TEMPLATE_NAME#', 'xml/categories_list').replace('#CATEGORY_ID#', $cat_id); Request.makeRequest($url, this.BusyRequest, 'categories_div', this.successCallback, this.errorCallback, 'categories_div'); } @@ -147,4 +155,8 @@ a_toolbar.HideButton($dep_buttons[$i]); $i++; } +} + +Catalog.prototype.setItemCount = function($prefix, $count) { + setInnerHTML($prefix + '_item_count', $count); } \ No newline at end of file Index: trunk/core/kernel/application.php =================================================================== diff -u -r5002 -r5018 --- trunk/core/kernel/application.php (.../application.php) (revision 5002) +++ trunk/core/kernel/application.php (.../application.php) (revision 5018) @@ -1318,6 +1318,7 @@ if (!isset($params['pass'])) $params['pass'] = 'all'; $params['__URLENCODE__'] = 1; $location = $this->HREF($t, $prefix, $params, $index_file); + $a_location = $location; $location = "Location: $location"; //echo " location : $location
"; @@ -1335,10 +1336,16 @@ return true; } else { - if (headers_sent() != '') { - echo ''; + if ($this->GetVar('ajax') == 'yes' && $t != $this->GetVar('t')) { + // redirection to other then current template during ajax request + echo '#redirect#'.$a_location; } + elseif (headers_sent() != '') { + // some output occured -> redirect using javascript + echo ''; + } else { + // no output before -> redirect using HTTP header header("$location"); } } Index: trunk/kernel/admin_templates/incs/catalog.js =================================================================== diff -u -r5009 -r5018 --- trunk/kernel/admin_templates/incs/catalog.js (.../catalog.js) (revision 5009) +++ trunk/kernel/admin_templates/incs/catalog.js (.../catalog.js) (revision 5018) @@ -70,6 +70,14 @@ $cat_id = get_hidden_field('m_cat_id'); } + // set all item tabs counters to "?" before quering catagories + var $i = 1; + while ($i < this.TabRegistry.length) { + this.setItemCount(this.TabRegistry[$i]['prefix'], '?'); + $i++; + } + + // query sub categories of $cat_id var $url = this.URLMask.replace('#TEMPLATE_NAME#', 'xml/categories_list').replace('#CATEGORY_ID#', $cat_id); Request.makeRequest($url, this.BusyRequest, 'categories_div', this.successCallback, this.errorCallback, 'categories_div'); } @@ -147,4 +155,8 @@ a_toolbar.HideButton($dep_buttons[$i]); $i++; } +} + +Catalog.prototype.setItemCount = function($prefix, $count) { + setInnerHTML($prefix + '_item_count', $count); } \ No newline at end of file Index: trunk/kernel/admin_templates/xml/categories_list.tpl =================================================================== diff -u -r5002 -r5018 --- trunk/kernel/admin_templates/xml/categories_list.tpl (.../categories_list.tpl) (revision 5002) +++ trunk/kernel/admin_templates/xml/categories_list.tpl (.../categories_list.tpl) (revision 5018) @@ -4,6 +4,7 @@ Grids['c'] = new Grid('table_white_selected', ':original', edit, a_toolbar); Grids['c'].AddItemsByIdMask('td', /^c_([0-9-]+)/, 'c[$$ID$$][CategoryId]'); Grids['c'].InitItems(); +Grids['c'].SetDependantToolbarButtons( new Array('edit','delete','approve','decline','sep3','cut','copy','move_up','move_down','sep6')); setInnerHTML('category_count', ); set_hidden_field('m_cat_id', ); Index: trunk/core/admin_templates/categories/xml/categories_list.tpl =================================================================== diff -u -r5002 -r5018 --- trunk/core/admin_templates/categories/xml/categories_list.tpl (.../categories_list.tpl) (revision 5002) +++ trunk/core/admin_templates/categories/xml/categories_list.tpl (.../categories_list.tpl) (revision 5018) @@ -4,6 +4,7 @@ Grids['c'] = new Grid('table_white_selected', ':original', edit, a_toolbar); Grids['c'].AddItemsByIdMask('td', /^c_([0-9-]+)/, 'c[$$ID$$][CategoryId]'); Grids['c'].InitItems(); +Grids['c'].SetDependantToolbarButtons( new Array('edit','delete','approve','decline','sep3','cut','copy','move_up','move_down','sep6')); setInnerHTML('category_count', ); set_hidden_field('m_cat_id', );