[13282] | 1 | {footer_script require='jquery.ui.sortable'}{literal} |
---|
| 2 | jQuery(document).ready(function(){ |
---|
| 3 | jQuery(".catPos").hide(); |
---|
| 4 | jQuery(".drag_button").show(); |
---|
[18986] | 5 | jQuery("#manualOrder").hide(); |
---|
[13282] | 6 | jQuery(".categoryLi").css("cursor","move"); |
---|
| 7 | jQuery(".categoryUl").sortable({ |
---|
| 8 | axis: "y", |
---|
| 9 | opacity: 0.8, |
---|
| 10 | update : function() { |
---|
| 11 | jQuery("#manualOrder").show(); |
---|
| 12 | jQuery("#notManualOrder").hide(); |
---|
[18986] | 13 | jQuery("#formAutoOrder").hide(); |
---|
| 14 | jQuery("#formCreateAlbum").hide(); |
---|
[13282] | 15 | }, |
---|
| 16 | }); |
---|
[2554] | 17 | |
---|
[13282] | 18 | jQuery("#categoryOrdering").submit(function(){ |
---|
| 19 | ar = jQuery('.categoryUl').sortable('toArray'); |
---|
| 20 | for(i=0;i<ar.length;i++) { |
---|
| 21 | cat = ar[i].split('cat_'); |
---|
| 22 | document.getElementsByName('catOrd[' + cat[1] + ']')[0].value = i; |
---|
| 23 | } |
---|
| 24 | }); |
---|
| 25 | |
---|
| 26 | jQuery("input[name=order_type]").click(function () { |
---|
| 27 | jQuery("#automatic_order_params").hide(); |
---|
| 28 | if (jQuery("input[name=order_type]:checked").val() == "automatic") { |
---|
| 29 | jQuery("#automatic_order_params").show(); |
---|
| 30 | } |
---|
| 31 | }); |
---|
| 32 | |
---|
| 33 | jQuery("#addAlbumOpen").click(function(){ |
---|
[18986] | 34 | jQuery("#formCreateAlbum").toggle(); |
---|
[13282] | 35 | jQuery("input[name=virtual_name]").focus(); |
---|
[18986] | 36 | jQuery("#formAutoOrder").hide(); |
---|
[13282] | 37 | }); |
---|
| 38 | |
---|
| 39 | jQuery("#addAlbumClose").click(function(){ |
---|
[18986] | 40 | jQuery("#formCreateAlbum").hide(); |
---|
[13282] | 41 | }); |
---|
| 42 | |
---|
| 43 | |
---|
| 44 | jQuery("#autoOrderOpen").click(function(){ |
---|
[18986] | 45 | jQuery("#formAutoOrder").toggle(); |
---|
| 46 | jQuery("#formCreateAlbum").hide(); |
---|
[13282] | 47 | }); |
---|
| 48 | |
---|
| 49 | jQuery("#autoOrderClose").click(function(){ |
---|
[18986] | 50 | jQuery("#formAutoOrder").hide(); |
---|
[13282] | 51 | }); |
---|
| 52 | |
---|
| 53 | jQuery("#cancelManualOrder").click(function(){ |
---|
| 54 | jQuery(".categoryUl").sortable("cancel"); |
---|
| 55 | jQuery("#manualOrder").hide(); |
---|
| 56 | jQuery("#notManualOrder").show(); |
---|
| 57 | }); |
---|
[7995] | 58 | }); |
---|
[13282] | 59 | {/literal}{/footer_script} |
---|
[6698] | 60 | |
---|
[13282] | 61 | <h2><span style="letter-spacing:0">{$CATEGORIES_NAV}</span> › {'Album list management'|@translate}</h2> |
---|
[18986] | 62 | <p class="showCreateAlbum" id="notManualOrder"> |
---|
| 63 | <a href="#" id="addAlbumOpen">{'create a new album'|@translate}</a> |
---|
| 64 | {if count($categories)}| <a href="#" id="autoOrderOpen">{'apply automatic sort order'|@translate}</a>{/if} |
---|
[16829] | 65 | </p> |
---|
[18986] | 66 | <form id="formCreateAlbum" action="{$F_ACTION}" method="post" style="display:none;"> |
---|
| 67 | <fieldset> |
---|
[16825] | 68 | <legend>{'create a new album'|@translate}</legend> |
---|
| 69 | <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}"> |
---|
[18986] | 70 | |
---|
| 71 | <p> |
---|
| 72 | <strong>{'Album name'|@translate}</strong><br> |
---|
| 73 | <input type="text" name="virtual_name" maxlength="255"> |
---|
[16825] | 74 | </p> |
---|
[18986] | 75 | |
---|
| 76 | <p class="actionButtons"> |
---|
| 77 | <input class="submit" name="submitAdd" type="submit" value="{'Create'|@translate}"> |
---|
[16825] | 78 | <a href="#" id="addAlbumClose">{'Cancel'|@translate}</a> |
---|
[18986] | 79 | </p> |
---|
[16825] | 80 | </fieldset> |
---|
| 81 | </form> |
---|
[18986] | 82 | {if count($categories)} |
---|
| 83 | <form id="formAutoOrder" action="{$F_ACTION}" method="post" style="display:none;"> |
---|
| 84 | <fieldset> |
---|
[16825] | 85 | <legend>{'Automatic sort order'|@translate}</legend> |
---|
[18986] | 86 | <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}"> |
---|
| 87 | |
---|
[16825] | 88 | <p><strong>{'Sort order'|@translate}</strong> |
---|
| 89 | <br><label><input type="radio" value="asc" name="ascdesc" checked="checked">{'ascending'|@translate}</label> |
---|
| 90 | <br><label><input type="radio" value="desc" name="ascdesc">{'descending'|@translate}</label> |
---|
| 91 | </p> |
---|
| 92 | |
---|
| 93 | <p> |
---|
| 94 | <label><input type="checkbox" name="recursive"> <strong>{'Apply to sub-albums'|@translate}</strong></label> |
---|
| 95 | </p> |
---|
| 96 | |
---|
| 97 | <p class="actionButtons"> |
---|
| 98 | <input class="submit" name="submitAutoOrder" type="submit" value="{'Save order'|@translate}"> |
---|
| 99 | <a href="#" id="autoOrderClose">{'Cancel'|@translate}</a> |
---|
| 100 | </p> |
---|
[16827] | 101 | </fieldset> |
---|
[18986] | 102 | </form> |
---|
[16827] | 103 | {/if} |
---|
[18986] | 104 | |
---|
| 105 | <form id="categoryOrdering" action="{$F_ACTION}" method="post"> |
---|
| 106 | <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}"> |
---|
| 107 | <p id="manualOrder"> |
---|
[16827] | 108 | <input class="submit" name="submitManualOrder" type="submit" value="{'Save manual order'|@translate}"> |
---|
| 109 | {'... or '|@translate} <a href="#" id="cancelManualOrder">{'cancel manual order'|@translate}</a> |
---|
[18986] | 110 | </p> |
---|
[16825] | 111 | |
---|
[18986] | 112 | {if count($categories)} |
---|
[2531] | 113 | <ul class="categoryUl"> |
---|
| 114 | {foreach from=$categories item=category} |
---|
[2554] | 115 | <li class="categoryLi{if $category.IS_VIRTUAL} virtual_cat{/if}" id="cat_{$category.ID}"> |
---|
[2531] | 116 | <!-- category {$category.ID} --> |
---|
[13282] | 117 | <p class="albumTitle"> |
---|
[18986] | 118 | <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}"> |
---|
| 119 | <strong><a href="{$category.U_CHILDREN}" title="{'manage sub-albums'|@translate}">{$category.NAME}</a></strong> |
---|
[2531] | 120 | </p> |
---|
| 121 | |
---|
[2554] | 122 | <p class="catPos"> |
---|
[2531] | 123 | <label> |
---|
| 124 | {'Position'|@translate} : |
---|
[3185] | 125 | <input type="text" size="4" name="catOrd[{$category.ID}]" maxlength="4" value="{$category.RANK}"> |
---|
[2531] | 126 | </label> |
---|
| 127 | </p> |
---|
| 128 | |
---|
[16825] | 129 | <p class="albumActions"> |
---|
[16827] | 130 | <a href="{$category.U_EDIT}">{'Edit'|@translate}</a> |
---|
| 131 | {if isset($category.U_MANAGE_ELEMENTS) } |
---|
| 132 | | <a href="{$category.U_MANAGE_ELEMENTS}">{'manage album photos'|@translate}</a> |
---|
| 133 | {/if} |
---|
| 134 | | <a href="{$category.U_CHILDREN}">{'manage sub-albums'|@translate}</a> |
---|
| 135 | {if isset($category.U_SYNC) } |
---|
| 136 | | <a href="{$category.U_SYNC}">{'Synchronize'|@translate}</a> |
---|
| 137 | {/if} |
---|
| 138 | {if isset($category.U_DELETE) } |
---|
| 139 | | <a href="{$category.U_DELETE}" onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');">{'delete album'|@translate}</a> |
---|
[16825] | 140 | {/if} |
---|
| 141 | {if cat_admin_access($category.ID)} |
---|
[18986] | 142 | | <a href="{$category.U_JUMPTO}">{'jump to album'|@translate} →</a> |
---|
[16825] | 143 | {/if} |
---|
| 144 | </p> |
---|
[13282] | 145 | |
---|
[2531] | 146 | </li> |
---|
| 147 | {/foreach} |
---|
| 148 | </ul> |
---|
[13282] | 149 | {/if} |
---|
[2531] | 150 | </form> |
---|