$cid = tep_db_prepare_input($_POST['categories_id']); $prefix = tep_db_prepare_input($_POST['prefix']); if ($cid == '0') { $cat_id_new = true; $ctid = tep_db_prepare_input($_POST['categories_top_id']); $cid = Category::createNewCategory($ctid, $prefix); $cat = new Category($cid); } else { $cat_id_new = false; $cat = new Category($cid); $cat->updateDetail($prefix); } foreach ($languages as $lid => $l) { $name = tep_db_prepare_input($_POST['categories_name'][$lid]); $seo_text = tep_db_input($_POST['seo_text'][$lid]); $cat->updateDetailLanguage($lid, $name, $seo_text); } if ($cat_id_new) { $hm = $hidemenuscript == '' ? '' : '&hidemenu=true'; header('Location: ?open=setting-category&id=' . $cat->id . $hm); exit; } } elseif ($_POST['me_action'] == 'DELETECATEGORY') { $cid = tep_db_prepare_input($_POST['categories_id']); $cat = new Category($cid); $ctid = $cat->getCategoryTop()->id; $cat->delete(); $messagebox->add('A Category has been succesfully deleted,' . ' please refresh the list to see the update', 'green'); $_GET['id'] = 'new'; $_GET['ctid'] = $ctid; }