diff --git a/e107_plugins/download/admin_download.php b/e107_plugins/download/admin_download.php index f8765b945..5e26c0df5 100644 --- a/e107_plugins/download/admin_download.php +++ b/e107_plugins/download/admin_download.php @@ -60,12 +60,6 @@ $adminDownload = new adminDownload(); new plugin_download_admin(); require_once(e_ADMIN."auth.php"); - - - - - - $pst->save_preset(); // unique name(s) for the presets - comma separated. /* @@ -275,7 +269,7 @@ if (isset($_POST['submit_mirror'])) if ($action == "mirror") { - $adminDownload->show_existing_mirrors(); + //$adminDownload->show_existing_mirrors(); } @@ -287,48 +281,6 @@ if ($action == "dlm") } -if ($action == "create") -{ - $adminDownload->create_download($subAction, $id); -} - - -if (isset($delete) && $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') -{ - $adminDownload->show_categories($subAction, $id); -} - - -if (isset($delete) && $delete == 'main') -{ - $result = $sql->db_Delete('download', 'download_id='.$del_id); - if ($result) - { - // Process triggers before calling admin_update so trigger messages can be shown - $data = array('method'=>'delete', 'table'=>'download', 'id'=>$del_id, 'plugin'=>'download', 'function'=>'delete_download'); - $hooks = $e107->e_event->triggerHook($data); - require_once(e_HANDLER."message_handler.php"); - $emessage = &eMessage::getInstance(); - $emessage->add($hooks, E_MESSAGE_SUCCESS); - - admin_update($result, 'delete', DOWLAN_27." #".$del_id." ".DOWLAN_36); - - $admin_log->log_event('DOWNL_07',$del_id,E_LOG_INFORMATIVE,''); - admin_purge_related('download', $del_id); - $e_event->trigger('dldelete', $del_id); - } - unset($subAction, $id); -} if (isset($message)) { @@ -348,10 +300,10 @@ if ($from === "maint" && isset($_POST['submit_download'])) if (!e_QUERY || $action == "main") { - $text = $emessage->render(); - $text .= $adminDownload->show_filter_form($action, $subAction, $id, $from, $amount); - $text .= $adminDownload->show_existing_items($action, $subAction, $id, $from, $amount); - $ns->tablerender(DOWLAN_7, $text); + //$text = $emessage->render(); + //$text .= $adminDownload->show_filter_form($action, $subAction, $id, $from, $amount); + //$text .= $adminDownload->show_existing_items($action, $subAction, $id, $from, $amount); + //$ns->tablerender(DOWLAN_7, $text); } @@ -388,6 +340,8 @@ function showLimits() { $sql = e107::getDb(); $ns = e107::getRender(); + $tp = e107::getParser(); + global $pref; if ($sql->db_Select('userclass_classes','userclass_id, userclass_name')) @@ -491,6 +445,8 @@ function showMaint() global $pref; $ns = e107::getRender(); $sql = e107::getDb(); + $frm = e107::getForm(); + $tp = e107::getParser(); if (isset($_POST['dl_maint'])) { switch ($_POST['dl_maint']) @@ -511,8 +467,9 @@ function showMaint() $currentURL = ""; while($row = $sql->db_Fetch()) { if (!$foundSome) { - $text .= $rs->form_open("post", e_SELF."?".e_QUERY, "myform"); - $text .= ''; + // $text .= $rs->form_open("post", e_SELF."?".e_QUERY, "myform"); + $text .= ' +
'; $text .= ''; $text .= ''; $text .= ''; @@ -530,14 +487,14 @@ function showMaint() while($row = $sql2->db_Fetch()) { $text .= ''; if ($currentURL != $row['download_url']) { - $text .= ''; + $text .= ''; $currentURL = $row['download_url']; } else { $text .= ''; } $text .= ''; $text .= "'; - $text .= ''; + $text .= ''; $text .= '
'.DOWLAN_13.''.DOWLAN_67.'
'.$e107->tp->toHTML($row['download_url']).''.$tp->toHTML($row['download_url']).'*'.$row['download_id'].'".$e107->tp->toHTML($row['download_name']).''.$e107->tp->toHTML($row['download_category_name']).''.$tp->toHTML($row['download_category_name']).' '.ADMIN_EDIT_ICON.' toJS(DOWLAN_33.' [ID: '.$row["download_id"].' ]').'") \'/> @@ -566,8 +523,9 @@ function showMaint() foreach($files as $file) { if (0 == $sql->db_Count('download', '(*)', " WHERE download_url='".$file['fname']."'")) { if (!$foundSome) { - $text .= $rs->form_open("post", e_SELF."?".e_QUERY, "myform"); - $text .= ''; + // $text .= $rs->form_open("post", e_SELF."?".e_QUERY, "myform"); + $text .= ' +
'; $text .= ''; $text .= ''; $text .= ''; @@ -579,7 +537,7 @@ function showMaint() $filesize = (is_readable(e_DOWNLOAD.$row['download_url']) ? $e107->parseMemorySize(filesize(e_DOWNLOAD.$file['fname'])) : DOWLAN_181); $filets = (is_readable(e_DOWNLOAD.$row['download_url']) ? $gen->convert_date(filectime(e_DOWNLOAD.$file['fname']), "long") : DOWLAN_181); $text .= ''; - $text .= ''; + $text .= ''; $text .= ''; $text .= ''; //TODO $text .= '
'.DOWLAN_13.''.DOWLAN_182.'
'.$e107->tp->toHTML($file['fname']).''.$tp->toHTML($file['fname']).''.$filets.''.$filesize.' @@ -609,9 +567,12 @@ function showMaint() if ($count) { while($row = $sql->db_Fetch()) { if (!is_readable(e_DOWNLOAD.$row['download_url'])) { - if (!$foundSome) { - $text .= $rs->form_open("post", e_SELF."?".e_QUERY, "myform"); - $text .= ''; + if (!$foundSome) + { + // $text .= $rs->form_open("post", e_SELF."?".e_QUERY, "myform"); + + $text .= ' +
'; $text .= ''; $text .= ''; $text .= ''; @@ -623,9 +584,9 @@ function showMaint() } $text .= ''; $text .= ''; - $text .= "'; - $text .= ''; - $text .= ''; + $text .= "'; + $text .= ''; + $text .= ''; $text .= '
'.DOWLAN_67.''.DOWLAN_27.'
'.$row['download_id'].'".$e107->tp->toHTML($row['download_name']).''.$e107->tp->toHTML($row['download_category_name']).''.$e107->tp->toHTML($row['download_url']).'".$tp->toHTML($row['download_name']).''.$tp->toHTML($row['download_category_name']).''.$tp->toHTML($row['download_url']).' '.ADMIN_EDIT_ICON.' toJS(DOWLAN_33.' [ID: '.$row["download_id"].' ]').'") \'/> @@ -653,9 +614,11 @@ function showMaint() $foundSome = false; if ($count) { while($row = $sql->db_Fetch()) { - if (!$foundSome) { - $text .= $rs->form_open("post", e_SELF."?".e_QUERY, "myform"); - $text .= ''; + if (!$foundSome) + { + // $text .= $rs->form_open("post", e_SELF."?".e_QUERY, "myform"); + $text .= ' +
'; $text .= ''; $text .= ''; $text .= ''; @@ -665,6 +628,7 @@ function showMaint() $text .= ''; $foundSome = true; } + $text .= ''; $text .= ''; $text .= "'; @@ -706,8 +670,10 @@ function showMaint() if ($count) { while($row = $sql->db_Fetch()) { if (!$foundSome) { - $text .= $rs->form_open("post", e_SELF."?".e_QUERY, "myform"); - $text .= '
'.DOWLAN_67.''.DOWLAN_27.'
'.$row['download_id'].'".$e107->tp->toHTML($row['download_name']).'
'; + // $text .= $rs->form_open("post", e_SELF."?".e_QUERY, "myform"); + $text .= ' + +
'; $text .= ''; $text .= ''; $text .= ''; @@ -759,8 +725,9 @@ function showMaint() $filesize = filesize(e_DOWNLOAD.$row['download_url']); if ($filesize <> $row['download_filesize']) { if (!$foundSome) { - $text .= $rs->form_open("post", e_SELF."?".e_QUERY, "myform"); - $text .= '
'.DOWLAN_67.''.DOWLAN_27.'
'; + // $text .= $rs->form_open("post", e_SELF."?".e_QUERY, "myform"); + $text .= ' +
'; $text .= ''; $text .= ''; $text .= ''; @@ -878,7 +845,7 @@ function showMaint() // $ns->tablerender(DOWLAN_165.$title, $text); } - +/* function admin_download_adminmenu($parms) { global $action,$subAction; @@ -911,4 +878,6 @@ function admin_download_adminmenu($parms) $var['uopt']['link'] = e_SELF."?uopt"; e_admin_menu(DOWLAN_10, $action, $var); } + */ + ?> \ No newline at end of file diff --git a/e107_plugins/download/handlers/adminDownload_class.php b/e107_plugins/download/handlers/adminDownload_class.php index a3099869a..096fea9bc 100644 --- a/e107_plugins/download/handlers/adminDownload_class.php +++ b/e107_plugins/download/handlers/adminDownload_class.php @@ -522,7 +522,7 @@ class adminDownload extends download - function create_download($subAction, $id) + function create_download($subAction='', $id='') { global $download, $e107, $cal, $tp, $sql, $fl, $rs, $ns, $file_array, $image_array, $thumb_array, $pst; require_once(e_PLUGIN.'download/download_shortcodes.php'); @@ -572,9 +572,9 @@ class adminDownload extends download return; } $download_active = 1; - if ($subAction == "edit" && !$_POST['submit']) + if ($_GET['action'] == "edit" && !$_POST['submit']) { - if ($sql->db_Select("download", "*", "download_id=".$id)) + if ($sql->db_Select("download", "*", "download_id=".intval($_GET['id']))) { $row = $sql->db_Fetch(); extract($row); @@ -686,7 +686,7 @@ class adminDownload extends download // See if any mirrors to display if (!$sql -> db_Select("download_mirror")) { // No mirrors defined here - $text .= DOWLAN_144.""; + $text .= DOWLAN_144.""; } else { @@ -1986,7 +1986,7 @@ class adminDownload extends download -
+
'.DOWLAN_67.''.DOWLAN_27.'