Index: admin/categories.php =================================================================== --- admin/categories.php (revision 1594) +++ admin/categories.php (revision 1595) @@ -56,32 +56,10 @@ # Update order -if (!empty($_POST['save_order'])) -{ - if (!empty($_POST['categories_order'])) { // js is enable - $categories = json_decode($_POST['categories_order']); - - foreach ($categories as $category) { - if (!empty($category->item_id)) { - $core->blog->updCategoryPosition($category->item_id, $category->left, $category->right); - } - } - } elseif (!empty($_POST['cat_rank'])) { - function countChildren($t, $id) { - $c = 0; - foreach ($t as $k => $v) { - if (preg_match('`^'.$id.'\..*`', $k)) { - $c++; - } - } - - return $c; - } - - $i = 1; - $ranks = array_flip($_POST['cat_rank']); - uksort($ranks, 'version_compare'); - foreach ($ranks as $str => $id) { - $core->blog->updCategoryPosition($id, $i, ($i + 2 * countChildren($ranks, $str) + 1)); - $i = $i+2; +if (!empty($_POST['save_order']) && !empty($_POST['categories_order'])) { + $categories = json_decode($_POST['categories_order']); + + foreach ($categories as $category) { + if (!empty($category->item_id)) { + $core->blog->updCategoryPosition($category->item_id, $category->left, $category->right); } } @@ -165,5 +143,4 @@ $ref_level = $level = $rs->level-1; - $parts = array(); while ($rs->fetch()) { @@ -172,11 +149,6 @@ if ($rs->level > $level) { echo str_repeat('
'.
@@ -193,7 +164,5 @@
sprintf(($rs->nb_post > 1 ? __('%d entries') : __('%d entry') ),$rs->nb_post).''.
', '.__('total:').' '.$rs->nb_total.') '.
- ''.__('URL:').' '.html::escapeHTML($rs->cat_url).'
'.
- form::field('cat_rank['.$rs->cat_id.']',10,10,$cat_rank,'cat-rank').
- '
'.html::escapeHTML($rs->cat_url).'
';
$level = $rs->level;
Index: admin/js/_categories.js
===================================================================
--- admin/js/_categories.js (revision 1594)
+++ admin/js/_categories.js (revision 1595)
@@ -1,5 +1,4 @@
$(function() {
if ($.fn['nestedSortable']!==undefined) {
- $('.dragdrop-hidden, .cat-rank').hide();
$('#categories ul li').css('cursor','move');
$('#save-set-order').prop('disabled',true).addClass('disabled');