if ($section_id === false) { $backend->print_error('Error adding module'); } else { if (file_exists(CAT_PATH . '/modules/' . $module . '/add.php')) { global $backend, $admin; $admin =& $backend; require CAT_PATH . '/modules/' . $module . '/add.php'; } } } elseif ($delete_section_id != '') { $section_id = $delete_section_id; $section = CAT_Sections::getSection($section_id); if (file_exists(CAT_PATH . '/modules/' . $section['module'] . '/delete.php')) { require CAT_PATH . '/modules/' . $section['module'] . '/delete.php'; } if (CAT_Sections::deleteSection($section_id, $page_id)) { $backend->print_success('Success', CAT_ADMIN_URL . '/pages/modify.php?page_id=' . $page_id); exit; } } elseif ($update_section_id != '') { $block = $val->sanitizeGet('block'); $name = $val->sanitizeGet('name'); $day_from = is_numeric($val->sanitizeGet('day_from')) ? $val->sanitizeGet('day_from') : 0; $month_from = is_numeric($val->sanitizeGet('month_from')) ? $val->sanitizeGet('month_from') : 0; $year_from = is_numeric($val->sanitizeGet('year_from')) ? $val->sanitizeGet('year_from') : 0; $hour_from = is_numeric($val->sanitizeGet('hour_from')) ? $val->sanitizeGet('hour_from') : 0; $minute_from = is_numeric($val->sanitizeGet('minute_from')) ? $val->sanitizeGet('minute_from') : 0; $day_to = is_numeric($val->sanitizeGet('day_to')) ? $val->sanitizeGet('day_to') : 0; $month_to = is_numeric($val->sanitizeGet('month_to')) ? $val->sanitizeGet('month_to') : 0; $year_to = is_numeric($val->sanitizeGet('year_to')) ? $val->sanitizeGet('year_to') : 0; $hour_to = is_numeric($val->sanitizeGet('hour_to')) ? $val->sanitizeGet('hour_to') : 0;
} } elseif ($delete_section_id) { $section = CAT_Sections::getSection($delete_section_id); if (!$section || !is_array($section) || !count($section)) { $ajax = array('message' => $backend->lang()->translate('Section not found.'), 'success' => false); print json_encode($ajax); exit; } // ================================================ // ! Include the modules delete file if it exists // ================================================ if (file_exists(CAT_PATH . '/modules/' . $section['module'] . '/delete.php')) { $section_id = $delete_section_id; require CAT_PATH . '/modules/' . $section['module'] . '/delete.php'; } if (!CAT_Sections::deleteSection($delete_section_id, $page_id)) { $ajax = array('message' => $backend->db()->getError(), 'success' => false); print json_encode($ajax); exit; } else { // ======================= // ! Reorder the sections // ======================= require CAT_PATH . '/framework/class.order.php'; $order = new order(CAT_TABLE_PREFIX . 'sections', 'position', 'section_id', 'page_id'); $order->clean($page_id); $ajax = array('message' => $backend->lang()->translate('Section deleted successfully.'), 'success' => true); print json_encode($ajax); exit; } } elseif ($update_section_id) {