source: trunk/admin/themes/default/template/menubar.tpl @ 9559

Last change on this file since 9559 was 9559, checked in by patdenice, 13 years ago

Update jQuery UI to 1.8.10.
Improve jquery ui management in template class.

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