Mercurial > hg > vamp-website
comparison forum/Themes/default/ManageBoards.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 // Template for listing all the current categories and boards. | |
14 function template_main() | |
15 { | |
16 global $context, $settings, $options, $scripturl, $txt, $modSettings; | |
17 | |
18 // Table header. | |
19 echo ' | |
20 <div id="manage_boards"> | |
21 <div class="title_bar"> | |
22 <h3 class="titlebg">', $txt['boardsEdit'], '</h3> | |
23 </div>'; | |
24 | |
25 if (!empty($context['move_board'])) | |
26 echo ' | |
27 <div class="information"> | |
28 <p>', $context['move_title'], ' [<a href="', $scripturl, '?action=admin;area=manageboards">', $txt['mboards_cancel_moving'], '</a>]', '</p> | |
29 </div>'; | |
30 | |
31 // No categories so show a label. | |
32 if (empty($context['categories'])) | |
33 echo ' | |
34 <div class="windowbg"> | |
35 <span class="topslice"><span></span></span> | |
36 <div class="content centertext"> | |
37 ', $txt['mboards_no_cats'], ' | |
38 </div> | |
39 <span class="botslice"><span></span></span> | |
40 </div>'; | |
41 | |
42 // Loop through every category, listing the boards in each as we go. | |
43 foreach ($context['categories'] as $category) | |
44 { | |
45 // Link to modify the category. | |
46 echo ' | |
47 <div class="cat_bar"> | |
48 <h3 class="catbg"> | |
49 <a href="' . $scripturl . '?action=admin;area=manageboards;sa=cat;cat=' . $category['id'] . '">', $category['name'], '</a> <a href="' . $scripturl . '?action=admin;area=manageboards;sa=cat;cat=' . $category['id'] . '">', $txt['catModify'], '</a> | |
50 </h3> | |
51 </div>'; | |
52 | |
53 // Boards table header. | |
54 echo ' | |
55 <form action="', $scripturl, '?action=admin;area=manageboards;sa=newboard;cat=', $category['id'], '" method="post" accept-charset="', $context['character_set'], '"> | |
56 <div class="windowbg"> | |
57 <span class="topslice"><span></span></span> | |
58 <div class="content"> | |
59 <ul id="category_', $category['id'], '" style="float:left; width:100%;">'; | |
60 | |
61 if (!empty($category['move_link'])) | |
62 echo ' | |
63 <li><a href="', $category['move_link']['href'], '" title="', $category['move_link']['label'], '"><img src="', $settings['images_url'], '/smiley_select_spot.gif" alt="', $category['move_link']['label'], '" /></a></li>'; | |
64 | |
65 $alternate = false; | |
66 | |
67 // List through every board in the category, printing its name and link to modify the board. | |
68 foreach ($category['boards'] as $board) | |
69 { | |
70 $alternate = !$alternate; | |
71 | |
72 echo ' | |
73 <li', !empty($modSettings['recycle_board']) && !empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] == $board['id'] ? ' id="recycle_board"' : ' ', ' class="windowbg', $alternate ? '' : '2', '" style="padding-' . ($context['right_to_left'] ? 'right' : 'left') . ': ', 5 + 30 * $board['child_level'], 'px;', $board['move'] ? 'color: red;' : '', '"><span class="floatleft"><a href="', $scripturl, '?board=', $board['id'], '">', $board['name'], '</a>', !empty($modSettings['recycle_board']) && !empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] == $board['id'] ? '<a href="' . $scripturl . '?action=admin;area=manageboards;sa=settings"> <img src="' . $settings['images_url'] . '/post/recycled.gif" alt="' . $txt['recycle_board'] . '" /></a></span>' : '</span>', ' | |
74 <span class="floatright">', $context['can_manage_permissions'] ? '<span class="modify_boards"><a href="' . $scripturl . '?action=admin;area=permissions;sa=index;pid=' . $board['permission_profile'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '">' . $txt['mboards_permissions'] . '</a></span>' : '', ' | |
75 <span class="modify_boards"><a href="', $scripturl, '?action=admin;area=manageboards;move=', $board['id'], '">', $txt['mboards_move'], '</a></span> | |
76 <span class="modify_boards"><a href="', $scripturl, '?action=admin;area=manageboards;sa=board;boardid=', $board['id'], '">', $txt['mboards_modify'], '</a></span></span><br style="clear: right;" /> | |
77 </li>'; | |
78 | |
79 if (!empty($board['move_links'])) | |
80 { | |
81 $alternate = !$alternate; | |
82 | |
83 echo ' | |
84 <li class="windowbg', $alternate ? '' : '2', '" style="padding-', $context['right_to_left'] ? 'right' : 'left', ': ', 5 + 30 * $board['move_links'][0]['child_level'], 'px;">'; | |
85 | |
86 foreach ($board['move_links'] as $link) | |
87 echo ' | |
88 <a href="', $link['href'], '" class="move_links" title="', $link['label'], '"><img src="', $settings['images_url'], '/board_select_spot', $link['child_level'] > 0 ? '_child' : '', '.gif" alt="', $link['label'], '" style="padding: 0px; margin: 0px;" /></a>'; | |
89 | |
90 echo ' | |
91 </li>'; | |
92 } | |
93 } | |
94 | |
95 // Button to add a new board. | |
96 echo ' | |
97 </ul> | |
98 <div class="righttext"> | |
99 <input type="submit" value="', $txt['mboards_new_board'], '" class="button_submit" /> | |
100 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> | |
101 </div> | |
102 </div> | |
103 <span class="botslice"><span></span></span> | |
104 </div> | |
105 </form>'; | |
106 } | |
107 echo ' | |
108 </div> | |
109 <br class="clear" />'; | |
110 } | |
111 | |
112 // Template for editing/adding a category on the forum. | |
113 function template_modify_category() | |
114 { | |
115 global $context, $settings, $options, $scripturl, $txt; | |
116 | |
117 // Print table header. | |
118 echo ' | |
119 <div id="manage_boards"> | |
120 <form action="', $scripturl, '?action=admin;area=manageboards;sa=cat2" method="post" accept-charset="', $context['character_set'], '"> | |
121 <input type="hidden" name="cat" value="', $context['category']['id'], '" /> | |
122 <div class="cat_bar"> | |
123 <h3 class="catbg"> | |
124 ', isset($context['category']['is_new']) ? $txt['mboards_new_cat_name'] : $txt['catEdit'], ' | |
125 </h3> | |
126 </div> | |
127 <div class="windowbg"> | |
128 <span class="topslice"><span></span></span> | |
129 <div class="content"> | |
130 <dl class="settings">'; | |
131 // If this isn't the only category, let the user choose where this category should be positioned down the board index. | |
132 if (count($context['category_order']) > 1) | |
133 { | |
134 echo ' | |
135 <dt><strong>', $txt['order'], ':</strong></dt> | |
136 <dd> | |
137 <select name="cat_order">'; | |
138 // Print every existing category into a select box. | |
139 foreach ($context['category_order'] as $order) | |
140 echo ' | |
141 <option', $order['selected'] ? ' selected="selected"' : '', ' value="', $order['id'], '">', $order['name'], '</option>'; | |
142 echo ' | |
143 </select> | |
144 </dd>'; | |
145 } | |
146 // Allow the user to edit the category name and/or choose whether you can collapse the category. | |
147 echo ' | |
148 <dt> | |
149 <strong>', $txt['full_name'], ':</strong><br /> | |
150 <span class="smalltext">', $txt['name_on_display'], '</span> | |
151 </dt> | |
152 <dd> | |
153 <input type="text" name="cat_name" value="', $context['category']['editable_name'], '" size="30" tabindex="', $context['tabindex']++, '" class="input_text" /> | |
154 </dd> | |
155 <dt> | |
156 <strong>' . $txt['collapse_enable'] . '</strong><br /> | |
157 <span class="smalltext">' . $txt['collapse_desc'] . '</span> | |
158 </dt> | |
159 <dd> | |
160 <input type="checkbox" name="collapse"', $context['category']['can_collapse'] ? ' checked="checked"' : '', ' tabindex="', $context['tabindex']++, '" class="input_check" /> | |
161 </dd>'; | |
162 | |
163 // Table footer. | |
164 echo ' | |
165 </dl> | |
166 <div class="righttext">'; | |
167 | |
168 if (isset($context['category']['is_new'])) | |
169 echo ' | |
170 <input type="submit" name="add" value="', $txt['mboards_add_cat_button'], '" onclick="return !isEmptyText(this.form.cat_name);" tabindex="', $context['tabindex']++, '" class="button_submit" />'; | |
171 else | |
172 echo ' | |
173 <input type="submit" name="edit" value="', $txt['modify'], '" onclick="return !isEmptyText(this.form.cat_name);" tabindex="', $context['tabindex']++, '" class="button_submit" /> | |
174 <input type="submit" name="delete" value="', $txt['mboards_delete_cat'], '" onclick="return confirm(\'', $txt['catConfirm'], '\');" class="button_submit" />'; | |
175 echo ' | |
176 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />'; | |
177 | |
178 // If this category is empty we don't bother with the next confirmation screen. | |
179 if ($context['category']['is_empty']) | |
180 echo ' | |
181 <input type="hidden" name="empty" value="1" />'; | |
182 | |
183 echo ' | |
184 </div> | |
185 </div> | |
186 <span class="botslice"><span></span></span> | |
187 </div> | |
188 </form> | |
189 </div> | |
190 <br class="clear" />'; | |
191 } | |
192 | |
193 // A template to confirm if a user wishes to delete a category - and whether they want to save the boards. | |
194 function template_confirm_category_delete() | |
195 { | |
196 global $context, $settings, $options, $scripturl, $txt; | |
197 | |
198 // Print table header. | |
199 echo ' | |
200 <div id="manage_boards"> | |
201 <form action="', $scripturl, '?action=admin;area=manageboards;sa=cat2" method="post" accept-charset="', $context['character_set'], '"> | |
202 <input type="hidden" name="cat" value="', $context['category']['id'], '" /> | |
203 <div class="cat_bar"> | |
204 <h3 class="catbg">', $txt['mboards_delete_cat'], '</h3> | |
205 </div> | |
206 <div class="windowbg"> | |
207 <span class="topslice"><span></span></span> | |
208 <div class="content"> | |
209 <p>', $txt['mboards_delete_cat_contains'], ':</p> | |
210 <ul>'; | |
211 | |
212 foreach ($context['category']['children'] as $child) | |
213 echo ' | |
214 <li>', $child, '</li>'; | |
215 | |
216 echo ' | |
217 </ul> | |
218 </div> | |
219 <span class="botslice"><span></span></span> | |
220 </div> | |
221 <div class="cat_bar"> | |
222 <h3 class="catbg">', $txt['mboards_delete_what_do'], '</h3> | |
223 </div> | |
224 <div class="windowbg"> | |
225 <span class="topslice"><span></span></span> | |
226 <div class="content"> | |
227 <p> | |
228 <label for="delete_action0"><input type="radio" id="delete_action0" name="delete_action" value="0" class="input_radio" checked="checked" />', $txt['mboards_delete_option1'], '</label><br /> | |
229 <label for="delete_action1"><input type="radio" id="delete_action1" name="delete_action" value="1" class="input_radio"', count($context['category_order']) == 1 ? ' disabled="disabled"' : '', ' />', $txt['mboards_delete_option2'], '</label>: | |
230 <select name="cat_to" ', count($context['category_order']) == 1 ? 'disabled="disabled"' : '', '>'; | |
231 | |
232 foreach ($context['category_order'] as $cat) | |
233 if ($cat['id'] != 0) | |
234 echo ' | |
235 <option value="', $cat['id'], '">', $cat['true_name'], '</option>'; | |
236 | |
237 echo ' | |
238 </select> | |
239 </p> | |
240 <input type="submit" name="delete" value="', $txt['mboards_delete_confirm'], '" class="button_submit" /> | |
241 <input type="submit" name="cancel" value="', $txt['mboards_delete_cancel'], '" class="button_submit" /> | |
242 <input type="hidden" name="confirmation" value="1" /> | |
243 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> | |
244 </div> | |
245 <span class="botslice"><span></span></span> | |
246 </div> | |
247 </form> | |
248 </div> | |
249 <br class="clear" />'; | |
250 } | |
251 | |
252 // Below is the template for adding/editing an board on the forum. | |
253 function template_modify_board() | |
254 { | |
255 global $context, $settings, $options, $scripturl, $txt, $modSettings; | |
256 | |
257 // The main table header. | |
258 echo ' | |
259 <div id="manage_boards"> | |
260 <form action="', $scripturl, '?action=admin;area=manageboards;sa=board2" method="post" accept-charset="', $context['character_set'], '"> | |
261 <input type="hidden" name="boardid" value="', $context['board']['id'], '" /> | |
262 <div class="cat_bar"> | |
263 <h3 class="catbg"> | |
264 ', isset($context['board']['is_new']) ? $txt['mboards_new_board_name'] : $txt['boardsEdit'], ' | |
265 </h3> | |
266 </div> | |
267 <div class="windowbg"> | |
268 <span class="topslice"><span></span></span> | |
269 <div class="content"> | |
270 <dl class="settings">'; | |
271 | |
272 // Option for choosing the category the board lives in. | |
273 echo ' | |
274 | |
275 <dt> | |
276 <strong>', $txt['mboards_category'], ':</strong> | |
277 | |
278 </dt> | |
279 <dd> | |
280 <select name="new_cat" onchange="if (this.form.order) {this.form.order.disabled = this.options[this.selectedIndex].value != 0; this.form.board_order.disabled = this.options[this.selectedIndex].value != 0 || this.form.order.options[this.form.order.selectedIndex].value == \'\';}">'; | |
281 foreach ($context['categories'] as $category) | |
282 echo ' | |
283 <option', $category['selected'] ? ' selected="selected"' : '', ' value="', $category['id'], '">', $category['name'], '</option>'; | |
284 echo ' | |
285 </select> | |
286 </dd>'; | |
287 | |
288 // If this isn't the only board in this category let the user choose where the board is to live. | |
289 if ((isset($context['board']['is_new']) && count($context['board_order']) > 0) || count($context['board_order']) > 1) | |
290 { | |
291 echo ' | |
292 <dt> | |
293 <strong>', $txt['order'], ':</strong> | |
294 </dt> | |
295 <dd>'; | |
296 | |
297 // The first select box gives the user the option to position it before, after or as a child of another board. | |
298 echo ' | |
299 <select id="order" name="placement" onchange="this.form.board_order.disabled = this.options[this.selectedIndex].value == \'\';"> | |
300 ', !isset($context['board']['is_new']) ? '<option value="">(' . $txt['mboards_unchanged'] . ')</option>' : '', ' | |
301 <option value="after">' . $txt['mboards_order_after'] . '...</option> | |
302 <option value="child">' . $txt['mboards_order_child_of'] . '...</option> | |
303 <option value="before">' . $txt['mboards_order_before'] . '...</option> | |
304 </select>'; | |
305 | |
306 // The second select box lists all the boards in the category. | |
307 echo ' | |
308 <select id="board_order" name="board_order" ', isset($context['board']['is_new']) ? '' : 'disabled="disabled"', '> | |
309 ', !isset($context['board']['is_new']) ? '<option value="">(' . $txt['mboards_unchanged'] . ')</option>' : ''; | |
310 foreach ($context['board_order'] as $order) | |
311 echo ' | |
312 <option', $order['selected'] ? ' selected="selected"' : '', ' value="', $order['id'], '">', $order['name'], '</option>'; | |
313 echo ' | |
314 </select> | |
315 </dd>'; | |
316 } | |
317 | |
318 // Options for board name and description. | |
319 echo ' | |
320 <dt> | |
321 <strong>', $txt['full_name'], ':</strong><br /> | |
322 <span class="smalltext">', $txt['name_on_display'], '</span> | |
323 </dt> | |
324 <dd> | |
325 <input type="text" name="board_name" value="', $context['board']['name'], '" size="30" class="input_text" /> | |
326 </dd> | |
327 <dt> | |
328 <strong>', $txt['mboards_description'], ':</strong><br /> | |
329 <span class="smalltext">', $txt['mboards_description_desc'], '</span> | |
330 </dt> | |
331 <dd> | |
332 <textarea name="desc" rows="3" cols="35" style="' . ($context['browser']['is_ie8'] ? 'width: 635px; max-width: 99%; min-width: 99%' : 'width: 99%') . ';">', $context['board']['description'], '</textarea> | |
333 </dd> | |
334 <dt> | |
335 <strong>', $txt['permission_profile'], ':</strong><br /> | |
336 <span class="smalltext">', $context['can_manage_permissions'] ? sprintf($txt['permission_profile_desc'], $scripturl . '?action=admin;area=permissions;sa=profiles;' . $context['session_var'] . '=' . $context['session_id']) : strip_tags($txt['permission_profile_desc']), '</span> | |
337 </dt> | |
338 <dd> | |
339 <select name="profile">'; | |
340 | |
341 if (isset($context['board']['is_new'])) | |
342 echo ' | |
343 <option value="-1">[', $txt['permission_profile_inherit'], ']</option>'; | |
344 | |
345 foreach ($context['profiles'] as $id => $profile) | |
346 echo ' | |
347 <option value="', $id, '" ', $id == $context['board']['profile'] ? 'selected="selected"' : '', '>', $profile['name'], '</option>'; | |
348 | |
349 echo ' | |
350 </select> | |
351 </dd> | |
352 <dt> | |
353 <strong>', $txt['mboards_groups'], ':</strong><br /> | |
354 <span class="smalltext">', $txt['mboards_groups_desc'], '</span> | |
355 </dt> | |
356 <dd>'; | |
357 | |
358 // List all the membergroups so the user can choose who may access this board. | |
359 foreach ($context['groups'] as $group) | |
360 echo ' | |
361 <label for="groups_', $group['id'], '"> | |
362 <input type="checkbox" name="groups[]" value="', $group['id'], '" id="groups_', $group['id'], '"', $group['checked'] ? ' checked="checked"' : '', ' class="input_check" /> | |
363 <span', $group['is_post_group'] ? ' class="post_group" title="' . $txt['mboards_groups_post_group'] . '"' : '', $group['id'] == 0 ? ' class="regular_members" title="' . $txt['mboards_groups_regular_members'] . '"' : '', '> | |
364 ', $group['name'], ' | |
365 </span> | |
366 </label><br />'; | |
367 echo ' | |
368 <em>', $txt['check_all'], '</em> <input type="checkbox" class="input_check" onclick="invertAll(this, this.form, \'groups[]\');" /><br /> | |
369 <br /> | |
370 </dd>'; | |
371 | |
372 // Options to choose moderators, specifiy as announcement board and choose whether to count posts here. | |
373 echo ' | |
374 <dt> | |
375 <strong>', $txt['mboards_moderators'], ':</strong><br /> | |
376 <span class="smalltext">', $txt['mboards_moderators_desc'], '</span><br /> | |
377 </dt> | |
378 <dd> | |
379 <input type="text" name="moderators" id="moderators" value="', $context['board']['moderator_list'], '" size="30" class="input_text" /> | |
380 <div id="moderator_container"></div> | |
381 </dd> | |
382 </dl> | |
383 <hr class="hrcolor" />'; | |
384 | |
385 if (empty($context['board']['is_recycle']) && empty($context['board']['topics'])) | |
386 echo ' | |
387 <dl class="settings"> | |
388 <dt> | |
389 <strong', $context['board']['topics'] ? ' style="color: gray;"' : '', '>', $txt['mboards_redirect'], ':</strong><br /> | |
390 <span class="smalltext">', $txt['mboards_redirect_desc'], '</span><br /> | |
391 </dt> | |
392 <dd> | |
393 <input type="checkbox" id="redirect_enable" name="redirect_enable"', $context['board']['topics'] ? ' disabled="disabled"' : '', $context['board']['redirect'] != '' ? ' checked="checked"' : '', ' onclick="refreshOptions();" class="input_check" /> | |
394 </dd> | |
395 </dl>'; | |
396 | |
397 if (!empty($context['board']['is_recycle'])) | |
398 echo ' | |
399 <div class="information">', $txt['mboards_redirect_disabled_recycle'], '</div>'; | |
400 | |
401 if (empty($context['board']['is_recycle']) && !empty($context['board']['topics'])) | |
402 echo ' | |
403 <div class="information"> | |
404 <strong>', $txt['mboards_redirect'],'</strong><br /> | |
405 ', $txt['mboards_redirect_disabled'], ' | |
406 </div>'; | |
407 | |
408 if (!$context['board']['topics'] && empty($context['board']['is_recycle'])) | |
409 { | |
410 echo ' | |
411 <div id="redirect_address_div"> | |
412 <dl class="settings"> | |
413 <dt> | |
414 <strong>', $txt['mboards_redirect_url'], ':</strong><br /> | |
415 <span class="smalltext">', $txt['mboards_redirect_url_desc'], '</span><br /> | |
416 </dt> | |
417 <dd> | |
418 <input type="text" name="redirect_address" value="', $context['board']['redirect'], '" size="40" class="input_text" /> | |
419 </dd> | |
420 </dl> | |
421 </div>'; | |
422 | |
423 if ($context['board']['redirect']) | |
424 echo ' | |
425 <div id="reset_redirect_div"> | |
426 <dl class="settings"> | |
427 <dt> | |
428 <strong>', $txt['mboards_redirect_reset'], ':</strong><br /> | |
429 <span class="smalltext">', $txt['mboards_redirect_reset_desc'], '</span><br /> | |
430 </dt> | |
431 <dd> | |
432 <input type="checkbox" name="reset_redirect" class="input_check" /> | |
433 <em>(', sprintf($txt['mboards_current_redirects'], $context['board']['posts']), ')</em> | |
434 </dd> | |
435 </dl> | |
436 </div>'; | |
437 } | |
438 | |
439 echo ' | |
440 <div id="count_posts_div"> | |
441 <dl class="settings"> | |
442 <dt> | |
443 <strong>', $txt['mboards_count_posts'], ':</strong><br /> | |
444 <span class="smalltext">', $txt['mboards_count_posts_desc'], '</span><br /> | |
445 </dt> | |
446 <dd> | |
447 <input type="checkbox" name="count" ', $context['board']['count_posts'] ? ' checked="checked"' : '', ' class="input_check" /> | |
448 </dd> | |
449 </dl> | |
450 </div>'; | |
451 | |
452 // Here the user can choose to force this board to use a theme other than the default theme for the forum. | |
453 echo ' | |
454 <div id="board_theme_div"> | |
455 <dl class="settings"> | |
456 <dt> | |
457 <strong>', $txt['mboards_theme'], ':</strong><br /> | |
458 <span class="smalltext">', $txt['mboards_theme_desc'], '</span><br /> | |
459 </dt> | |
460 <dd> | |
461 <select name="boardtheme" id="boardtheme" onchange="refreshOptions();"> | |
462 <option value="0"', $context['board']['theme'] == 0 ? ' selected="selected"' : '', '>', $txt['mboards_theme_default'], '</option>'; | |
463 | |
464 foreach ($context['themes'] as $theme) | |
465 echo ' | |
466 <option value="', $theme['id'], '"', $context['board']['theme'] == $theme['id'] ? ' selected="selected"' : '', '>', $theme['name'], '</option>'; | |
467 | |
468 echo ' | |
469 </select> | |
470 </dd> | |
471 </dl> | |
472 </div> | |
473 <div id="override_theme_div"> | |
474 <dl class="settings"> | |
475 <dt> | |
476 <strong>', $txt['mboards_override_theme'], ':</strong><br /> | |
477 <span class="smalltext">', $txt['mboards_override_theme_desc'], '</span><br /> | |
478 </dt> | |
479 <dd> | |
480 <input type="checkbox" name="override_theme"', $context['board']['override_theme'] ? ' checked="checked"' : '', ' class="input_check" /> | |
481 </dd> | |
482 </dl> | |
483 </div>'; | |
484 | |
485 if (!empty($context['board']['is_recycle'])) | |
486 echo '<div class="information">', $txt['mboards_recycle_disabled_delete'], '</div>'; | |
487 | |
488 echo ' | |
489 <input type="hidden" name="rid" value="', $context['redirect_location'], '" /> | |
490 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />'; | |
491 | |
492 // If this board has no children don't bother with the next confirmation screen. | |
493 if ($context['board']['no_children']) | |
494 echo ' | |
495 <input type="hidden" name="no_children" value="1" />'; | |
496 | |
497 if (isset($context['board']['is_new'])) | |
498 echo ' | |
499 <input type="hidden" name="cur_cat" value="', $context['board']['category'], '" /> | |
500 <input type="submit" name="add" value="', $txt['mboards_new_board'], '" onclick="return !isEmptyText(this.form.board_name);" class="button_submit" />'; | |
501 else | |
502 echo ' | |
503 <input type="submit" name="edit" value="', $txt['modify'], '" onclick="return !isEmptyText(this.form.board_name);" class="button_submit" />'; | |
504 | |
505 if (!isset($context['board']['is_new']) && empty($context['board']['is_recycle'])) | |
506 echo ' | |
507 <span', $context['board']['is_recycle'] ? ' style="visibility:hidden">' : '>', '<input type="submit" name="delete" value="', $txt['mboards_delete_board'], '" onclick="return confirm(\'', $txt['boardConfirm'], '\');"', ' class="button_submit" /></span>'; | |
508 echo ' | |
509 </div> | |
510 <span class="botslice"><span></span></span> | |
511 </div> | |
512 </form> | |
513 </div> | |
514 <br class="clear" /> | |
515 <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/suggest.js?fin20"></script> | |
516 <script type="text/javascript"><!-- // --><![CDATA[ | |
517 var oModeratorSuggest = new smc_AutoSuggest({ | |
518 sSelf: \'oModeratorSuggest\', | |
519 sSessionId: \'', $context['session_id'], '\', | |
520 sSessionVar: \'', $context['session_var'], '\', | |
521 sSuggestId: \'moderators\', | |
522 sControlId: \'moderators\', | |
523 sSearchType: \'member\', | |
524 bItemList: true, | |
525 sPostName: \'moderator_list\', | |
526 sURLMask: \'action=profile;u=%item_id%\', | |
527 sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\', | |
528 sItemListContainerId: \'moderator_container\', | |
529 aListItems: ['; | |
530 | |
531 foreach ($context['board']['moderators'] as $id_member => $member_name) | |
532 echo ' | |
533 { | |
534 sItemId: ', JavaScriptEscape($id_member), ', | |
535 sItemName: ', JavaScriptEscape($member_name), ' | |
536 }', $id_member == $context['board']['last_moderator_id'] ? '' : ','; | |
537 | |
538 echo ' | |
539 ] | |
540 }); | |
541 // ]]></script>'; | |
542 | |
543 // Javascript for deciding what to show. | |
544 echo ' | |
545 <script type="text/javascript"><!-- // --><![CDATA[ | |
546 function refreshOptions() | |
547 { | |
548 var redirect = document.getElementById("redirect_enable"); | |
549 var redirectEnabled = redirect ? redirect.checked : false; | |
550 var nonDefaultTheme = document.getElementById("boardtheme").value == 0 ? false : true; | |
551 | |
552 // What to show? | |
553 document.getElementById("override_theme_div").style.display = redirectEnabled || !nonDefaultTheme ? "none" : ""; | |
554 document.getElementById("board_theme_div").style.display = redirectEnabled ? "none" : ""; | |
555 document.getElementById("count_posts_div").style.display = redirectEnabled ? "none" : "";'; | |
556 | |
557 if (!$context['board']['topics'] && empty($context['board']['is_recycle'])) | |
558 { | |
559 echo ' | |
560 document.getElementById("redirect_address_div").style.display = redirectEnabled ? "" : "none";'; | |
561 | |
562 if ($context['board']['redirect']) | |
563 echo ' | |
564 document.getElementById("reset_redirect_div").style.display = redirectEnabled ? "" : "none";'; | |
565 } | |
566 | |
567 echo ' | |
568 } | |
569 refreshOptions(); | |
570 // ]]></script>'; | |
571 } | |
572 | |
573 // A template used when a user is deleting a board with child boards in it - to see what they want to do with them. | |
574 function template_confirm_board_delete() | |
575 { | |
576 global $context, $settings, $options, $scripturl, $txt; | |
577 | |
578 // Print table header. | |
579 echo ' | |
580 <div id="manage_boards"> | |
581 <form action="', $scripturl, '?action=admin;area=manageboards;sa=board2" method="post" accept-charset="', $context['character_set'], '"> | |
582 <input type="hidden" name="boardid" value="', $context['board']['id'], '" /> | |
583 | |
584 <div class="cat_bar"> | |
585 <h3 class="catbg">', $txt['mboards_delete_board'], '</h3> | |
586 </div> | |
587 <div class="windowbg"> | |
588 <span class="topslice"><span></span></span> | |
589 <div class="content"> | |
590 <p>', $txt['mboards_delete_board_contains'], '</p> | |
591 <ul>'; | |
592 | |
593 foreach ($context['children'] as $child) | |
594 echo ' | |
595 <li>', $child['node']['name'], '</li>'; | |
596 | |
597 echo ' | |
598 </ul> | |
599 </div> | |
600 <span class="botslice"><span></span></span> | |
601 </div> | |
602 <div class="cat_bar"> | |
603 <h3 class="catbg">', $txt['mboards_delete_what_do'], '</h3> | |
604 </div> | |
605 <div class="windowbg"> | |
606 <span class="topslice"><span></span></span> | |
607 <div class="content"> | |
608 <p> | |
609 <label for="delete_action0"><input type="radio" id="delete_action0" name="delete_action" value="0" class="input_radio" checked="checked" />', $txt['mboards_delete_board_option1'], '</label><br /> | |
610 <label for="delete_action1"><input type="radio" id="delete_action1" name="delete_action" value="1" class="input_radio"', empty($context['can_move_children']) ? ' disabled="disabled"' : '', ' />', $txt['mboards_delete_board_option2'], '</label>: | |
611 <select name="board_to" ', empty($context['can_move_children']) ? 'disabled="disabled"' : '', '>'; | |
612 | |
613 foreach ($context['board_order'] as $board) | |
614 if ($board['id'] != $context['board']['id'] && empty($board['is_child'])) | |
615 echo ' | |
616 <option value="', $board['id'], '">', $board['name'], '</option>'; | |
617 | |
618 echo ' | |
619 </select> | |
620 </p> | |
621 <input type="submit" name="delete" value="', $txt['mboards_delete_confirm'], '" class="button_submit" /> | |
622 <input type="submit" name="cancel" value="', $txt['mboards_delete_cancel'], '" class="button_submit" /> | |
623 <input type="hidden" name="confirmation" value="1" /> | |
624 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> | |
625 </div> | |
626 <span class="botslice"><span></span></span> | |
627 </div> | |
628 </form> | |
629 </div> | |
630 <br class="clear" />'; | |
631 } | |
632 | |
633 ?> |