1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-10 01:26:29 +02:00

Some updates to start making filter list code more generic

This commit is contained in:
bugrain
2009-08-15 01:00:38 +00:00
parent 397175c178
commit 708f5780e3
4 changed files with 35 additions and 24 deletions

View File

@ -9,9 +9,9 @@
* Admin Navigation * Admin Navigation
* *
* $Source: /cvs_backup/e107_0.8/e107_admin/ad_links.php,v $ * $Source: /cvs_backup/e107_0.8/e107_admin/ad_links.php,v $
* $Revision: 1.15 $ * $Revision: 1.16 $
* $Date: 2009-08-05 20:05:48 $ * $Date: 2009-08-15 01:00:38 $
* $Author: e107coders $ * $Author: bugrain $
*/ */
if (!defined('e107_INIT')) { exit; } if (!defined('e107_INIT')) { exit; }
@ -145,6 +145,9 @@ if (!defined('E_16_CRON')) {
if (!defined('E_16_CUST')) { if (!defined('E_16_CUST')) {
define('E_16_CUST', "<img class='icon S16' src='".e_IMAGE."admin_images/custom_16.png' alt='' />"); define('E_16_CUST', "<img class='icon S16' src='".e_IMAGE."admin_images/custom_16.png' alt='' />");
} }
if (!defined('E_16_CUSTOMFIELD')) {
define('E_16_CUSTOMFIELD', "<img class='icon S16' src='".e_IMAGE."admin_images/custom_field_16.png' alt='' />");
}
if (!defined('E_16_DATAB')) { if (!defined('E_16_DATAB')) {
define('E_16_DATAB', "<img class='icon S16' src='".e_IMAGE."admin_images/database_16.png' alt='' />"); define('E_16_DATAB', "<img class='icon S16' src='".e_IMAGE."admin_images/database_16.png' alt='' />");
} }
@ -294,6 +297,9 @@ if (!defined('E_32_CRON')) {
if (!defined('E_32_CUST')) { if (!defined('E_32_CUST')) {
define('E_32_CUST', "<img class='icon S32' src='".e_IMAGE."admin_images/custom_32.png' alt='' />"); define('E_32_CUST', "<img class='icon S32' src='".e_IMAGE."admin_images/custom_32.png' alt='' />");
} }
if (!defined('E_32_CUSTOMFIELD')) {
define('E_32_CUSTOMFIELD', "<img class='icon S16' src='".e_IMAGE."admin_images/custom_field_32.png' alt='' />");
}
if (!defined('E_32_DATAB')) { if (!defined('E_32_DATAB')) {
define('E_32_DATAB', "<img class='icon S32' src='".e_IMAGE."admin_images/database_32.png' alt='' />"); define('E_32_DATAB', "<img class='icon S32' src='".e_IMAGE."admin_images/database_32.png' alt='' />");
} }
@ -430,6 +436,7 @@ $e_icon_array = array(
'credits' => E_32_CREDITS, 'credits' => E_32_CREDITS,
'cron' => E_32_CRON, 'cron' => E_32_CRON,
'custom' => E_32_CUST, 'custom' => E_32_CUST,
'custom_field' => E_32_CUSTOMFIELD,
'database' => E_32_DATAB, 'database' => E_32_DATAB,
'docs' => E_32_DOCS, 'docs' => E_32_DOCS,
'download' => E_32_DOWNL, 'download' => E_32_DOWNL,
@ -581,8 +588,9 @@ $array_functions = array(
32 => array(e_ADMIN.'eurl.php', ADLAN_159, ADLAN_160, 'L', 1, E_16_EURL, E_32_EURL), 32 => array(e_ADMIN.'eurl.php', ADLAN_159, ADLAN_160, 'L', 1, E_16_EURL, E_32_EURL),
33 => array(e_ADMIN.'plugin.php', ADLAN_98, ADLAN_99, 'Z', 5 , E_16_PLUGMANAGER, E_32_PLUGMANAGER), 33 => array(e_ADMIN.'plugin.php', ADLAN_98, ADLAN_99, 'Z', 5 , E_16_PLUGMANAGER, E_32_PLUGMANAGER),
34 => array(e_ADMIN.'docs.php', ADLAN_12, ADLAN_13, '', 20, E_16_DOCS, E_32_DOCS), 34 => array(e_ADMIN.'docs.php', ADLAN_12, ADLAN_13, '', 20, E_16_DOCS, E_32_DOCS),
35 => array('#TODO', 'System Info', 'System Information', '', 20, E_16_SYSINFO, E_32_SYSINFO), 35 => array('#TODO', 'System Info', 'System Information', '', 20, '', ''),
36 => array(e_ADMIN.'credits.php', LAN_CREDITS, LAN_CREDITS, '', 20, E_16_CREDITS, E_32_CREDITS) 36 => array(e_ADMIN.'credits.php', LAN_CREDITS, LAN_CREDITS, '', 20, '', ''),
37 => array(e_ADMIN.'custom_field.php', ADLAN_161, ADLAN_162, 'U', 4, E_16_CUSTOMFIELD, E_32_CUSTOMFIELD)
); );
//FIXME array structure suitable for e_admin_menu - see shortcodes/admin_navigation.php //FIXME array structure suitable for e_admin_menu - see shortcodes/admin_navigation.php

View File

@ -8,8 +8,8 @@
* e107 Admin Helper * e107 Admin Helper
* *
* $Source: /cvs_backup/e107_0.8/e107_files/jslib/core/admin.js,v $ * $Source: /cvs_backup/e107_0.8/e107_files/jslib/core/admin.js,v $
* $Revision: 1.19 $ * $Revision: 1.20 $
* $Date: 2009-08-15 00:03:05 $ * $Date: 2009-08-15 01:00:38 $
* $Author: bugrain $ * $Author: bugrain $
* *
*/ */
@ -307,6 +307,15 @@ if(e107Admin.initRules.AdminMenu)
//TODO find the right place for this and make generic - wanted it out of download plugin for now //TODO find the right place for this and make generic - wanted it out of download plugin for now
// Current use:
// - filter text field must be in a form
// - form tag must have a class of e-filter-form
// - form must have an id of jstarget-xxx where xxx is the ID of the element to be replaced by the Ajax response
// - form action must be the URL to submit the Ajax request to
// - ajax requests posts 3 values:
// - ajax_used = 1 - because of a current issue with e107Ajax.Updater
// - filter_list=1 - to indicate to called URL that this is a filter list request
// - the name/value of the st input field in the form, i.e. the one with the text to be searched for
e107.runOnLoad(function(){ e107.runOnLoad(function(){
$$('form.e-filter-form').each(function(f) { $$('form.e-filter-form').each(function(f) {
var el = f.select('input')[0]; var el = f.select('input')[0];
@ -320,12 +329,9 @@ e107.runOnLoad(function(){
} }
el.e107PreviousValue = el.getValue(); el.e107PreviousValue = el.getValue();
el.e107Timeout = window.setTimeout(function () { el.e107Timeout = window.setTimeout(function () {
new e107Ajax.Updater('downloads-list', f.action, { new e107Ajax.Updater(f.id.replace(/jstarget-/, '').strip(), f.action, {
method: 'post', method: 'post',
parameters: { //send query parameters here parameters: 'ajax_used=1&filter_list=1&'+el.name+'='+el.getValue(),
'download_filter_list': 1,
'download-search-text': el.getValue()
},
overlayPage: $(document.body) overlayPage: $(document.body)
}); });
}, 500); }, 500);

View File

@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_plugins/download/admin_download.php,v $ | $Source: /cvs_backup/e107_0.8/e107_plugins/download/admin_download.php,v $
| $Revision: 1.11 $ | $Revision: 1.12 $
| $Date: 2009-08-14 23:22:37 $ | $Date: 2009-08-15 01:00:38 $
| $Author: bugrain $ | $Author: bugrain $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@ -88,7 +88,7 @@ require_once (e_HANDLER.'message_handler.php');
$emessage = &eMessage::getInstance(); $emessage = &eMessage::getInstance();
if(isset($_POST['download_filter_list'])) if(isset($_POST['filter_list']))
{ {
echo $adminDownload->show_existing_items($action, $subAction, $id, 0, 10); echo $adminDownload->show_existing_items($action, $subAction, $id, 0, 10);
exit; exit;

View File

@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_plugins/download/handlers/adminDownload_class.php,v $ | $Source: /cvs_backup/e107_0.8/e107_plugins/download/handlers/adminDownload_class.php,v $
| $Revision: 1.16 $ | $Revision: 1.17 $
| $Date: 2009-08-14 23:22:37 $ | $Date: 2009-08-15 01:00:38 $
| $Author: bugrain $ | $Author: bugrain $
| |
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
@ -51,23 +51,20 @@ class adminDownload extends download
$frm = new e_form(); $frm = new e_form();
$filterColumns = ($user_pref['admin_download_disp'] ? $user_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 $url = $e107->url->getUrl('forum', 'thread', array('func' => 'view', 'id' => 123));
? "e107Ajax.toggleUpdate('{$id}-iconpicker', '{$id}-iconpicker-cn', 'sc:iconpicker=".urlencode($sc_parameters)."', '{$id}-iconpicker-ajax', { overlayElement: '{$id}-iconpicker-button' })" $url = "admin_download.php";
: "e107Helper.toggle('{$id}-iconpicker')";
$url = $e107->url->getUrl('forum', 'thread', array('func' => 'view', 'id' => 123));
$url = "admin_download.php";
// Search field // Search field
$text .= " $text .= "
<script type='text/javascript'> <script type='text/javascript'>
</script> </script>
<form method='post' action='".e_SELF."' class='e-show-if-js'> <form method='post' action='".e_SELF."' class='e-show-if-js e-filter-form' id='jstarget-downloads-list'>
<div id='download_search'> <div id='download_search'>
<fieldset> <fieldset>
<legend class='e-hideme'>".DOWLAN_194."</legend> <legend class='e-hideme'>".DOWLAN_194."</legend>
<table class='adminlist'> <table class='adminlist'>
<tr> <tr>
<td>".DOWLAN_198." ".$frm->text('download-search-text', $this->searchField, 50, array('size'=>50, 'other' => "onkeyup=\"{$jsfunc}\""))."&nbsp;<a href='#download_search#download_advanced_search' class='e-swapit'>Switch to Advanced-Search</a></td> <td>".DOWLAN_198." ".$frm->text('download-search-text', $this->searchField, 50, array('size'=>50, 'class' => 'someclass'))."&nbsp;<a href='#download_search#download_advanced_search' class='e-swapit'>Switch to Advanced-Search</a></td>
</tr> </tr>
</table> </table>