1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-19 12:51:52 +02:00

Chnages to make batch processing common code reusable - moved setting up of drop down list to form handler, made JavaScript unobtrusive

First stab at a datepicker function for form handler - very basic
Some tidying up in download plugin
This commit is contained in:
bugrain
2009-08-14 23:22:38 +00:00
parent 0527a8a02a
commit 3816e3ba55
7 changed files with 162 additions and 123 deletions

View File

@@ -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.10 $
| $Date: 2009-08-06 22:36:17 $
| $Revision: 1.11 $
| $Date: 2009-08-14 23:22:37 $
| $Author: bugrain $
+----------------------------------------------------------------------------+
*/
@@ -834,12 +834,5 @@ function admin_download_adminmenu($parms)
$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);
}
}
?>

View File

@@ -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.15 $
| $Date: 2009-08-06 22:41:34 $
| $Revision: 1.16 $
| $Date: 2009-08-14 23:22:37 $
| $Author: bugrain $
|
+----------------------------------------------------------------------------+
@@ -60,30 +60,6 @@ class adminDownload extends download
// Search field
$text .= "
<script type='text/javascript'>
e107.runOnLoad(function(){
var el = $('download-search-text');
el.e107PreviousValue = el.getValue();
el.observe('keyup', function(e) {
var el = e.element();
e.stop();
if (el.getValue() != el.e107PreviousValue) {
if (el.e107Timeout) {
window.clearTimeout(el.e107Timeout);
}
el.e107PreviousValue = el.getValue();
el.e107Timeout = window.setTimeout(function () {
new e107Ajax.Updater('downloads-list', '{$url}', {
method: 'post',
parameters: { //send query parameters here
'download_filter_list': 1,
'download-search-text': el.getValue()
},
overlayPage: $(document.body)
});
}, 500);
}
});
}, document, false);
</script>
<form method='post' action='".e_SELF."' class='e-show-if-js'>
<div id='download_search'>
@@ -456,7 +432,7 @@ class adminDownload extends download
{
$parms = "{$downloads},{$amount},{$from},".e_SELF."?".(e_QUERY ? "$action.$subAction.$id." : "main.{$sortorder}.{$sortdirection}.")."[FROM]";
$text .= "<div class='buttons-bar center nextprev'>".$this->batch_options().
$tp->parseTemplate("{NEXTPREV={$parms}}")."</div>";
$tp->parseTemplate("{NEXTPREV={$parms}}")."</div>";
}
$text .= "</form></fieldset>";
@@ -465,37 +441,17 @@ class adminDownload extends download
}
// ---------------------------------------------------------------------------
function batch_options()
function batch_options()
{
$text = "<span class='f-left' style='padding-left:15px'><img src='".e_IMAGE."generic/branchbottom.gif' alt='' />
<select class='tbox' name='execute_batch' onchange='this.form.submit()'>
<option value=''>With selected...</option>";
$text .= "<option value='delete_selected'>".LAN_DELETE."</option>";
$text .= "
<optgroup label='Assign Userclass..'>
";
$classes = get_userclass_list();
foreach ($classes as $key => $val)
{
$text .= "<option value='userclass_selected_".$val['userclass_name']['userclass_id']."'>".$val['userclass_name']['userclass_name']."</option>\n";
}
$text .= "
</optgroup>
<optgroup label='Assign Visibility..'>
";
$classes = get_userclass_list();
foreach ($classes as $key => $val)
{
$text .= "<option value='visibility_selected_".$val['userclass_name']['userclass_id']."'>".$val['userclass_name']['userclass_name']."</option>\n";
}
$text .= "
</optgroup>
</select></span><span class='clear'>&nbsp;</span>";
return $text;
$frm = new e_form();
$classes = get_userclass_list();
return $frm->batchoptions(
array('delete_selected'=>LAN_DELETE),
array(
'userclass' =>array('Assign userclass...',$classes),
'visibility'=>array('Assign Visibility..',$classes)
)
);
}

View File

@@ -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.6 $
| $Date: 2009-07-18 19:04:04 $
| $Revision: 1.7 $
| $Date: 2009-08-14 23:22:38 $
| $Author: bugrain $
+----------------------------------------------------------------------------+
*/
@@ -185,7 +185,7 @@ define("DOWLAN_180", "File size (database/disk)");
define("DOWLAN_181", "Not readable");
define("DOWLAN_182", "Timestamp");
define("DOWLAN_183", "Advanced search");
define("DOWLAN_184", "Batch options");
define("DOWLAN_184", "");
define("DOWLAN_185", "Files referenced multiple times in the database");
define("DOWLAN_186", "Files not referenced in the database");
define("DOWLAN_187", "Database entries referencing non-existent files");