check(5); include dirname(__FILE__).'/inc/connexion.php'; $err = ''; # Reord if (!empty($_GET['reord'])) { if ($blog->reordCats(false,true) === false) { $err = $blog->error(1); } else { header('Location: cat_list.php'); exit; } } # Classic ord if (isset($_POST['catOrd']) && is_array($_POST['catOrd'])) { if ($blog->ordCats($_POST['catOrd']) === false) { $err = $blog->error(1); } else { header('Location: cat_list.php'); exit; } } # DragNdrop if (!empty($_POST['dndSort'])) { $catOrd = array(); foreach (explode(';',$_POST['dndSort']) as $k => $v) { $catOrd[substr($v,3)] = $k; } if ($blog->ordCats($catOrd) === false) { $err = $blog->error(1); } else { header('Location: cat_list.php'); exit; } } $mySubMenu->addItem(''.__('New category').'','categorie.php','images/ico_new.png',false); openPage(__('Categories list'), ' '. ' '. ' '); ?>

'.__('Error(s)').' :

'. $err.''; } $rsCat = $blog->getCat('','cat_ord'); if ($rsCat->isEmpty()) { echo '

'.__('No category yet').'

'; } else { echo '

'.__('Drag items to change their positions.').'

'; echo '
'; echo '
'; while(!$rsCat->EOF()) { $cat_id = $rsCat->field('cat_id'); $cat_ord = $rsCat->field('cat_ord'); $cat_libelle = $rsCat->field('cat_libelle'); $cat_nb_post = (integer) $rsCat->field('nb_post'); echo '
'. '

'. $cat_libelle.' - '; if ($cat_nb_post > 0) { echo ''. (($cat_nb_post>1) ? sprintf(__('%d entries'),$cat_nb_post) : sprintf(__('%d entry'),$cat_nb_post)). ''; } else { echo ''. __('delete').''; } echo '

'. '

'. form::field(array('catOrd['.$cat_id.']','catOrd'.$cat_id),3,3,$cat_ord).'

'. '
'; $rsCat->moveNext(); } echo '
'. '

'. '

'. '
'; echo '

'.__('Reorder categories').'

'; } ?>