[9599] | 1 | {combine_script id='jquery.sort' load='footer' path='themes/default/js/plugins/jquery.sort.js'} |
---|
[9598] | 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 | |
---|
[9586] | 14 | jQuery(document).ready(function(){ |
---|
| 15 | jQuery("td[id^='desc_']").click(function() { |
---|
[7995] | 16 | id = this.id.split('_'); |
---|
| 17 | nb_lines = jQuery("#bigdesc_"+id[1]).html().split('<br>').length; |
---|
[5729] | 18 | |
---|
[7995] | 19 | jQuery("#smalldesc_"+id[1]).toggle('blind', 1); |
---|
[9586] | 20 | if (jQuery(this).hasClass('bigdesc')) { |
---|
[7995] | 21 | jQuery("#bigdesc_"+id[1]).toggle('blind', 1); |
---|
[9586] | 22 | } else { |
---|
[7995] | 23 | jQuery("#bigdesc_"+id[1]).toggle('blind', 50 + (nb_lines * 30)); |
---|
| 24 | } |
---|
| 25 | jQuery(this).toggleClass('bigdesc'); |
---|
| 26 | return false; |
---|
| 27 | }); |
---|
[9598] | 28 | |
---|
| 29 | jQuery('select[name="selectOrder"]').change(function() { |
---|
| 30 | sortOrder = this.value; |
---|
| 31 | $('.pluginBox').sortElements(sortPlugins); |
---|
[11222] | 32 | $.get("admin.php?plugins_new_order="+sortOrder); |
---|
[9598] | 33 | }); |
---|
[2587] | 34 | }); |
---|
[9586] | 35 | {/literal}{/footer_script} |
---|
[2587] | 36 | |
---|
[2531] | 37 | <div class="titrePage"> |
---|
[2631] | 38 | <span class="sort"> |
---|
[2531] | 39 | {'Sort order'|@translate} : |
---|
[9598] | 40 | {html_options name="selectOrder" options=$order_options selected=$order_selected} |
---|
[2631] | 41 | </span> |
---|
| 42 | <h2>{'Plugins'|@translate}</h2> |
---|
| 43 | </div> |
---|
[2531] | 44 | |
---|
[5570] | 45 | {if not empty($plugins)} |
---|
[5695] | 46 | <div id="availablePlugins"> |
---|
[5516] | 47 | <fieldset> |
---|
| 48 | <legend></legend> |
---|
[2531] | 49 | {foreach from=$plugins item=plugin name=plugins_loop} |
---|
[5729] | 50 | <div class="pluginBox" id="plugin_{$plugin.ID}"> |
---|
[9598] | 51 | <input type="hidden" name="date" value="{$plugin.ID}"> |
---|
| 52 | <input type="hidden" name="name" value="{$plugin.EXT_NAME}"> |
---|
| 53 | <input type="hidden" name="revision" value="{$plugin.REVISION_DATE}"> |
---|
| 54 | <input type="hidden" name="downloads" value="{$plugin.DOWNLOADS}"> |
---|
| 55 | <input type="hidden" name="author" value="{$plugin.AUTHOR}"> |
---|
[5515] | 56 | <table> |
---|
| 57 | <tr> |
---|
| 58 | <td class="pluginBoxNameCell">{$plugin.EXT_NAME}</td> |
---|
| 59 | {if $plugin.BIG_DESC != $plugin.SMALL_DESC} |
---|
| 60 | <td id="desc_{$plugin.ID}" class="pluginDesc"> |
---|
| 61 | <span id="smalldesc_{$plugin.ID}"> |
---|
[5516] | 62 | <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/plus.gif" alt="">{$plugin.SMALL_DESC}... |
---|
[5515] | 63 | </span> |
---|
| 64 | <span id="bigdesc_{$plugin.ID}" style="display:none;"> |
---|
[5516] | 65 | <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/minus.gif" alt="">{$plugin.BIG_DESC|@nl2br}<br> |
---|
[5515] | 66 | </span> |
---|
| 67 | </td> |
---|
| 68 | {else} |
---|
| 69 | <td>{$plugin.BIG_DESC|@nl2br}</td> |
---|
[2531] | 70 | {/if} |
---|
[5515] | 71 | </tr> |
---|
| 72 | <tr> |
---|
| 73 | <td> |
---|
| 74 | <a href="{$plugin.URL_INSTALL}" onclick="return confirm('{'Are you sure you want to install this plugin?'|@translate|@escape:javascript}');">{'Install'|@translate}</a> |
---|
| 75 | | <a href="{$plugin.URL_DOWNLOAD}">{'Download'|@translate}</a> |
---|
| 76 | </td> |
---|
| 77 | <td> |
---|
[5516] | 78 | <em>{'Downloads'|@translate}: {$plugin.DOWNLOADS}</em> |
---|
[5515] | 79 | {'Version'|@translate} {$plugin.VERSION} |
---|
| 80 | | {'By %s'|@translate|@sprintf:$plugin.AUTHOR} |
---|
| 81 | | <a class="externalLink" href="{$plugin.EXT_URL}">{'Visit plugin site'|@translate}</a> |
---|
| 82 | </td> |
---|
| 83 | </tr> |
---|
| 84 | </table> |
---|
| 85 | </div> |
---|
[5516] | 86 | {/foreach} |
---|
[5570] | 87 | </fieldset> |
---|
[5695] | 88 | </div> |
---|
[5570] | 89 | {else} |
---|
| 90 | <p>{'There is no other plugin available.'|@translate}</p> |
---|
| 91 | {/if} |
---|