/** * Displays an campaign delete confirmation view. * * Note, that the campaign for non-index mode operation is automatically determined in the can_handle * phase. * * If create privileges apply, we relocate to the index creation campaign, */ public function _handler_delete($handler_id, array $args, array &$data) { $this->_campaign = $this->_master->load_campaign($args[0]); $this->_campaign->require_do('midgard:delete'); $this->_load_datamanager(); if (array_key_exists('org_openpsa_directmarketing_deleteok', $_REQUEST)) { // Deletion confirmed. if (!$this->_campaign->delete()) { throw new midcom_error("Failed to delete campaign {$args[0]}, last Midgard error was: " . midcom_connection::get_error_string()); } // Update the index $indexer = midcom::get('indexer'); $indexer->delete($this->_campaign->guid); // Delete ok, relocating to welcome. return new midcom_response_relocate(''); } if (array_key_exists('org_openpsa_directmarketing_deletecancel', $_REQUEST)) { // Redirect to view page. return new midcom_response_relocate("campaign/{$this->_campaign->guid}/"); } $this->set_active_leaf('campaign_' . $this->_campaign->id); $this->_prepare_request_data($handler_id); $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => "campaign/edit/{$this->_campaign->guid}/", MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('edit campaign'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/edit.png', MIDCOM_TOOLBAR_ENABLED => $this->_campaign->can_do('midgard:update'), MIDCOM_TOOLBAR_ACCESSKEY => 'e')); midcom::get('head')->set_pagetitle($this->_campaign->title); $this->bind_view_to_object($this->_campaign, $this->_datamanager->schema->name); $this->_update_breadcrumb_line($handler_id); }