/** * Удаление разделов (подразделов) * * @param integer $section_id ИД раздела * @param inetger $sub ИД родителя подраздела (для удаления подразделов) * @return object xajaxResponse */ function deleteSection($section_id, $sub = false) { session_start(); if (!hasPermissions('seo')) { return false; } $objResponse = new xajaxResponse(); $seo = new seo($_SESSION['subdomain']); $section = $seo->getSectionById($section_id); $direction = $seo->getDirections($section['direct_id']); $seo->deleteSection($section_id); if ($sub) { $section = $seo->getFullSectionById($sub); ob_start(); include $_SERVER['DOCUMENT_ROOT'] . '/catalog/admin/tpl.section.php'; $html = ob_get_clean(); $objResponse->assign("section_{$sub}", "innerHTML", $html); $objResponse->script("init_collapse_button('section_{$sub}');"); // активируем кнопку разворачивания подменю } else { $objResponse->script("location.href = '/catalog/admin/?direction={$direction[0]['name_section_link']}'"); } return $objResponse; }