mirror of
https://github.com/e107inc/e107.git
synced 2025-04-21 21:21:54 +02:00
* Added basic/advanced search option to admin page (proof of concept work)
* Moved colum selection to drop down list
This commit is contained in:
parent
f0716da9da
commit
84a6fc3a61
@ -11,8 +11,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/download/admin_download.php,v $
|
||||
| $Revision: 1.3 $
|
||||
| $Date: 2009-07-15 00:48:09 $
|
||||
| $Revision: 1.4 $
|
||||
| $Date: 2009-07-15 23:28:46 $
|
||||
| $Author: bugrain $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
@ -76,12 +76,13 @@ if (e_QUERY)
|
||||
$tmp = explode(".", e_QUERY);
|
||||
$action = $tmp[0];
|
||||
$subAction = varset($tmp[1],'');
|
||||
$id = intval(varset($tmp[2],''));
|
||||
$id = varset($tmp[2],'');
|
||||
$from = varset($tmp[3], 0);
|
||||
$maintPage = varset($tmp[4], '');
|
||||
unset($tmp);
|
||||
}
|
||||
|
||||
$adminDownload->observer();
|
||||
|
||||
if (isset($_POST['delete']))
|
||||
{
|
||||
@ -92,7 +93,7 @@ if (isset($_POST['delete']))
|
||||
}
|
||||
|
||||
$from = ($from ? $from : 0);
|
||||
$amount = 50;
|
||||
$amount = varset($pref['download_view'], 50);
|
||||
|
||||
if (isset($_POST))
|
||||
{
|
||||
|
@ -1,914 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
+ ----------------------------------------------------------------------------+
|
||||
| e107 website system
|
||||
|
|
||||
| ©Steve Dunstan 2001-2002
|
||||
| http://e107.org
|
||||
| jalist@e107.org
|
||||
|
|
||||
| Released under the terms and conditions of the
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/download/download_admin.php,v $
|
||||
| $Revision: 1.10 $
|
||||
| $Date: 2009-05-04 20:09:45 $
|
||||
| $Author: bugrain $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
$eplug_admin = true;
|
||||
define('DOWNLOAD_DEBUG',FALSE);
|
||||
|
||||
require_once("../../class2.php");
|
||||
if (!getperms("P") || !plugInstalled('download'))
|
||||
{
|
||||
header("location:".e_BASE."index.php");
|
||||
exit() ;
|
||||
}
|
||||
|
||||
include_lan(e_PLUGIN.'download/languages/'.e_LANGUAGE.'/download.php');
|
||||
include_lan(e_PLUGIN.'download/languages/'.e_LANGUAGE.'/admin_download.php');
|
||||
require_once(e_PLUGIN.'download/handlers/adminDownload_class.php');
|
||||
require_once(e_HANDLER."form_handler.php");
|
||||
require_once(e_HANDLER."ren_help.php");
|
||||
require_once(e_HANDLER."calendar/calendar_class.php");
|
||||
$cal = new DHTML_Calendar(true);
|
||||
$gen = new convert();
|
||||
|
||||
function headerjs()
|
||||
{
|
||||
global $cal;
|
||||
return $cal->load_files();
|
||||
}
|
||||
|
||||
$e_sub_cat = 'download';
|
||||
require_once(e_HANDLER."form_handler.php");
|
||||
require_once(e_HANDLER."userclass_class.php");
|
||||
require_once(e_HANDLER."file_class.php");
|
||||
|
||||
$fl = new e_file;
|
||||
|
||||
// -------- Presets. ------------
|
||||
require_once(e_HANDLER."preset_class.php");
|
||||
$pst = new e_preset;
|
||||
$pst->form = array("myform","dlform"); // form id of the form that will have it's values saved.
|
||||
$pst->page = array("download.php?create","download.php?cat"); // display preset options on which page(s).
|
||||
$pst->id = array("admin_downloads","admin_dl_cat");
|
||||
// -------------------------------
|
||||
|
||||
$download = new download();
|
||||
$adminDownload = new adminDownload();
|
||||
require_once(e_ADMIN."auth.php");
|
||||
$pst->save_preset(); // unique name(s) for the presets - comma separated.
|
||||
|
||||
/*
|
||||
One form example (no arrays needed)
|
||||
$pst->form = "myform"; // form id of the form that will have it's values saved.
|
||||
$pst->page = "download.php?create"; // display preset options on which page.
|
||||
$pst->save_preset("admin_downloads"); // unique name for the preset
|
||||
*/
|
||||
|
||||
$rs = new form;
|
||||
$subAction = '';
|
||||
if (e_QUERY)
|
||||
{
|
||||
$tmp = explode(".", e_QUERY);
|
||||
$action = $tmp[0];
|
||||
$subAction = varset($tmp[1],'');
|
||||
$id = intval(varset($tmp[2],''));
|
||||
$from = varset($tmp[3], 0);
|
||||
$maintPage = varset($tmp[4], '');
|
||||
unset($tmp);
|
||||
}
|
||||
|
||||
|
||||
if (isset($_POST['delete']))
|
||||
{
|
||||
$tmp = array_keys($_POST['delete']);
|
||||
list($delete, $del_id) = explode("_", $tmp[0]);
|
||||
$del_id = intval($del_id);
|
||||
unset($_POST['searchquery']);
|
||||
}
|
||||
|
||||
$from = ($from ? $from : 0);
|
||||
$amount = 50;
|
||||
|
||||
if (isset($_POST))
|
||||
{
|
||||
$e107cache->clear("download_cat");
|
||||
}
|
||||
|
||||
if (isset($_POST['add_category']))
|
||||
{
|
||||
$adminDownload->create_category($subAction, $id);
|
||||
}
|
||||
|
||||
|
||||
if (isset($_POST['submit_download']))
|
||||
{
|
||||
$adminDownload->submit_download($subAction, $id);
|
||||
$action = "main";
|
||||
unset($subAction, $id);
|
||||
}
|
||||
|
||||
|
||||
if (isset($_POST['update_catorder']))
|
||||
{
|
||||
foreach($_POST['catorder'] as $key=>$order)
|
||||
{
|
||||
if (is_numeric($_POST['catorder'][$key]))
|
||||
{
|
||||
$sql -> db_Update("download_category", "download_category_order='".intval($order)."' WHERE download_category_id='".intval($key)."'");
|
||||
}
|
||||
}
|
||||
$admin_log->log_event('DOWNL_08',implode(',',array_keys($_POST['catorder'])),E_LOG_INFORMATIVE,'');
|
||||
$ns->tablerender("", "<div style='text-align:center'><b>".LAN_UPDATED."</b></div>");
|
||||
}
|
||||
|
||||
|
||||
if (isset($_POST['updateoptions']))
|
||||
{
|
||||
unset($temp);
|
||||
$temp['download_php'] = $_POST['download_php'];
|
||||
$temp['download_view'] = $_POST['download_view'];
|
||||
$temp['download_sort'] = $_POST['download_sort'];
|
||||
$temp['download_order'] = $_POST['download_order'];
|
||||
$temp['mirror_order'] = $_POST['mirror_order'];
|
||||
$temp['recent_download_days'] = $_POST['recent_download_days'];
|
||||
$temp['agree_flag'] = $_POST['agree_flag'];
|
||||
$temp['download_email'] = $_POST['download_email'];
|
||||
$temp['agree_text'] = $tp->toDB($_POST['agree_text']);
|
||||
$temp['download_denied'] = $tp->toDB($_POST['download_denied']);
|
||||
$temp['download_reportbroken'] = $_POST['download_reportbroken'];
|
||||
if ($_POST['download_subsub']) $temp['download_subsub'] = '1'; else $temp['download_subsub'] = '0';
|
||||
if ($_POST['download_incinfo']) $temp['download_incinfo'] = '1'; else $temp['download_incinfo'] = '0';
|
||||
if ($admin_log->logArrayDiffs($temp, $pref, 'DOWNL_01'))
|
||||
{
|
||||
save_prefs();
|
||||
$message = DOWLAN_65;
|
||||
}
|
||||
else
|
||||
{
|
||||
$message = DOWLAN_8;
|
||||
}
|
||||
}
|
||||
|
||||
$targetFields = array('gen_datestamp', 'gen_user_id', 'gen_ip', 'gen_intdata', 'gen_chardata'); // Fields for download limits
|
||||
|
||||
if (isset($_POST['addlimit']))
|
||||
{
|
||||
if ($sql->db_Select('generic','gen_id',"gen_type = 'download_limit' AND gen_datestamp = {$_POST['newlimit_class']}"))
|
||||
{
|
||||
$message = DOWLAN_116;
|
||||
}
|
||||
else
|
||||
{
|
||||
$vals = array();
|
||||
$vals['gen_type'] = 'download_limit';
|
||||
foreach(array('newlimit_class','new_bw_num','new_bw_days','new_count_num','new_count_days') as $k => $lName)
|
||||
{
|
||||
$vals[$targetFields[$k]] = intval($_POST[$lName]);
|
||||
}
|
||||
$valString = implode(',',$vals);
|
||||
if ($sql->db_Insert('generic',$vals))
|
||||
{
|
||||
$message = DOWLAN_117;
|
||||
$admin_log->log_event('DOWNL_09',$valString,E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
else
|
||||
{
|
||||
$message = DOWLAN_118;
|
||||
}
|
||||
unset($vals);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (isset($_POST['updatelimits']))
|
||||
{
|
||||
|
||||
if ($pref['download_limits'] != $_POST['download_limits'])
|
||||
{
|
||||
$pref['download_limits'] = ($_POST['download_limits'] == 'on') ? 1 : 0;
|
||||
save_prefs();
|
||||
$message .= DOWLAN_126."<br/>";
|
||||
}
|
||||
foreach(array_keys($_POST['count_num']) as $idLim)
|
||||
{
|
||||
$idLim = intval($idLim);
|
||||
if (!$_POST['count_num'][$idLim] && !$_POST['count_days'][$idLim] && !$_POST['bw_num'][$idLim] && !$_POST['bw_days'][$idLim])
|
||||
{
|
||||
//All entries empty - Remove record
|
||||
if ($sql->db_Delete('generic',"gen_id = {$idLim}"))
|
||||
{
|
||||
$message .= $idLim." - ".DOWLAN_119."<br/>";
|
||||
$admin_log->log_event('DOWNL_11','ID: '.$idLim,E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
else
|
||||
{
|
||||
$message .= $idLim." - ".DOWLAN_120."<br/>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$vals = array();
|
||||
foreach(array('bw_num','bw_days','count_num','count_days') as $k => $lName)
|
||||
{
|
||||
$vals[$targetFields[$k+1]] = intval($_POST[$lName][$idLim]);
|
||||
}
|
||||
$valString = implode(',',$vals);
|
||||
$sql->db_UpdateArray('generic',$vals," WHERE gen_id = {$idLim}");
|
||||
$admin_log->log_event('DOWNL_10',$idLim.', '.$valString,E_LOG_INFORMATIVE,'');
|
||||
$message .= $idLim." - ".DOWLAN_121."<br/>";
|
||||
unset($vals);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (isset($_POST['submit_mirror']))
|
||||
{
|
||||
$adminDownload->submit_mirror($subAction, $id);
|
||||
}
|
||||
|
||||
|
||||
if ($action == "mirror")
|
||||
{
|
||||
$adminDownload->show_existing_mirrors();
|
||||
}
|
||||
|
||||
|
||||
if ($action == "dlm")
|
||||
{
|
||||
$action = "create";
|
||||
$id = $subAction;
|
||||
$subAction = "dlm";
|
||||
}
|
||||
|
||||
|
||||
if ($action == "create")
|
||||
{
|
||||
$adminDownload->create_download($subAction, $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')
|
||||
{
|
||||
$adminDownload->show_categories($subAction, $id);
|
||||
}
|
||||
|
||||
|
||||
if ($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))
|
||||
{
|
||||
$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
|
||||
}
|
||||
|
||||
|
||||
if ($from === "maint" && isset($_POST['submit_download']))
|
||||
{ // Return to one of the maintanence pages after submitting the create/edit form
|
||||
$action = $from;
|
||||
$subAction = $maintPage;
|
||||
}
|
||||
|
||||
if (!e_QUERY || $action == "main")
|
||||
{
|
||||
$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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if ($action == "opt")
|
||||
{
|
||||
global $pref, $ns;
|
||||
$agree_flag = $pref['agree_flag'];
|
||||
$agree_text = $pref['agree_text'];
|
||||
$text = "<div style='text-align:center'>
|
||||
<form method='post' action='".e_SELF."?".e_QUERY."'>\n
|
||||
<table style='".ADMIN_WIDTH."' class='fborder'>
|
||||
<colgroup>
|
||||
<col style='width:50%'/>
|
||||
<col style='width:50%'/>
|
||||
</colgroup>
|
||||
<tr>
|
||||
<td>".DOWLAN_69."</td>
|
||||
<td style='text-align:left'>";
|
||||
$c = $pref['download_php'] ? " checked = 'checked' " : "";
|
||||
$ssc = ((!isset($pref['download_subsub'])) || ($pref['download_subsub'] == '1')) ? " checked = 'checked' " : "";
|
||||
$sacc = (varset($pref['download_incinfo'],0) == '1') ? " checked = 'checked' " : "";
|
||||
$text .= "<input type='checkbox' name='download_php' value='1' {$c}/> <span class='smalltext'>".DOWLAN_70."</span></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>".DOWLAN_158."</td>
|
||||
<td style='text-align:left'>
|
||||
<input type='checkbox' name='download_subsub' value='1' {$ssc}/> </td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>".DOWLAN_159."</td>
|
||||
<td style='text-align:left'>
|
||||
<input type='checkbox' name='download_incinfo' value='1' {$sacc}/> </td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
".DOWLAN_55."
|
||||
</td>
|
||||
<td style='text-align:left'>
|
||||
<select name='download_view' class='tbox'>". ($pref['download_view'] == 5 ? "<option selected='selected'>5</option>" : "<option>5</option>"). ($pref['download_view'] == 10 ? "<option selected='selected'>10</option>" : "<option>10</option>"). ($pref['download_view'] == 15 ? "<option selected='selected'>15</option>" : "<option>15</option>"). ($pref['download_view'] == 20 ? "<option selected='selected'>20</option>" : "<option>20</option>"). ($pref['download_view'] == 50 ? "<option selected='selected'>50</option>" : "<option>50</option>")."
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr><td>
|
||||
".DOWLAN_56."
|
||||
</td>
|
||||
<td style='text-align:left'>
|
||||
|
||||
<select name='download_order' class='tbox'>";
|
||||
$order_options = array("download_id"=>"Id No.","download_datestamp"=>LAN_DATE,"download_requested"=>ADLAN_24,"download_name"=>DOWLAN_59,"download_author"=>DOWLAN_15);
|
||||
foreach($order_options as $value=>$label){
|
||||
$select = ($pref['download_order'] == $value) ? "selected='selected'" : "";
|
||||
$text .= "<option value='$value' $select >$label</option>\n";
|
||||
}
|
||||
|
||||
$text .= "</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td>
|
||||
".LAN_ORDER."
|
||||
</td>
|
||||
<td style='text-align:left'>
|
||||
<select name='download_sort' class='tbox'>". ($pref['download_sort'] == "ASC" ? "<option value='ASC' selected='selected'>".DOWLAN_62."</option>" : "<option value='ASC'>".DOWLAN_62."</option>"). ($pref['download_sort'] == "DESC" ? "<option value='DESC' selected='selected'>".DOWLAN_63."</option>" : "<option value='DESC'>".DOWLAN_63."</option>")."
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>".DOWLAN_160."</td>
|
||||
<td style='text-align:left'>
|
||||
<select name='mirror_order' class='tbox'>".
|
||||
($pref['mirror_order'] == "0" ? "<option value='0' selected='selected'>".DOWLAN_161."</option>" : "<option value='0'>".DOWLAN_161."</option>").
|
||||
($pref['mirror_order'] == "1" ? "<option value='1' selected='selected'>".DOWLAN_162."</option>" : "<option value='1'>".DOWLAN_162."</option>").
|
||||
($pref['mirror_order'] == "2" ? "<option value='2' selected='selected'>".DOWLAN_163."</option>" : "<option value='2'>".DOWLAN_163."</option>")."
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
".DOWLAN_164."
|
||||
</td>
|
||||
<td style='text-align:left'>
|
||||
<input name='recent_download_days' class='tbox' value='".$pref['recent_download_days']."' size='3' maxlength='3'/>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>".DOWLAN_151."</td>
|
||||
<td style='text-align:left'>". r_userclass("download_reportbroken", $pref['download_reportbroken'])."</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>".DOWLAN_150."</td>
|
||||
<td style='text-align:left'>". ($pref['download_email'] ? "<input type='checkbox' name='download_email' value='1' checked='checked'/>" : "<input type='checkbox' name='download_email' value='1'/>")."</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>".DOWLAN_100."</td>
|
||||
<td style='text-align:left'>". ($agree_flag ? "<input type='checkbox' name='agree_flag' value='1' checked='checked'/>" : "<input type='checkbox' name='agree_flag' value='1'/>")."</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr><td>
|
||||
".DOWLAN_101."
|
||||
</td>
|
||||
<td style='text-align:left'>
|
||||
";
|
||||
$eform = new e_form();
|
||||
$text .= $eform->bbarea('agree_text',$agree_text);
|
||||
$text .= "
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr><td>
|
||||
".DOWLAN_146."
|
||||
</td>
|
||||
<td style='text-align:left'>
|
||||
";
|
||||
$eform = new e_form();
|
||||
$text .= $eform->bbarea('download_denied',$pref['download_denied']);
|
||||
$text .= "
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style=''>
|
||||
<td colspan='2' style='text-align:center' class='forumheader'>
|
||||
<input class='button' type='submit' name='updateoptions' value='".DOWLAN_64."'/>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
</div>";
|
||||
$ns->tablerender(DOWLAN_54, $text);
|
||||
}
|
||||
|
||||
if ($action == 'maint')
|
||||
{
|
||||
global $pref, $ns;
|
||||
switch ($subAction)
|
||||
{
|
||||
case 'duplicates':
|
||||
{
|
||||
$title = DOWLAN_166;
|
||||
$query = 'SELECT GROUP_CONCAT(d.download_id SEPARATOR ",") as gc, d.download_id, d.download_name, d.download_url, dc.download_category_name
|
||||
FROM #download as d
|
||||
LEFT JOIN #download_category AS dc ON dc.download_category_id=d.download_category
|
||||
GROUP BY d.download_url
|
||||
HAVING COUNT(d.download_id) > 1
|
||||
';
|
||||
$text = "";
|
||||
$count = $sql->db_Select_gen($query);
|
||||
$foundSome = false;
|
||||
if ($count) {
|
||||
$currentURL = "";
|
||||
while($row = $sql->db_Fetch()) {
|
||||
if (!$foundSome) {
|
||||
$text .= $rs->form_open("post", e_SELF."?".e_QUERY, "myform");
|
||||
$text .= '<table class="fborder" style="width:100%">';
|
||||
$text .= '<tr>';
|
||||
$text .= '<th>'.DOWLAN_13.'</th>';
|
||||
$text .= '<th>'.DOWLAN_67.'</th>';
|
||||
$text .= '<th>'.DOWLAN_27.'</th>';
|
||||
$text .= '<th>'.DOWLAN_11.'</th>';
|
||||
$text .= '<th>'.LAN_OPTIONS.'</th>';
|
||||
$text .= '</tr>';
|
||||
$foundSome = true;
|
||||
}
|
||||
$query = "SELECT d.*, dc.* FROM `#download` AS d
|
||||
LEFT JOIN `#download_category` AS dc ON dc.download_category_id=d.download_category
|
||||
WHERE download_id IN (".$row['gc'].")
|
||||
ORDER BY download_id ASC";
|
||||
$count = $sql2->db_Select_gen($query);
|
||||
while($row = $sql2->db_Fetch()) {
|
||||
$text .= '<tr>';
|
||||
if ($currentURL != $row['download_url']) {
|
||||
$text .= '<td>'.$row['download_url'].'</td>';
|
||||
$currentURL = $row['download_url'];
|
||||
} else {
|
||||
$text .= '<td>*</td>';
|
||||
}
|
||||
$text .= '<td>'.$row['download_id'].'</td>';
|
||||
$text .= "<td><a href='".e_PLUGIN."download/download.php?view.".$row['download_id']."'>".$row['download_name'].'</a></td>';
|
||||
$text .= '<td>'.$row['download_category_name'].'</td>';
|
||||
$text .= '<td>
|
||||
<a href="'.e_SELF.'?create.edit.'.$row["download_id"].'.maint.duplicates">'.ADMIN_EDIT_ICON.'</a>
|
||||
<input type="image" title="'.LAN_DELETE.'" name="delete[main_'.$row["download_id"].']" src="'.ADMIN_DELETE_ICON_PATH.'" onclick=\'return jsconfirm("'.$tp->toJS(DOWLAN_33.' [ID: '.$row["download_id"].' ]').'") \'/>
|
||||
</td>';
|
||||
$text .= '</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($foundSome) {
|
||||
$text .= '</table></form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$text = DOWLAN_172;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'orphans':
|
||||
{
|
||||
$title = DOWLAN_167;
|
||||
$text = "";
|
||||
require_once(e_HANDLER."file_class.php");
|
||||
$efile = new e_file();
|
||||
$files = $efile->get_files(e_DOWNLOAD);
|
||||
$foundSome = false;
|
||||
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 .= '<table class="fborder" style="width:100%">';
|
||||
$text .= '<tr>';
|
||||
$text .= '<th>'.DOWLAN_13.'</th>';
|
||||
$text .= '<th>'.DOWLAN_182.'</th>';
|
||||
$text .= '<th>'.DOWLAN_170.'</th>';
|
||||
$text .= '<th>'.LAN_OPTIONS.'</th>';
|
||||
$text .= '</tr>';
|
||||
$foundSome = true;
|
||||
}
|
||||
$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 .= '<tr>';
|
||||
$text .= '<td>'.$file['fname'].'</td>';
|
||||
$text .= '<td>'.$filets.'</td>';
|
||||
$text .= '<td>'.$filesize.'</td>';
|
||||
//TODO $text .= '<td>
|
||||
//TODO <a href="'.e_SELF.'?create.add.'. urlencode($file["fname"]).'">'.E_16_CREATE.'</a>
|
||||
//TODO <input type="image" title="'.LAN_DELETE.'" name="delete[main_'.$file["fname"].']" src="'.ADMIN_DELETE_ICON_PATH.'" onclick=\'return jsconfirm("'.$tp->toJS(DOWLAN_173.' [ '.$file["fname"].' ]').'") \'/>
|
||||
//TODO </td>';
|
||||
//TODO $text .= '</tr>';
|
||||
}
|
||||
}
|
||||
if ($foundSome) {
|
||||
$text .= '</table></form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$text = DOWLAN_174;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'missing':
|
||||
{
|
||||
$title = DOWLAN_168;
|
||||
$text = "";
|
||||
$query = "SELECT d.*, dc.* FROM `#download` AS d LEFT JOIN `#download_category` AS dc ON dc.download_category_id=d.download_category";
|
||||
$count = $sql->db_Select_gen($query);
|
||||
$foundSome = false;
|
||||
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 .= '<table class="fborder" style="width:100%">';
|
||||
$text .= '<tr>';
|
||||
$text .= '<th>'.DOWLAN_67.'</th>';
|
||||
$text .= '<th>'.DOWLAN_27.'</th>';
|
||||
$text .= '<th>'.DOWLAN_11.'</th>';
|
||||
$text .= '<th>'.DOWLAN_13.'</th>';
|
||||
$text .= '<th>'.LAN_OPTIONS.'</th>';
|
||||
$text .= '</tr>';
|
||||
$foundSome = true;
|
||||
}
|
||||
$text .= '<tr>';
|
||||
$text .= '<td>'.$row['download_id'].'</td>';
|
||||
$text .= "<td><a href='".e_PLUGIN."download/download.php?view.".$row['download_id']."'>".$row['download_name'].'</a></td>';
|
||||
$text .= '<td>'.$row['download_category_name'].'</td>';
|
||||
$text .= '<td>'.$row['download_url'].'</td>';
|
||||
$text .= '<td>
|
||||
<a href="'.e_SELF.'?create.edit.'.$row["download_id"].'.maint.missing">'.ADMIN_EDIT_ICON.'</a>
|
||||
<input type="image" title="'.LAN_DELETE.'" name="delete[main_'.$row["download_id"].']" src="'.ADMIN_DELETE_ICON_PATH.'" onclick=\'return jsconfirm("'.$tp->toJS(DOWLAN_33.' [ID: '.$row["download_id"].' ]').'") \'/>
|
||||
</td>';
|
||||
$text .= '</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($foundSome) {
|
||||
$text .= '</table></form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$text = DOWLAN_172;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'inactive':
|
||||
{
|
||||
$title = DOWLAN_169;
|
||||
$text = "";
|
||||
$query = "SELECT d.*, dc.* FROM `#download` AS d LEFT JOIN `#download_category` AS dc ON dc.download_category_id=d.download_category WHERE download_active=0";
|
||||
$count = $sql->db_Select_gen($query);
|
||||
$foundSome = false;
|
||||
if ($count) {
|
||||
while($row = $sql->db_Fetch()) {
|
||||
if (!$foundSome) {
|
||||
$text .= $rs->form_open("post", e_SELF."?".e_QUERY, "myform");
|
||||
$text .= '<table class="fborder" style="width:100%">';
|
||||
$text .= '<tr>';
|
||||
$text .= '<th>'.DOWLAN_67.'</th>';
|
||||
$text .= '<th>'.DOWLAN_27.'</th>';
|
||||
$text .= '<th>'.DOWLAN_11.'</th>';
|
||||
$text .= '<th>'.DOWLAN_13.'</th>';
|
||||
$text .= '<th>'.LAN_OPTIONS.'</th>';
|
||||
$text .= '</tr>';
|
||||
$foundSome = true;
|
||||
}
|
||||
$text .= '<tr>';
|
||||
$text .= '<td>'.$row['download_id'].'</td>';
|
||||
$text .= "<td><a href='".e_PLUGIN."download/download.php?view.".$row['download_id']."'>".$row['download_name'].'</a></td>';
|
||||
$text .= '<td>'.$row['download_category_name'].'</td>';
|
||||
if (strlen($row['download_url']) > 0) {
|
||||
$text .= '<td>'.$row['download_url'].'</td>';
|
||||
} else {
|
||||
$mirrorArray = download::makeMirrorArray($row['download_mirror'], TRUE);
|
||||
$text .= '<td>';
|
||||
foreach($mirrorArray as $mirror) {
|
||||
$text .= $mirror['url'].'<br/>';
|
||||
}
|
||||
$text .= '</td>';
|
||||
}
|
||||
$text .= '<td>
|
||||
<a href="'.e_SELF.'?create.edit.'.$row["download_id"].'.maint.inactive">'.ADMIN_EDIT_ICON.'</a>
|
||||
<input type="image" title="'.LAN_DELETE.'" name="delete[main_'.$row["download_id"].']" src="'.ADMIN_DELETE_ICON_PATH.'" onclick=\'return jsconfirm("'.$tp->toJS(DOWLAN_33.' [ID: '.$row["download_id"].' ]').'") \'/>
|
||||
</td>';
|
||||
$text .= '</tr>';
|
||||
}
|
||||
}
|
||||
if ($foundSome) {
|
||||
$text .= '</table></form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$text = DOWLAN_172;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'nocategory':
|
||||
{
|
||||
$title = DOWLAN_178;
|
||||
$text = "";
|
||||
$query = "SELECT * FROM `#download` WHERE download_category=0";
|
||||
$count = $sql->db_Select_gen($query);
|
||||
$foundSome = false;
|
||||
if ($count) {
|
||||
while($row = $sql->db_Fetch()) {
|
||||
if (!$foundSome) {
|
||||
$text .= $rs->form_open("post", e_SELF."?".e_QUERY, "myform");
|
||||
$text .= '<table class="fborder" style="width:100%">';
|
||||
$text .= '<tr>';
|
||||
$text .= '<th>'.DOWLAN_67.'</th>';
|
||||
$text .= '<th>'.DOWLAN_27.'</th>';
|
||||
$text .= '<th>'.DOWLAN_13.'</th>';
|
||||
$text .= '<th>'.LAN_OPTIONS.'</th>';
|
||||
$text .= '</tr>';
|
||||
$foundSome = true;
|
||||
}
|
||||
$text .= '<tr>';
|
||||
$text .= '<td>'.$row['download_id'].'</td>';
|
||||
$text .= "<td><a href='".e_PLUGIN."download/download.php?view.".$row['download_id']."'>".$row['download_name'].'</a></td>';
|
||||
if (strlen($row['download_url']) > 0) {
|
||||
$text .= '<td>'.$row['download_url'].'</td>';
|
||||
} else {
|
||||
$mirrorArray = download::makeMirrorArray($row['download_mirror'], TRUE);
|
||||
$text .= '<td>';
|
||||
foreach($mirrorArray as $mirror) {
|
||||
$text .= $mirror['url'].'<br/>';
|
||||
}
|
||||
$text .= '</td>';
|
||||
}
|
||||
$text .= '<td>
|
||||
<a href="'.e_SELF.'?create.edit.'.$row["download_id"].'.maint.nocategory">'.ADMIN_EDIT_ICON.'</a>
|
||||
<input type="image" title="'.LAN_DELETE.'" name="delete[main_'.$row["download_id"].']" src="'.ADMIN_DELETE_ICON_PATH.'" onclick=\'return jsconfirm("'.$tp->toJS(DOWLAN_33.' [ID: '.$row["download_id"].' ]').'") \'/>
|
||||
</td>';
|
||||
$text .= '</tr>';
|
||||
}
|
||||
}
|
||||
if ($foundSome) {
|
||||
$text .= '</table></form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$text = DOWLAN_172;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'filesize':
|
||||
{
|
||||
$title = DOWLAN_170;
|
||||
$text = "";
|
||||
$query = "SELECT d.*, dc.* FROM `#download` AS d LEFT JOIN `#download_category` AS dc ON dc.download_category_id=d.download_category WHERE d.download_url<>''";
|
||||
$count = $sql->db_Select_gen($query);
|
||||
$foundSome = false;
|
||||
if ($count) {
|
||||
while($row = $sql->db_Fetch()) {
|
||||
if (is_readable(e_DOWNLOAD.$row['download_url'])) {
|
||||
$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 .= '<table class="fborder" style="width:100%">';
|
||||
$text .= '<tr>';
|
||||
$text .= '<th>'.DOWLAN_67.'</th>';
|
||||
$text .= '<th>'.DOWLAN_27.'</th>';
|
||||
$text .= '<th>'.DOWLAN_11.'</th>';
|
||||
$text .= '<th>'.DOWLAN_13.'</th>';
|
||||
$text .= '<th>'.DOWLAN_180.'</th>';
|
||||
$text .= '<th>'.LAN_OPTIONS.'</th>';
|
||||
$text .= '</tr>';
|
||||
$foundSome = true;
|
||||
}
|
||||
$text .= '<tr>';
|
||||
$text .= '<td>'.$row['download_id'].'</td>';
|
||||
$text .= "<td><a href='".e_PLUGIN."download/download.php?view.".$row['download_id']."'>".$row['download_name'].'</a></td>';
|
||||
$text .= '<td>'.$row['download_category_name'].'</td>';
|
||||
$text .= '<td>'.$row['download_url'].'</td>';
|
||||
$text .= '<td>'.$row['download_filesize'].' / ';
|
||||
$text .= $filesize;
|
||||
$text .= '</td>';
|
||||
$text .= '<td>
|
||||
<a href="'.e_SELF.'?create.edit.'.$row["download_id"].'.maint.filesize">'.ADMIN_EDIT_ICON.'</a>
|
||||
<input type="image" title="'.LAN_DELETE.'" name="delete[main_'.$row["download_id"].']" src="'.ADMIN_DELETE_ICON_PATH.'" onclick=\'return jsconfirm("'.$tp->toJS(DOWLAN_33.' [ID: '.$row["download_id"].' ]').'") \'/>
|
||||
</td>';
|
||||
$text .= '</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($foundSome) {
|
||||
$text .= '</table></form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$text = DOWLAN_172;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'log':
|
||||
{
|
||||
$text = "log - view manage download history log";
|
||||
header('location: '.e_ADMIN.'admin_log.php?downlog');
|
||||
exit();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
$text = DOWLAN_179;
|
||||
}
|
||||
}
|
||||
$ns->tablerender(DOWLAN_165.' - '.$title, $text);
|
||||
}
|
||||
|
||||
|
||||
if ($action == 'limits')
|
||||
{
|
||||
if ($sql->db_Select('userclass_classes','userclass_id, userclass_name'))
|
||||
{
|
||||
$classList = $sql->db_getList();
|
||||
}
|
||||
if ($sql->db_Select("generic", "gen_id as limit_id, gen_datestamp as limit_classnum, gen_user_id as limit_bw_num, gen_ip as limit_bw_days, gen_intdata as limit_count_num, gen_chardata as limit_count_days", "gen_type = 'download_limit'"))
|
||||
{
|
||||
while($row = $sql->db_Fetch())
|
||||
{
|
||||
$limitList[$row['limit_classnum']] = $row;
|
||||
}
|
||||
}
|
||||
$txt = "
|
||||
<form method='post' action='".e_SELF."?".e_QUERY."'>
|
||||
<table class='fborder' style='width:100%'>
|
||||
<tr>
|
||||
<td colspan='4' style='text-align:left'>
|
||||
";
|
||||
if ($pref['download_limits'] == 1)
|
||||
{
|
||||
$chk = "checked = 'checked'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$chk = "";
|
||||
}
|
||||
|
||||
$txt .= "
|
||||
<input type='checkbox' name='download_limits' {$chk}/> ".DOWLAN_125."
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='fcaption'>".DOWLAN_67."</td>
|
||||
<td class='fcaption'>".DOWLAN_113."</td>
|
||||
<td class='fcaption'>".DOWLAN_107."</td>
|
||||
<td class='fcaption'>".DOWLAN_108."</td>
|
||||
</tr>
|
||||
";
|
||||
|
||||
foreach($limitList as $row)
|
||||
{
|
||||
$txt .= "
|
||||
<tr>
|
||||
<td>".$row['limit_id']."</td>
|
||||
<td>".r_userclass_name($row['limit_classnum'])."</td>
|
||||
<td>
|
||||
<input type='text' class='tbox' size='5' name='count_num[{$row['limit_id']}]' value='".($row['limit_count_num'] ? $row['limit_count_num'] : "")."'/> ".DOWLAN_109."
|
||||
<input type='text' class='tbox' size='5' name='count_days[{$row['limit_id']}]' value='".($row['limit_count_days'] ? $row['limit_count_days'] : "")."'/> ".DOWLAN_110."
|
||||
</td>
|
||||
<td>
|
||||
<input type='text' class='tbox' size='5' name='bw_num[{$row['limit_id']}]' value='".($row['limit_bw_num'] ? $row['limit_bw_num'] : "")."'/> ".DOWLAN_111." ".DOWLAN_109."
|
||||
<input type='text' class='tbox' size='5' name='bw_days[{$row['limit_id']}]' value='".($row['limit_bw_days'] ? $row['limit_bw_days'] : "")."'/> ".DOWLAN_110."
|
||||
</td>
|
||||
</tr>
|
||||
";
|
||||
}
|
||||
|
||||
$txt .= "
|
||||
<tr>
|
||||
<td class='forumheader' colspan='4' style='text-align:center'>
|
||||
<input type='submit' class='button' name='updatelimits' value='".DOWLAN_115."'/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='4'><br/><br/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2'>".r_userclass("newlimit_class", 0, "off", "guest, member, admin, classes, language")."</td>
|
||||
<td>
|
||||
<input type='text' class='tbox' size='5' name='new_count_num' value=''/> ".DOWLAN_109."
|
||||
<input type='text' class='tbox' size='5' name='new_count_days' value=''/> ".DOWLAN_110."
|
||||
</td>
|
||||
<td>
|
||||
<input type='text' class='tbox' size='5' name='new_bw_num' value=''/> ".DOWLAN_111." ".DOWLAN_109."
|
||||
<input type='text' class='tbox' size='5' name='new_bw_days' value=''/> ".DOWLAN_110."
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='forumheader' colspan='4' style='text-align:center'>
|
||||
<input type='submit' class='button' name='addlimit' value='".DOWLAN_114."'/>
|
||||
</td>
|
||||
</tr>
|
||||
";
|
||||
|
||||
$txt .= "</table></form>";
|
||||
|
||||
$ns->tablerender(DOWLAN_112, $txt);
|
||||
require_once(e_ADMIN.'footer.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once(e_ADMIN."footer.php");
|
||||
exit;
|
||||
|
||||
function download_admin_adminmenu($parms)
|
||||
{
|
||||
global $action,$subAction;
|
||||
if ($action == "") {
|
||||
$action = "main";
|
||||
}
|
||||
$var['main']['text'] = DOWLAN_29;
|
||||
$var['main']['link'] = e_SELF;
|
||||
$var['create']['text'] = DOWLAN_30;
|
||||
$var['create']['link'] = e_SELF."?create";
|
||||
$var['cat']['text'] = DOWLAN_31;
|
||||
$var['cat']['link'] = e_SELF."?cat";
|
||||
$var['cat']['perm'] = "Q";
|
||||
$var['opt']['text'] = LAN_OPTIONS;
|
||||
$var['opt']['link'] = e_SELF."?opt";
|
||||
$var['maint']['text'] = DOWLAN_165;
|
||||
$var['maint']['link'] = e_SELF."?maint";
|
||||
$var['limits']['text'] = DOWLAN_112;
|
||||
$var['limits']['link'] = e_SELF."?limits";
|
||||
$var['mirror']['text'] = DOWLAN_128;
|
||||
$var['mirror']['link'] = e_SELF."?mirror";
|
||||
e_admin_menu(DOWLAN_32, $action, $var);
|
||||
|
||||
unset($var);
|
||||
if ($action == "" || $action == "main") {
|
||||
$var['1']['text'] = "//TODO";
|
||||
$var['1']['link'] = "";
|
||||
e_admin_menu(DOWLAN_184, $subAction, $var);
|
||||
}
|
||||
if ($action == "maint") {
|
||||
$var['duplicates']['text'] = DOWLAN_166;
|
||||
$var['duplicates']['link'] = e_SELF."?maint.duplicates";
|
||||
$var['orphans']['text'] = DOWLAN_167;
|
||||
$var['orphans']['link'] = e_SELF."?maint.orphans";
|
||||
$var['missing']['text'] = DOWLAN_168;
|
||||
$var['missing']['link'] = e_SELF."?maint.missing";
|
||||
$var['inactive']['text'] = DOWLAN_169;
|
||||
$var['inactive']['link'] = e_SELF."?maint.inactive";
|
||||
$var['nocategory']['text'] = DOWLAN_178;
|
||||
$var['nocategory']['link'] = e_SELF."?maint.nocategory";
|
||||
$var['filesize']['text'] = DOWLAN_170;
|
||||
$var['filesize']['link'] = e_SELF."?maint.filesize";
|
||||
$var['log']['text'] = DOWLAN_171;
|
||||
$var['log']['link'] = e_SELF."?maint.log";
|
||||
e_admin_menu(DOWLAN_177, $subAction, $var);
|
||||
}
|
||||
}
|
||||
?>
|
@ -11,8 +11,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/download/handlers/adminDownload_class.php,v $
|
||||
| $Revision: 1.4 $
|
||||
| $Date: 2009-07-14 23:14:41 $
|
||||
| $Revision: 1.5 $
|
||||
| $Date: 2009-07-15 23:28:46 $
|
||||
| $Author: bugrain $
|
||||
|
|
||||
+----------------------------------------------------------------------------+
|
||||
@ -23,8 +23,8 @@ require_once(e_PLUGIN.'download/handlers/download_class.php');
|
||||
|
||||
class adminDownload extends download
|
||||
{
|
||||
var $filterCookieName;
|
||||
var $filterFields;
|
||||
var $searchField;
|
||||
var $advancedSearchFields;
|
||||
var $userclassOptions;
|
||||
|
||||
function adminDownload()
|
||||
@ -32,31 +32,17 @@ class adminDownload extends download
|
||||
global $pref;
|
||||
parent::download();
|
||||
$this->userclassOptions = 'blank,nobody,guest,public,main,admin,member,classes';
|
||||
$this->filterCookieName = $pref['cookie_name']."_download_filter_admin";
|
||||
if (isset($_COOKIE[$this->filterCookieName])) {
|
||||
$this->filterFields = unserialize($_COOKIE[$this->filterCookieName]);
|
||||
|
||||
// Save basic search string
|
||||
if (isset($_POST['download_search_submit']))
|
||||
{
|
||||
$this->searchField = $_POST['download_search'];
|
||||
}
|
||||
|
||||
// Delete filter selection
|
||||
if (isset($_POST['download_filter_delete']))
|
||||
// Save advanced search criteria
|
||||
if (isset($_POST['download_advanced_search_submit']))
|
||||
{
|
||||
$this->filterFields = array();
|
||||
}
|
||||
|
||||
// Save filter selection
|
||||
if (isset($_POST['download_filter_submit']))
|
||||
{
|
||||
// Store filter fields in a cookie
|
||||
$this->filterFields = $_POST['download_filter'];
|
||||
// Convert date if input
|
||||
//TODO need a core way of doing this - e_form validation? convert class?
|
||||
$tmp = split("/", $this->filterFields['date']);
|
||||
$this->filterFields['date'] = mktime(0,0,0,$tmp[1],$tmp[0],$tmp[2]);
|
||||
cookie($this->filterCookieName, serialize($this->filterFields), 0); // Use session cookie
|
||||
|
||||
// Columns to display saved in prefs
|
||||
$pref['admin_download_disp'] = implode("|",$_POST['filter_columns']);
|
||||
save_prefs();
|
||||
$this->advancedSearchFields = $_POST['download_advanced_search'];
|
||||
}
|
||||
}
|
||||
function show_filter_form($action, $subAction, $id, $from, $amount)
|
||||
@ -64,45 +50,68 @@ class adminDownload extends download
|
||||
global $mySQLdefaultdb, $pref;
|
||||
$eform = new e_form();
|
||||
|
||||
/* ************************************************************
|
||||
|
||||
This whole form needs a rework. We need to incorporate ajax usage extensively.
|
||||
Displaying all filter fields at once should be avoided.
|
||||
|
||||
******************************************************************* */
|
||||
|
||||
|
||||
|
||||
$filterColumns = ($pref['admin_download_disp'] ? explode("|",$pref['admin_download_disp']) : array("download_name","download_class"));
|
||||
|
||||
// Filter fields
|
||||
$text .= '<fieldset id="download_filter"><legend>'.DOWLAN_183.'</legend>';
|
||||
$text .= "<form method='post' action='".e_SELF."'>
|
||||
<table style='width:100%'>
|
||||
<colgroup>
|
||||
<col style='width:8%;'/>
|
||||
<col style='width:20%;'/>
|
||||
<col style='width:8%;'/>
|
||||
<col style='width:36%;'/>
|
||||
<col style='width:8%;'/>
|
||||
<col style='width:20%;'/>
|
||||
</colgroup>
|
||||
<tr>
|
||||
<td>Name</td><td><input class='tbox' type='text' name='download_filter[name]' size='20' value='{$this->filterFields['name']}' maxlength='50'/></td>
|
||||
<td>Category</td><td>
|
||||
print_r($this->advancedSearchFields);
|
||||
if ($this->advancedSearchFields)
|
||||
{
|
||||
$showBasicSearch = " style='display:none'";
|
||||
$showAdvancedSearch = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
$showBasicSearch = "";
|
||||
$showAdvancedSearch = " style='display:none'";
|
||||
}
|
||||
// Search field
|
||||
$text .= "
|
||||
<form method='post' action='".e_SELF."'>
|
||||
<fieldset id='download_search'{$showBasicSearch}>
|
||||
<legend class='e-hideme'>".DOWLAN_194."</legend>
|
||||
<table class='adminform'>
|
||||
<tr>
|
||||
<td>
|
||||
<input class='tbox' type='text' name='download_search' size='50' value='{$this->searchField}' maxlength='50'/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class='buttons-bar center'>
|
||||
<button type='submit' class='update' name='download_search_submit' value='".DOWLAN_51."'><span>".DOWLAN_51."</span></button>
|
||||
<br/>
|
||||
<a href='#' onclick='$(\"download_search\").hide();$(\"download_advanced_search\").show();return false;'>Advanced search</a>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
";
|
||||
$text .= $this->getCategorySelectList($this->filterFields['category'], true, false, ' ', 'download_filter[category]');
|
||||
// Advanced search fields
|
||||
$text .= "
|
||||
<form method='post' action='".e_SELF."'>
|
||||
<fieldset id='download_advanced_search'{$showAdvancedSearch}>
|
||||
<legend class='e-hideme'>".DOWLAN_183."</legend>
|
||||
<table class='adminform'>
|
||||
<colgroup>
|
||||
<col style='width:8%;'/>
|
||||
<col style='width:20%;'/>
|
||||
<col style='width:8%;'/>
|
||||
<col style='width:36%;'/>
|
||||
<col style='width:8%;'/>
|
||||
<col style='width:20%;'/>
|
||||
</colgroup>
|
||||
<tr>
|
||||
<td>Name</td><td><input class='tbox' type='text' name='download_advanced_search[name]' size='20' value='{$this->advancedSearchFields['name']}' maxlength='50'/></td>
|
||||
<td>Category</td><td>
|
||||
";
|
||||
$text .= $this->getCategorySelectList($this->advancedSearchFields['category'], true, false, ' ', 'download_advanced_search[category]');
|
||||
$text .= "</td>
|
||||
<td>Filesize</td>
|
||||
<td>
|
||||
";
|
||||
$text .= $this->_getConditionList('download_filter[filesize_condition]', $this->filterFields['filesize_condition']);
|
||||
$text .= $this->_getConditionList('download_advanced_search[filesize_condition]', $this->advancedSearchFields['filesize_condition']);
|
||||
$text .= "
|
||||
<input class='tbox' type='text' name='download_filter[filesize]' size='10' value='{$this->filterFields['filesize']}'/>
|
||||
<select name='download_filter[filesize_units]' class='tbox'>
|
||||
<option value='1' ".($this->filterFields['filesize_units'] == '' ? " selected='selected' " : "")." >b</option>
|
||||
<option value='1024' ".($this->filterFields['filesize_units'] == '1024' ? " selected='selected' " : "")." >Kb</option>
|
||||
<option value='1048576' ".($this->filterFields['filesize_units'] == '1048576' ? " selected='selected' " : "")." >Mb</option>
|
||||
<input class='tbox' type='text' name='download_advanced_search[filesize]' size='10' value='{$this->advancedSearchFields['filesize']}'/>
|
||||
<select name='download_advanced_search[filesize_units]' class='tbox'>
|
||||
<option value='1' ".($this->advancedSearchFields['filesize_units'] == '' ? " selected='selected' " : "")." >b</option>
|
||||
<option value='1024' ".($this->advancedSearchFields['filesize_units'] == '1024' ? " selected='selected' " : "")." >Kb</option>
|
||||
<option value='1048576' ".($this->advancedSearchFields['filesize_units'] == '1048576' ? " selected='selected' " : "")." >Mb</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
@ -110,140 +119,151 @@ class adminDownload extends download
|
||||
<td>Date</td>
|
||||
<td>
|
||||
";
|
||||
$text .= $this->_getConditionList('download_filter[date_condition]', $this->filterFields['date_condition']);
|
||||
//TODO $text .= $eform->datepicker('download_filter[date]', $this->filterFields['date']);
|
||||
$text .= $this->_getConditionList('download_advanced_search[date_condition]', $this->advancedSearchFields['date_condition']);
|
||||
//TODO $text .= $eform->datepicker('download_advanced_search[date]', $this->advancedSearchFields['date']);
|
||||
$text .= "//TODO";
|
||||
$text .= "
|
||||
</td>
|
||||
<td>Status</td>
|
||||
<td>
|
||||
<select name='download_filter[status]' class='tbox'>";
|
||||
$text .= $this->_getStatusList('download_filter[status]', $this->filterFields['status']);
|
||||
<select name='download_advanced_search[status]' class='tbox'>";
|
||||
$text .= $this->_getStatusList('download_advanced_search[status]', $this->advancedSearchFields['status']);
|
||||
$text .= " </select>
|
||||
</td>
|
||||
<td>Requested</td>
|
||||
<td>
|
||||
";
|
||||
$text .= $this->_getConditionList('download_filter[requested_condition]', $this->filterFields['requested_condition']);
|
||||
$text .= " <input class='tbox' type='text' name='download_filter[requested]' size='6' value='{$this->filterFields['requested']}' maxlength='6'/> times
|
||||
$text .= $this->_getConditionList('download_advanced_search[requested_condition]', $this->advancedSearchFields['requested_condition']);
|
||||
$text .= " <input class='tbox' type='text' name='download_advanced_search[requested]' size='6' value='{$this->advancedSearchFields['requested']}' maxlength='6'/> times
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Visibility</td>
|
||||
<td>
|
||||
";
|
||||
$text .= $eform->uc_select('download_filter[visible]', $this->filterFields['visible'], $this->userclassOptions);
|
||||
$text .= $eform->uc_select('download_advanced_search[visible]', $this->advancedSearchFields['visible'], $this->userclassOptions);
|
||||
//TODO language file stuff
|
||||
$text .= "
|
||||
</td>
|
||||
<td>URL</td><td><input class='tbox' type='text' name='download_filter[url]' size='50' value='{$this->filterFields['url']}' maxlength='50'/></td>
|
||||
<td>Author</td><td><input class='tbox' type='text' name='download_filter[author]' size='20' value='{$this->filterFields['author']}' maxlength='50'/></td>
|
||||
<td>URL</td><td><input class='tbox' type='text' name='download_advanced_search[url]' size='50' value='{$this->advancedSearchFields['url']}' maxlength='50'/></td>
|
||||
<td>Author</td><td><input class='tbox' type='text' name='download_advanced_search[author]' size='20' value='{$this->advancedSearchFields['author']}' maxlength='50'/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Class</td>
|
||||
<td>
|
||||
";
|
||||
$text .= $eform->uc_select('download_filter[class]', $this->filterFields['class'], $this->userclassOptions);
|
||||
$text .= $eform->uc_select('download_advanced_search[class]', $this->advancedSearchFields['class'], $this->userclassOptions);
|
||||
$text .= "
|
||||
</td>
|
||||
<td>Description</td><td><input class='tbox' type='text' name='download_filter[description]' size='50' value='{$this->filterFields['description']}' maxlength='50'/></td>
|
||||
<td>Description</td><td><input class='tbox' type='text' name='download_advanced_search[description]' size='50' value='{$this->advancedSearchFields['description']}' maxlength='50'/></td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>Fields to show</p>
|
||||
";
|
||||
|
||||
// Fields to display list - these are just columns form the download table
|
||||
$fields = mysql_list_fields($mySQLdefaultdb, MPREFIX."download");
|
||||
$columns = mysql_num_fields($fields);
|
||||
for ($i = 0; $i < $columns; $i++) {
|
||||
$fname[] = mysql_field_name($fields, $i);
|
||||
}
|
||||
$replacechar = array("download_","_");
|
||||
$text .= "<div>";
|
||||
foreach($fname as $fcol)
|
||||
{
|
||||
$checked = (in_array($fcol,$filterColumns)) ? "checked='checked'" : "";
|
||||
$text .= "<div style='float:left;width:20%;'>";
|
||||
$text .= "<label for='filter_".$fcol."'><input type='checkbox' name='filter_columns[]' value='".$fcol."' id='filter_".$fcol."' $checked/>".str_replace($replacechar," ",$fcol)."</label>";
|
||||
$text .= "</div>\n";
|
||||
}
|
||||
|
||||
$text .= "
|
||||
<div class='buttons-bar center' style='clear:both;'>
|
||||
<button type='submit' class='update' name='download_filter_submit' value='".DOWLAN_51."'><span>".DOWLAN_51."</span></button>
|
||||
<button type='submit' class='delete' name='download_filter_delete' value='".DOWLAN_57."'><span>".DOWLAN_57."</span></button>
|
||||
</table>
|
||||
<div class='buttons-bar center'>
|
||||
<button type='submit' class='update' name='download_advanced_search_submit' value='".DOWLAN_51."'><span>".DOWLAN_51."</span></button>
|
||||
<br/>
|
||||
<a href='#' onclick='$(\"download_search\").show();$(\"download_advanced_search\").hide();return false;'>Basic search</a>
|
||||
</div>
|
||||
</div></form></fieldset>";
|
||||
</fieldset>
|
||||
</form>";
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
function show_existing_items($action, $subAction, $id, $from, $amount)
|
||||
{
|
||||
global $sql, $rs, $ns, $tp, $mySQLdefaultdb, $pref;
|
||||
$sortorder = ($pref['download_order']) ? $pref['download_order'] : "download_datestamp";
|
||||
$sortdirection = ($pref['download_sort']) ? strtolower($pref['download_sort']) : "desc";
|
||||
if ($sortdirection != 'desc') $sortdirection = 'asc';
|
||||
global $sql, $rs, $ns, $tp, $mySQLdefaultdb, $pref, $user_pref;
|
||||
$eform = new e_form();
|
||||
$sortorder = $subAction ? $subAction : $pref['download_order'];
|
||||
$sortdirection = $id=="asc" ? "asc" : "desc";
|
||||
$sort_link = $sortdirection == 'asc' ? 'desc' : 'asc';
|
||||
$columnInfo = array(
|
||||
"download_id" => array("title"=>DOWLAN_67, "type"=>"", "width"=>"auto", "thclass"=>"", "url"=>e_SELF."?main.download_id.{$sort_link}.{$from}", "forced"=>true),
|
||||
"download_name" => array("title"=>DOWLAN_12, "type"=>"", "width"=>"auto", "thclass"=>"", "url"=>e_SELF."?main.download_name.{$sort_link}.{$from}"),
|
||||
"download_url" => array("title"=>DOWLAN_13, "type"=>"", "width"=>"auto", "thclass"=>"", "url"=>e_SELF."?main.download_url.{$sort_link}.{$from}"),
|
||||
"download_author" => array("title"=>DOWLAN_15, "type"=>"", "width"=>"auto", "thclass"=>"", "url"=>e_SELF."?main.download_author.{$sort_link}.{$from}"),
|
||||
"download_author_email" => array("title"=>DOWLAN_16, "type"=>"", "width"=>"auto", "thclass"=>"", "url"=>e_SELF."?main.download_author_email.{$sort_link}.{$from}"),
|
||||
"download_author_website" => array("title"=>DOWLAN_17, "type"=>"", "width"=>"auto", "thclass"=>"", "url"=>e_SELF."?main.download_author_website.{$sort_link}.{$from}"),
|
||||
"download_description" => array("title"=>DOWLAN_18, "type"=>"", "width"=>"auto", "thclass"=>"", "url"=>e_SELF."?main.download_description.{$sort_link}.{$from}"),
|
||||
"download_filesize" => array("title"=>DOWLAN_66, "type"=>"", "width"=>"auto", "thclass"=>"", "url"=>e_SELF."?main.download_filesize.{$sort_link}.{$from}"),
|
||||
"download_requested" => array("title"=>DOWLAN_29, "type"=>"", "width"=>"auto", "thclass"=>"", "url"=>e_SELF."?main.download_requested.{$sort_link}.{$from}"),
|
||||
"download_category" => array("title"=>DOWLAN_11, "type"=>"", "width"=>"auto", "thclass"=>"", "url"=>e_SELF."?main.download_category.{$sort_link}.{$from}"),
|
||||
"download_active" => array("title"=>DOWLAN_21, "type"=>"", "width"=>"auto", "thclass"=>"", "url"=>e_SELF."?main.download_active.{$sort_link}.{$from}"),
|
||||
"download_datestamp" => array("title"=>DOWLAN_182, "type"=>"", "width"=>"auto", "thclass"=>"", "url"=>e_SELF."?main.download_datestamp.{$sort_link}.{$from}"),
|
||||
"download_thumb" => array("title"=>DOWLAN_20, "type"=>"", "width"=>"auto", "thclass"=>"", "url"=>e_SELF."?main.download_thumb.{$sort_link}.{$from}"),
|
||||
"download_image" => array("title"=>DOWLAN_19, "type"=>"", "width"=>"auto", "thclass"=>"", "url"=>e_SELF."?main.download_image.{$sort_link}.{$from}"),
|
||||
"download_comment" => array("title"=>DOWLAN_, "type"=>"", "width"=>"auto", "thclass"=>"", "url"=>e_SELF."?main.download_comment.{$sort_link}.{$from}"),
|
||||
"download_class" => array("title"=>DOWLAN_113, "type"=>"", "width"=>"auto", "thclass"=>"", "url"=>e_SELF."?main.download_class.{$sort_link}.{$from}"),
|
||||
"download_mirror" => array("title"=>DOWLAN_128, "type"=>"", "width"=>"auto", "thclass"=>"", "url"=>e_SELF."?main.download_mirror.{$sort_link}.{$from}"),
|
||||
"download_mirror_type" => array("title"=>DOWLAN_, "type"=>"", "width"=>"auto", "thclass"=>"", "url"=>e_SELF."?main.download_mirror_type.{$sort_link}.{$from}"),
|
||||
"download_visible" => array("title"=>DOWLAN_43, "type"=>"", "width"=>"auto", "thclass"=>"", "url"=>e_SELF."?main.download_visible.{$sort_link}.{$from}"),
|
||||
"options" => array("title"=>LAN_OPTIONS, "width"=>"auto", "thclass"=>"center last", "url"=>"", "forced"=>true)
|
||||
);
|
||||
|
||||
if (!$pref['admin_download_disp'])
|
||||
{
|
||||
$filterColumns = array("download_name","download_class");
|
||||
}
|
||||
else
|
||||
{
|
||||
$filterColumns = explode("|",$pref['admin_download_disp']);
|
||||
}
|
||||
$filterColumns = ($user_pref['admin_download_disp']) ? $user_pref['admin_download_disp'] : array("download_id","download_name","download_class","options");
|
||||
$query = "SELECT d.*, dc.* FROM `#download` AS d LEFT JOIN `#download_category` AS dc ON dc. download_category_id=d.download_category";
|
||||
if ($this->filterFields) {
|
||||
|
||||
if ($this->searchField) {
|
||||
$where = array();
|
||||
if (strlen($this->filterFields['name']) > 0) {
|
||||
array_push($where, "download_name REGEXP('".$this->filterFields['name']."')");
|
||||
array_push($where, "download_name REGEXP('".$this->searchField."')");
|
||||
array_push($where, "download_description REGEXP('".$this->searchField."')");
|
||||
array_push($where, "download_author REGEXP('".$this->searchField."')");
|
||||
array_push($where, "download_author_email REGEXP('".$this->searchField."')");
|
||||
array_push($where, "download_author_website REGEXP('".$this->searchField."')");
|
||||
$where = " WHERE ".implode(" OR ", $where);
|
||||
$query .= "$where ORDER BY {$sortorder} {$sortdirection}";
|
||||
}
|
||||
else if ($this->advancedSearchFields) {
|
||||
$where = array();
|
||||
if (strlen($this->advancedSearchFields['name']) > 0) {
|
||||
array_push($where, "download_name REGEXP('".$this->advancedSearchFields['name']."')");
|
||||
}
|
||||
if (strlen($this->filterFields['url']) > 0) {
|
||||
array_push($where, "download_url REGEXP('".$this->filterFields['url']."')");
|
||||
if (strlen($this->advancedSearchFields['url']) > 0) {
|
||||
array_push($where, "download_url REGEXP('".$this->advancedSearchFields['url']."')");
|
||||
}
|
||||
if (strlen($this->filterFields['author']) > 0) {
|
||||
array_push($where, "download_author REGEXP('".$this->filterFields['author']."')");
|
||||
if (strlen($this->advancedSearchFields['author']) > 0) {
|
||||
array_push($where, "download_author REGEXP('".$this->advancedSearchFields['author']."')");
|
||||
}
|
||||
if (strlen($this->filterFields['description']) > 0) {
|
||||
array_push($where, "download_description REGEXP('".$this->filterFields['description']."')");
|
||||
if (strlen($this->advancedSearchFields['description']) > 0) {
|
||||
array_push($where, "download_description REGEXP('".$this->advancedSearchFields['description']."')");
|
||||
}
|
||||
if (strlen($this->filterFields['category']) != 0) {
|
||||
array_push($where, "download_category=".$this->filterFields['category']);
|
||||
if (strlen($this->advancedSearchFields['category']) != 0) {
|
||||
array_push($where, "download_category=".$this->advancedSearchFields['category']);
|
||||
}
|
||||
if (strlen($this->filterFields['filesize']) > 0) {
|
||||
array_push($where, "download_filesize".$this->filterFields['filesize_condition'].($this->filterFields['filesize']*$this->filterFields['filesize_units']));
|
||||
if (strlen($this->advancedSearchFields['filesize']) > 0) {
|
||||
array_push($where, "download_filesize".$this->advancedSearchFields['filesize_condition'].($this->advancedSearchFields['filesize']*$this->advancedSearchFields['filesize_units']));
|
||||
}
|
||||
if ($this->filterFields['status'] != 99) {
|
||||
array_push($where, "download_active=".$this->filterFields['status']);
|
||||
if ($this->advancedSearchFields['status'] != 99) {
|
||||
array_push($where, "download_active=".$this->advancedSearchFields['status']);
|
||||
}
|
||||
if (strlen($this->filterFields['date']) > 0) {
|
||||
switch ($this->filterFields['date_condition']) {
|
||||
if (strlen($this->advancedSearchFields['date']) > 0) {
|
||||
switch ($this->advancedSearchFields['date_condition']) {
|
||||
case "<=" :
|
||||
{
|
||||
array_push($where, "download_datestamp".$this->filterFields['date_condition'].($this->filterFields['date']+86400));
|
||||
array_push($where, "download_datestamp".$this->advancedSearchFields['date_condition'].($this->advancedSearchFields['date']+86400));
|
||||
break;
|
||||
}
|
||||
case "=" :
|
||||
{
|
||||
array_push($where, "(download_datestamp>=".$this->filterFields['date']." AND download_datestamp<=".($this->filterFields['date']+86399).")");
|
||||
array_push($where, "(download_datestamp>=".$this->advancedSearchFields['date']." AND download_datestamp<=".($this->advancedSearchFields['date']+86399).")");
|
||||
break;
|
||||
}
|
||||
case ">=" :
|
||||
{
|
||||
array_push($where, "download_datestamp".$this->filterFields['date_condition'].$this->filterFields['date']);
|
||||
array_push($where, "download_datestamp".$this->advancedSearchFields['date_condition'].$this->advancedSearchFields['date']);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (strlen($this->filterFields['requested']) > 0) {
|
||||
array_push($where, "download_requested".$this->filterFields['requested_condition'].$this->filterFields['requested']);
|
||||
if (strlen($this->advancedSearchFields['requested']) > 0) {
|
||||
array_push($where, "download_requested".$this->advancedSearchFields['requested_condition'].$this->advancedSearchFields['requested']);
|
||||
}
|
||||
if ($this->filterFields['visible']) {
|
||||
array_push($where, "download_visible=".$this->filterFields['visible']);
|
||||
if ($this->advancedSearchFields['visible']) {
|
||||
array_push($where, "download_visible=".$this->advancedSearchFields['visible']);
|
||||
}
|
||||
if ($this->filterFields['class']) {
|
||||
array_push($where, "download_class=".$this->filterFields['class']);
|
||||
if ($this->advancedSearchFields['class']) {
|
||||
array_push($where, "download_class=".$this->advancedSearchFields['class']);
|
||||
}
|
||||
$where = (count($where) > 0 ? " WHERE ".implode(" AND ", $where) : "");
|
||||
|
||||
@ -254,37 +274,18 @@ class adminDownload extends download
|
||||
$query .= " ORDER BY ".($subAction ? $subAction : $sortorder)." ".($id ? $id : $sortdirection)." LIMIT $from, $amount";
|
||||
}
|
||||
|
||||
$text .= '<fieldset id="downloads-list">
|
||||
<legend>'.DOWLAN_7.'</legend>';
|
||||
$text .= "<div style='text-align:center'><div style='padding : 1px; ".ADMIN_WIDTH."; margin-left: auto; margin-right: auto;'>";
|
||||
if ($dl_count = $sql->db_Select_gen($query))
|
||||
$text .= "<fieldset id='downloads-list'><legend class='e-hideme'>".DOWLAN_7."</legend>";
|
||||
if ($dl_count = $sql->db_Select_gen($query))
|
||||
{
|
||||
$text .= $rs->form_open("post", e_SELF."?".e_QUERY, "myform")."
|
||||
<table class='adminlist' style='width:100%'>
|
||||
<thead>
|
||||
|
||||
<tr class='first last'>
|
||||
<th>".DOWLAN_67."</th>
|
||||
<colgroup span='".count($filterColumns)."'>".$eform->colGroup($columnInfo,$filterColumns)."</colgroup>
|
||||
<thead>
|
||||
<tr>".$eform->thead($columnInfo,$filterColumns)."</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
";
|
||||
|
||||
// Search Display Column header.----------
|
||||
foreach($filterColumns as $disp)
|
||||
{
|
||||
if ($disp == "download_name")
|
||||
{ // Toggle direction
|
||||
$text .= "<th><a href='".e_SELF."?main.download_name.".($id == "desc" ? "asc" : "desc").".$from'>".DOWLAN_12."</a></th>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$repl = array("download_","_");
|
||||
$text .= "<th><a href='".e_SELF."?main.{$disp}.".($id == "desc" ? "asc" : "desc").".$from'>".ucwords(str_replace($repl," ",$disp))."</a></th>";
|
||||
}
|
||||
}
|
||||
|
||||
$text .="<th class='center'>".LAN_OPTIONS."</th></tr>
|
||||
</thead>
|
||||
<tbody>";
|
||||
|
||||
$rowStyle = "even";
|
||||
|
||||
while ($row = $sql->db_Fetch())
|
||||
@ -360,18 +361,16 @@ class adminDownload extends download
|
||||
{ // 'No downloads yet'
|
||||
$text .= "<div style='text-align:center'>".DOWLAN_6."</div>";
|
||||
}
|
||||
$text .= "</div>";
|
||||
|
||||
// Next-Previous.
|
||||
$downloads = $sql->db_Count("download");
|
||||
if ($downloads > $amount && !$_POST['searchquery'])
|
||||
if ($downloads > $amount && !$this->searchFields && !$this->advancedSearchFields)
|
||||
{
|
||||
$parms = "{$downloads},{$amount},{$from},".e_SELF."?".(e_QUERY ? "$action.$subAction.$id." : "main.{$sortorder}.{$sortdirection}.")."[FROM]";
|
||||
$text .= "<br/>".$tp->parseTemplate("{NEXTPREV={$parms}}");
|
||||
}
|
||||
|
||||
$text .= "</div>
|
||||
</fieldset>";
|
||||
$text .= "</fieldset>";
|
||||
return $text;
|
||||
}
|
||||
|
||||
@ -1768,5 +1767,54 @@ class adminDownload extends download
|
||||
}
|
||||
return $text;
|
||||
}
|
||||
|
||||
function observer()
|
||||
{
|
||||
//Required on create & savepreset action triggers
|
||||
// if(isset($_POST['news_userclass']) && is_array($_POST['news_userclass']))
|
||||
// {
|
||||
// $_POST['news_class'] = implode(",", $_POST['news_userclass']);
|
||||
// unset($_POST['news_userclass']);
|
||||
// }
|
||||
//
|
||||
// if(isset($_POST['delete']) && is_array($_POST['delete']))
|
||||
// {
|
||||
// $this->_observe_delete();
|
||||
// }
|
||||
// elseif(isset($_POST['submit_news']))
|
||||
// {
|
||||
// $this->_observe_submit_item($this->getSubAction(), $this->getId());
|
||||
// }
|
||||
// elseif(isset($_POST['create_category']))
|
||||
// {
|
||||
// $this->_observe_create_category();
|
||||
// }
|
||||
// elseif(isset($_POST['update_category']))
|
||||
// {
|
||||
// $this->_observe_update_category();
|
||||
// }
|
||||
// elseif(isset($_POST['save_prefs']))
|
||||
// {
|
||||
// $this->_observe_save_prefs();
|
||||
// }
|
||||
// elseif(isset($_POST['submitupload']))
|
||||
// {
|
||||
// $this->_observe_upload();
|
||||
// }
|
||||
// elseif(isset($_POST['news_comments_recalc']))
|
||||
// {
|
||||
// $this->_observe_newsCommentsRecalc();
|
||||
// }
|
||||
if(isset($_POST['submit-e-columns']))
|
||||
{
|
||||
$this->_observe_saveColumns();
|
||||
}
|
||||
}
|
||||
function _observe_saveColumns()
|
||||
{
|
||||
global $user_pref,$admin_log;
|
||||
$user_pref['admin_download_disp'] = $_POST['e-columns'];
|
||||
save_prefs('user');
|
||||
}
|
||||
}
|
||||
?>
|
@ -4,8 +4,8 @@
|
||||
| e107 website system - Language File.
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/download/languages/English/admin_download.php,v $
|
||||
| $Revision: 1.3 $
|
||||
| $Date: 2009-07-14 23:59:57 $
|
||||
| $Revision: 1.4 $
|
||||
| $Date: 2009-07-15 23:28:46 $
|
||||
| $Author: bugrain $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
@ -70,7 +70,7 @@ define("DOWLAN_47", "Category created");
|
||||
define("DOWLAN_48", "Category Updated");
|
||||
define("DOWLAN_49", "Download Category");
|
||||
|
||||
define("DOWLAN_51", "Search/Refresh downloads");
|
||||
define("DOWLAN_51", "Search downloads");
|
||||
define("DOWLAN_52", "Files");
|
||||
define("DOWLAN_53", "Subcategory");
|
||||
define("DOWLAN_54", "Subcategories");
|
||||
@ -184,7 +184,7 @@ define("DOWLAN_179", "Select an option from the Maintenance Options menu");
|
||||
define("DOWLAN_180", "File size (database/disk)");
|
||||
define("DOWLAN_181", "Not readable");
|
||||
define("DOWLAN_182", "Timestamp");
|
||||
define("DOWLAN_183", "Filter options");
|
||||
define("DOWLAN_183", "Advanced search");
|
||||
define("DOWLAN_184", "Batch options");
|
||||
define("DOWLAN_185", "Files referenced multiple times in the database");
|
||||
define("DOWLAN_186", "Files not referenced in the database");
|
||||
@ -195,6 +195,7 @@ define("DOWLAN_190", "Size differences between database entry and the file itsel
|
||||
define("DOWLAN_191", "Downloads log entries");
|
||||
define("DOWLAN_192", "Execute selected option");
|
||||
define("DOWLAN_193", "Select option");
|
||||
define("DOWLAN_194", "Search");
|
||||
|
||||
define("DOWLAN_HELP_1", "Download Help");
|
||||
define("DOWLAN_HELP_2", "<p>Create/edit a download.</p><p>Enter only one of: File, URL or Mirror.</p><p>Ensure you select a category, otherwise your download will not be visible on the downloads page.</p>");
|
||||
|
Loading…
x
Reference in New Issue
Block a user