1 | {combine_script id='jquery.sort' load='footer' path='themes/default/js/plugins/jquery.sort.js'} |
---|
2 | |
---|
3 | {footer_script require='jquery.ui.effect-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 | |
---|
14 | jQuery(document).ready(function(){ |
---|
15 | jQuery("td[id^='desc_']").click(function() { |
---|
16 | id = this.id.split('_'); |
---|
17 | nb_lines = jQuery("#bigdesc_"+id[1]).html().split('<br>').length; |
---|
18 | |
---|
19 | jQuery("#smalldesc_"+id[1]).toggle('blind', 1); |
---|
20 | if (jQuery(this).hasClass('bigdesc')) { |
---|
21 | jQuery("#bigdesc_"+id[1]).toggle('blind', 1); |
---|
22 | } else { |
---|
23 | jQuery("#bigdesc_"+id[1]).toggle('blind', 50 + (nb_lines * 30)); |
---|
24 | } |
---|
25 | jQuery(this).toggleClass('bigdesc'); |
---|
26 | return false; |
---|
27 | }); |
---|
28 | |
---|
29 | jQuery('select[name="selectOrder"]').change(function() { |
---|
30 | sortOrder = this.value; |
---|
31 | $('.pluginBox').sortElements(sortPlugins); |
---|
32 | $.get("admin.php?plugins_new_order="+sortOrder); |
---|
33 | }); |
---|
34 | }); |
---|
35 | {/literal}{/footer_script} |
---|
36 | |
---|
37 | <div class="titrePage"> |
---|
38 | <span class="sort"> |
---|
39 | {'Sort order'|@translate} : |
---|
40 | {html_options name="selectOrder" options=$order_options selected=$order_selected} |
---|
41 | </span> |
---|
42 | <h2>{'Plugins'|@translate}</h2> |
---|
43 | </div> |
---|
44 | |
---|
45 | {if not empty($plugins)} |
---|
46 | <div id="availablePlugins"> |
---|
47 | <fieldset> |
---|
48 | <legend></legend> |
---|
49 | {foreach from=$plugins item=plugin name=plugins_loop} |
---|
50 | <div class="pluginBox" id="plugin_{$plugin.ID}"> |
---|
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}"> |
---|
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}"> |
---|
62 | <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/plus.gif" alt="">{$plugin.SMALL_DESC}... |
---|
63 | </span> |
---|
64 | <span id="bigdesc_{$plugin.ID}" style="display:none;"> |
---|
65 | <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/minus.gif" alt="">{$plugin.BIG_DESC|@nl2br}<br> |
---|
66 | </span> |
---|
67 | </td> |
---|
68 | {else} |
---|
69 | <td>{$plugin.BIG_DESC|@nl2br}</td> |
---|
70 | {/if} |
---|
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> |
---|
78 | <em>{'Downloads'|@translate}: {$plugin.DOWNLOADS}</em> |
---|
79 | {'Version'|@translate} {$plugin.VERSION} |
---|
80 | | {'By %s'|@translate:$plugin.AUTHOR} |
---|
81 | | <a class="externalLink" href="{$plugin.EXT_URL}">{'Visit plugin site'|@translate}</a> |
---|
82 | </td> |
---|
83 | </tr> |
---|
84 | </table> |
---|
85 | </div> |
---|
86 | {/foreach} |
---|
87 | </fieldset> |
---|
88 | </div> |
---|
89 | {else} |
---|
90 | <p>{'There is no other plugin available.'|@translate}</p> |
---|
91 | {/if} |
---|