Mercurial > hg > vamp-website
comparison forum/Themes/Vamp/ManageMembergroups.template.php @ 76:e3e11437ecea website
Add forum code
author | Chris Cannam |
---|---|
date | Sun, 07 Jul 2013 11:25:48 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
75:72f59aa7e503 | 76:e3e11437ecea |
---|---|
1 <?php | |
2 /** | |
3 * Simple Machines Forum (SMF) | |
4 * | |
5 * @package SMF | |
6 * @author Simple Machines | |
7 * @copyright 2011 Simple Machines | |
8 * @license http://www.simplemachines.org/about/smf/license.php BSD | |
9 * | |
10 * @version 2.0 | |
11 */ | |
12 | |
13 function template_main() | |
14 { | |
15 global $context, $settings, $options, $scripturl, $txt; | |
16 | |
17 template_show_list('regular_membergroups_list'); | |
18 echo '<br /><br />'; | |
19 template_show_list('post_count_membergroups_list'); | |
20 | |
21 } | |
22 | |
23 function template_new_group() | |
24 { | |
25 global $context, $settings, $options, $scripturl, $txt, $modSettings; | |
26 | |
27 echo ' | |
28 <div id="admincenter"> | |
29 <form action="', $scripturl, '?action=admin;area=membergroups;sa=add" method="post" accept-charset="', $context['character_set'], '"> | |
30 <div class="cat_bar"> | |
31 <h3 class="catbg">', $txt['membergroups_new_group'], '</h3> | |
32 </div> | |
33 <div class="windowbg"> | |
34 <span class="topslice"><span></span></span> | |
35 <div class="content"> | |
36 <dl class="settings"> | |
37 <dt> | |
38 <label for="group_name_input"><strong>', $txt['membergroups_group_name'], ':</strong></label> | |
39 </dt> | |
40 <dd> | |
41 <input type="text" name="group_name" id="group_name_input" size="30" class="input_text" /> | |
42 </dd>'; | |
43 if ($context['undefined_group']) | |
44 { | |
45 echo ' | |
46 <dt> | |
47 <label for="group_type"><strong>', $txt['membergroups_edit_group_type'], '</strong>:</label> | |
48 </dt> | |
49 <dd> | |
50 <fieldset id="group_type"> | |
51 <legend>', $txt['membergroups_edit_select_group_type'], '</legend> | |
52 <label for="group_type_private"><input type="radio" name="group_type" id="group_type_private" value="0" checked="checked" class="input_radio" onclick="swapPostGroup(0);" />', $txt['membergroups_group_type_private'], '</label><br />'; | |
53 | |
54 if ($context['allow_protected']) | |
55 echo ' | |
56 <label for="group_type_protected"><input type="radio" name="group_type" id="group_type_protected" value="1" class="input_radio" onclick="swapPostGroup(0);" />', $txt['membergroups_group_type_protected'], '</label><br />'; | |
57 | |
58 echo ' | |
59 <label for="group_type_request"><input type="radio" name="group_type" id="group_type_request" value="2" class="input_radio" onclick="swapPostGroup(0);" />', $txt['membergroups_group_type_request'], '</label><br /> | |
60 <label for="group_type_free"><input type="radio" name="group_type" id="group_type_free" value="3" class="input_radio" onclick="swapPostGroup(0);" />', $txt['membergroups_group_type_free'], '</label><br /> | |
61 <label for="group_type_post"><input type="radio" name="group_type" id="group_type_post" value="-1" class="input_radio" onclick="swapPostGroup(1);" />', $txt['membergroups_group_type_post'], '</label><br /> | |
62 </fieldset> | |
63 </dd>'; | |
64 } | |
65 | |
66 if ($context['post_group'] || $context['undefined_group']) | |
67 echo ' | |
68 <dt id="min_posts_text"> | |
69 <strong>', $txt['membergroups_min_posts'], ':</strong> | |
70 </dt> | |
71 <dd> | |
72 <input type="text" name="min_posts" id="min_posts_input" size="5" class="input_text" /> | |
73 </dd>'; | |
74 if (!$context['post_group'] || !empty($modSettings['permission_enable_postgroups'])) | |
75 { | |
76 echo ' | |
77 <dt> | |
78 <label for="permission_base"><strong>', $txt['membergroups_permissions'], ':</strong></label><br /> | |
79 <span class="smalltext">', $txt['membergroups_can_edit_later'], '</span> | |
80 </dt> | |
81 <dd> | |
82 <fieldset id="permission_base"> | |
83 <legend>', $txt['membergroups_select_permission_type'], '</legend> | |
84 <input type="radio" name="perm_type" id="perm_type_inherit" value="inherit" checked="checked" class="input_radio" /> | |
85 <label for="perm_type_inherit">', $txt['membergroups_new_as_inherit'], ':</label> | |
86 <select name="inheritperm" id="inheritperm_select" onclick="document.getElementById(\'perm_type_inherit\').checked = true;"> | |
87 <option value="-1">', $txt['membergroups_guests'], '</option> | |
88 <option value="0" selected="selected">', $txt['membergroups_members'], '</option>'; | |
89 foreach ($context['groups'] as $group) | |
90 echo ' | |
91 <option value="', $group['id'], '">', $group['name'], '</option>'; | |
92 echo ' | |
93 </select><br /> | |
94 | |
95 <input type="radio" name="perm_type" id="perm_type_copy" value="copy" class="input_radio" /> | |
96 <label for="perm_type_copy">', $txt['membergroups_new_as_copy'], ':</label> | |
97 <select name="copyperm" id="copyperm_select" onclick="document.getElementById(\'perm_type_copy\').checked = true;"> | |
98 <option value="-1">', $txt['membergroups_guests'], '</option> | |
99 <option value="0" selected="selected">', $txt['membergroups_members'], '</option>'; | |
100 foreach ($context['groups'] as $group) | |
101 echo ' | |
102 <option value="', $group['id'], '">', $group['name'], '</option>'; | |
103 echo ' | |
104 </select><br /> | |
105 | |
106 <input type="radio" name="perm_type" id="perm_type_predefined" value="predefined" class="input_radio" /> | |
107 <label for="perm_type_predefined">', $txt['membergroups_new_as_type'], ':</label> | |
108 <select name="level" id="level_select" onclick="document.getElementById(\'perm_type_predefined\').checked = true;"> | |
109 <option value="restrict">', $txt['permitgroups_restrict'], '</option> | |
110 <option value="standard" selected="selected">', $txt['permitgroups_standard'], '</option> | |
111 <option value="moderator">', $txt['permitgroups_moderator'], '</option> | |
112 <option value="maintenance">', $txt['permitgroups_maintenance'], '</option> | |
113 </select> | |
114 </fieldset> | |
115 </dd>'; | |
116 } | |
117 echo ' | |
118 <dt> | |
119 <strong>', $txt['membergroups_new_board'], ':</strong>', $context['post_group'] ? '<br /> | |
120 <span class="smalltext" style="font-weight: normal">' . $txt['membergroups_new_board_post_groups'] . '</span>' : '', ' | |
121 </dt> | |
122 <dd> | |
123 <fieldset id="visible_boards"> | |
124 <legend>', $txt['membergroups_new_board_desc'], '</legend>'; | |
125 foreach ($context['boards'] as $board) | |
126 echo ' | |
127 <div style="margin-left: ', $board['child_level'], 'em;"><input type="checkbox" name="boardaccess[]" id="boardaccess_', $board['id'], '" value="', $board['id'], '" ', $board['selected'] ? ' checked="checked" disabled="disabled"' : '', ' class="input_check" /> <label for="boardaccess_', $board['id'], '">', $board['name'], '</label></div>'; | |
128 | |
129 echo ' | |
130 <br /> | |
131 <input type="checkbox" id="checkall_check" class="input_check" onclick="invertAll(this, this.form, \'boardaccess\');" /> <label for="checkall_check"><em>', $txt['check_all'], '</em></label> | |
132 </fieldset> | |
133 </dd> | |
134 </dl> | |
135 <div class="righttext"> | |
136 <input type="submit" value="', $txt['membergroups_add_group'], '" class="button_submit" /> | |
137 </div> | |
138 </div> | |
139 <span class="botslice"><span></span></span> | |
140 </div>'; | |
141 if ($context['undefined_group']) | |
142 { | |
143 echo ' | |
144 <script type="text/javascript"><!-- // --><![CDATA[ | |
145 function swapPostGroup(isChecked) | |
146 { | |
147 var min_posts_text = document.getElementById(\'min_posts_text\'); | |
148 document.getElementById(\'min_posts_input\').disabled = !isChecked; | |
149 min_posts_text.style.color = isChecked ? "" : "#888888"; | |
150 } | |
151 swapPostGroup(', $context['post_group'] ? 'true' : 'false', '); | |
152 // ]]></script>'; | |
153 } | |
154 echo ' | |
155 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> | |
156 </form> | |
157 </div> | |
158 <br class="clear" />'; | |
159 } | |
160 | |
161 function template_edit_group() | |
162 { | |
163 global $context, $settings, $options, $scripturl, $txt; | |
164 | |
165 echo ' | |
166 <div id="admincenter"> | |
167 <form action="', $scripturl, '?action=admin;area=membergroups;sa=edit;group=', $context['group']['id'], '" method="post" accept-charset="', $context['character_set'], '" name="groupForm" id="groupForm"> | |
168 <div class="cat_bar"> | |
169 <h3 class="catbg">', $txt['membergroups_edit_group'], ' - ', $context['group']['name'], ' | |
170 </h3> | |
171 </div> | |
172 <div class="windowbg2"> | |
173 <span class="topslice"><span></span></span> | |
174 <div class="content"> | |
175 <dl class="settings"> | |
176 <dt> | |
177 <label for="group_name_input"><strong>', $txt['membergroups_edit_name'], ':</strong></label> | |
178 </dt> | |
179 <dd> | |
180 <input type="text" name="group_name" id="group_name_input" value="', $context['group']['editable_name'], '" size="30" class="input_text" /> | |
181 </dd>'; | |
182 | |
183 if ($context['group']['id'] != 3 && $context['group']['id'] != 4) | |
184 echo ' | |
185 | |
186 <dt id="group_desc_text"> | |
187 <label for="group_desc_input"><strong>', $txt['membergroups_edit_desc'], ':</strong></label> | |
188 </dt> | |
189 <dd> | |
190 <textarea name="group_desc" id="group_desc_input" rows="4" cols="40">', $context['group']['description'], '</textarea> | |
191 </dd>'; | |
192 | |
193 // Group type... | |
194 if ($context['group']['allow_post_group']) | |
195 { | |
196 echo ' | |
197 <dt> | |
198 <label for="group_type"><strong>', $txt['membergroups_edit_group_type'], ':</strong></label> | |
199 </dt> | |
200 <dd> | |
201 <fieldset id="group_type"> | |
202 <legend>', $txt['membergroups_edit_select_group_type'], '</legend> | |
203 <label for="group_type_private"><input type="radio" name="group_type" id="group_type_private" value="0" ', !$context['group']['is_post_group'] && $context['group']['type'] == 0 ? 'checked="checked"' : '', ' class="input_radio" onclick="swapPostGroup(0);" />', $txt['membergroups_group_type_private'], '</label><br />'; | |
204 | |
205 if ($context['group']['allow_protected']) | |
206 echo ' | |
207 <label for="group_type_protected"><input type="radio" name="group_type" id="group_type_protected" value="1" ', $context['group']['type'] == 1 ? 'checked="checked"' : '', ' class="input_radio" onclick="swapPostGroup(0);" />', $txt['membergroups_group_type_protected'], '</label><br />'; | |
208 | |
209 echo ' | |
210 <label for="group_type_request"><input type="radio" name="group_type" id="group_type_request" value="2" ', $context['group']['type'] == 2 ? 'checked="checked"' : '', ' class="input_radio" onclick="swapPostGroup(0);" />', $txt['membergroups_group_type_request'], '</label><br /> | |
211 <label for="group_type_free"><input type="radio" name="group_type" id="group_type_free" value="3" ', $context['group']['type'] == 3 ? 'checked="checked"' : '', ' class="input_radio" onclick="swapPostGroup(0);" />', $txt['membergroups_group_type_free'], '</label><br /> | |
212 <label for="group_type_post"><input type="radio" name="group_type" id="group_type_post" value="-1" ', $context['group']['is_post_group'] ? 'checked="checked"' : '', ' class="input_radio" onclick="swapPostGroup(1);" />', $txt['membergroups_group_type_post'], '</label><br /> | |
213 </fieldset> | |
214 </dd>'; | |
215 } | |
216 | |
217 if ($context['group']['id'] != 3 && $context['group']['id'] != 4) | |
218 echo ' | |
219 <dt id="group_moderators_text"> | |
220 <label for="group_moderators"><strong>', $txt['moderators'], ':</strong></label> | |
221 </dt> | |
222 <dd> | |
223 <input type="text" name="group_moderators" id="group_moderators" value="', $context['group']['moderator_list'], '" size="30" class="input_text" /> | |
224 <div id="moderator_container"></div> | |
225 </dd> | |
226 <dt id="group_hidden_text"> | |
227 <label for="group_hidden_input"><strong>', $txt['membergroups_edit_hidden'], ':</strong></label> | |
228 </dt> | |
229 <dd> | |
230 <select name="group_hidden" id="group_hidden_input" onchange="if (this.value == 2 && !confirm(\'', $txt['membergroups_edit_hidden_warning'], '\')) this.value = 0;"> | |
231 <option value="0" ', $context['group']['hidden'] ? '' : 'selected="selected"', '>', $txt['membergroups_edit_hidden_no'], '</option> | |
232 <option value="1" ', $context['group']['hidden'] == 1 ? 'selected="selected"' : '', '>', $txt['membergroups_edit_hidden_boardindex'], '</option> | |
233 <option value="2" ', $context['group']['hidden'] == 2 ? 'selected="selected"' : '', '>', $txt['membergroups_edit_hidden_all'], '</option> | |
234 </select> | |
235 </dd>'; | |
236 | |
237 // Can they inherit permissions? | |
238 if ($context['group']['id'] > 1 && $context['group']['id'] != 3) | |
239 { | |
240 echo ' | |
241 <dt id="group_inherit_text"> | |
242 <label for="group_inherit_input"><strong>', $txt['membergroups_edit_inherit_permissions'], '</strong></label>:<br /> | |
243 <span class="smalltext">', $txt['membergroups_edit_inherit_permissions_desc'], '</span> | |
244 </dt> | |
245 <dd> | |
246 <select name="group_inherit" id="group_inherit_input"> | |
247 <option value="-2">', $txt['membergroups_edit_inherit_permissions_no'], '</option> | |
248 <option value="-1" ', $context['group']['inherited_from'] == -1 ? 'selected="selected"' : '', '>', $txt['membergroups_edit_inherit_permissions_from'], ': ', $txt['membergroups_guests'], '</option> | |
249 <option value="0" ', $context['group']['inherited_from'] == 0 ? 'selected="selected"' : '', '>', $txt['membergroups_edit_inherit_permissions_from'], ': ', $txt['membergroups_members'], '</option>'; | |
250 | |
251 // For all the inheritable groups show an option. | |
252 foreach ($context['inheritable_groups'] as $id => $group) | |
253 echo ' | |
254 <option value="', $id, '" ', $context['group']['inherited_from'] == $id ? 'selected="selected"' : '', '>', $txt['membergroups_edit_inherit_permissions_from'], ': ', $group, '</option>'; | |
255 | |
256 echo ' | |
257 </select> | |
258 <input type="hidden" name="old_inherit" value="', $context['group']['inherited_from'], '" /> | |
259 </dd>'; | |
260 } | |
261 | |
262 if ($context['group']['allow_post_group']) | |
263 echo ' | |
264 | |
265 <dt id="min_posts_text"> | |
266 <label for="min_posts_input"><strong>', $txt['membergroups_min_posts'], ':</strong></label> | |
267 </dt> | |
268 <dd> | |
269 <input type="text" name="min_posts" id="min_posts_input"', $context['group']['is_post_group'] ? ' value="' . $context['group']['min_posts'] . '"' : '', ' size="6" class="input_text" /> | |
270 </dd>'; | |
271 echo ' | |
272 <dt> | |
273 <label for="online_color_input"><strong>', $txt['membergroups_online_color'], ':</strong></label> | |
274 </dt> | |
275 <dd> | |
276 <input type="text" name="online_color" id="online_color_input" value="', $context['group']['color'], '" size="20" class="input_text" /> | |
277 </dd> | |
278 <dt> | |
279 <label for="star_count_input"><strong>', $txt['membergroups_star_count'], ':</strong></label> | |
280 </dt> | |
281 <dd> | |
282 <input type="text" name="star_count" id="star_count_input" value="', $context['group']['star_count'], '" size="4" onkeyup="if (this.value.length > 2) this.value = 99;" onkeydown="this.onkeyup();" onchange="if (this.value != 0) this.form.star_image.onchange();" class="input_text" /> | |
283 </dd> | |
284 <dt> | |
285 <label for="star_image_input"><strong>', $txt['membergroups_star_image'], ':</strong></label><br /> | |
286 <span class="smalltext">', $txt['membergroups_star_image_note'], '</span> | |
287 </dt> | |
288 <dd> | |
289 ', $txt['membergroups_images_url'], ' | |
290 <input type="text" name="star_image" id="star_image_input" value="', $context['group']['star_image'], '" onchange="if (this.value && this.form.star_count.value == 0) this.form.star_count.value = 1; else if (!this.value) this.form.star_count.value = 0; document.getElementById(\'star_preview\').src = smf_images_url + \'/\' + (this.value && this.form.star_count.value > 0 ? this.value.replace(/\$language/g, \'', $context['user']['language'], '\') : \'blank.gif\');" size="20" class="input_text" /> | |
291 <img id="star_preview" src="', $settings['images_url'], '/', $context['group']['star_image'] == '' ? 'blank.gif' : $context['group']['star_image'], '" alt="*" /> | |
292 </dd> | |
293 <dt> | |
294 <label for="max_messages_input"><strong>', $txt['membergroups_max_messages'], ':</strong></label><br /> | |
295 <span class="smalltext">', $txt['membergroups_max_messages_note'], '</span> | |
296 </dt> | |
297 <dd> | |
298 <input type="text" name="max_messages" id="max_messages_input" value="', $context['group']['id'] == 1 ? 0 : $context['group']['max_messages'], '" size="6"', $context['group']['id'] == 1 ? ' disabled="disabled"' : '', ' class="input_text" /> | |
299 </dd>'; | |
300 if (!empty($context['boards'])) | |
301 { | |
302 echo ' | |
303 <dt> | |
304 <strong>', $txt['membergroups_new_board'], ':</strong>', $context['group']['is_post_group'] ? '<br /> | |
305 <span class="smalltext">' . $txt['membergroups_new_board_post_groups'] . '</span>' : '', ' | |
306 </dt> | |
307 <dd> | |
308 <fieldset id="visible_boards" style="width: 95%;"> | |
309 <legend><a href="javascript:void(0);" onclick="document.getElementById(\'visible_boards\').style.display = \'none\';document.getElementById(\'visible_boards_link\').style.display = \'block\'; return false;">', $txt['membergroups_new_board_desc'], '</a></legend>'; | |
310 foreach ($context['boards'] as $board) | |
311 echo ' | |
312 <div style="margin-left: ', $board['child_level'], 'em;"><input type="checkbox" name="boardaccess[]" id="boardaccess_', $board['id'], '" value="', $board['id'], '" ', $board['selected'] ? ' checked="checked"' : '', ' class="input_check" /> <label for="boardaccess_', $board['id'], '">', $board['name'], '</label></div>'; | |
313 | |
314 echo ' | |
315 <br /> | |
316 <input type="checkbox" id="checkall_check" class="input_check" onclick="invertAll(this, this.form, \'boardaccess\');" /> <label for="checkall_check"><em>', $txt['check_all'], '</em></label> | |
317 </fieldset> | |
318 <a href="javascript:void(0);" onclick="document.getElementById(\'visible_boards\').style.display = \'block\'; document.getElementById(\'visible_boards_link\').style.display = \'none\'; return false;" id="visible_boards_link" style="display: none;">[ ', $txt['membergroups_select_visible_boards'], ' ]</a> | |
319 <script type="text/javascript"><!-- // --><![CDATA[ | |
320 document.getElementById("visible_boards_link").style.display = ""; | |
321 document.getElementById("visible_boards").style.display = "none"; | |
322 // ]]></script> | |
323 </dd>'; | |
324 } | |
325 echo ' | |
326 </dl> | |
327 <div class="righttext"> | |
328 <input type="submit" name="submit" value="', $txt['membergroups_edit_save'], '" class="button_submit" />', $context['group']['allow_delete'] ? ' | |
329 <input type="submit" name="delete" value="' . $txt['membergroups_delete'] . '" onclick="return confirm(\'' . $txt['membergroups_confirm_delete'] . '\');" class="button_submit" />' : '', ' | |
330 </div> | |
331 </div> | |
332 <span class="botslice"><span></span></span> | |
333 </div> | |
334 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> | |
335 </form> | |
336 </div> | |
337 <br class="clear" /> | |
338 <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/suggest.js?fin20"></script> | |
339 <script type="text/javascript"><!-- // --><![CDATA[ | |
340 var oModeratorSuggest = new smc_AutoSuggest({ | |
341 sSelf: \'oModeratorSuggest\', | |
342 sSessionId: \'', $context['session_id'], '\', | |
343 sSessionVar: \'', $context['session_var'], '\', | |
344 sSuggestId: \'group_moderators\', | |
345 sControlId: \'group_moderators\', | |
346 sSearchType: \'member\', | |
347 bItemList: true, | |
348 sPostName: \'moderator_list\', | |
349 sURLMask: \'action=profile;u=%item_id%\', | |
350 sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\', | |
351 sItemListContainerId: \'moderator_container\', | |
352 aListItems: ['; | |
353 | |
354 foreach ($context['group']['moderators'] as $id_member => $member_name) | |
355 echo ' | |
356 { | |
357 sItemId: ', JavaScriptEscape($id_member), ', | |
358 sItemName: ', JavaScriptEscape($member_name), ' | |
359 }', $id_member == $context['group']['last_moderator_id'] ? '' : ','; | |
360 | |
361 echo ' | |
362 ] | |
363 }); | |
364 // ]]></script>'; | |
365 | |
366 if ($context['group']['allow_post_group']) | |
367 echo ' | |
368 <script type="text/javascript"><!-- // --><![CDATA[ | |
369 function swapPostGroup(isChecked) | |
370 { | |
371 var min_posts_text = document.getElementById(\'min_posts_text\'); | |
372 var group_desc_text = document.getElementById(\'group_desc_text\'); | |
373 var group_hidden_text = document.getElementById(\'group_hidden_text\'); | |
374 var group_moderators_text = document.getElementById(\'group_moderators_text\'); | |
375 document.forms.groupForm.min_posts.disabled = !isChecked; | |
376 min_posts_text.style.color = isChecked ? "" : "#888888"; | |
377 document.forms.groupForm.group_desc_input.disabled = isChecked; | |
378 group_desc_text.style.color = !isChecked ? "" : "#888888"; | |
379 document.forms.groupForm.group_hidden_input.disabled = isChecked; | |
380 group_hidden_text.style.color = !isChecked ? "" : "#888888"; | |
381 document.forms.groupForm.group_moderators.disabled = isChecked; | |
382 group_moderators_text.style.color = !isChecked ? "" : "#888888"; | |
383 } | |
384 swapPostGroup(', $context['group']['is_post_group'] ? 'true' : 'false', '); | |
385 // ]]></script>'; | |
386 } | |
387 | |
388 // Templating for viewing the members of a group. | |
389 function template_group_members() | |
390 { | |
391 global $context, $settings, $options, $scripturl, $txt; | |
392 | |
393 echo ' | |
394 <div id="admincenter"> | |
395 <form action="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : '') , ';sa=members;group=', $context['group']['id'], '" method="post" accept-charset="', $context['character_set'], '"> | |
396 <div class="cat_bar"> | |
397 <h3 class="catbg">', $context['page_title'], '</h3> | |
398 </div> | |
399 <div class="windowbg"> | |
400 <span class="topslice"><span></span></span> | |
401 <div class="content"> | |
402 <dl class="settings"> | |
403 <dt> | |
404 <strong>', $txt['name'], ':</strong> | |
405 </dt> | |
406 <dd> | |
407 <span ', $context['group']['online_color'] ? 'style="color: ' . $context['group']['online_color'] . ';"' : '', '>', $context['group']['name'], '</span> ', $context['group']['stars'], ' | |
408 </dd>'; | |
409 //Any description to show? | |
410 if (!empty($context['group']['description'])) | |
411 echo ' | |
412 <dt> | |
413 <strong>' . $txt['membergroups_members_description'] . ':</strong> | |
414 </dt> | |
415 <dd> | |
416 ', $context['group']['description'] ,' | |
417 </dd>'; | |
418 | |
419 echo ' | |
420 <dt> | |
421 <strong>', $txt['membergroups_members_top'], ':</strong> | |
422 </dt> | |
423 <dd> | |
424 ', $context['total_members'] ,' | |
425 </dd>'; | |
426 // Any group moderators to show? | |
427 if (!empty($context['group']['moderators'])) | |
428 { | |
429 $moderators = array(); | |
430 foreach ($context['group']['moderators'] as $moderator) | |
431 $moderators[] = '<a href="' . $scripturl . '?action=profile;u=' . $moderator['id'] . '">' . $moderator['name'] . '</a>'; | |
432 | |
433 echo ' | |
434 <dt> | |
435 <strong>', $txt['membergroups_members_group_moderators'], ':</strong> | |
436 </dt> | |
437 <dd> | |
438 ', implode(', ', $moderators) ,' | |
439 </dd>'; | |
440 } | |
441 | |
442 echo ' | |
443 </dl> | |
444 </div> | |
445 <span class="botslice"><span></span></span> | |
446 </div> | |
447 | |
448 <br /> | |
449 <div class="title_bar"> | |
450 <h4 class="titlebg">', $txt['membergroups_members_group_members'], '</h4> | |
451 </div> | |
452 <br /> | |
453 <div class="pagesection">', $txt['pages'], ': ', $context['page_index'], '</div> | |
454 <table width="100%" class="table_grid"> | |
455 <thead> | |
456 <tr class="catbg"> | |
457 <th><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=name', $context['sort_by'] == 'name' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['name'], $context['sort_by'] == 'name' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></th> | |
458 <th><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=email', $context['sort_by'] == 'email' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['email'], $context['sort_by'] == 'email' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></th> | |
459 <th><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=active', $context['sort_by'] == 'active' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['membergroups_members_last_active'], $context['sort_by'] == 'active' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></th> | |
460 <th><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=registered', $context['sort_by'] == 'registered' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['date_registered'], $context['sort_by'] == 'registered' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></th> | |
461 <th', empty($context['group']['assignable']) ? ' colspan="2"' : '', '><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=posts', $context['sort_by'] == 'posts' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['posts'], $context['sort_by'] == 'posts' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></th>'; | |
462 if (!empty($context['group']['assignable'])) | |
463 echo ' | |
464 <td width="4%" align="center"><input type="checkbox" class="input_check" onclick="invertAll(this, this.form);" /></td>'; | |
465 echo ' | |
466 </tr> | |
467 </thead> | |
468 <tbody>'; | |
469 | |
470 if (empty($context['members'])) | |
471 echo ' | |
472 <tr class="windowbg2"> | |
473 <td colspan="6" align="center">', $txt['membergroups_members_no_members'], '</td> | |
474 </tr>'; | |
475 | |
476 foreach ($context['members'] as $member) | |
477 { | |
478 echo ' | |
479 <tr class="windowbg2"> | |
480 <td>', $member['name'], '</td> | |
481 <td', $member['show_email'] == 'no_through_forum' && $settings['use_image_buttons'] ? ' align="center"' : '', '>'; | |
482 | |
483 // Is it totally hidden? | |
484 if ($member['show_email'] == 'no') | |
485 echo ' | |
486 <em>', $txt['hidden'], '</em>'; | |
487 // ... otherwise they want it hidden but it's not to this person? | |
488 elseif ($member['show_email'] == 'yes_permission_override') | |
489 echo ' | |
490 <a href="mailto:', $member['email'], '"><em>', $member['email'], '</em></a>'; | |
491 // ... otherwise it's visible - but only via an image? | |
492 elseif ($member['show_email'] == 'no_through_forum') | |
493 echo ' | |
494 <a href="', $scripturl, '?action=emailuser;sa=email;uid=', $member['id'], '" rel="nofollow">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt['email'] . '" title="' . $txt['email'] . '" />' : $txt['email']), '</a>'; | |
495 // ... otherwise it must be a 'yes', show it and show it fully. | |
496 else | |
497 echo ' | |
498 <a href="mailto:', $member['email'], '">', $member['email'], '</a>'; | |
499 | |
500 echo ' | |
501 </td> | |
502 <td class="windowbg">', $member['last_online'], '</td> | |
503 <td class="windowbg">', $member['registered'], '</td> | |
504 <td', empty($context['group']['assignable']) ? ' colspan="2"' : '', '>', $member['posts'], '</td>'; | |
505 if (!empty($context['group']['assignable'])) | |
506 echo ' | |
507 <td align="center" width="4%"><input type="checkbox" name="rem[]" value="', $member['id'], '" class="input_check" ', ($context['user']['id'] == $member['id'] && $context['group']['id'] == 1 ? 'onclick="if (this.checked) return confirm(\'' . $txt['membergroups_members_deadmin_confirm'] . '\')" ' : ''), '/></td>'; | |
508 echo ' | |
509 </tr>'; | |
510 } | |
511 | |
512 echo ' | |
513 </tbody> | |
514 </table> | |
515 <div class="pagesection flow_hidden"> | |
516 <div class="floatleft">', $txt['pages'], ': ', $context['page_index'], '</div>'; | |
517 | |
518 if (!empty($context['group']['assignable'])) | |
519 echo ' | |
520 <div class="floatright"><input type="submit" name="remove" value="', $txt['membergroups_members_remove'], '" class="button_submit" /></div>'; | |
521 echo ' | |
522 </div> | |
523 <br />'; | |
524 | |
525 if (!empty($context['group']['assignable'])) | |
526 { | |
527 echo ' | |
528 <div class="cat_bar"> | |
529 <h3 class="catbg">', $txt['membergroups_members_add_title'], '</h3> | |
530 </div> | |
531 <div class="windowbg"> | |
532 <span class="topslice"><span></span></span> | |
533 <div class="content"> | |
534 <strong>', $txt['membergroups_members_add_desc'], ':</strong> | |
535 <input type="text" name="toAdd" id="toAdd" value="" class="input_text" /> | |
536 <div id="toAddItemContainer"></div> | |
537 <input type="submit" name="add" value="', $txt['membergroups_members_add'], '" class="button_submit" /> | |
538 </div> | |
539 <span class="botslice"><span></span></span> | |
540 </div>'; | |
541 } | |
542 | |
543 echo ' | |
544 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> | |
545 </form> | |
546 </div> | |
547 <br class="clear" />'; | |
548 | |
549 if (!empty($context['group']['assignable'])) | |
550 echo ' | |
551 <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/suggest.js?fin20"></script> | |
552 <script type="text/javascript"><!-- // --><![CDATA[ | |
553 var oAddMemberSuggest = new smc_AutoSuggest({ | |
554 sSelf: \'oAddMemberSuggest\', | |
555 sSessionId: \'', $context['session_id'], '\', | |
556 sSessionVar: \'', $context['session_var'], '\', | |
557 sSuggestId: \'to_suggest\', | |
558 sControlId: \'toAdd\', | |
559 sSearchType: \'member\', | |
560 sPostName: \'member_add\', | |
561 sURLMask: \'action=profile;u=%item_id%\', | |
562 sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\', | |
563 bItemList: true, | |
564 sItemListContainerId: \'toAddItemContainer\' | |
565 }); | |
566 // ]]></script>'; | |
567 } | |
568 | |
569 // Allow the moderator to enter a reason to each user being rejected. | |
570 function template_group_request_reason() | |
571 { | |
572 global $settings, $options, $context, $txt, $scripturl; | |
573 | |
574 // Show a welcome message to the user. | |
575 echo ' | |
576 <div id="moderationcenter"> | |
577 <form action="', $scripturl, '?action=groups;sa=requests" method="post" accept-charset="', $context['character_set'], '"> | |
578 <div class="cat_bar"> | |
579 <h3 class="catbg">', $txt['mc_groups_reason_title'], '</h3> | |
580 </div> | |
581 <div class="windowbg"> | |
582 <span class="topslice"><span></span></span> | |
583 <div class="content"> | |
584 <dl class="settings">'; | |
585 | |
586 // Loop through and print out a reason box for each... | |
587 foreach ($context['group_requests'] as $request) | |
588 echo ' | |
589 <dt> | |
590 <strong>', sprintf($txt['mc_groupr_reason_desc'], $request['member_link'], $request['group_link']), ':</strong> | |
591 </dt> | |
592 <dd> | |
593 <input type="hidden" name="groupr[]" value="', $request['id'], '" /> | |
594 <textarea name="groupreason[', $request['id'], ']" rows="3" cols="40" style="' . ($context['browser']['is_ie8'] ? 'width: 635px; max-width: 96%; min-width: 96%' : 'width: 96%') . ';"></textarea> | |
595 </dd>'; | |
596 | |
597 echo ' | |
598 </dl> | |
599 <input type="submit" name="go" value="', $txt['mc_groupr_submit'], '" class="button_submit" /> | |
600 <input type="hidden" name="req_action" value="got_reason" /> | |
601 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> | |
602 </div> | |
603 <span class="botslice"><span></span></span> | |
604 </div> | |
605 </form> | |
606 </div> | |
607 <br class="clear" />'; | |
608 } | |
609 | |
610 ?> |