check(5); include dirname(__FILE__).'/inc/connexion.php'; $err = ''; $cat_libelle = ''; $cat_libelle_url = ''; $cat_desc = ''; # Edition d'une catégorie if (!empty($_REQUEST['cat_id'])) { $rsCat = $blog->getCat($_REQUEST['cat_id']); $cat_libelle = $rsCat->field('cat_libelle'); $cat_libelle_url = $rsCat->field('cat_libelle_url'); $cat_desc = $rsCat->field('cat_desc'); $cat_id = $rsCat->field('cat_id'); # Suppression if (!empty($_GET['del'])) { if ($blog->delCat($cat_id) !== false) { $msg = __('Category has been deleted'); header('Location: cat_list.php?msg='.rawurlencode($msg)); exit; } else { $msg = __('Cannot delete category'); header('Location: cat_list.php?msg='.rawurlencode($msg)); } } # Modification if (!empty($_POST['submit']) && $cat_id) { $cat_libelle = $_POST['cat_libelle']; $cat_libelle_url = $_POST['cat_libelle_url']; $cat_desc = $_POST['cat_desc']; if ($blog->updCat($cat_id,$cat_libelle,$cat_desc,$cat_libelle_url) !== false) { $msg = __('Category has been updated'); header('Location: cat_list.php?msg='.rawurlencode($msg)); exit; } else { $err = $blog->error(1); } } } # Ajout d'une catégorie elseif (!empty($_POST['submit'])) { $cat_libelle = $_POST['cat_libelle']; $cat_libelle_url = $_POST['cat_libelle_url']; $cat_desc = $_POST['cat_desc']; if ($blog->addCat($cat_libelle,$cat_desc,$cat_libelle_url) !== false) { $msg = __('Category has been created'); header('Location: cat_list.php?msg='.rawurlencode($msg)); exit; } else { $err = $blog->error(1); } } openPage(__('Category')); if ($err != '') { echo '
'.__('Error(s)').' :
'. $err.'