1 | {footer_script require='jquery.ui.sortable'}{literal} |
---|
2 | jQuery(document).ready(function(){ |
---|
3 | jQuery(".menuPos").hide(); |
---|
4 | jQuery(".drag_button").show(); |
---|
5 | jQuery(".menuLi").css("cursor","move"); |
---|
6 | jQuery(".menuUl").sortable({ |
---|
7 | axis: "y", |
---|
8 | opacity: 0.8 |
---|
9 | }); |
---|
10 | jQuery("input[name^='hide_']").click(function() { |
---|
11 | men = this.name.split('hide_'); |
---|
12 | if (this.checked) { |
---|
13 | jQuery("#menu_"+men[1]).addClass('menuLi_hidden'); |
---|
14 | } else { |
---|
15 | jQuery("#menu_"+men[1]).removeClass('menuLi_hidden'); |
---|
16 | } |
---|
17 | }); |
---|
18 | jQuery("#menuOrdering").submit(function(){ |
---|
19 | ar = jQuery('.menuUl').sortable('toArray'); |
---|
20 | for(i=0;i<ar.length;i++) { |
---|
21 | men = ar[i].split('menu_'); |
---|
22 | document.getElementsByName('pos_' + men[1])[0].value = i+1; |
---|
23 | } |
---|
24 | }); |
---|
25 | }); |
---|
26 | {/literal}{/footer_script} |
---|
27 | |
---|
28 | <div class="titrePage"> |
---|
29 | <h2>{'Menu Management'|@translate}</h2> |
---|
30 | </div> |
---|
31 | |
---|
32 | <form id="menuOrdering" action="{$F_ACTION}" method="post"> |
---|
33 | <ul class="menuUl"> |
---|
34 | {foreach from=$blocks item=block name="block_loop"} |
---|
35 | <li class="menuLi {if $block.pos<0}menuLi_hidden{/if}" id="menu_{$block.reg->get_id()}"> |
---|
36 | <p> |
---|
37 | <span> |
---|
38 | <strong>{'Hide'|@translate} <input type="checkbox" name="hide_{$block.reg->get_id()}" {if $block.pos<0}checked="checked"{/if}></strong> |
---|
39 | </span> |
---|
40 | |
---|
41 | <img src="{$themeconf.admin_icon_dir}/cat_move.png" class="button drag_button" style="display:none;" alt="{'Drag to re-order'|@translate}" title="{'Drag to re-order'|@translate}"> |
---|
42 | <strong>{$block.reg->get_name()|@translate}</strong> ({$block.reg->get_id()}) |
---|
43 | </p> |
---|
44 | |
---|
45 | {if $block.reg->get_owner() != 'piwigo'} |
---|
46 | <p class="menuAuthor"> |
---|
47 | {'Author'|@translate}: <i>{$block.reg->get_owner()}</i> |
---|
48 | </p> |
---|
49 | {/if} |
---|
50 | |
---|
51 | <p class="menuPos"> |
---|
52 | <label> |
---|
53 | {'Position'|@translate} : |
---|
54 | <input type="text" size="4" name="pos_{$block.reg->get_id()}" maxlength="4" value="{math equation="abs(pos)" pos=$block.pos}"> |
---|
55 | </label> |
---|
56 | </p> |
---|
57 | </li> |
---|
58 | {/foreach} |
---|
59 | </ul> |
---|
60 | <p class="menuSubmit"> |
---|
61 | <input type="submit" name="submit" value="{'Submit'|@translate}"> |
---|
62 | <input type="submit" name="reset" value="{'Reset'|@translate}"> |
---|
63 | </p> |
---|
64 | |
---|
65 | </form> |
---|