$galleries = $pictures_handler->getAll($criteria, array('pic_path'), false); foreach ($galleries as $k => $v) { unlink($picture_dir . $v['pic_path']); unlink($picture_dir . 'mid_' . $v['pic_path']); unlink($picture_dir . 'thumb_' . $v['pic_path']); } $pictures_handler->deleteAll($criteria, true); } if ($item_picture) { unlink($picture_dir . $item_picture); unlink($picture_dir . 'mid_' . $item_picture); unlink($picture_dir . 'thumb_' . $item_picture); } redirect_header('admin.item.php', 3, _AM_CATALOG_DELETESUCCESS); } else { echo _AM_CATALOG_ACTIVEERROR; } } else { xoops_confirm(array('ok' => 1, 'item_id' => $item_id, 'ac' => 'delete'), $_SERVER['REQUEST_URI'], _AM_CATALOG_RESUREDEL); } break; default: include_once dirname(dirname(__FILE__)) . "/include/functions.php"; $weight = isset($_REQUEST['weight']) ? $_REQUEST['weight'] : ''; if ($weight) { ContentOrder($weight, 'item', 'weight'); } redirect_header('admin.item.php', 3, _AM_CATALOG_ACTIVSUCCESS); break; } include "footer.php";
<?php include 'header.php'; xoops_cp_header(); loadModuleAdminMenu(4, ""); include_once dirname(dirname(__FILE__)) . "/include/functions.php"; $op = isset($_REQUEST['op']) ? trim($_REQUEST['op']) : 'list'; $cat_id = isset($_REQUEST['cat_id']) ? trim($_REQUEST['cat_id']) : ''; $category_handler = xoops_getmodulehandler('category', 'catalog'); switch ($op) { default: case 'list': $cat_weight = isset($_REQUEST['cat_weight']) ? $_REQUEST['cat_weight'] : ''; if (!empty($cat_weight)) { $ac_weight = ContentOrder($cat_weight, 'category', 'cat_weight'); if (!empty($ac_weight)) { redirect_header('admin.category.php', 3, _AM_CATALOG_UPDATEDSUCCESS); } } $categories =& $category_handler->getTrees(0, " "); foreach ($categories as $k => $v) { $categories[$k]['cat_published'] = formatTimestamp($v['cat_published'], 'Y/m/d'); } $xoopsTpl->assign('categories', $categories); $xoopsTpl->assign('xoops_dirname', $xoopsModule->dirname()); $template_main = "catalog_admin_category.html"; break; case 'new': $category_obj =& $category_handler->create(); $action = 'action.category.php'; $form = $category_obj->getForm($action);
$country_id = isset($_REQUEST['country_id']) ? trim($_REQUEST['country_id']) : ''; $country_handler = xoops_getmodulehandler('country', 'catalog'); $brand_handler = xoops_getmodulehandler('brand', 'catalog'); $item_handler = xoops_getmodulehandler('item', 'catalog'); switch ($op) { default: case "list": include_once XOOPS_ROOT_PATH . "/class/pagenav.php"; $start = isset($_GET["start"]) ? intval($_GET["start"]) : 0; $items_perpage = $xoopsModuleConfig['countries']; $total = intval($country_handler->getCount()); $pagenav = new XoopsPageNav($total, $items_perpage, $start, "start"); include_once dirname(dirname(__FILE__)) . "/include/functions.php"; $country_weight = isset($_POST['country_weight']) ? $_POST['country_weight'] : ''; if ($country_weight) { ContentOrder($country_weight, 'country', 'country_weight'); } $country = isset($_POST['country']) ? $_POST['country'] : ''; if ($country) { $criteria = new CriteriaCompo(); $criteria->add(new Criteria('country_id', '(' . implode(',', $country) . ')', 'IN')); $country_handler->deleteAll($criteria, true); redirect_header('admin.country.php', 3, _AM_CATALOG_ACTIVSUCCESS); } $criteria = new CriteriaCompo(); $criteria->setSort('country_weight'); $criteria->setOrder('ASC'); $criteria->setLimit($items_perpage); $criteria->setStart($start); $country = $country_handler->getAll($criteria, null, false, false); foreach ($country as $k => $v) {
$brand_obj =& $brand_handler->get($brand_id); if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1) { if (!$GLOBALS['xoopsSecurity']->check()) { redirect_header('admin.brand.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); } $criteria = new CriteriaCompo(); $criteria->add(new Criteria('brand_id', $brand_id)); if ($brand_handler->delete($brand_obj)) { redirect_header('admin.brand.php', 3, _AM_CATALOG_DELETESUCCESS); } else { echo _AM_CATALOG_ACTIVEERROR; } } else { xoops_confirm(array('ok' => 1, 'brand_id' => $brand_id, 'ac' => 'delete'), $_SERVER['REQUEST_URI'], _AM_CATALOG_RESUREDEL); } break; default: include_once dirname(dirname(__FILE__)) . "/include/functions.php"; $brand_weight = isset($_REQUEST['brand_weight']) ? $_REQUEST['brand_weight'] : ''; if ($brand_weight) { ContentOrder($brand_weight, 'brand', 'brand_weight'); } if ($brand_id) { $criteria = new CriteriaCompo(); $criteria->add(new Criteria('brand_id', '(' . implode(',', $brand_id) . ')', 'IN')); $brand_handler->deleteAll($criteria, true); } redirect_header('admin.brand.php', 3, _AM_CATALOG_ACTIVSUCCESS); break; } include 'footer.php';