[5123] | 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" } |
---|
[2554] | 4 | |
---|
| 5 | <script type="text/javascript"> |
---|
| 6 | jQuery().ready(function(){ldelim} |
---|
| 7 | jQuery(".catPos").hide(); |
---|
[2567] | 8 | jQuery(".drag_button").show(); |
---|
[2573] | 9 | jQuery(".categoryLi").css("cursor","move"); |
---|
| 10 | jQuery(".categoryUl").sortable({ldelim} |
---|
[2554] | 11 | axis: "y", |
---|
| 12 | opacity: 0.8 |
---|
| 13 | }); |
---|
| 14 | jQuery("#categoryOrdering").submit(function(){ldelim} |
---|
| 15 | ar = jQuery('.categoryUl').sortable('toArray'); |
---|
| 16 | for(i=0;i<ar.length;i++) {ldelim} |
---|
| 17 | cat = ar[i].split('cat_'); |
---|
| 18 | document.getElementsByName('catOrd[' + cat[1] + ']')[0].value = i; |
---|
| 19 | } |
---|
| 20 | }); |
---|
[6698] | 21 | |
---|
| 22 | jQuery("input[name=order_type]").click(function () {ldelim} |
---|
| 23 | jQuery("#automatic_order_params").hide(); |
---|
| 24 | if (jQuery("input[name=order_type]:checked").val() == "automatic") {ldelim} |
---|
| 25 | jQuery("#automatic_order_params").show(); |
---|
| 26 | } |
---|
| 27 | }); |
---|
[2554] | 28 | }); |
---|
| 29 | </script> |
---|
| 30 | |
---|
[5021] | 31 | <h2>{'Categories management'|@translate}</h2> |
---|
[2531] | 32 | |
---|
| 33 | <h3>{$CATEGORIES_NAV}</h3> |
---|
| 34 | |
---|
| 35 | <form id="addVirtual" action="{$F_ACTION}" method="post"> |
---|
| 36 | <p> |
---|
[5931] | 37 | <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}"> |
---|
[6969] | 38 | {'Add a virtual album'|@translate} : <input type="text" name="virtual_name"> |
---|
[3185] | 39 | <input class="submit" type="submit" value="{'Submit'|@translate}" name="submitAdd" {$TAG_INPUT_ENABLED}> |
---|
[2531] | 40 | {if count($categories)>9 } |
---|
[2948] | 41 | <a href="#EoP" class="button" style="border:0;"> |
---|
[3185] | 42 | <img src="{$themeconf.admin_icon_dir}/page_end.png" title="{'Page end'|@translate}" class="button" alt="page_end" style="margin-bottom:-0.6em;"></a> |
---|
[2531] | 43 | {/if} |
---|
| 44 | </p> |
---|
| 45 | </form> |
---|
| 46 | |
---|
| 47 | {if count($categories) } |
---|
| 48 | <form id="categoryOrdering" action="{$F_ACTION}" method="post"> |
---|
[6698] | 49 | <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}"> |
---|
| 50 | |
---|
| 51 | <div class="orderParams"> |
---|
[3185] | 52 | <input class="submit" name="submitOrder" type="submit" value="{'Save order'|@translate}" {$TAG_INPUT_ENABLED}> |
---|
[6698] | 53 | <label><input type="radio" name="order_type" value="manual" checked="checked"> {'manual order'|@translate}</label> |
---|
| 54 | <label><input type="radio" name="order_type" value="automatic"> {'automatic order'|@translate}</label> |
---|
| 55 | <span id="automatic_order_params" style="display:none"> |
---|
| 56 | <select name="ascdesc"> |
---|
| 57 | <option value="asc">{'ascending'|@translate}</option> |
---|
| 58 | <option value="desc">{'descending'|@translate}</option> |
---|
| 59 | </select> |
---|
[6969] | 60 | <label><input type="checkbox" name="recursive"> {'Apply to sub-albums'|@translate}</label> |
---|
[6698] | 61 | </span> |
---|
| 62 | </div> |
---|
| 63 | |
---|
[2531] | 64 | <ul class="categoryUl"> |
---|
| 65 | |
---|
| 66 | {foreach from=$categories item=category} |
---|
[2554] | 67 | <li class="categoryLi{if $category.IS_VIRTUAL} virtual_cat{/if}" id="cat_{$category.ID}"> |
---|
[2531] | 68 | <!-- category {$category.ID} --> |
---|
| 69 | <ul class="categoryActions"> |
---|
[2777] | 70 | {if cat_admin_access($category.ID)} |
---|
[3185] | 71 | <li><a href="{$category.U_JUMPTO}" title="{'jump to category'|@translate}"><img src="{$themeconf.admin_icon_dir}/category_jump-to.png" class="button" alt="{'jump to category'|@translate}"></a></li> |
---|
[2777] | 72 | {/if} |
---|
[5529] | 73 | <li><a href="{$category.U_EDIT}" title="{'edit category informations'|@translate}"><img src="{$themeconf.admin_icon_dir}/category_edit.png" class="button" alt="{'edit'|@translate}"></a></li> |
---|
[2531] | 74 | {if isset($category.U_MANAGE_ELEMENTS) } |
---|
[5529] | 75 | <li><a href="{$category.U_MANAGE_ELEMENTS}" title="{'manage category elements'|@translate}"><img src="{$themeconf.admin_icon_dir}/category_elements.png" class="button" alt="{'elements'|@translate}"></a></li> |
---|
[2531] | 76 | {/if} |
---|
[5529] | 77 | <li><a href="{$category.U_CHILDREN}" title="{'manage sub-categories'|@translate}"><img src="{$themeconf.admin_icon_dir}/category_children.png" class="button" alt="{'sub-categories'|@translate}"></a></li> |
---|
[2531] | 78 | {if isset($category.U_MANAGE_PERMISSIONS) } |
---|
[5530] | 79 | <li><a href="{$category.U_MANAGE_PERMISSIONS}" title="{'edit category permissions'|@translate}" ><img src="{$themeconf.admin_icon_dir}/category_permissions.png" class="button" alt="{'Permissions'|@translate}"></a></li> |
---|
[2531] | 80 | {/if} |
---|
| 81 | {if isset($category.U_DELETE) } |
---|
[5529] | 82 | <li><a href="{$category.U_DELETE}" title="{'delete category'|@translate}" onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');"><img src="{$themeconf.admin_icon_dir}/category_delete.png" class="button" alt="{'delete'|@translate}"></a></li> |
---|
[2531] | 83 | {/if} |
---|
| 84 | </ul> |
---|
| 85 | |
---|
| 86 | <p> |
---|
[3185] | 87 | <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}"> |
---|
[2531] | 88 | <strong><a href="{$category.U_CHILDREN}" title="{'manage sub-categories'|@translate}">{$category.NAME}</a></strong> |
---|
| 89 | {if $category.IS_VIRTUAL} |
---|
[5021] | 90 | <img src="{$themeconf.admin_icon_dir}/virt_category.png" class="button" alt="{'Virtual category'|@translate}"> |
---|
[2531] | 91 | {/if} |
---|
| 92 | </p> |
---|
| 93 | |
---|
[2554] | 94 | <p class="catPos"> |
---|
[2531] | 95 | <label> |
---|
| 96 | {'Position'|@translate} : |
---|
[3185] | 97 | <input type="text" size="4" name="catOrd[{$category.ID}]" maxlength="4" value="{$category.RANK}"> |
---|
[2531] | 98 | </label> |
---|
| 99 | </p> |
---|
| 100 | |
---|
| 101 | </li> |
---|
| 102 | {/foreach} |
---|
| 103 | </ul> |
---|
| 104 | </form> |
---|
| 105 | {/if} |
---|