function DelCategory() { global $zbp; $id = (int) GetVars('id', 'GET'); $cate = $zbp->GetCategoryByID($id); if ($cate->ID > 0) { DelCategory_Articles($cate->ID); $cate->Del(); $zbp->LoadCategorys(); $zbp->AddBuildModule('catalog'); $zbp->DelItemToNavbar('category', $cate->ID); foreach ($GLOBALS['Filter_Plugin_DelCategory_Succeed'] as $fpname => &$fpsignal) { $fpname($cate); } } return true; }
/** * 删除分类 * @return bool */ function DelCategory() { global $zbp; $id = (int) GetVars('id', 'GET'); $cate = $zbp->GetCategoryByID($id); if ($cate->ID > 0) { if (count($cate->SubCategories) > 0) { $zbp->ShowError(49, __FILE__, __LINE__); return false; } DelCategory_Articles($cate->ID); $cate->Del(); $zbp->LoadCategorys(); $zbp->AddBuildModule('catalog'); $zbp->DelItemToNavbar('category', $cate->ID); foreach ($GLOBALS['hooks']['Filter_Plugin_DelCategory_Succeed'] as $fpname => &$fpsignal) { $fpname($cate); } } return true; }