Code Duplication    Length = 12-12 lines in 2 locations

admin/category.php 1 location

@@ 37-48 (lines=12) @@
34
        $categoryObj = $publisher->getHandler('category')->get($categoryid);
35
        $confirm     = XoopsRequest::getInt('confirm', '', 'POST');
36
        $name        = XoopsRequest::getString('name', '', 'POST');
37
        if ($confirm) {
38
            if (!$publisher->getHandler('category')->delete($categoryObj)) {
39
                redirect_header('category.php', 1, _AM_PUBLISHER_DELETE_CAT_ERROR);
40
                //                exit();
41
            }
42
            redirect_header('category.php', 1, sprintf(_AM_PUBLISHER_COLISDELETED, $name));
43
            //            exit();
44
        } else {
45
            xoops_cp_header();
46
            xoops_confirm(array('op' => 'del', 'categoryid' => $categoryObj->categoryid(), 'confirm' => 1, 'name' => $categoryObj->name()), 'category.php',
47
                          _AM_PUBLISHER_DELETECOL . " '" . $categoryObj->name() . "'. <br> <br>" . _AM_PUBLISHER_DELETE_CAT_CONFIRM, _AM_PUBLISHER_DELETE);
48
            xoops_cp_footer();
49
        }
50
        break;
51

admin/item.php 1 location

@@ 149-160 (lines=12) @@
146
        $itemObj = $publisher->getHandler('item')->get($itemid);
147
        $confirm = XoopsRequest::getInt('confirm', '', 'POST');
148
149
        if ($confirm) {
150
            if (!$publisher->getHandler('item')->delete($itemObj)) {
151
                redirect_header('item.php', 2, _AM_PUBLISHER_ITEM_DELETE_ERROR . publisherFormatErrors($itemObj->getErrors()));
152
                //                exit();
153
            }
154
            redirect_header('item.php', 2, sprintf(_AM_PUBLISHER_ITEMISDELETED, $itemObj->getTitle()));
155
            //            exit();
156
        } else {
157
            xoops_cp_header();
158
            xoops_confirm(array('op' => 'del', 'itemid' => $itemObj->itemid(), 'confirm' => 1, 'name' => $itemObj->getTitle()), 'item.php',
159
                          _AM_PUBLISHER_DELETETHISITEM . " <br>'" . $itemObj->getTitle() . "'. <br> <br>", _AM_PUBLISHER_DELETE);
160
            xoops_cp_footer();
161
        }
162
        exit();
163
        break;