From 2fcfdb4ddce0dd296227a59bb855ea6c75efa894 Mon Sep 17 00:00:00 2001 From: CaMer0n Date: Sun, 19 Jul 2009 20:25:03 +0000 Subject: [PATCH] Added non-function batch example + user_pref fix for column/field option. --- .../download/handlers/adminDownload_class.php | 43 +++++++++++++------ 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/e107_plugins/download/handlers/adminDownload_class.php b/e107_plugins/download/handlers/adminDownload_class.php index 40c76a33a..ae09b95c4 100644 --- a/e107_plugins/download/handlers/adminDownload_class.php +++ b/e107_plugins/download/handlers/adminDownload_class.php @@ -11,9 +11,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/download/handlers/adminDownload_class.php,v $ -| $Revision: 1.9 $ -| $Date: 2009-07-18 19:04:04 $ -| $Author: bugrain $ +| $Revision: 1.10 $ +| $Date: 2009-07-19 20:25:03 $ +| $Author: e107coders $ | +----------------------------------------------------------------------------+ */ @@ -47,10 +47,10 @@ class adminDownload extends download } function show_filter_form($action, $subAction, $id, $from, $amount) { - global $e107, $mySQLdefaultdb, $pref; + global $e107, $mySQLdefaultdb, $pref, $user_pref; $frm = new e_form(); - $filterColumns = ($pref['admin_download_disp'] ? explode("|",$pref['admin_download_disp']) : array("download_name","download_class")); + $filterColumns = ($user_pref['admin_download_disp'] ? $user_pref['admin_download_disp'] : array("download_name","download_class")); $jsfunc = $ajax ? "e107Ajax.toggleUpdate('{$id}-iconpicker', '{$id}-iconpicker-cn', 'sc:iconpicker=".urlencode($sc_parameters)."', '{$id}-iconpicker-ajax', { overlayElement: '{$id}-iconpicker-button' })" : "e107Helper.toggle('{$id}-iconpicker')"; @@ -91,12 +91,10 @@ class adminDownload extends download ".DOWLAN_194." - +
".DOWLAN_198." ".$frm->text('download-search-text', $this->searchField, 50, array('size'=>50, 'other' => "onkeyup=\"{$jsfunc}\""))."".DOWLAN_198." ".$frm->text('download-search-text', $this->searchField, 50, array('size'=>50, 'other' => "onkeyup=\"{$jsfunc}\""))." Switch to Advanced-Search
-
- Advanced search -
+ "; // Filter should use ajax to filter the results automatically after typing. @@ -224,7 +222,8 @@ class adminDownload extends download $sort_link = $sortdirection == 'asc' ? 'desc' : 'asc'; $columnInfo = array( - "download_id" => array("title"=>DOWLAN_67, "type"=>"", "width"=>"auto", "thclass"=>"center first", "forced"=>true), + "checkboxes" => array("title" => "", "forced"=> TRUE, "width" => "3%", "thclass" => "center first", "url" => ""), + "download_id" => array("title"=>DOWLAN_67, "type"=>"", "width"=>"auto", "thclass"=>"", "forced"=>true), "download_name" => array("title"=>DOWLAN_12, "type"=>"", "width"=>"auto", "thclass"=>""), "download_url" => array("title"=>DOWLAN_13, "type"=>"", "width"=>"auto", "thclass"=>""), "download_author" => array("title"=>DOWLAN_15, "type"=>"", "width"=>"auto", "thclass"=>""), @@ -334,8 +333,9 @@ class adminDownload extends download while ($row = $sql->db_Fetch()) { $mirror = strlen($row['download_mirror']) > 0; - - $text .= "\n".$row['download_id']."\n"; + $text .= "\n + ".$frm->checkbox("dl_selected[".$row["download_id"]."]", $row['download_id'])." + ".$row['download_id']."\n"; // Display Chosen options @@ -455,7 +455,8 @@ class adminDownload extends download if ($downloads > $amount && !$this->searchFields && !$this->advancedSearchFields) { $parms = "{$downloads},{$amount},{$from},".e_SELF."?".(e_QUERY ? "$action.$subAction.$id." : "main.{$sortorder}.{$sortdirection}.")."[FROM]"; - $text .= "
".$tp->parseTemplate("{NEXTPREV={$parms}}"); + $text .= "
".$this->batch_options(). + $tp->parseTemplate("{NEXTPREV={$parms}}")."
"; } $text .= ""; @@ -463,7 +464,23 @@ class adminDownload extends download } // --------------------------------------------------------------------------- + function batch_options() + { + $text = " + "; + return $text; + } // Given the string which is stored in the DB, turns it into an array of mirror entries // If $byID is true, the array index is the mirror ID. Otherwise its a simple array