public function delete_events() { //-------------------------------------------- // call cal delete events hook //-------------------------------------------- if (ee()->extensions->active_hook('calendar_delete_events') === TRUE) { $edata = ee()->extensions->call('calendar_delete_events', $this); if (ee()->extensions->end_script === TRUE) { return; } } if (APP_VER < 2.0) { if (!class_exists('Publish')) { require_once PATH_CP . 'cp.publish' . EXT; $PB = new Publish(); $PB->delete_entries(); } } else { if (!ee()->cp->allowed_group('can_access_content')) { show_error(lang('unauthorized_access')); } if (!ee()->cp->allowed_group('can_delete_self_entries') and !ee()->cp->allowed_group('can_delete_all_entries')) { show_error(lang('unauthorized_access')); } // ------------------------------------------- // 'delete_entries_start' hook. // - Perform actions prior to entry deletion / take over deletion if (ee()->extensions->active_hook('delete_entries_start') === TRUE) { $edata = ee()->extensions->call('delete_entries_start'); if (ee()->extensions->end_script === TRUE) { return; } } // // ------------------------------------------- ee()->api->instantiate('channel_entries'); $res = ee()->api_channel_entries->delete_entry(ee()->input->post('delete')); } //sadly, if the entries were deleted somewhere else, they might not get properly deleted $delete = ee()->input->post('delete'); //this should be an array coming from the delete_confirm, but JUUUST in case if (!is_array($delete)) { if (!is_numeric($delete)) { return; } $delete = array($delete); } foreach ($delete as $id) { $this->data->delete_event($id); } }