public function __construct() { global $osC_Language, $osC_MessageStack; parent::__construct(); $this->_page_contents = 'entries_delete.php'; if (isset($_POST['subaction']) && $_POST['subaction'] == 'confirm') { if (osC_ZoneGroups_Admin::deleteEntry($_GET['zeID'])) { $osC_MessageStack->add($this->_module, $osC_Language->get('ms_success_action_performed'), 'success'); } else { $osC_MessageStack->add($this->_module, $osC_Language->get('ms_error_action_not_performed'), 'error'); } osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module . '=' . $_GET[$this->_module])); } }
public function __construct() { global $osC_Language, $osC_MessageStack; parent::__construct(); if (isset($_POST['batch']) && is_array($_POST['batch']) && !empty($_POST['batch'])) { $this->_page_contents = 'entries_batch_delete.php'; if (isset($_POST['subaction']) && $_POST['subaction'] == 'confirm') { $error = false; foreach ($_POST['batch'] as $id) { if (!osC_ZoneGroups_Admin::deleteEntry($id)) { $error = true; break; } } if ($error === false) { $osC_MessageStack->add($this->_module, $osC_Language->get('ms_success_action_performed'), 'success'); } else { $osC_MessageStack->add($this->_module, $osC_Language->get('ms_error_action_not_performed'), 'error'); } osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module . '=' . $_GET[$this->_module])); } } }
function deleteZoneEntries() { global $toC_Json, $osC_Language; $error = false; $batch = explode(',', $_REQUEST['batch']); foreach ($batch as $id) { if (!osC_ZoneGroups_Admin::deleteEntry($id)) { $error = true; break; } } if ($error === false) { $response = array('success' => true, 'feedback' => $osC_Language->get('ms_success_action_performed')); } else { $response = array('success' => false, 'feedback' => $osC_Language->get('ms_error_action_not_performed')); } echo $toC_Json->encode($response); }