@@ 178-209 (lines=32) @@ | ||
175 | exit(); |
|
176 | break; |
|
177 | ||
178 | case 'del': |
|
179 | global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $_GET; |
|
180 | ||
181 | $module_id = $xoopsModule->getVar('mid'); |
|
182 | $gpermHandler = xoops_getHandler('groupperm'); |
|
183 | ||
184 | $fileid = isset($_POST['fileid']) ? (int)$_POST['fileid'] : 0; |
|
185 | $fileid = isset($_GET['fileid']) ? (int)$_GET['fileid'] : $fileid; |
|
186 | ||
187 | $fileObj = new SmartpartnerFile($fileid); |
|
188 | ||
189 | $confirm = isset($_POST['confirm']) ? $_POST['confirm'] : 0; |
|
190 | $title = isset($_POST['title']) ? $_POST['title'] : ''; |
|
191 | ||
192 | if ($confirm) { |
|
193 | if (!$smartPartnerFileHandler->delete($fileObj)) { |
|
194 | redirect_header('partner.php', 2, _AM_SPARTNER_FILE_DELETE_ERROR); |
|
195 | exit; |
|
196 | } |
|
197 | ||
198 | redirect_header('partner.php', 2, sprintf(_AM_SPARTNER_FILEISDELETED, $fileObj->name())); |
|
199 | } else { |
|
200 | // no confirm: show deletion condition |
|
201 | $fileid = isset($_GET['fileid']) ? (int)$_GET['fileid'] : 0; |
|
202 | ||
203 | smartpartner_xoops_cp_header(); |
|
204 | xoops_confirm(array('op' => 'del', 'fileid' => $fileObj->fileid(), 'confirm' => 1, 'name' => $fileObj->name()), 'file.php', |
|
205 | _AM_SPARTNER_DELETETHISFILE . ' <br>' . $fileObj->name() . ' <br> <br>', _AM_SPARTNER_DELETE); |
|
206 | xoops_cp_footer(); |
|
207 | } |
|
208 | ||
209 | exit(); |
|
210 | break; |
|
211 | ||
212 | case 'default': |
@@ 407-437 (lines=31) @@ | ||
404 | break; |
|
405 | //end of fx2024 code |
|
406 | ||
407 | case 'del': |
|
408 | global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $_GET; |
|
409 | ||
410 | $module_id = $xoopsModule->getVar('mid'); |
|
411 | $gpermHandler = xoops_getHandler('groupperm'); |
|
412 | ||
413 | $categoryid = isset($_POST['categoryid']) ? (int)$_POST['categoryid'] : 0; |
|
414 | $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : $categoryid; |
|
415 | ||
416 | //$categoryObj = new SmartpartnerCategory($categoryid); |
|
417 | $categoryObj = $smartPartnerCategoryHandler->get($categoryid); |
|
418 | ||
419 | $confirm = isset($_POST['confirm']) ? $_POST['confirm'] : 0; |
|
420 | $name = isset($_POST['name']) ? $_POST['name'] : ''; |
|
421 | ||
422 | if ($confirm) { |
|
423 | if (!$smartPartnerCategoryHandler->delete($categoryObj)) { |
|
424 | redirect_header('category.php', 1, _AM_SPARTNER_CATEGORY_DELETE_ERROR); |
|
425 | exit; |
|
426 | } |
|
427 | ||
428 | redirect_header('category.php', 1, sprintf(_AM_SPARTNER_CATEGORY_DELETED, $name)); |
|
429 | } else { |
|
430 | // no confirm: show deletion condition |
|
431 | $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0; |
|
432 | xoops_cp_header(); |
|
433 | xoops_confirm(array('op' => 'del', 'categoryid' => $categoryObj->categoryid(), 'confirm' => 1, 'name' => $categoryObj->name()), 'category.php', |
|
434 | _AM_SPARTNER_CATEGORY_DELETE . " '" . $categoryObj->name() . "'. <br> <br>" . _AM_SPARTNER_CATEGORY_DELETE_CONFIRM, _AM_SPARTNER_DELETE); |
|
435 | xoops_cp_footer(); |
|
436 | } |
|
437 | exit(); |
|
438 | break; |
|
439 | ||
440 | case 'cancel': |
@@ 461-491 (lines=31) @@ | ||
458 | ||
459 | break; |
|
460 | ||
461 | case 'del': |
|
462 | global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $_GET; |
|
463 | ||
464 | $module_id = $xoopsModule->getVar('mid'); |
|
465 | $gpermHandler = xoops_getHandler('groupperm'); |
|
466 | ||
467 | $id = isset($_POST['id']) ? (int)$_POST['id'] : 0; |
|
468 | $id = isset($_GET['id']) ? (int)$_GET['id'] : $id; |
|
469 | ||
470 | $partnerObj = new SmartpartnerPartner($id); |
|
471 | ||
472 | $confirm = isset($_POST['confirm']) ? $_POST['confirm'] : 0; |
|
473 | $title = isset($_POST['title']) ? $_POST['title'] : ''; |
|
474 | ||
475 | if ($confirm) { |
|
476 | if (!$smartPartnerPartnerHandler->delete($partnerObj)) { |
|
477 | redirect_header('partner.php', 2, _AM_SPARTNER_PARTNER_DELETE_ERROR); |
|
478 | exit; |
|
479 | } |
|
480 | ||
481 | redirect_header('partner.php', 2, sprintf(_AM_SPARTNER_PARTNER_DELETE_SUCCESS, $partnerObj->title())); |
|
482 | } else { |
|
483 | // no confirm: show deletion condition |
|
484 | $id = isset($_GET['id']) ? (int)$_GET['id'] : 0; |
|
485 | xoops_cp_header(); |
|
486 | xoops_confirm(array('op' => 'del', 'id' => $partnerObj->id(), 'confirm' => 1, 'name' => $partnerObj->title()), 'partner.php', |
|
487 | _AM_SPARTNER_DELETETHISP . " <br>'" . $partnerObj->title() . "' <br> <br>", _AM_SPARTNER_DELETE); |
|
488 | xoops_cp_footer(); |
|
489 | } |
|
490 | ||
491 | exit(); |
|
492 | break; |
|
493 | ||
494 | case 'default': |