[19230] | 1 | {footer_script} |
---|
| 2 | {literal} |
---|
| 3 | $(document).ready(function() { |
---|
[25449] | 4 | /** |
---|
| 5 | * Add group |
---|
| 6 | */ |
---|
| 7 | jQuery("#addGroup").click(function() { |
---|
| 8 | jQuery("#addGroupForm").toggle(); |
---|
| 9 | jQuery("input[name=groupname]").focus(); |
---|
| 10 | return false; |
---|
| 11 | }); |
---|
| 12 | |
---|
| 13 | jQuery("#addGroupClose").click(function() { |
---|
| 14 | jQuery("#addGroupForm").hide(); |
---|
| 15 | return false; |
---|
| 16 | }); |
---|
| 17 | |
---|
[23121] | 18 | $('.groups input').change(function () { $(this).parent('p').toggleClass('group_select'); }); |
---|
[19230] | 19 | $(".grp_action").hide(); |
---|
[19286] | 20 | $("input.group_selection").click(function() { |
---|
[19230] | 21 | |
---|
| 22 | var nbSelected = 0; |
---|
[19286] | 23 | nbSelected = $("input.group_selection").filter(':checked').length; |
---|
[19230] | 24 | |
---|
| 25 | if (nbSelected == 0) { |
---|
| 26 | $("#permitAction").hide(); |
---|
| 27 | $("#forbidAction").show(); |
---|
| 28 | } |
---|
| 29 | else { |
---|
| 30 | $("#permitAction").show(); |
---|
| 31 | $("#forbidAction").hide(); |
---|
| 32 | } |
---|
[22368] | 33 | $("p[group_id="+$(this).prop("value")+"]").each(function () { |
---|
[19230] | 34 | $(this).toggle(); |
---|
| 35 | }); |
---|
[22368] | 36 | |
---|
[19230] | 37 | if (nbSelected<2) { |
---|
| 38 | $("#two_to_select").show(); |
---|
| 39 | $("#two_atleast").hide(); |
---|
| 40 | } |
---|
| 41 | else { |
---|
| 42 | $("#two_to_select").hide(); |
---|
| 43 | $("#two_atleast").show(); |
---|
| 44 | } |
---|
| 45 | }); |
---|
| 46 | $("[id^=action_]").hide(); |
---|
| 47 | $("select[name=selectAction]").change(function () { |
---|
| 48 | $("[id^=action_]").hide(); |
---|
[22368] | 49 | $("#action_"+$(this).prop("value")).show(); |
---|
[23121] | 50 | if ($(this).val() != -1 ) { |
---|
[19230] | 51 | $("#applyActionBlock").show(); |
---|
| 52 | } |
---|
| 53 | else { |
---|
| 54 | $("#applyActionBlock").hide(); |
---|
| 55 | } |
---|
| 56 | }); |
---|
| 57 | }); |
---|
| 58 | |
---|
| 59 | {/literal} |
---|
| 60 | {/footer_script} |
---|
| 61 | |
---|
| 62 | |
---|
| 63 | |
---|
[2531] | 64 | <div class="titrePage"> |
---|
[5021] | 65 | <h2>{'Group management'|@translate}</h2> |
---|
[2531] | 66 | </div> |
---|
| 67 | |
---|
[25449] | 68 | <p class="showCreateAlbum" id="showAddGroup"> |
---|
| 69 | <a class="icon-plus-circled" href="#" id="addGroup">{'Add group'|translate}</a> |
---|
| 70 | </p> |
---|
| 71 | |
---|
| 72 | <form method="post" style="display:none" id="addGroupForm" name="add_user" action="{$F_ADD_ACTION}" class="properties"> |
---|
[2531] | 73 | <fieldset> |
---|
| 74 | <legend>{'Add group'|@translate}</legend> |
---|
| 75 | |
---|
[25449] | 76 | <p> |
---|
| 77 | <strong>{'Group name'|translate}</strong><br> |
---|
| 78 | <input type="text" name="groupname" maxlength="50" size="20"> |
---|
| 79 | </p> |
---|
| 80 | |
---|
| 81 | <p class="actionButtons"> |
---|
| 82 | <input class="submit" name="submit_add" type="submit" value="{'Add'|translate}"> |
---|
| 83 | <a href="#" id="addGroupClose">{'Cancel'|@translate}</a> |
---|
| 84 | </p> |
---|
| 85 | |
---|
| 86 | <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}"> |
---|
| 87 | |
---|
[2531] | 88 | </fieldset> |
---|
| 89 | </form> |
---|
[25449] | 90 | |
---|
[19230] | 91 | <form method="post" name="add_user" action="{$F_ADD_ACTION}" class="properties"> |
---|
| 92 | <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}"> |
---|
[22368] | 93 | |
---|
[23121] | 94 | <ul class="groups"> |
---|
[19230] | 95 | {if not empty($groups)} |
---|
| 96 | {foreach from=$groups item=group name=group_loop} |
---|
[23121] | 97 | <li> |
---|
| 98 | <label><p>{$group.NAME}<i><small>{$group.IS_DEFAULT}</small></i><input class="group_selection" name="group_selection[]" type="checkbox" value="{$group.ID}"></p></label> |
---|
[26117] | 99 | <p class="list_user">{if $group.MEMBERS>0}{$group.MEMBERS}<br>{$group.L_MEMBERS}{else}{$group.MEMBERS}{/if}</p> |
---|
[25449] | 100 | <a class="icon-lock group_perm" href="{$group.U_PERM}" title="{'Permissions'|@translate}">{'Permissions'|translate}</a> |
---|
[23062] | 101 | </li> |
---|
[19230] | 102 | {/foreach} |
---|
| 103 | {/if} |
---|
[23062] | 104 | </ul> |
---|
[22368] | 105 | |
---|
[19230] | 106 | <fieldset id="action"> |
---|
| 107 | <legend>{'Action'|@translate}</legend> |
---|
[19286] | 108 | <div id="forbidAction">{'No group selected, no action possible.'|@translate}</div> |
---|
| 109 | <div id="permitAction" style="display:none"> |
---|
[2531] | 110 | |
---|
[19230] | 111 | <select name="selectAction"> |
---|
| 112 | <option value="-1">{'Choose an action'|@translate}</option> |
---|
| 113 | <option disabled="disabled">------------------</option> |
---|
| 114 | <option value="rename">{'Rename'|@translate}</option> |
---|
| 115 | <option value="delete">{'Delete'|@translate}</option> |
---|
| 116 | <option value="merge">{'Merge selected groups'|@translate}</option> |
---|
| 117 | <option value="duplicate">{'Duplicate'|@translate}</option> |
---|
| 118 | <option value="toggle_default">{'Toggle \'default group\' property'|@translate}</option> |
---|
| 119 | {if !empty($element_set_groupe_plugins_actions)} |
---|
| 120 | {foreach from=$element_set_groupe_plugins_actions item=action} |
---|
| 121 | <option value="{$action.ID}">{$action.NAME}</option> |
---|
| 122 | {/foreach} |
---|
| 123 | {/if} |
---|
| 124 | </select> |
---|
| 125 | |
---|
| 126 | <!-- rename --> |
---|
| 127 | <div id="action_rename" class="bulkAction"> |
---|
| 128 | {if not empty($groups)} |
---|
| 129 | {foreach from=$groups item=group} |
---|
| 130 | <p group_id="{$group.ID}" class="grp_action"> |
---|
| 131 | <input type="text" class="large" name="rename_{$group.ID}" value="{$group.NAME}" onfocus="this.value=(this.value=='{$group.NAME}') ? '' : this.value;" onblur="this.value=(this.value=='') ? '{$group.NAME}' : this.value;"> |
---|
| 132 | </p> |
---|
| 133 | {/foreach} |
---|
| 134 | {/if} |
---|
| 135 | </div> |
---|
| 136 | |
---|
| 137 | <!-- merge --> |
---|
| 138 | <div id="action_merge" class="bulkAction"> |
---|
| 139 | <p id="two_to_select">{'Please select at least two groups'|@translate}</p> |
---|
| 140 | {assign var='mergeDefaultValue' value='Type here the name of the new group'|@translate} |
---|
| 141 | <p id="two_atleast"> |
---|
| 142 | <input type="text" class="large" name="merge" value="{$mergeDefaultValue}" onfocus="this.value=(this.value=='{$mergeDefaultValue}') ? '' : this.value;" onblur="this.value=(this.value=='') ? '{$mergeDefaultValue}' : this.value;"> |
---|
| 143 | </p> |
---|
| 144 | </div> |
---|
| 145 | |
---|
| 146 | <!-- delete --> |
---|
| 147 | <div id="action_delete" class="bulkAction"> |
---|
| 148 | <p><label><input type="checkbox" name="confirm_deletion" value="1"> {'Are you sure?'|@translate}</label></p> |
---|
| 149 | </div> |
---|
| 150 | |
---|
| 151 | <!-- duplicate --> |
---|
| 152 | <div id="action_duplicate" class="bulkAction"> |
---|
| 153 | {assign var='duplicateDefaultValue' value='Type here the name of the new group'|@translate} |
---|
| 154 | {if not empty($groups)} |
---|
| 155 | {foreach from=$groups item=group} |
---|
| 156 | <p group_id="{$group.ID}" class="grp_action"> |
---|
| 157 | {$group.NAME} > <input type="text" class="large" name="duplicate_{$group.ID}" value="{$duplicateDefaultValue}" onfocus="this.value=(this.value=='{$duplicateDefaultValue}') ? '' : this.value;" onblur="this.value=(this.value=='') ? '{$duplicateDefaultValue}' : this.value;"> |
---|
| 158 | </p> |
---|
| 159 | {/foreach} |
---|
| 160 | {/if} |
---|
| 161 | </div> |
---|
| 162 | |
---|
| 163 | <!-- toggle_default --> |
---|
| 164 | <div id="action_toggle_default" class="bulkAction"> |
---|
| 165 | {if not empty($groups)} |
---|
| 166 | {foreach from=$groups item=group} |
---|
| 167 | <p group_id="{$group.ID}" class="grp_action"> |
---|
| 168 | {$group.NAME} > {if empty($group.IS_DEFAULT)}{'This group will be set to default'|@translate}{else}{'This group will be unset to default'|@translate}{/if} |
---|
| 169 | </p> |
---|
| 170 | {/foreach} |
---|
| 171 | {/if} |
---|
| 172 | </div> |
---|
[22368] | 173 | |
---|
| 174 | |
---|
[19230] | 175 | <!-- plugins --> |
---|
| 176 | {if !empty($element_set_groupe_plugins_actions)} |
---|
| 177 | {foreach from=$element_set_groupe_plugins_actions item=action} |
---|
| 178 | <div id="action_{$action.ID}" class="bulkAction"> |
---|
| 179 | {if !empty($action.CONTENT)}{$action.CONTENT}{/if} |
---|
| 180 | </div> |
---|
| 181 | {/foreach} |
---|
| 182 | {/if} |
---|
[22368] | 183 | |
---|
[19230] | 184 | <p id="applyActionBlock" style="display:none" class="actionButtons"> |
---|
| 185 | <input id="applyAction" class="submit" type="submit" value="{'Apply action'|@translate}" name="submit"> <span id="applyOnDetails"></span></p> |
---|
| 186 | </div> <!-- #permitAction --> |
---|
| 187 | </fieldset> |
---|
| 188 | </form> |
---|
| 189 | </form> |
---|