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