function delete_poll($existing) { global $sql, $admin_log; if ($sql->db_Delete("polls", " poll_id='" . intval($existing) . "' ")) { if (function_exists("admin_purge_related")) { admin_purge_related("poll", $existing); } $admin_log->log_event('POLL_01', POLL_ADLAN08 . ': ' . $existing, ''); return POLL_ADLAN08; } }
function delete_poll($existing) { global $admin_log; $sql = e107::getDb(); if ($sql->delete("polls", " poll_id='" . intval($existing) . "' ")) { if (function_exists("admin_purge_related")) { admin_purge_related("poll", $existing); } e107::getLog()->add('POLL_01', LAN_AL_POLL_01 . ': ' . $existing, ''); //return POLL_ADLAN08; } }
$download->create_download($sub_action, $id); } if ($delete == 'category') { if (admin_update($sql->db_Delete('download_category', 'download_category_id=' . $del_id), 'delete', DOWLAN_49 . " #" . $del_id . " " . DOWLAN_36)) { $sql->db_Delete('download_category', 'download_category_parent=' . $del_id); $admin_log->log_event('DOWNL_04', $del_id, E_LOG_INFORMATIVE, ''); } } if ($action == 'cat') { $download->show_categories($sub_action, $id); } if ($delete == 'main') { $result = admin_update($sql->db_Delete('download', 'download_id=' . $del_id), 'delete', DOWLAN_27 . " #" . $del_id . " " . DOWLAN_36); if ($result) { $admin_log->log_event('DOWNL_07', $del_id, E_LOG_INFORMATIVE, ''); admin_purge_related('download', $del_id); $e_event->trigger('dldelete', $del_id); } unset($sub_action, $id); } if (isset($message)) { $ns->tablerender("", "<div style='text-align:center'><b>" . $message . "</b></div>"); } if (!e_QUERY || $action == "main") { $download->show_existing_items($action, $sub_action, $id, $from, $amount); } if ($action == "opt") { global $pref, $ns; $agree_flag = $pref['agree_flag']; $agree_text = $pref['agree_text']; $text = "<div style='text-align:center'>\n\t\t<form method='post' action='" . e_SELF . "?" . e_QUERY . "'>\n\n\t\t<table style='" . ADMIN_WIDTH . "' class='fborder'>\n\t\t<colgroup>\n\t\t<col style='width:70%' />\n\t\t<col style='width:30%' />\n\t\t</colgroup>\n\t\t<tr>\n\t\t<td class='forumheader3'>" . DOWLAN_69 . "</td>\n\t\t<td class='forumheader3' style='text-align:left'>";
function _observe_delete() { $admin_log = e107::getAdminLog(); //FIXME - SEF URL cache $tmp = array_keys($_POST['delete']); list($delete, $del_id) = explode("_", $tmp[0]); $del_id = intval($del_id); if (!$del_id) { return false; } $e107 = e107::getInstance(); switch ($delete) { case 'main': if ($e107->sql->db_Count('news', '(*)', "news_id={$del_id}")) { e107::getEvent()->trigger("newsdel", $del_id); if ($e107->sql->db_Delete("news", "news_id={$del_id}")) { $admin_log->log_event('NEWS_01', $del_id, E_LOG_INFORMATIVE, ''); $this->show_message(NWSLAN_31 . " #" . $del_id . " " . NWSLAN_32, E_MESSAGE_SUCCESS); $this->clear_cache(); $data = array('method' => 'delete', 'table' => 'news', 'id' => $del_id, 'plugin' => 'news', 'function' => 'delete'); $this->show_message(e107::getEvent()->triggerHook($data), E_MESSAGE_WARNING); admin_purge_related("news", $del_id); } } break; case 'category': if (!getperms('0|7')) { $this->noPermissions(); } if (($count = $e107->sql->db_Count('news', '(news_id)', "news_category={$del_id}")) === false || $count > 0) { $this->show_message('Category is in used in <strong>' . $count . '</strong> news items and cannot be deleted.', E_MESSAGE_ERROR); return false; } if ($e107->sql->db_Count('news_category', '(*)', "category_id={$del_id}")) { e107::getEvent()->trigger("newscatdel", $del_id); if ($e107->sql->db_Delete("news_category", "category_id={$del_id}")) { $admin_log->log_event('NEWS_02', $del_id, E_LOG_INFORMATIVE, ''); $this->show_message(NWSLAN_33 . " #" . $del_id . " " . NWSLAN_32, E_MESSAGE_SUCCESS); $this->clear_cache(); } } break; case 'sn': if ($e107->sql->db_Delete("submitnews", "submitnews_id={$del_id}")) { $admin_log->log_event('NEWS_03', $del_id, E_LOG_INFORMATIVE, ''); $this->show_message(NWSLAN_34 . " #" . $del_id . " " . NWSLAN_32); $this->clear_cache(); } break; default: return false; } return true; }