Changeset 9598 for trunk/admin
- Timestamp:
- Mar 10, 2011, 12:36:14 PM (14 years ago)
- Location:
- trunk/admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/plugins_new.php
r8728 r9598 31 31 $template->set_filenames(array('plugins' => 'plugins_new.tpl')); 32 32 33 $order = isset($_GET['order']) ? $_GET['order'] : 'date'; 34 $base_url = get_root_url().'admin.php?page='.$page['page'].'&order='.$order; 33 $base_url = get_root_url().'admin.php?page='.$page['page']; 35 34 36 35 $plugins = new plugins(); … … 87 86 88 87 //---------------------------------------------------------------Order options 89 $link = get_root_url().'admin.php?page='.$page['page'].'&order=';90 88 $template->assign('order_options', 91 89 array( 92 $link.'date' => l10n('Post date'), 93 $link.'revision' => l10n('Last revisions'), 94 $link.'name' => l10n('Name'), 95 $link.'author' => l10n('Author'), 96 $link.'downloads' => l10n('Number of downloads'))); 97 $template->assign('order_selected', $link.$order); 90 'date' => l10n('Post date'), 91 'revision' => l10n('Last revisions'), 92 'name' => l10n('Name'), 93 'author' => l10n('Author'), 94 'downloads' => l10n('Number of downloads'))); 98 95 99 96 // +-----------------------------------------------------------------------+ … … 102 99 if ($plugins->get_server_plugins(true)) 103 100 { 104 $plugins->sort_server_plugins( $order);101 $plugins->sort_server_plugins('date'); 105 102 106 103 foreach($plugins->server_plugins as $plugin) … … 122 119 'BIG_DESC' => $ext_desc, 123 120 'VERSION' => $plugin['revision_name'], 121 'REVISION_DATE' => preg_replace('/[^0-9]/', '', $plugin['revision_date']), 124 122 'AUTHOR' => $plugin['author_name'], 125 123 'DOWNLOADS' => $plugin['extension_nb_downloads'], -
trunk/admin/themes/default/template/plugins_new.tpl
r9586 r9598 1 {footer_script require='jquery.effects.blind'}{literal} 1 {combine_script id='jquery.sort' path='themes/default/js/plugins/jquery.sort.js'} 2 3 {footer_script require='jquery.effects.blind,jquery.sort'}{literal} 4 var sortOrder = 'date'; 5 var sortPlugins = (function(a, b) { 6 if (sortOrder == 'downloads' || sortOrder == 'revision' || sortOrder == 'date') 7 return parseInt($(a).find('input[name="'+sortOrder+'"]').val()) 8 < parseInt($(b).find('input[name="'+sortOrder+'"]').val()) ? 1 : -1; 9 else 10 return $(a).find('input[name="'+sortOrder+'"]').val().toLowerCase() 11 > $(b).find('input[name="'+sortOrder+'"]').val().toLowerCase() ? 1 : -1; 12 }); 13 2 14 jQuery(document).ready(function(){ 3 15 jQuery("td[id^='desc_']").click(function() { … … 14 26 return false; 15 27 }); 28 29 jQuery('select[name="selectOrder"]').change(function() { 30 sortOrder = this.value; 31 $('.pluginBox').sortElements(sortPlugins); 32 }); 16 33 }); 17 34 {/literal}{/footer_script} … … 20 37 <span class="sort"> 21 38 {'Sort order'|@translate} : 22 <select onchange="document.location = this.options[this.selectedIndex].value;"> 23 {html_options options=$order_options selected=$order_selected} 24 </select> 39 {html_options name="selectOrder" options=$order_options selected=$order_selected} 25 40 </span> 26 41 <h2>{'Plugins'|@translate}</h2> … … 33 48 {foreach from=$plugins item=plugin name=plugins_loop} 34 49 <div class="pluginBox" id="plugin_{$plugin.ID}"> 50 <input type="hidden" name="date" value="{$plugin.ID}"> 51 <input type="hidden" name="name" value="{$plugin.EXT_NAME}"> 52 <input type="hidden" name="revision" value="{$plugin.REVISION_DATE}"> 53 <input type="hidden" name="downloads" value="{$plugin.DOWNLOADS}"> 54 <input type="hidden" name="author" value="{$plugin.AUTHOR}"> 35 55 <table> 36 56 <tr>
Note: See TracChangeset
for help on using the changeset viewer.