@@ 154-166 (lines=13) @@ | ||
151 | $itemObj = $publisher->getItemHandler()->get($itemid); |
|
152 | $confirm = isset($_POST['confirm']) ? $_POST['confirm'] : 0; |
|
153 | ||
154 | if ($confirm) { |
|
155 | if (!$publisher->getItemHandler()->delete($itemObj)) { |
|
156 | $xoops->redirect("item.php", 2, _AM_PUBLISHER_ITEM_DELETE_ERROR . PublisherUtils::formatErrors($itemObj->getErrors())); |
|
157 | exit(); |
|
158 | } |
|
159 | $xoops->redirect("item.php", 2, sprintf(_AM_PUBLISHER_ITEMISDELETED, $itemObj->title())); |
|
160 | } else { |
|
161 | $xoops->header(); |
|
162 | echo $xoops->confirm(array( |
|
163 | 'op' => 'del', 'itemid' => $itemObj->getVar('itemid'), 'confirm' => 1, 'name' => $itemObj->title() |
|
164 | ), 'item.php', _AM_PUBLISHER_DELETETHISITEM . " <br />'" . $itemObj->title() . "'. <br /> <br />", _AM_PUBLISHER_DELETE); |
|
165 | $xoops->footer(); |
|
166 | } |
|
167 | exit(); |
|
168 | break; |
|
169 |
@@ 113-122 (lines=10) @@ | ||
110 | case 'del': |
|
111 | $confirm = isset($_POST['confirm']) ? $_POST['confirm'] : 0; |
|
112 | ||
113 | if ($confirm) { |
|
114 | if (!$publisher->getItemHandler()->delete($itemObj)) { |
|
115 | $xoops->redirect("index.php", 2, _AM_PUBLISHER_ITEM_DELETE_ERROR . PublisherUtils::formatErrors($itemObj->getErrors())); |
|
116 | } |
|
117 | $xoops->redirect("index.php", 2, sprintf(_AM_PUBLISHER_ITEMISDELETED, $itemObj->title())); |
|
118 | } else { |
|
119 | $xoops->header(); |
|
120 | echo $xoops->confirm(array('op' => 'del', 'itemid' => $itemObj->getVar('itemid'), 'confirm' => 1, 'name' => $itemObj->title()), 'submit.php', _AM_PUBLISHER_DELETETHISITEM . " <br />'" . $itemObj->title() . "'. <br /> <br />", _AM_PUBLISHER_DELETE); |
|
121 | $xoops->footer(); |
|
122 | } |
|
123 | break; |
|
124 | case 'preview': |
|
125 | // Putting the values about the ITEM in the ITEM object |