aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/adm/style/permission_mask.html
blob: 5df845702d811404b6a62e6d7edad6147a74e051 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245

<script type="text/javascript">
<!--
	var active_pmask = '0';
	var active_fmask = '0';
	var active_cat = '0';

	var role_options = new Array();

	<!-- IF S_ROLE_JS_ARRAY -->
		{S_ROLE_JS_ARRAY}
	<!-- ENDIF -->

	// Show/hide option panels
	// value = suffix for ID to show
	function swap_options(pmask, fmask, cat)
	{
		id = pmask + fmask + cat;
		active_option = active_pmask + active_fmask + active_cat;

		if (id == active_option)
		{
			return;
		}
		
		// Hide active options
		dE('options' + active_option, -1);
		dE('head' + active_pmask + active_fmask, 1, 'inline');
		dE('apply' + active_pmask + active_fmask, -1);

		// Display container
		dE('options' + id, 1);
		dE('head' + pmask + fmask, -1, 'inline');
		dE('apply' + pmask + fmask, 1);

		active_pmask = pmask;
		active_fmask = fmask;
		active_cat = cat;
	}

	// Mark all radio buttons in one panel
	// id = table ID container, s = status ['y'/'u'/'n']
	function mark_options(id, s)
	{
		var t = document.getElementById(id);
		
		if (!t)
		{
			return;
		}
	
		var rb = t.getElementsByTagName('input');
	
		for (var r = 0; r < rb.length; r++ )
		{
			if (rb[r].id.substr(rb[r].id.length-1) == s)
			{
				rb[r].checked = true;
			}
		}
	}

	// Mark one radio button in one panel
	// id = table ID container, field_name = the auth option, s = status ['y'/'u'/'n']
	function mark_one_option(id, field_name, s)
	{
		var t = document.getElementById(id);
		
		if (!t)
		{
			return;
		}

		var rb = t.getElementsByTagName('input');
	
		for (var r = 0; r < rb.length; r++ )
		{
			if (rb[r].id.substr(rb[r].id.length-field_name.length-3, field_name.length) == field_name && rb[r].id.substr(rb[r].id.length-1) == s)
			{
				rb[r].checked = true;
			}
		}
	}

	// Reset role dropdown field to Select role... if an option gets changed
	function reset_role(id)
	{
		var t = document.getElementById(id);

		if (!t)
		{
			return;
		}

		t.options[0].selected = true;
	}

	// Load role and set options accordingly
	function set_role_settings(role_id, target_id)
	{
		settings = role_options[role_id];

		if (!settings)
		{
			return;
		}

		// Mark all options to unset first...
		mark_options(target_id, 'u');

		for (var r in settings)
		{
			mark_one_option(target_id, r, (settings[r] == 1) ? 'y' : 'n');
		}
	}

//-->
</script>

<!-- BEGIN p_mask -->

<div class="clearfix"></div>

