Commit | Line | Data |
---|---|---|
97f28da5 MS |
1 | {if $categoryName|isset && $categoryName|substr:-2 == '.*'} |
2 | {assign var='__categoryNameStart' value=$categoryName|substr:0:-1} | |
3 | {/if} | |
9543d9fe | 4 | <script data-relocate="true"> |
092bdf82 AE |
5 | //<![CDATA[ |
6 | $(function() { | |
7 | {if $aclValues[$objectTypeID]|isset} | |
0f0590c2 | 8 | var initialPermissions = { |
092bdf82 AE |
9 | returnValues: { |
10 | options: { | |
97f28da5 MS |
11 | {foreach from=$aclValues[$objectTypeID][options] key='__optionID' item='__optionData'} |
12 | {assign var='__optionCategoryName' value=$__optionData[categoryName]} | |
13 | ||
14 | {if !$categoryName|isset || ($__categoryNameStart|isset && $__optionCategoryName|strpos:$__categoryNameStart === 0) || (!$__categoryNameStart|isset && $__optionCategoryName == $categoryName)} | |
15 | {@$__optionID}: { | |
16 | categoryName: '{@$__optionData[categoryName]|encodeJS}', | |
17 | label: '{@$__optionData[label]|encodeJS}', | |
18 | optionName: '{@$__optionData[optionName]|encodeJS}' | |
19 | }, | |
20 | {/if} | |
21 | {/foreach} | |
092bdf82 AE |
22 | }, |
23 | categories: { | |
24 | {implode from=$aclValues[$objectTypeID][categories] key='__category' item='__categoryName'} | |
25 | '{@$__category|encodeJS}': '{@$__categoryName|encodeJS}' | |
26 | {/implode} | |
27 | }, | |
28 | user: { | |
29 | {if $aclValues[$objectTypeID][user]|isset} | |
30 | option: { | |
97f28da5 MS |
31 | {foreach from=$aclValues[$objectTypeID][user][option] key='__userID' item='__optionData'} |
32 | {hascontent} | |
33 | {@$__userID}: { | |
34 | {content} | |
35 | {foreach from=$__optionData key='__optionID' item='__optionValue'} | |
36 | {assign var='__optionCategoryName' value=$aclValues[$objectTypeID][options][$__optionID][categoryName]} | |
37 | ||
38 | {if !$categoryName|isset || ($__categoryNameStart|isset && $__optionCategoryName|strpos:$__categoryNameStart === 0) || (!$__categoryNameStart|isset && $__optionCategoryName == $categoryName)} | |
39 | {@$__optionID}: {@$__optionValue}, | |
40 | {/if} | |
41 | {/foreach} | |
42 | {/content} | |
43 | }, | |
44 | {/hascontent} | |
45 | {/foreach} | |
092bdf82 | 46 | }, |
97f28da5 | 47 | label: { } |
092bdf82 AE |
48 | {/if} |
49 | }, | |
50 | group: { | |
51 | {if $aclValues[$objectTypeID][group]|isset} | |
52 | option: { | |
97f28da5 MS |
53 | {foreach from=$aclValues[$objectTypeID][group][option] key='__groupID' item='__optionData'} |
54 | {hascontent} | |
55 | {@$__groupID}: { | |
56 | {content} | |
57 | {foreach from=$__optionData key='__optionID' item='__optionValue'} | |
58 | {assign var='__optionCategoryName' value=$aclValues[$objectTypeID][options][$__optionID][categoryName]} | |
59 | ||
60 | {if !$categoryName|isset || ($__categoryNameStart|isset && $__optionCategoryName|strpos:$__categoryNameStart === 0) || (!$__categoryNameStart|isset && $__optionCategoryName == $categoryName)} | |
61 | {@$__optionID}: {@$__optionValue}, | |
62 | {/if} | |
63 | {/foreach} | |
64 | {/content} | |
65 | }, | |
66 | {/hascontent} | |
67 | {/foreach} | |
092bdf82 | 68 | }, |
97f28da5 | 69 | label: { } |
092bdf82 AE |
70 | {/if} |
71 | } | |
72 | } | |
73 | }; | |
97f28da5 MS |
74 | |
75 | {if $aclValues[$objectTypeID][user]|isset} | |
76 | {foreach from=$aclValues[$objectTypeID][user][label] key='__userID' item='__label'} | |
77 | if (initialPermissions.returnValues.user.option[{@$__userID}]) { | |
78 | initialPermissions.returnValues.user.label[{@$__userID}] = '{@$__label|encodeJS}'; | |
79 | } | |
80 | {/foreach} | |
81 | {/if} | |
82 | ||
83 | {if $aclValues[$objectTypeID][group]|isset} | |
84 | {foreach from=$aclValues[$objectTypeID][group][label] key='__groupID' item='__label'} | |
85 | if (initialPermissions.returnValues.group.option[{@$__groupID}]) { | |
86 | initialPermissions.returnValues.group.label[{@$__groupID}] = '{@$__label|encodeJS}'; | |
87 | } | |
88 | {/foreach} | |
89 | {/if} | |
092bdf82 AE |
90 | {/if} |
91 | new {if $aclListClassName|isset}{@$aclListClassName}{else}WCF.ACL.List{/if}($('#{@$containerID}'), {@$objectTypeID}, {if $categoryName|isset}'{@$categoryName}'{else}null{/if}, {if $objectID|isset}{@$objectID}{else}0{/if}, {if !$includeUserGroups|isset || $includeUserGroups}true{else}false{/if}{if $aclValues[$objectTypeID]|isset}, initialPermissions{/if}); | |
92 | }); | |
93 | //]]> | |
97f28da5 | 94 | </script> |