<fieldset class="permissions">
	<!-- IF p_mask.USER_GROUPS_DEFAULT or p_mask.USER_GROUPS_CUSTOM -->
		<br />
		<p>
		<!-- IF p_mask.USER_GROUPS_DEFAULT --><b>{p_mask.NAME}</b> {L_USER_IS_MEMBER_OF_DEFAULT}: <b>{p_mask.USER_GROUPS_DEFAULT}</b><br /><!-- ENDIF -->
		<!-- IF p_mask.USER_GROUPS_CUSTOM --><b>{p_mask.NAME}</b> {L_USER_IS_MEMBER_OF_CUSTOM}: <b>{p_mask.USER_GROUPS_CUSTOM}</b><!-- ENDIF -->
		</p>
	<!-- ENDIF -->

	<table cellspacing="1" class="pmask">
	<thead>
	<tr>
		<th style="text-align: left; width: 70%">{p_mask.NAME}<!-- IF p_mask.S_LOCAL --><span class="small" style="text-transform: none;"> [{p_mask.L_ACL_TYPE}]</span><!-- ENDIF --></th>
		<th>{p_mask.CATEGORIES}</th>
	</tr>
	</thead>
	<tbody>

	<!-- BEGIN f_mask -->
		<!-- IF p_mask.f_mask.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
		<td class="name">
			<table cellspacing="0" cellpadding="0" class="type2" style="background-color: transparent; border: 0;">
			<tbody>
			<tr>
				<td width="16">
					<span id="head{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}"<!-- IF p_mask.S_FIRST_ROW and p_mask.f_mask.S_FIRST_ROW --> style="display: none;"<!-- ENDIF -->>
						<!-- IF not p_mask.S_VIEW --><input type="checkbox" name="inherit[{p_mask.f_mask.UG_ID}][{p_mask.f_mask.FORUM_ID}]" value="1" /><!-- ELSE -->&nbsp;<!-- ENDIF -->
					</span>
				</td>
				<td>{p_mask.f_mask.PADDING}<!-- IF p_mask.f_mask.FOLDER_IMAGE --> {p_mask.f_mask.FOLDER_IMAGE} <!-- ENDIF --><a href="javascript:swap_options('{p_mask.S_ROW_COUNT}', '{p_mask.f_mask.S_ROW_COUNT}', '0');">{p_mask.f_mask.NAME}</a></span></td>
				<td style="text-align: right;">
				<!-- IF p_mask.S_VIEW -->
					&nbsp;
				<!-- ELSE -->
					<!-- IF p_mask.f_mask.S_ROLE_OPTIONS -->
						<b>{L_ROLE}:</b>&nbsp; &nbsp;<select id="role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}" name="role[{p_mask.f_mask.UG_ID}][{p_mask.f_mask.FORUM_ID}]" onchange="set_role_settings(this.options[selectedIndex].value, 'a_options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}')">{p_mask.f_mask.S_ROLE_OPTIONS}</select>
					<!-- ELSE -->
						<b>{L_ROLE}:</b> {L_NO_ROLE_AVAILABLE}
					<!-- ENDIF -->
				<!-- ENDIF -->
				</td>
			</tr>
			</tbody>
			</table>
		</td>
		<!-- BEGIN category -->
			<!-- IF p_mask.f_mask.category.S_YES -->
				<td class="preset preset_yes">
			<!-- ELSEIF p_mask.f_mask.category.S_NO -->
				<td class="preset preset_no">
			<!-- ELSEIF p_mask.f_mask.category.S_UNSET -->
				<td class="preset preset_unset">
			<!-- ELSE -->
				<td class="preset preset_custom">
			<!-- ENDIF -->
				<a href="javascript:swap_options('{p_mask.S_ROW_COUNT}', '{p_mask.f_mask.S_ROW_COUNT}', '{p_mask.f_mask.category.S_ROW_COUNT}');"><span></span></a></td>
		<!-- END category -->
	</tr>
	<tr class="row3">
		<td style="vertical-align: top;">
			<div id="apply{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}" style="text-align: left; width: 98%; margin: 5px;<!-- IF p_mask.S_FIRST_ROW and p_mask.f_mask.S_FIRST_ROW --><!-- ELSE --> display: none;<!-- ENDIF -->">
			<!-- IF not p_mask.S_VIEW -->
				<div style="float: left; width: 60%;">
					<p class="small">{L_APPLY_PERMISSIONS_EXPLAIN}</p>
					<input class="button1" type="submit" name="psubmit[{p_mask.f_mask.UG_ID}][{p_mask.f_mask.FORUM_ID}]" value="{L_APPLY_PERMISSIONS}" />
				</div>
				<div style="float: right; text-align: right; width: 35%;">
					<p class="small">
						[<a href="javascript: mark_options('a_options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}', 'y'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}');">{L_ALL_YES}</a>]<br />
						[<a href="javascript: mark_options('a_options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}', 'n'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}');">{L_ALL_NO}</a>]<br />
						[<a href="javascript: mark_options('a_options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}', 'u'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}');">{L_ALL_UNSET}</a>]
					</p>
				</div>
			<!-- ELSE -->
				&nbsp;
			<!-- ENDIF -->
			</div>
		</td>
		<td colspan="{p_mask.S_NUM_CATS}" id="a_options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}" style="vertical-align: top; text-align: left;">
			<div style="width: 350px; height: 0; line-height: 0;">&nbsp;</div>
			<!-- BEGIN category -->
				<table cellspacing="1" id="options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}{p_mask.f_mask.category.S_ROW_COUNT}" class="type3"<!-- IF p_mask.S_FIRST_ROW and p_mask.f_mask.S_FIRST_ROW and p_mask.f_mask.category.S_FIRST_ROW --><!-- ELSE --> style="display: none;"<!-- ENDIF -->>
				<thead>
				<tr>
					<th scope="col" style="text-align: left; padding-left: 0;"><strong>{L_ACL_SETTING} [{p_mask.f_mask.category.CAT_NAME}]</strong></th>
				<!-- IF p_mask.S_VIEW -->
					<th scope="col">{L_ACL_YES}</th>
					<th scope="col">{L_ACL_NO}</th>
				<!-- ELSE -->
					<th scope="col"><a href="javascript: mark_options('options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}{p_mask.f_mask.category.S_ROW_COUNT}', 'y'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}');">{L_ACL_YES}</a></th>
					<th scope="col"><a href="javascript: mark_options('options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}{p_mask.f_mask.category.S_ROW_COUNT}', 'u'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}');">{L_ACL_UNSET}</a></th>
					<th scope="col"><a href="javascript: mark_options('options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}{p_mask.f_mask.category.S_ROW_COUNT}', 'n'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}');">{L_ACL_NO}</a></th>
				<!-- ENDIF -->
				</tr>
				</thead>
				<tbody>
				<!-- BEGIN mask -->
					<!-- IF p_mask.f_mask.category.mask.S_ROW_COUNT is even --><tr class="row4"><!-- ELSE --><tr class="row3"><!-- ENDIF -->
					<th><!-- IF p_mask.f_mask.category.mask.U_TRACE --><a href="#" onclick="javascript:trace('{p_mask.f_mask.category.mask.U_TRACE}')" title="{L_TRACE_SETTING}"><img src="images/icon_trace.gif" alt="{L_TRACE_SETTING}" /></a> <!-- ENDIF -->{p_mask.f_mask.category.mask.PERMISSION}</th>
					<!-- IF p_mask.S_VIEW -->
						<td<!-- IF p_mask.f_mask.category.mask.S_YES --> class="yes"<!-- ELSE --> class="unset"<!-- ENDIF -->>&nbsp;</td>
						<td<!-- IF p_mask.f_mask.category.mask.S_NO --> class="no"<!-- ELSE --> class="unset"<!-- ENDIF -->>&nbsp;</td>
					<!-- ELSE -->
						<td class="unset"><input onchange="reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}')" id="{p_mask.f_mask.category.mask.S_FIELD_NAME}_y" name="{p_mask.f_mask.category.mask.S_FIELD_NAME}" class="radio" type="radio"<!-- IF p_mask.f_mask.category.mask.S_YES --> checked="checked"<!-- ENDIF --> value="1" /></td>
						<td class="unset"><input onchange="reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}')" id="{p_mask.f_mask.category.mask.S_FIELD_NAME}_u" name="{p_mask.f_mask.category.mask.S_FIELD_NAME}" class="radio" type="radio"<!-- IF p_mask.f_mask.category.mask.S_UNSET --> checked="checked"<!-- ENDIF --> value="-1" /></td>
						<td class="unset"><input onchange="reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}')" id="{p_mask.f_mask.category.mask.S_FIELD_NAME}_n" name="{p_mask.f_mask.category.mask.S_FIELD_NAME}" class="radio" type="radio"<!-- IF p_mask.f_mask.category.mask.S_NO --> checked="checked"<!-- ENDIF --> value="0" /></td>
					<!-- ENDIF -->
				</tr>
				<!-- END mask -->
				</tbody>
				</table>
			<!-- END category -->
		</td>
	</tr>
	<!-- END f_mask -->
	
	</tbody>
	</table>

</fieldset>

<!-- END p_mask -->