@@ -127,8 +127,8 @@ discard block |
||
127 | 127 | <div class="windowbg2 noup"> |
128 | 128 | <dl class="settings">'; |
129 | 129 | |
130 | - if (!empty($context['table_info'])) |
|
131 | - echo ' |
|
130 | + if (!empty($context['table_info'])) { |
|
131 | + echo ' |
|
132 | 132 | <dt> |
133 | 133 | <strong>', $txt['search_method_messages_table_space'], ':</strong> |
134 | 134 | </dt> |
@@ -141,6 +141,7 @@ discard block |
||
141 | 141 | <dd> |
142 | 142 | ', $context['table_info']['index_length'], ' |
143 | 143 | </dd>'; |
144 | + } |
|
144 | 145 | echo ' |
145 | 146 | </dl> |
146 | 147 | ', $context['double_index'] ? '<div class="noticebox"> |
@@ -163,17 +164,17 @@ discard block |
||
163 | 164 | <dd> |
164 | 165 | <span class="smalltext">'; |
165 | 166 | |
166 | - if (empty($context['fulltext_index']) && empty($context['cannot_create_fulltext'])) |
|
167 | - echo ' |
|
167 | + if (empty($context['fulltext_index']) && empty($context['cannot_create_fulltext'])) { |
|
168 | + echo ' |
|
168 | 169 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_no_index_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=createfulltext;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_method_fulltext_create'], '</a>]'; |
169 | - |
|
170 | - elseif (empty($context['fulltext_index']) && !empty($context['cannot_create_fulltext'])) |
|
171 | - echo ' |
|
170 | + } elseif (empty($context['fulltext_index']) && !empty($context['cannot_create_fulltext'])) { |
|
171 | + echo ' |
|
172 | 172 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_fulltext_cannot_create']; |
173 | - else |
|
174 | - echo ' |
|
173 | + } else { |
|
174 | + echo ' |
|
175 | 175 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_index_already_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=removefulltext;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_method_fulltext_remove'], '</a>]<br> |
176 | 176 | <strong>', $txt['search_index_size'], ':</strong> ', $context['table_info']['fulltext_length']; |
177 | + } |
|
177 | 178 | echo ' |
178 | 179 | </span> |
179 | 180 | </dd>'; |
@@ -187,26 +188,27 @@ discard block |
||
187 | 188 | <dd> |
188 | 189 | <span class="smalltext">'; |
189 | 190 | |
190 | - if ($context['custom_index']) |
|
191 | - echo ' |
|
191 | + if ($context['custom_index']) { |
|
192 | + echo ' |
|
192 | 193 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_index_already_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=removecustom;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_index_custom_remove'], '</a>]<br> |
193 | 194 | <strong>', $txt['search_index_size'], ':</strong> ', $context['table_info']['custom_index_length']; |
194 | - |
|
195 | - elseif ($context['partial_custom_index']) |
|
196 | - echo ' |
|
195 | + } elseif ($context['partial_custom_index']) { |
|
196 | + echo ' |
|
197 | 197 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_index_partial'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=removecustom;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_index_custom_remove'], '</a>] [<a href="', $scripturl, '?action=admin;area=managesearch;sa=createmsgindex;resume;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_index_custom_resume'], '</a>]<br> |
198 | 198 | <strong>', $txt['search_index_size'], ':</strong> ', $context['table_info']['custom_index_length']; |
199 | - else |
|
200 | - echo ' |
|
199 | + } else { |
|
200 | + echo ' |
|
201 | 201 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_no_index_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=createmsgindex">', $txt['search_index_create_custom'], '</a>]'; |
202 | + } |
|
202 | 203 | echo ' |
203 | 204 | </span> |
204 | 205 | </dd>'; |
205 | 206 | |
206 | 207 | foreach ($context['search_apis'] as $api) |
207 | 208 | { |
208 | - if (empty($api['label']) || $api['has_template']) |
|
209 | - continue; |
|
209 | + if (empty($api['label']) || $api['has_template']) { |
|
210 | + continue; |
|
211 | + } |
|
210 | 212 | |
211 | 213 | echo ' |
212 | 214 | <dt> |
@@ -214,12 +216,13 @@ discard block |
||
214 | 216 | ', $api['label'], ' |
215 | 217 | </dt>'; |
216 | 218 | |
217 | - if ($api['desc']) |
|
218 | - echo ' |
|
219 | + if ($api['desc']) { |
|
220 | + echo ' |
|
219 | 221 | <dd> |
220 | 222 | <span class="smalltext">', $api['desc'], '</span> |
221 | 223 | </dd>'; |
222 | 224 | } |
225 | + } |
|
223 | 226 | |
224 | 227 | echo ' |
225 | 228 | </dl> |
@@ -91,8 +91,9 @@ discard block |
||
91 | 91 | foreach ($section['areas'] as $i => $area) |
92 | 92 | { |
93 | 93 | // Not supposed to be printed? |
94 | - if (empty($area['label'])) |
|
95 | - continue; |
|
94 | + if (empty($area['label'])) { |
|
95 | + continue; |
|
96 | + } |
|
96 | 97 | |
97 | 98 | echo ' |
98 | 99 | <li', !empty($area['subsections']) ? ' class="subsections"' : '', '>'; |
@@ -101,8 +102,9 @@ discard block |
||
101 | 102 | <a class="', $area['icon_class'], !empty($area['selected']) ? ' chosen ' : '', '" href="', (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i), $menu_context['extra_parameters'], '">', $area['icon'], $area['label'], '</a>'; |
102 | 103 | |
103 | 104 | // Is this the current area, or just some area? |
104 | - if (!empty($area['selected']) && empty($context['tabs'])) |
|
105 | - $context['tabs'] = isset($area['subsections']) ? $area['subsections'] : array(); |
|
105 | + if (!empty($area['selected']) && empty($context['tabs'])) { |
|
106 | + $context['tabs'] = isset($area['subsections']) ? $area['subsections'] : array(); |
|
107 | + } |
|
106 | 108 | |
107 | 109 | // Are there any subsections? |
108 | 110 | if (!empty($area['subsections'])) |
@@ -112,8 +114,9 @@ discard block |
||
112 | 114 | |
113 | 115 | foreach ($area['subsections'] as $sa => $sub) |
114 | 116 | { |
115 | - if (!empty($sub['disabled'])) |
|
116 | - continue; |
|
117 | + if (!empty($sub['disabled'])) { |
|
118 | + continue; |
|
119 | + } |
|
117 | 120 | |
118 | 121 | $url = isset($sub['url']) ? $sub['url'] : (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i) . ';sa=' . $sa; |
119 | 122 | |
@@ -160,8 +163,9 @@ discard block |
||
160 | 163 | <h3 class="catbg">'; |
161 | 164 | |
162 | 165 | // The function is in Admin.template.php, but since this template is used elsewhere too better check if the function is available |
163 | - if (function_exists('template_admin_quick_search')) |
|
164 | - template_admin_quick_search(); |
|
166 | + if (function_exists('template_admin_quick_search')) { |
|
167 | + template_admin_quick_search(); |
|
168 | + } |
|
165 | 169 | |
166 | 170 | // Exactly how many tabs do we have? |
167 | 171 | if (!empty($context['tabs'])) |
@@ -176,30 +180,36 @@ discard block |
||
176 | 180 | } |
177 | 181 | |
178 | 182 | // Did this not even exist - or do we not have a label? |
179 | - if (!isset($tab_context['tabs'][$id])) |
|
180 | - $tab_context['tabs'][$id] = array('label' => $tab['label']); |
|
181 | - elseif (!isset($tab_context['tabs'][$id]['label'])) |
|
182 | - $tab_context['tabs'][$id]['label'] = $tab['label']; |
|
183 | + if (!isset($tab_context['tabs'][$id])) { |
|
184 | + $tab_context['tabs'][$id] = array('label' => $tab['label']); |
|
185 | + } elseif (!isset($tab_context['tabs'][$id]['label'])) { |
|
186 | + $tab_context['tabs'][$id]['label'] = $tab['label']; |
|
187 | + } |
|
183 | 188 | |
184 | 189 | // Has a custom URL defined in the main admin structure? |
185 | - if (isset($tab['url']) && !isset($tab_context['tabs'][$id]['url'])) |
|
186 | - $tab_context['tabs'][$id]['url'] = $tab['url']; |
|
190 | + if (isset($tab['url']) && !isset($tab_context['tabs'][$id]['url'])) { |
|
191 | + $tab_context['tabs'][$id]['url'] = $tab['url']; |
|
192 | + } |
|
187 | 193 | |
188 | 194 | // Any additional paramaters for the url? |
189 | - if (isset($tab['add_params']) && !isset($tab_context['tabs'][$id]['add_params'])) |
|
190 | - $tab_context['tabs'][$id]['add_params'] = $tab['add_params']; |
|
195 | + if (isset($tab['add_params']) && !isset($tab_context['tabs'][$id]['add_params'])) { |
|
196 | + $tab_context['tabs'][$id]['add_params'] = $tab['add_params']; |
|
197 | + } |
|
191 | 198 | |
192 | 199 | // Has it been deemed selected? |
193 | - if (!empty($tab['is_selected'])) |
|
194 | - $tab_context['tabs'][$id]['is_selected'] = true; |
|
200 | + if (!empty($tab['is_selected'])) { |
|
201 | + $tab_context['tabs'][$id]['is_selected'] = true; |
|
202 | + } |
|
195 | 203 | |
196 | 204 | // Does it have its own help? |
197 | - if (!empty($tab['help'])) |
|
198 | - $tab_context['tabs'][$id]['help'] = $tab['help']; |
|
205 | + if (!empty($tab['help'])) { |
|
206 | + $tab_context['tabs'][$id]['help'] = $tab['help']; |
|
207 | + } |
|
199 | 208 | |
200 | 209 | // Is this the last one? |
201 | - if (!empty($tab['is_last']) && !isset($tab_context['override_last'])) |
|
202 | - $tab_context['tabs'][$id]['is_last'] = true; |
|
210 | + if (!empty($tab['is_last']) && !isset($tab_context['override_last'])) { |
|
211 | + $tab_context['tabs'][$id]['is_last'] = true; |
|
212 | + } |
|
203 | 213 | } |
204 | 214 | |
205 | 215 | // Find the selected tab |
@@ -216,20 +226,21 @@ discard block |
||
216 | 226 | // Show an icon and/or a help item? |
217 | 227 | if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class']) || !empty($selected_tab['icon']) || !empty($tab_context['icon']) || !empty($selected_tab['help']) || !empty($tab_context['help'])) |
218 | 228 | { |
219 | - if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class'])) |
|
220 | - echo ' |
|
229 | + if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class'])) { |
|
230 | + echo ' |
|
221 | 231 | <span class="', !empty($selected_tab['icon_class']) ? $selected_tab['icon_class'] : $tab_context['icon_class'], ' icon"></span>'; |
222 | - elseif (!empty($selected_tab['icon']) || !empty($tab_context['icon'])) |
|
223 | - echo ' |
|
232 | + } elseif (!empty($selected_tab['icon']) || !empty($tab_context['icon'])) { |
|
233 | + echo ' |
|
224 | 234 | <img src="', $settings['images_url'], '/icons/', !empty($selected_tab['icon']) ? $selected_tab['icon'] : $tab_context['icon'], '" alt="" class="icon">'; |
235 | + } |
|
225 | 236 | |
226 | - if (!empty($selected_tab['help']) || !empty($tab_context['help'])) |
|
227 | - echo ' |
|
237 | + if (!empty($selected_tab['help']) || !empty($tab_context['help'])) { |
|
238 | + echo ' |
|
228 | 239 | <a href="', $scripturl, '?action=helpadmin;help=', !empty($selected_tab['help']) ? $selected_tab['help'] : $tab_context['help'], '" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'], '"></span></a>'; |
240 | + } |
|
229 | 241 | |
230 | 242 | echo $tab_context['title']; |
231 | - } |
|
232 | - else |
|
243 | + } else |
|
233 | 244 | { |
234 | 245 | echo ' |
235 | 246 | ', $tab_context['title']; |
@@ -242,11 +253,12 @@ discard block |
||
242 | 253 | } |
243 | 254 | |
244 | 255 | // Shall we use the tabs? Yes, it's the only known way! |
245 | - if (!empty($selected_tab['description']) || !empty($tab_context['description'])) |
|
246 | - echo ' |
|
256 | + if (!empty($selected_tab['description']) || !empty($tab_context['description'])) { |
|
257 | + echo ' |
|
247 | 258 | <p class="information"> |
248 | 259 | ', !empty($selected_tab['description']) ? $selected_tab['description'] : $tab_context['description'], ' |
249 | 260 | </p>'; |
261 | + } |
|
250 | 262 | |
251 | 263 | // Print out all the items in this tab (if any). |
252 | 264 | if (!empty($context['tabs'])) |
@@ -258,8 +270,9 @@ discard block |
||
258 | 270 | |
259 | 271 | foreach ($tab_context['tabs'] as $sa => $tab) |
260 | 272 | { |
261 | - if (!empty($tab['disabled'])) |
|
262 | - continue; |
|
273 | + if (!empty($tab['disabled'])) { |
|
274 | + continue; |
|
275 | + } |
|
263 | 276 | |
264 | 277 | if (!empty($tab['is_selected'])) |
265 | 278 | { |
@@ -267,12 +280,12 @@ discard block |
||
267 | 280 | <li> |
268 | 281 | <a class="active" href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], isset($tab['add_params']) ? $tab['add_params'] : '', '">', $tab['label'], '</a> |
269 | 282 | </li>'; |
270 | - } |
|
271 | - else |
|
272 | - echo ' |
|
283 | + } else { |
|
284 | + echo ' |
|
273 | 285 | <li> |
274 | 286 | <a href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], isset($tab['add_params']) ? $tab['add_params'] : '', '">', $tab['label'], '</a> |
275 | 287 | </li>'; |
288 | + } |
|
276 | 289 | } |
277 | 290 | |
278 | 291 | // The end of tabs |
@@ -20,13 +20,12 @@ |
||
20 | 20 | // We completed some tasks? |
21 | 21 | if (!empty($context['tasks_were_run'])) |
22 | 22 | { |
23 | - if (empty($context['scheduled_errors'])) |
|
24 | - echo ' |
|
23 | + if (empty($context['scheduled_errors'])) { |
|
24 | + echo ' |
|
25 | 25 | <div class="infobox"> |
26 | 26 | ', $txt['scheduled_tasks_were_run'], ' |
27 | 27 | </div>'; |
28 | - |
|
29 | - else |
|
28 | + } else |
|
30 | 29 | { |
31 | 30 | echo ' |
32 | 31 | <div class="errorbox" id="errors"> |
@@ -25,18 +25,20 @@ discard block |
||
25 | 25 | </div> |
26 | 26 | <div class="windowbg2 noup">'; |
27 | 27 | |
28 | - if (!empty($context['move_board'])) |
|
29 | - echo ' |
|
28 | + if (!empty($context['move_board'])) { |
|
29 | + echo ' |
|
30 | 30 | <div class="noticebox"> |
31 | 31 | ', $context['move_title'], ' [<a href="', $scripturl, '?action=admin;area=manageboards">', $txt['mboards_cancel_moving'], '</a>]', ' |
32 | 32 | </div>'; |
33 | + } |
|
33 | 34 | |
34 | 35 | // No categories so show a label. |
35 | - if (empty($context['categories'])) |
|
36 | - echo ' |
|
36 | + if (empty($context['categories'])) { |
|
37 | + echo ' |
|
37 | 38 | <div class="windowbg centertext"> |
38 | 39 | ', $txt['mboards_no_cats'], ' |
39 | 40 | </div>'; |
41 | + } |
|
40 | 42 | |
41 | 43 | // Loop through every category, listing the boards in each as we go. |
42 | 44 | foreach ($context['categories'] as $category) |
@@ -54,9 +56,10 @@ discard block |
||
54 | 56 | <form action="', $scripturl, '?action=admin;area=manageboards;sa=newboard;cat=', $category['id'], '" method="post" accept-charset="', $context['character_set'], '"> |
55 | 57 | <ul id="category_', $category['id'], '" class="nolist">'; |
56 | 58 | |
57 | - if (!empty($category['move_link'])) |
|
58 | - echo ' |
|
59 | + if (!empty($category['move_link'])) { |
|
60 | + echo ' |
|
59 | 61 | <li><a href="', $category['move_link']['href'], '" title="', $category['move_link']['label'], '"><span class="generic_icons select_above"></span></a></li>'; |
62 | + } |
|
60 | 63 | |
61 | 64 | $recycle_board = '<a href="' . $scripturl . '?action=admin;area=manageboards;sa=settings"> <img src="' . $settings['images_url'] . '/post/recycled.png" alt="' . $txt['recycle_board'] . '" title="' . $txt['recycle_board'] . '"></a>'; |
62 | 65 | $redirect_board = '<img src="' . $settings['images_url'] . '/new_redirect.png" alt="' . $txt['redirect_board_desc'] . '" title="' . $txt['redirect_board_desc'] . '">'; |
@@ -81,9 +84,10 @@ discard block |
||
81 | 84 | echo ' |
82 | 85 | <li class="windowbg" style="padding-', $context['right_to_left'] ? 'right' : 'left', ': ', 5 + 30 * $board['move_links'][0]['child_level'], 'px;">'; |
83 | 86 | |
84 | - foreach ($board['move_links'] as $link) |
|
85 | - echo ' |
|
87 | + foreach ($board['move_links'] as $link) { |
|
88 | + echo ' |
|
86 | 89 | <a href="', $link['href'], '" class="move_links" title="', $link['label'], '"><span class="generic_icons select_', $link['class'], '" title="', $link['label'], '"></span></a>'; |
90 | + } |
|
87 | 91 | |
88 | 92 | echo ' |
89 | 93 | </li>'; |
@@ -132,9 +136,10 @@ discard block |
||
132 | 136 | <select name="cat_order">'; |
133 | 137 | |
134 | 138 | // Print every existing category into a select box. |
135 | - foreach ($context['category_order'] as $order) |
|
136 | - echo ' |
|
139 | + foreach ($context['category_order'] as $order) { |
|
140 | + echo ' |
|
137 | 141 | <option', $order['selected'] ? ' selected' : '', ' value="', $order['id'], '">', $order['name'], '</option>'; |
142 | + } |
|
138 | 143 | echo ' |
139 | 144 | </select> |
140 | 145 | </dd>'; |
@@ -169,14 +174,15 @@ discard block |
||
169 | 174 | { |
170 | 175 | foreach ($context['custom_category_settings'] as $catset_id => $catset) |
171 | 176 | { |
172 | - if (!empty($catset['dt']) && !empty($catset['dd'])) |
|
173 | - echo ' |
|
177 | + if (!empty($catset['dt']) && !empty($catset['dd'])) { |
|
178 | + echo ' |
|
174 | 179 | <dt class="clear', !is_numeric($catset_id) ? ' catset_' . $catset_id : '', '"> |
175 | 180 | ', $catset['dt'], ' |
176 | 181 | </dt> |
177 | 182 | <dd', !is_numeric($catset_id) ? ' class="catset_' . $catset_id . '"' : '', '> |
178 | 183 | ', $catset['dd'], ' |
179 | 184 | </dd>'; |
185 | + } |
|
180 | 186 | } |
181 | 187 | } |
182 | 188 | |
@@ -184,21 +190,23 @@ discard block |
||
184 | 190 | echo ' |
185 | 191 | </dl>'; |
186 | 192 | |
187 | - if (isset($context['category']['is_new'])) |
|
188 | - echo ' |
|
193 | + if (isset($context['category']['is_new'])) { |
|
194 | + echo ' |
|
189 | 195 | <input type="submit" name="add" value="', $txt['mboards_add_cat_button'], '" onclick="return !isEmptyText(this.form.cat_name);" tabindex="', $context['tabindex']++, '" class="button">'; |
190 | - else |
|
191 | - echo ' |
|
196 | + } else { |
|
197 | + echo ' |
|
192 | 198 | <input type="submit" name="edit" value="', $txt['modify'], '" onclick="return !isEmptyText(this.form.cat_name);" tabindex="', $context['tabindex']++, '" class="button"> |
193 | 199 | <input type="submit" name="delete" value="', $txt['mboards_delete_cat'], '" data-confirm="', $txt['catConfirm'], '" class="button you_sure">'; |
200 | + } |
|
194 | 201 | echo ' |
195 | 202 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
196 | 203 | <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">'; |
197 | 204 | |
198 | 205 | // If this category is empty we don't bother with the next confirmation screen. |
199 | - if ($context['category']['is_empty']) |
|
200 | - echo ' |
|
206 | + if ($context['category']['is_empty']) { |
|
207 | + echo ' |
|
201 | 208 | <input type="hidden" name="empty" value="1">'; |
209 | + } |
|
202 | 210 | |
203 | 211 | echo ' |
204 | 212 | </div><!-- .windowbg2 --> |
@@ -225,9 +233,10 @@ discard block |
||
225 | 233 | <p>', $txt['mboards_delete_cat_contains'], ':</p> |
226 | 234 | <ul>'; |
227 | 235 | |
228 | - foreach ($context['category']['children'] as $child) |
|
229 | - echo ' |
|
236 | + foreach ($context['category']['children'] as $child) { |
|
237 | + echo ' |
|
230 | 238 | <li>', $child, '</li>'; |
239 | + } |
|
231 | 240 | |
232 | 241 | echo ' |
233 | 242 | </ul> |
@@ -241,10 +250,11 @@ discard block |
||
241 | 250 | <label for="delete_action1"><input type="radio" id="delete_action1" name="delete_action" value="1"', count($context['category_order']) == 1 ? ' disabled' : '', '>', $txt['mboards_delete_option2'], '</label>: |
242 | 251 | <select name="cat_to"', count($context['category_order']) == 1 ? ' disabled' : '', '>'; |
243 | 252 | |
244 | - foreach ($context['category_order'] as $cat) |
|
245 | - if ($cat['id'] != 0) |
|
253 | + foreach ($context['category_order'] as $cat) { |
|
254 | + if ($cat['id'] != 0) |
|
246 | 255 | echo ' |
247 | 256 | <option value="', $cat['id'], '">', $cat['true_name'], '</option>'; |
257 | + } |
|
248 | 258 | |
249 | 259 | echo ' |
250 | 260 | </select> |
@@ -287,9 +297,10 @@ discard block |
||
287 | 297 | <dd> |
288 | 298 | <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 == \'\';}">'; |
289 | 299 | |
290 | - foreach ($context['categories'] as $category) |
|
291 | - echo ' |
|
300 | + foreach ($context['categories'] as $category) { |
|
301 | + echo ' |
|
292 | 302 | <option', $category['selected'] ? ' selected' : '', ' value="', $category['id'], '">', $category['name'], '</option>'; |
303 | + } |
|
293 | 304 | echo ' |
294 | 305 | </select> |
295 | 306 | </dd>'; |
@@ -317,9 +328,10 @@ discard block |
||
317 | 328 | <select id="board_order" name="board_order"', !isset($context['board']['is_new']) ? ' disabled' : '', '> |
318 | 329 | ', !isset($context['board']['is_new']) ? '<option value="">(' . $txt['mboards_unchanged'] . ')</option>' : ''; |
319 | 330 | |
320 | - foreach ($context['board_order'] as $order) |
|
321 | - echo ' |
|
331 | + foreach ($context['board_order'] as $order) { |
|
332 | + echo ' |
|
322 | 333 | <option', $order['selected'] ? ' selected' : '', ' value="', $order['id'], '">', $order['name'], '</option>'; |
334 | + } |
|
323 | 335 | echo ' |
324 | 336 | </select> |
325 | 337 | </dd>'; |
@@ -348,13 +360,15 @@ discard block |
||
348 | 360 | <dd> |
349 | 361 | <select name="profile">'; |
350 | 362 | |
351 | - if (isset($context['board']['is_new'])) |
|
352 | - echo ' |
|
363 | + if (isset($context['board']['is_new'])) { |
|
364 | + echo ' |
|
353 | 365 | <option value="-1">[', $txt['permission_profile_inherit'], ']</option>'; |
366 | + } |
|
354 | 367 | |
355 | - foreach ($context['profiles'] as $id => $profile) |
|
356 | - echo ' |
|
368 | + foreach ($context['profiles'] as $id => $profile) { |
|
369 | + echo ' |
|
357 | 370 | <option value="', $id, '"', $id == $context['board']['profile'] ? ' selected' : '', '>', $profile['name'], '</option>'; |
371 | + } |
|
358 | 372 | |
359 | 373 | echo ' |
360 | 374 | </select> |
@@ -367,8 +381,8 @@ discard block |
||
367 | 381 | </dt> |
368 | 382 | <dd>'; |
369 | 383 | |
370 | - if (!empty($modSettings['deny_boards_access'])) |
|
371 | - echo ' |
|
384 | + if (!empty($modSettings['deny_boards_access'])) { |
|
385 | + echo ' |
|
372 | 386 | <table> |
373 | 387 | <tr> |
374 | 388 | <td></td> |
@@ -376,10 +390,11 @@ discard block |
||
376 | 390 | <th>', $txt['permissions_option_off'], '</th> |
377 | 391 | <th>', $txt['permissions_option_deny'], '</th> |
378 | 392 | </tr>'; |
393 | + } |
|
379 | 394 | |
380 | 395 | // List all the membergroups so the user can choose who may access this board. |
381 | - foreach ($context['groups'] as $group) |
|
382 | - if (empty($modSettings['deny_boards_access'])) |
|
396 | + foreach ($context['groups'] as $group) { |
|
397 | + if (empty($modSettings['deny_boards_access'])) |
|
383 | 398 | echo ' |
384 | 399 | <label for="groups_', $group['id'], '"> |
385 | 400 | <input type="checkbox" name="groups[', $group['id'], ']" value="allow" id="groups_', $group['id'], '"', in_array($group['id'], $context['board_managers']) ? ' checked disabled' : ($group['allow'] ? ' checked' : ''), '> |
@@ -387,8 +402,9 @@ discard block |
||
387 | 402 | ', $group['name'], ' |
388 | 403 | </span> |
389 | 404 | </label><br>'; |
390 | - else |
|
391 | - echo ' |
|
405 | + } |
|
406 | + else { |
|
407 | + echo ' |
|
392 | 408 | <tr> |
393 | 409 | <td> |
394 | 410 | <label for="groups_', $group['id'], '_a"> |
@@ -408,16 +424,17 @@ discard block |
||
408 | 424 | </td> |
409 | 425 | <td></td> |
410 | 426 | </tr>'; |
427 | + } |
|
411 | 428 | |
412 | - if (empty($modSettings['deny_boards_access'])) |
|
413 | - echo ' |
|
429 | + if (empty($modSettings['deny_boards_access'])) { |
|
430 | + echo ' |
|
414 | 431 | <span class="select_all_box"> |
415 | 432 | <em>', $txt['check_all'], '</em> <input type="checkbox" onclick="invertAll(this, this.form, \'groups[\');"> |
416 | 433 | </span> |
417 | 434 | <br><br> |
418 | 435 | </dd>'; |
419 | - else |
|
420 | - echo ' |
|
436 | + } else { |
|
437 | + echo ' |
|
421 | 438 | <tr class="select_all_box"> |
422 | 439 | <td> |
423 | 440 | </td> |
@@ -436,6 +453,7 @@ discard block |
||
436 | 453 | </tr> |
437 | 454 | </table> |
438 | 455 | </dd>'; |
456 | + } |
|
439 | 457 | |
440 | 458 | // Options to choose moderators, specify as announcement board and choose whether to count posts here. |
441 | 459 | echo ' |
@@ -490,8 +508,8 @@ discard block |
||
490 | 508 | </dl> |
491 | 509 | </div>'; |
492 | 510 | |
493 | - if ($context['board']['redirect']) |
|
494 | - echo ' |
|
511 | + if ($context['board']['redirect']) { |
|
512 | + echo ' |
|
495 | 513 | <div id="reset_redirect_div"> |
496 | 514 | <dl class="settings"> |
497 | 515 | <dt> |
@@ -504,6 +522,7 @@ discard block |
||
504 | 522 | </dd> |
505 | 523 | </dl> |
506 | 524 | </div>'; |
525 | + } |
|
507 | 526 | } |
508 | 527 | |
509 | 528 | echo ' |
@@ -531,9 +550,10 @@ discard block |
||
531 | 550 | <select name="boardtheme" id="boardtheme" onchange="refreshOptions();"> |
532 | 551 | <option value="0"', $context['board']['theme'] == 0 ? ' selected' : '', '>', $txt['mboards_theme_default'], '</option>'; |
533 | 552 | |
534 | - foreach ($context['themes'] as $theme) |
|
535 | - echo ' |
|
553 | + foreach ($context['themes'] as $theme) { |
|
554 | + echo ' |
|
536 | 555 | <option value="', $theme['id'], '"', $context['board']['theme'] == $theme['id'] ? ' selected' : '', '>', $theme['name'], '</option>'; |
556 | + } |
|
537 | 557 | |
538 | 558 | echo ' |
539 | 559 | </select> |
@@ -562,14 +582,15 @@ discard block |
||
562 | 582 | |
563 | 583 | foreach ($context['custom_board_settings'] as $cbs_id => $cbs) |
564 | 584 | { |
565 | - if (!empty($cbs['dt']) && !empty($cbs['dd'])) |
|
566 | - echo ' |
|
585 | + if (!empty($cbs['dt']) && !empty($cbs['dd'])) { |
|
586 | + echo ' |
|
567 | 587 | <dt class="clear', !is_numeric($cbs_id) ? ' cbs_' . $cbs_id : '', '"> |
568 | 588 | ', $cbs['dt'], ' |
569 | 589 | </dt> |
570 | 590 | <dd', !is_numeric($cbs_id) ? ' class="cbs_' . $cbs_id . '"' : '', '> |
571 | 591 | ', $cbs['dd'], ' |
572 | 592 | </dd>'; |
593 | + } |
|
573 | 594 | } |
574 | 595 | |
575 | 596 | echo ' |
@@ -577,9 +598,10 @@ discard block |
||
577 | 598 | </div>'; |
578 | 599 | } |
579 | 600 | |
580 | - if (!empty($context['board']['is_recycle'])) |
|
581 | - echo ' |
|
601 | + if (!empty($context['board']['is_recycle'])) { |
|
602 | + echo ' |
|
582 | 603 | <div class="noticebox">', $txt['mboards_recycle_disabled_delete'], '</div>'; |
604 | + } |
|
583 | 605 | |
584 | 606 | echo ' |
585 | 607 | <input type="hidden" name="rid" value="', $context['redirect_location'], '"> |
@@ -587,21 +609,24 @@ discard block |
||
587 | 609 | <input type="hidden" name="', $context['admin-be-' . $context['board']['id'] . '_token_var'], '" value="', $context['admin-be-' . $context['board']['id'] . '_token'], '">'; |
588 | 610 | |
589 | 611 | // If this board has no children don't bother with the next confirmation screen. |
590 | - if ($context['board']['no_children']) |
|
591 | - echo ' |
|
612 | + if ($context['board']['no_children']) { |
|
613 | + echo ' |
|
592 | 614 | <input type="hidden" name="no_children" value="1">'; |
615 | + } |
|
593 | 616 | |
594 | - if (isset($context['board']['is_new'])) |
|
595 | - echo ' |
|
617 | + if (isset($context['board']['is_new'])) { |
|
618 | + echo ' |
|
596 | 619 | <input type="hidden" name="cur_cat" value="', $context['board']['category'], '"> |
597 | 620 | <input type="submit" name="add" value="', $txt['mboards_new_board'], '" onclick="return !isEmptyText(this.form.board_name);" class="button">'; |
598 | - else |
|
599 | - echo ' |
|
621 | + } else { |
|
622 | + echo ' |
|
600 | 623 | <input type="submit" name="edit" value="', $txt['modify'], '" onclick="return !isEmptyText(this.form.board_name);" class="button">'; |
624 | + } |
|
601 | 625 | |
602 | - if (!isset($context['board']['is_new']) && empty($context['board']['is_recycle'])) |
|
603 | - echo ' |
|
626 | + if (!isset($context['board']['is_new']) && empty($context['board']['is_recycle'])) { |
|
627 | + echo ' |
|
604 | 628 | <input type="submit" name="delete" value="', $txt['mboards_delete_board'], '" data-confirm="', $txt['boardConfirm'], '" class="button you_sure">'; |
629 | + } |
|
605 | 630 | echo ' |
606 | 631 | </div><!-- .windowbg2 --> |
607 | 632 | </form> |
@@ -622,12 +647,13 @@ discard block |
||
622 | 647 | sItemListContainerId: \'moderator_container\', |
623 | 648 | aListItems: ['; |
624 | 649 | |
625 | - foreach ($context['board']['moderators'] as $id_member => $member_name) |
|
626 | - echo ' |
|
650 | + foreach ($context['board']['moderators'] as $id_member => $member_name) { |
|
651 | + echo ' |
|
627 | 652 | { |
628 | 653 | sItemId: ', JavaScriptEscape($id_member), ', |
629 | 654 | sItemName: ', JavaScriptEscape($member_name), ' |
630 | 655 | }', $id_member == $context['board']['last_moderator_id'] ? '' : ','; |
656 | + } |
|
631 | 657 | |
632 | 658 | echo ' |
633 | 659 | ] |
@@ -647,12 +673,13 @@ discard block |
||
647 | 673 | sItemListContainerId: \'moderator_group_container\', |
648 | 674 | aListItems: ['; |
649 | 675 | |
650 | - foreach ($context['board']['moderator_groups'] as $id_group => $group_name) |
|
651 | - echo ' |
|
676 | + foreach ($context['board']['moderator_groups'] as $id_group => $group_name) { |
|
677 | + echo ' |
|
652 | 678 | { |
653 | 679 | sItemId: ', JavaScriptEscape($id_group), ', |
654 | 680 | sItemName: ', JavaScriptEscape($group_name), ' |
655 | 681 | }', $id_group == $context['board']['last_moderator_group_id'] ? '' : ','; |
682 | + } |
|
656 | 683 | |
657 | 684 | echo ' |
658 | 685 | ] |
@@ -678,17 +705,19 @@ discard block |
||
678 | 705 | echo ' |
679 | 706 | document.getElementById("redirect_address_div").style.display = redirectEnabled ? "" : "none";'; |
680 | 707 | |
681 | - if ($context['board']['redirect']) |
|
682 | - echo ' |
|
708 | + if ($context['board']['redirect']) { |
|
709 | + echo ' |
|
683 | 710 | document.getElementById("reset_redirect_div").style.display = redirectEnabled ? "" : "none";'; |
711 | + } |
|
684 | 712 | } |
685 | 713 | |
686 | 714 | // Include any JavaScript added by mods using the 'integrate_edit_board' hook. |
687 | 715 | if (!empty($context['custom_refreshOptions']) && is_array($context['custom_refreshOptions'])) |
688 | 716 | { |
689 | - foreach ($context['custom_refreshOptions'] as $refreshOption) |
|
690 | - echo ' |
|
717 | + foreach ($context['custom_refreshOptions'] as $refreshOption) { |
|
718 | + echo ' |
|
691 | 719 | ', $refreshOption; |
720 | + } |
|
692 | 721 | } |
693 | 722 | |
694 | 723 | echo ' |
@@ -717,9 +746,10 @@ discard block |
||
717 | 746 | <p>', $txt['mboards_delete_board_contains'], '</p> |
718 | 747 | <ul>'; |
719 | 748 | |
720 | - foreach ($context['children'] as $child) |
|
721 | - echo ' |
|
749 | + foreach ($context['children'] as $child) { |
|
750 | + echo ' |
|
722 | 751 | <li>', $child['node']['name'], '</li>'; |
752 | + } |
|
723 | 753 | |
724 | 754 | echo ' |
725 | 755 | </ul> |
@@ -733,10 +763,11 @@ discard block |
||
733 | 763 | <label for="delete_action1"><input type="radio" id="delete_action1" name="delete_action" value="1"', empty($context['can_move_children']) ? ' disabled' : '', '>', $txt['mboards_delete_board_option2'], '</label>: |
734 | 764 | <select name="board_to"', empty($context['can_move_children']) ? ' disabled' : '', '>'; |
735 | 765 | |
736 | - foreach ($context['board_order'] as $board) |
|
737 | - if ($board['id'] != $context['board']['id'] && empty($board['is_child'])) |
|
766 | + foreach ($context['board_order'] as $board) { |
|
767 | + if ($board['id'] != $context['board']['id'] && empty($board['is_child'])) |
|
738 | 768 | echo ' |
739 | 769 | <option value="', $board['id'], '">', $board['name'], '</option>'; |
770 | + } |
|
740 | 771 | |
741 | 772 | echo ' |
742 | 773 | </select> |
@@ -19,26 +19,28 @@ discard block |
||
19 | 19 | global $context, $settings, $scripturl, $txt, $modSettings; |
20 | 20 | |
21 | 21 | // Not allowed to edit? |
22 | - if (!$context['can_modify']) |
|
23 | - echo ' |
|
22 | + if (!$context['can_modify']) { |
|
23 | + echo ' |
|
24 | 24 | <div class="errorbox"> |
25 | 25 | ', sprintf($txt['permission_cannot_edit'], $scripturl . '?action=admin;area=permissions;sa=profiles'), ' |
26 | 26 | </div>'; |
27 | + } |
|
27 | 28 | |
28 | 29 | echo ' |
29 | 30 | <div id="admin_form_wrapper"> |
30 | 31 | <form action="', $scripturl, '?action=admin;area=permissions;sa=quick" method="post" accept-charset="', $context['character_set'], '" name="permissionForm" id="permissionForm">'; |
31 | 32 | |
32 | - if (!empty($context['profile'])) |
|
33 | - echo ' |
|
33 | + if (!empty($context['profile'])) { |
|
34 | + echo ' |
|
34 | 35 | <div class="cat_bar"> |
35 | 36 | <h3 class="catbg">', $txt['permissions_for_profile'], ': "', $context['profile']['name'], '"</h3> |
36 | 37 | </div>'; |
37 | - else |
|
38 | - echo ' |
|
38 | + } else { |
|
39 | + echo ' |
|
39 | 40 | <div class="cat_bar"> |
40 | 41 | <h3 class="catbg">', $txt['permissions_title'], '</h3> |
41 | 42 | </div>'; |
43 | + } |
|
42 | 44 | |
43 | 45 | echo ' |
44 | 46 | <table class="table_grid"> |
@@ -47,13 +49,14 @@ discard block |
||
47 | 49 | <th>', $txt['membergroups_name'], '</th> |
48 | 50 | <th class="small_table">', $txt['membergroups_members_top'], '</th>'; |
49 | 51 | |
50 | - if (empty($modSettings['permission_enable_deny'])) |
|
51 | - echo ' |
|
52 | + if (empty($modSettings['permission_enable_deny'])) { |
|
53 | + echo ' |
|
52 | 54 | <th class="small_table">', $txt['membergroups_permissions'], '</th>'; |
53 | - else |
|
54 | - echo ' |
|
55 | + } else { |
|
56 | + echo ' |
|
55 | 57 | <th class="small_table">', $txt['permissions_allowed'], '</th> |
56 | 58 | <th class="small_table">', $txt['permissions_denied'], '</th>'; |
59 | + } |
|
57 | 60 | |
58 | 61 | echo ' |
59 | 62 | <th class="small_table">', $context['can_modify'] ? $txt['permissions_modify'] : $txt['permissions_view'], '</th> |
@@ -71,26 +74,28 @@ discard block |
||
71 | 74 | <td> |
72 | 75 | ', !empty($group['help']) ? ' <a class="help" href="' . $scripturl . '?action=helpadmin;help=' . $group['help'] . '" onclick="return reqOverlayDiv(this.href);"><span class="generic_icons help" title="' . $txt['help'] . '"></span></a>' : '<img class="icon" src="' . $settings['images_url'] . '/blank.png" alt="' . $txt['help'] . '">', ' <span>', $group['name'], '</span>'; |
73 | 76 | |
74 | - if (!empty($group['children'])) |
|
75 | - echo ' |
|
77 | + if (!empty($group['children'])) { |
|
78 | + echo ' |
|
76 | 79 | <br> |
77 | 80 | <span class="smalltext">', $txt['permissions_includes_inherited'], ': "', implode('", "', $group['children']), '"</span>'; |
81 | + } |
|
78 | 82 | |
79 | 83 | echo ' |
80 | 84 | </td> |
81 | 85 | <td>', $group['can_search'] ? $group['link'] : $group['num_members'], '</td>'; |
82 | 86 | |
83 | - if (empty($modSettings['permission_enable_deny'])) |
|
84 | - echo ' |
|
87 | + if (empty($modSettings['permission_enable_deny'])) { |
|
88 | + echo ' |
|
85 | 89 | <td>', $group['num_permissions']['allowed'], '</td>'; |
86 | - else |
|
87 | - echo ' |
|
90 | + } else { |
|
91 | + echo ' |
|
88 | 92 | <td ', $group['id'] == 1 ? ' style="font-style: italic;"' : '', '> |
89 | 93 | ', $group['num_permissions']['allowed'], ' |
90 | 94 | </td> |
91 | 95 | <td ', $group['id'] == 1 || $group['id'] == -1 ? ' style="font-style: italic;"' : (!empty($group['num_permissions']['denied']) ? ' class="red"' : ''), '> |
92 | 96 | ', $group['num_permissions']['denied'], ' |
93 | 97 | </td>'; |
98 | + } |
|
94 | 99 | |
95 | 100 | echo ' |
96 | 101 | <td> |
@@ -142,9 +147,10 @@ discard block |
||
142 | 147 | |
143 | 148 | foreach ($context['groups'] as $group) |
144 | 149 | { |
145 | - if ($group['id'] != 1) |
|
146 | - echo ' |
|
150 | + if ($group['id'] != 1) { |
|
151 | + echo ' |
|
147 | 152 | <option value="', $group['id'], '">', $group['name'], '</option>'; |
153 | + } |
|
148 | 154 | } |
149 | 155 | |
150 | 156 | echo ' |
@@ -155,9 +161,10 @@ discard block |
||
155 | 161 | <option value="add">', $txt['permissions_add'], '...</option> |
156 | 162 | <option value="clear">', $txt['permissions_remove'], '...</option>'; |
157 | 163 | |
158 | - if (!empty($modSettings['permission_enable_deny'])) |
|
159 | - echo ' |
|
164 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
165 | + echo ' |
|
160 | 166 | <option value="deny">', $txt['permissions_deny'], '...</option>'; |
167 | + } |
|
161 | 168 | |
162 | 169 | echo ' |
163 | 170 | </select> |
@@ -168,31 +175,35 @@ discard block |
||
168 | 175 | |
169 | 176 | foreach ($context['permissions'] as $permissionType) |
170 | 177 | { |
171 | - if ($permissionType['id'] == 'membergroup' && !empty($context['profile'])) |
|
172 | - continue; |
|
178 | + if ($permissionType['id'] == 'membergroup' && !empty($context['profile'])) { |
|
179 | + continue; |
|
180 | + } |
|
173 | 181 | |
174 | 182 | foreach ($permissionType['columns'] as $column) |
175 | 183 | { |
176 | 184 | foreach ($column as $permissionGroup) |
177 | 185 | { |
178 | - if ($permissionGroup['hidden']) |
|
179 | - continue; |
|
186 | + if ($permissionGroup['hidden']) { |
|
187 | + continue; |
|
188 | + } |
|
180 | 189 | |
181 | 190 | echo ' |
182 | 191 | <option value="" disabled>[', $permissionGroup['name'], ']</option>'; |
183 | 192 | |
184 | 193 | foreach ($permissionGroup['permissions'] as $perm) |
185 | 194 | { |
186 | - if ($perm['hidden']) |
|
187 | - continue; |
|
195 | + if ($perm['hidden']) { |
|
196 | + continue; |
|
197 | + } |
|
188 | 198 | |
189 | - if ($perm['has_own_any']) |
|
190 | - echo ' |
|
199 | + if ($perm['has_own_any']) { |
|
200 | + echo ' |
|
191 | 201 | <option value="', $permissionType['id'], '/', $perm['own']['id'], '"> ', $perm['name'], ' (', $perm['own']['name'], ')</option> |
192 | 202 | <option value="', $permissionType['id'], '/', $perm['any']['id'], '"> ', $perm['name'], ' (', $perm['any']['name'], ')</option>'; |
193 | - else |
|
194 | - echo ' |
|
203 | + } else { |
|
204 | + echo ' |
|
195 | 205 | <option value="', $permissionType['id'], '/', $perm['id'], '"> ', $perm['name'], '</option>'; |
206 | + } |
|
196 | 207 | } |
197 | 208 | } |
198 | 209 | } |
@@ -258,9 +269,10 @@ discard block |
||
258 | 269 | } |
259 | 270 | </script>'; |
260 | 271 | |
261 | - if (!empty($context['profile'])) |
|
262 | - echo ' |
|
272 | + if (!empty($context['profile'])) { |
|
273 | + echo ' |
|
263 | 274 | <input type="hidden" name="pid" value="', $context['profile']['id'], '">'; |
275 | + } |
|
264 | 276 | |
265 | 277 | echo ' |
266 | 278 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -305,9 +317,10 @@ discard block |
||
305 | 317 | <h3 class="subbg">', $category['name'], '</h3> |
306 | 318 | </div>'; |
307 | 319 | |
308 | - if (!empty($category['boards'])) |
|
309 | - echo ' |
|
320 | + if (!empty($category['boards'])) { |
|
321 | + echo ' |
|
310 | 322 | <ul class="perm_boards flow_hidden">'; |
323 | + } |
|
311 | 324 | |
312 | 325 | foreach ($category['boards'] as $board) |
313 | 326 | { |
@@ -323,33 +336,36 @@ discard block |
||
323 | 336 | echo ' |
324 | 337 | <select name="boardprofile[', $board['id'], ']">'; |
325 | 338 | |
326 | - foreach ($context['profiles'] as $id => $profile) |
|
327 | - echo ' |
|
339 | + foreach ($context['profiles'] as $id => $profile) { |
|
340 | + echo ' |
|
328 | 341 | <option value="', $id, '"', $id == $board['profile'] ? ' selected' : '', '>', $profile['name'], '</option>'; |
342 | + } |
|
329 | 343 | |
330 | 344 | echo ' |
331 | 345 | </select>'; |
332 | - } |
|
333 | - else |
|
334 | - echo ' |
|
346 | + } else { |
|
347 | + echo ' |
|
335 | 348 | <a href="', $scripturl, '?action=admin;area=permissions;sa=index;pid=', $board['profile'], ';', $context['session_var'], '=', $context['session_id'], '">', $board['profile_name'], '</a>'; |
349 | + } |
|
336 | 350 | |
337 | 351 | echo ' |
338 | 352 | </span> |
339 | 353 | </li>'; |
340 | 354 | } |
341 | 355 | |
342 | - if (!empty($category['boards'])) |
|
343 | - echo ' |
|
356 | + if (!empty($category['boards'])) { |
|
357 | + echo ' |
|
344 | 358 | </ul>'; |
359 | + } |
|
345 | 360 | } |
346 | 361 | |
347 | - if ($context['edit_all']) |
|
348 | - echo ' |
|
362 | + if ($context['edit_all']) { |
|
363 | + echo ' |
|
349 | 364 | <input type="submit" name="save_changes" value="', $txt['save'], '" class="button">'; |
350 | - else |
|
351 | - echo ' |
|
365 | + } else { |
|
366 | + echo ' |
|
352 | 367 | <a class="button" href="', $scripturl, '?action=admin;area=permissions;sa=board;edit;', $context['session_var'], '=', $context['session_id'], '">', $txt['permissions_board_all'], '</a>'; |
368 | + } |
|
353 | 369 | |
354 | 370 | echo ' |
355 | 371 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -389,12 +405,13 @@ discard block |
||
389 | 405 | <tr class="windowbg"> |
390 | 406 | <td>'; |
391 | 407 | |
392 | - if (!empty($context['show_rename_boxes']) && $profile['can_edit']) |
|
393 | - echo ' |
|
408 | + if (!empty($context['show_rename_boxes']) && $profile['can_edit']) { |
|
409 | + echo ' |
|
394 | 410 | <input type="text" name="rename_profile[', $profile['id'], ']" value="', $profile['name'], '">'; |
395 | - else |
|
396 | - echo ' |
|
411 | + } else { |
|
412 | + echo ' |
|
397 | 413 | <a href="', $scripturl, '?action=admin;area=permissions;sa=index;pid=', $profile['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $profile['name'], '</a>'; |
414 | + } |
|
398 | 415 | |
399 | 416 | echo ' |
400 | 417 | </td> |
@@ -414,9 +431,10 @@ discard block |
||
414 | 431 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
415 | 432 | <input type="hidden" name="', $context['admin-mpp_token_var'], '" value="', $context['admin-mpp_token'], '">'; |
416 | 433 | |
417 | - if ($context['can_edit_something']) |
|
418 | - echo ' |
|
434 | + if ($context['can_edit_something']) { |
|
435 | + echo ' |
|
419 | 436 | <input type="submit" name="rename" value="', empty($context['show_rename_boxes']) ? $txt['permissions_profile_rename'] : $txt['permissions_commit'], '" class="button">'; |
437 | + } |
|
420 | 438 | |
421 | 439 | echo ' |
422 | 440 | <input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" class="button" ', !empty($context['show_rename_boxes']) ? ' style="display:none"' : '', '/> |
@@ -441,9 +459,10 @@ discard block |
||
441 | 459 | <dd> |
442 | 460 | <select name="copy_from">'; |
443 | 461 | |
444 | - foreach ($context['profiles'] as $id => $profile) |
|
445 | - echo ' |
|
462 | + foreach ($context['profiles'] as $id => $profile) { |
|
463 | + echo ' |
|
446 | 464 | <option value="', $id, '">', $profile['name'], '</option>'; |
465 | + } |
|
447 | 466 | |
448 | 467 | echo ' |
449 | 468 | </select> |
@@ -471,8 +490,7 @@ discard block |
||
471 | 490 | <div class="errorbox"> |
472 | 491 | ', sprintf($txt['permission_cannot_edit'], $scripturl . '?action=admin;area=permissions;sa=profiles'), ' |
473 | 492 | </div>'; |
474 | - } |
|
475 | - else |
|
493 | + } else |
|
476 | 494 | { |
477 | 495 | echo ' |
478 | 496 | <script> |
@@ -492,22 +510,24 @@ discard block |
||
492 | 510 | <div id="admincenter"> |
493 | 511 | <form id="permissions" action="', $scripturl, '?action=admin;area=permissions;sa=modify2;group=', $context['group']['id'], ';pid=', $context['profile']['id'], '" method="post" accept-charset="', $context['character_set'], '" name="permissionForm" onsubmit="return warnAboutDeny();">'; |
494 | 512 | |
495 | - if (!empty($modSettings['permission_enable_deny']) && $context['group']['id'] != -1) |
|
496 | - echo ' |
|
513 | + if (!empty($modSettings['permission_enable_deny']) && $context['group']['id'] != -1) { |
|
514 | + echo ' |
|
497 | 515 | <div class="information"> |
498 | 516 | ', $txt['permissions_option_desc'], ' |
499 | 517 | </div>'; |
518 | + } |
|
500 | 519 | |
501 | 520 | echo ' |
502 | 521 | <div class="cat_bar"> |
503 | 522 | <h3 class="catbg">'; |
504 | 523 | |
505 | - if ($context['permission_type'] == 'board') |
|
506 | - echo ' |
|
524 | + if ($context['permission_type'] == 'board') { |
|
525 | + echo ' |
|
507 | 526 | ', $txt['permissions_local_for'], ' "', $context['group']['name'], '" ', $txt['permissions_on'], ' "', $context['profile']['name'], '"'; |
508 | - else |
|
509 | - echo ' |
|
527 | + } else { |
|
528 | + echo ' |
|
510 | 529 | ', $context['permission_type'] == 'membergroup' ? $txt['permissions_general'] : $txt['permissions_board'], ' - "', $context['group']['name'], '"'; |
530 | + } |
|
511 | 531 | echo ' |
512 | 532 | </h3> |
513 | 533 | </div>'; |
@@ -530,15 +550,17 @@ discard block |
||
530 | 550 | template_modify_group_display('board'); |
531 | 551 | } |
532 | 552 | |
533 | - if ($context['profile']['can_modify']) |
|
534 | - echo ' |
|
553 | + if ($context['profile']['can_modify']) { |
|
554 | + echo ' |
|
535 | 555 | <div class="padding"> |
536 | 556 | <input type="submit" value="', $txt['permissions_commit'], '" class="button"> |
537 | 557 | </div>'; |
558 | + } |
|
538 | 559 | |
539 | - foreach ($context['hidden_perms'] as $hidden_perm) |
|
540 | - echo ' |
|
560 | + foreach ($context['hidden_perms'] as $hidden_perm) { |
|
561 | + echo ' |
|
541 | 562 | <input type="hidden" name="perm[', $hidden_perm[0], '][', $hidden_perm[1], ']" value="', $hidden_perm[2], '">'; |
563 | + } |
|
542 | 564 | |
543 | 565 | echo ' |
544 | 566 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -566,17 +588,19 @@ discard block |
||
566 | 588 | |
567 | 589 | foreach ($column as $permissionGroup) |
568 | 590 | { |
569 | - if (empty($permissionGroup['permissions'])) |
|
570 | - continue; |
|
591 | + if (empty($permissionGroup['permissions'])) { |
|
592 | + continue; |
|
593 | + } |
|
571 | 594 | |
572 | 595 | // Are we likely to have something in this group to display or is it all hidden? |
573 | 596 | $has_display_content = false; |
574 | 597 | if (!$permissionGroup['hidden']) |
575 | 598 | { |
576 | 599 | // Before we go any further check we are going to have some data to print otherwise we just have a silly heading. |
577 | - foreach ($permissionGroup['permissions'] as $permission) |
|
578 | - if (!$permission['hidden']) |
|
600 | + foreach ($permissionGroup['permissions'] as $permission) { |
|
601 | + if (!$permission['hidden']) |
|
579 | 602 | $has_display_content = true; |
603 | + } |
|
580 | 604 | |
581 | 605 | if ($has_display_content) |
582 | 606 | { |
@@ -585,10 +609,11 @@ discard block |
||
585 | 609 | <th></th> |
586 | 610 | <th', $context['group']['id'] == -1 ? ' colspan="2"' : '', ' class="smalltext">', $permissionGroup['name'], '</th>'; |
587 | 611 | |
588 | - if ($context['group']['id'] != -1) |
|
589 | - echo ' |
|
612 | + if ($context['group']['id'] != -1) { |
|
613 | + echo ' |
|
590 | 614 | <th>', $txt['permissions_option_own'], '</th> |
591 | 615 | <th>', $txt['permissions_option_any'], '</th>'; |
616 | + } |
|
592 | 617 | |
593 | 618 | echo ' |
594 | 619 | </tr>'; |
@@ -611,17 +636,18 @@ discard block |
||
611 | 636 | // Guests can't do their own thing. |
612 | 637 | if ($context['group']['id'] != -1) |
613 | 638 | { |
614 | - if (empty($modSettings['permission_enable_deny'])) |
|
615 | - echo ' |
|
639 | + if (empty($modSettings['permission_enable_deny'])) { |
|
640 | + echo ' |
|
616 | 641 | <input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['own']['id'], ']"', $permission['own']['select'] == 'on' ? ' checked="checked"' : '', ' value="on" id="', $permission['own']['id'], '_on" ', $disable_field, '/>'; |
617 | - else |
|
642 | + } else |
|
618 | 643 | { |
619 | 644 | echo ' |
620 | 645 | <select name="perm[', $permission_type['id'], '][', $permission['own']['id'], ']" ', $disable_field, '>'; |
621 | 646 | |
622 | - foreach (array('on', 'off', 'deny') as $c) |
|
623 | - echo ' |
|
647 | + foreach (array('on', 'off', 'deny') as $c) { |
|
648 | + echo ' |
|
624 | 649 | <option ', $permission['own']['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>'; |
650 | + } |
|
625 | 651 | echo ' |
626 | 652 | </select>'; |
627 | 653 | } |
@@ -631,39 +657,41 @@ discard block |
||
631 | 657 | <td>'; |
632 | 658 | } |
633 | 659 | |
634 | - if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) |
|
635 | - echo ' |
|
660 | + if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) { |
|
661 | + echo ' |
|
636 | 662 | <input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['any']['id'], ']"', $permission['any']['select'] == 'on' ? ' checked="checked"' : '', ' value="on" ', $disable_field, '/>'; |
637 | - else |
|
663 | + } else |
|
638 | 664 | { |
639 | 665 | echo ' |
640 | 666 | <select name="perm[', $permission_type['id'], '][', $permission['any']['id'], ']" ', $disable_field, '>'; |
641 | 667 | |
642 | - foreach (array('on', 'off', 'deny') as $c) |
|
643 | - echo ' |
|
668 | + foreach (array('on', 'off', 'deny') as $c) { |
|
669 | + echo ' |
|
644 | 670 | <option ', $permission['any']['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>'; |
671 | + } |
|
645 | 672 | echo ' |
646 | 673 | </select>'; |
647 | 674 | } |
648 | - } |
|
649 | - else |
|
675 | + } else |
|
650 | 676 | { |
651 | - if ($context['group']['id'] != -1) |
|
652 | - echo ' |
|
677 | + if ($context['group']['id'] != -1) { |
|
678 | + echo ' |
|
653 | 679 | </td> |
654 | 680 | <td>'; |
681 | + } |
|
655 | 682 | |
656 | - if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) |
|
657 | - echo ' |
|
683 | + if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) { |
|
684 | + echo ' |
|
658 | 685 | <input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['id'], ']"', $permission['select'] == 'on' ? ' checked="checked"' : '', ' value="on" ', $disable_field, '/>'; |
659 | - else |
|
686 | + } else |
|
660 | 687 | { |
661 | 688 | echo ' |
662 | 689 | <select name="perm[', $permission_type['id'], '][', $permission['id'], ']" ', $disable_field, '>'; |
663 | 690 | |
664 | - foreach (array('on', 'off', 'deny') as $c) |
|
665 | - echo ' |
|
691 | + foreach (array('on', 'off', 'deny') as $c) { |
|
692 | + echo ' |
|
666 | 693 | <option ', $permission['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>'; |
694 | + } |
|
667 | 695 | echo ' |
668 | 696 | </select>'; |
669 | 697 | } |
@@ -694,11 +722,11 @@ discard block |
||
694 | 722 | <fieldset id="', $context['current_permission'], '"> |
695 | 723 | <legend><a href="javascript:void(0);" onclick="document.getElementById(\'', $context['current_permission'], '\').style.display = \'none\';document.getElementById(\'', $context['current_permission'], '_groups_link\').style.display = \'block\'; return false;" class="toggle_up"> ', $txt['avatar_select_permission'], '</a></legend>'; |
696 | 724 | |
697 | - if (empty($modSettings['permission_enable_deny'])) |
|
698 | - echo ' |
|
725 | + if (empty($modSettings['permission_enable_deny'])) { |
|
726 | + echo ' |
|
699 | 727 | <ul>'; |
700 | - else |
|
701 | - echo ' |
|
728 | + } else { |
|
729 | + echo ' |
|
702 | 730 | <div class="information">', $txt['permissions_option_desc'], '</div> |
703 | 731 | <dl class="settings"> |
704 | 732 | <dt> |
@@ -708,47 +736,52 @@ discard block |
||
708 | 736 | </dt> |
709 | 737 | <dd> |
710 | 738 | </dd>'; |
739 | + } |
|
711 | 740 | |
712 | 741 | foreach ($context['member_groups'] as $group) |
713 | 742 | { |
714 | - if (!empty($modSettings['permission_enable_deny'])) |
|
715 | - echo ' |
|
743 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
744 | + echo ' |
|
716 | 745 | <dt>'; |
717 | - else |
|
718 | - echo ' |
|
746 | + } else { |
|
747 | + echo ' |
|
719 | 748 | <li>'; |
749 | + } |
|
720 | 750 | |
721 | - if (empty($modSettings['permission_enable_deny'])) |
|
722 | - echo ' |
|
751 | + if (empty($modSettings['permission_enable_deny'])) { |
|
752 | + echo ' |
|
723 | 753 | <input type="checkbox" name="', $context['current_permission'], '[', $group['id'], ']" value="on"', $group['status'] == 'on' ? ' checked' : '', '>'; |
724 | - else |
|
725 | - echo ' |
|
754 | + } else { |
|
755 | + echo ' |
|
726 | 756 | <span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="on"', $group['status'] == 'on' ? ' checked' : '', '></span> |
727 | 757 | <span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="off"', $group['status'] == 'off' ? ' checked' : '', '></span> |
728 | 758 | <span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="deny"', $group['status'] == 'deny' ? ' checked' : '', '></span>'; |
759 | + } |
|
729 | 760 | |
730 | - if (!empty($modSettings['permission_enable_deny'])) |
|
731 | - echo ' |
|
761 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
762 | + echo ' |
|
732 | 763 | </dt> |
733 | 764 | <dd> |
734 | 765 | <span', $group['is_postgroup'] ? ' style="font-style: italic;"' : '', '>', $group['name'], '</span> |
735 | 766 | </dd>'; |
736 | - else |
|
737 | - echo ' |
|
767 | + } else { |
|
768 | + echo ' |
|
738 | 769 | <span', $group['is_postgroup'] ? ' style="font-style: italic;"' : '', '>', $group['name'], '</span> |
739 | 770 | </li>'; |
771 | + } |
|
740 | 772 | } |
741 | 773 | |
742 | - if (empty($modSettings['permission_enable_deny'])) |
|
743 | - echo ' |
|
774 | + if (empty($modSettings['permission_enable_deny'])) { |
|
775 | + echo ' |
|
744 | 776 | <li> |
745 | 777 | <input type="checkbox" onclick="invertAll(this, this.form, \''. $context['current_permission'] . '[\');"> |
746 | 778 | <span>', $txt['check_all'], '</span> |
747 | 779 | </li> |
748 | 780 | </ul>'; |
749 | - else |
|
750 | - echo ' |
|
781 | + } else { |
|
782 | + echo ' |
|
751 | 783 | </dl>'; |
784 | + } |
|
752 | 785 | |
753 | 786 | echo ' |
754 | 787 | </fieldset> |
@@ -788,9 +821,10 @@ discard block |
||
788 | 821 | if (!empty($modSettings['postmod_active'])) |
789 | 822 | { |
790 | 823 | // Got advanced permissions - if so warn! |
791 | - if (!empty($modSettings['permission_enable_deny'])) |
|
792 | - echo ' |
|
824 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
825 | + echo ' |
|
793 | 826 | <div class="information">', $txt['permissions_post_moderation_deny_note'], '</div>'; |
827 | + } |
|
794 | 828 | |
795 | 829 | echo ' |
796 | 830 | <div class="padding"> |
@@ -805,10 +839,11 @@ discard block |
||
805 | 839 | ', $txt['permissions_post_moderation_select'], ': |
806 | 840 | <select name="pid" onchange="document.forms.postmodForm.submit();">'; |
807 | 841 | |
808 | - foreach ($context['profiles'] as $profile) |
|
809 | - if ($profile['can_modify']) |
|
842 | + foreach ($context['profiles'] as $profile) { |
|
843 | + if ($profile['can_modify']) |
|
810 | 844 | echo ' |
811 | 845 | <option value="', $profile['id'], '"', $profile['id'] == $context['current_profile'] ? ' selected' : '', '>', $profile['name'], '</option>'; |
846 | + } |
|
812 | 847 | |
813 | 848 | echo ' |
814 | 849 | </select> |
@@ -829,11 +864,12 @@ discard block |
||
829 | 864 | ', $txt['permissions_post_moderation_replies_any'], ' |
830 | 865 | </th>'; |
831 | 866 | |
832 | - if ($modSettings['attachmentEnable'] == 1) |
|
833 | - echo ' |
|
867 | + if ($modSettings['attachmentEnable'] == 1) { |
|
868 | + echo ' |
|
834 | 869 | <th class="centercol" colspan="3"> |
835 | 870 | ', $txt['permissions_post_moderation_attachments'], ' |
836 | 871 | </th>'; |
872 | + } |
|
837 | 873 | |
838 | 874 | echo ' |
839 | 875 | </tr> |
@@ -851,11 +887,12 @@ discard block |
||
851 | 887 | <th><span class="generic_icons post_moderation_moderate"></span></th> |
852 | 888 | <th><span class="generic_icons post_moderation_deny"></span></th>'; |
853 | 889 | |
854 | - if ($modSettings['attachmentEnable'] == 1) |
|
855 | - echo ' |
|
890 | + if ($modSettings['attachmentEnable'] == 1) { |
|
891 | + echo ' |
|
856 | 892 | <th><span class="generic_icons post_moderation_allow"></span></th> |
857 | 893 | <th><span class="generic_icons post_moderation_moderate"></span></th> |
858 | 894 | <th><span class="generic_icons post_moderation_deny"></span></th>'; |
895 | + } |
|
859 | 896 | |
860 | 897 | echo ' |
861 | 898 | </tr> |
@@ -869,10 +906,11 @@ discard block |
||
869 | 906 | <td class="half_table"> |
870 | 907 | <span ', ($group['color'] ? 'style="color: ' . $group['color'] . '"' : ''), '>', $group['name'], '</span>'; |
871 | 908 | |
872 | - if (!empty($group['children'])) |
|
873 | - echo ' |
|
909 | + if (!empty($group['children'])) { |
|
910 | + echo ' |
|
874 | 911 | <br> |
875 | 912 | <span class="smalltext">', $txt['permissions_includes_inherited'], ': "', implode('", "', $group['children']), '"</span>'; |
913 | + } |
|
876 | 914 | |
877 | 915 | echo ' |
878 | 916 | </td> |
@@ -891,8 +929,7 @@ discard block |
||
891 | 929 | { |
892 | 930 | echo ' |
893 | 931 | <td colspan="3"></td>'; |
894 | - } |
|
895 | - else |
|
932 | + } else |
|
896 | 933 | { |
897 | 934 | echo ' |
898 | 935 | <td class="centercol"> |
@@ -232,7 +232,7 @@ |
||
232 | 232 | // In maintenance mode, only login is allowed and don't show OverlayDiv |
233 | 233 | echo ' |
234 | 234 | <ul class="floatleft welcome"> |
235 | - <li>', sprintf($txt['welcome_guest'], $txt['guest_title'], '', $scripturl. '?action=login', 'return true;'), '</li> |
|
235 | + <li>', sprintf($txt['welcome_guest'], $txt['guest_title'], '', $scripturl . '?action=login', 'return true;'), '</li> |
|
236 | 236 | </ul>'; |
237 | 237 | |
238 | 238 | if (!empty($modSettings['userLanguage']) && !empty($context['languages']) && count($context['languages']) > 1) |
@@ -72,9 +72,10 @@ discard block |
||
72 | 72 | |
73 | 73 | // Allow css/js files to be disabled for this specific theme. |
74 | 74 | // Add the identifier as an array key. IE array('smf_script'); Some external files might not add identifiers, on those cases SMF uses its filename as reference. |
75 | - if (!isset($settings['disable_files'])) |
|
76 | - $settings['disable_files'] = array(); |
|
77 | -} |
|
75 | + if (!isset($settings['disable_files'])) { |
|
76 | + $settings['disable_files'] = array(); |
|
77 | + } |
|
78 | + } |
|
78 | 79 | |
79 | 80 | /** |
80 | 81 | * The main sub template above the content. |
@@ -112,8 +113,9 @@ discard block |
||
112 | 113 | echo ' |
113 | 114 | <meta'; |
114 | 115 | |
115 | - foreach ($meta_tag as $meta_key => $meta_value) |
|
116 | - echo ' ', $meta_key, '="', $meta_value, '"'; |
|
116 | + foreach ($meta_tag as $meta_key => $meta_value) { |
|
117 | + echo ' ', $meta_key, '="', $meta_value, '"'; |
|
118 | + } |
|
117 | 119 | |
118 | 120 | echo '>'; |
119 | 121 | } |
@@ -124,14 +126,16 @@ discard block |
||
124 | 126 | <meta name="theme-color" content="#557EA0">'; |
125 | 127 | |
126 | 128 | // Please don't index these Mr Robot. |
127 | - if (!empty($context['robot_no_index'])) |
|
128 | - echo ' |
|
129 | + if (!empty($context['robot_no_index'])) { |
|
130 | + echo ' |
|
129 | 131 | <meta name="robots" content="noindex">'; |
132 | + } |
|
130 | 133 | |
131 | 134 | // Present a canonical url for search engines to prevent duplicate content in their indices. |
132 | - if (!empty($context['canonical_url'])) |
|
133 | - echo ' |
|
135 | + if (!empty($context['canonical_url'])) { |
|
136 | + echo ' |
|
134 | 137 | <link rel="canonical" href="', $context['canonical_url'], '">'; |
138 | + } |
|
135 | 139 | |
136 | 140 | // Show all the relative links, such as help, search, contents, and the like. |
137 | 141 | echo ' |
@@ -140,10 +144,11 @@ discard block |
||
140 | 144 | <link rel="search" href="' . $scripturl . '?action=search">' : ''); |
141 | 145 | |
142 | 146 | // If RSS feeds are enabled, advertise the presence of one. |
143 | - if (!empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged'])) |
|
144 | - echo ' |
|
147 | + if (!empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged'])) { |
|
148 | + echo ' |
|
145 | 149 | <link rel="alternate" type="application/rss+xml" title="', $context['forum_name_html_safe'], ' - ', $txt['rss'], '" href="', $scripturl, '?action=.xml;type=rss2', !empty($context['current_board']) ? ';board=' . $context['current_board'] : '', '"> |
146 | 150 | <link rel="alternate" type="application/atom+xml" title="', $context['forum_name_html_safe'], ' - ', $txt['atom'], '" href="', $scripturl, '?action=.xml;type=atom', !empty($context['current_board']) ? ';board=' . $context['current_board'] : '', '">'; |
151 | + } |
|
147 | 152 | |
148 | 153 | // If we're viewing a topic, these should be the previous and next topics, respectively. |
149 | 154 | if (!empty($context['links']['next'])) |
@@ -159,9 +164,10 @@ discard block |
||
159 | 164 | } |
160 | 165 | |
161 | 166 | // If we're in a board, or a topic for that matter, the index will be the board's index. |
162 | - if (!empty($context['current_board'])) |
|
163 | - echo ' |
|
167 | + if (!empty($context['current_board'])) { |
|
168 | + echo ' |
|
164 | 169 | <link rel="index" href="', $scripturl, '?board=', $context['current_board'], '.0">'; |
170 | + } |
|
165 | 171 | |
166 | 172 | // Output any remaining HTML headers. (from mods, maybe?) |
167 | 173 | echo $context['html_headers']; |
@@ -193,8 +199,9 @@ discard block |
||
193 | 199 | <ul class="floatleft" id="top_info"> |
194 | 200 | <li> |
195 | 201 | <a href="', $scripturl, '?action=profile"', !empty($context['self_profile']) ? ' class="active"' : '', ' id="profile_menu_top" onclick="return false;">'; |
196 | - if (!empty($context['user']['avatar'])) |
|
197 | - echo $context['user']['avatar']['image']; |
|
202 | + if (!empty($context['user']['avatar'])) { |
|
203 | + echo $context['user']['avatar']['image']; |
|
204 | + } |
|
198 | 205 | |
199 | 206 | echo $context['user']['name'], '</a> |
200 | 207 | <div id="profile_menu" class="top_menu"></div> |
@@ -223,17 +230,18 @@ discard block |
||
223 | 230 | } |
224 | 231 | // Otherwise they're a guest. Ask them to either register or login. |
225 | 232 | else |
226 | - if (empty($maintenance)) |
|
227 | - echo ' |
|
233 | + if (empty($maintenance)) { |
|
234 | + echo ' |
|
228 | 235 | <ul class="floatleft welcome"> |
229 | 236 | <li>', sprintf($txt[$context['can_register'] ? 'welcome_guest_register' : 'welcome_guest'], $txt['guest_title'], $context['forum_name_html_safe'], $scripturl . '?action=login', 'return reqOverlayDiv(this.href, ' . JavaScriptEscape($txt['login']) . ');', $scripturl . '?action=signup'), '</li> |
230 | 237 | </ul>'; |
231 | - else |
|
232 | - // In maintenance mode, only login is allowed and don't show OverlayDiv |
|
238 | + } else { |
|
239 | + // In maintenance mode, only login is allowed and don't show OverlayDiv |
|
233 | 240 | echo ' |
234 | 241 | <ul class="floatleft welcome"> |
235 | 242 | <li>', sprintf($txt['welcome_guest'], $txt['guest_title'], '', $scripturl. '?action=login', 'return true;'), '</li> |
236 | 243 | </ul>'; |
244 | + } |
|
237 | 245 | |
238 | 246 | if (!empty($modSettings['userLanguage']) && !empty($context['languages']) && count($context['languages']) > 1) |
239 | 247 | { |
@@ -241,9 +249,10 @@ discard block |
||
241 | 249 | <form id="languages_form" method="get" class="floatright"> |
242 | 250 | <select id="language_select" name="language" onchange="this.form.submit()">'; |
243 | 251 | |
244 | - foreach ($context['languages'] as $language) |
|
245 | - echo ' |
|
252 | + foreach ($context['languages'] as $language) { |
|
253 | + echo ' |
|
246 | 254 | <option value="', $language['filename'], '"', isset($context['user']['language']) && $context['user']['language'] == $language['filename'] ? ' selected="selected"' : '', '>', str_replace('-utf8', '', $language['name']), '</option>'; |
255 | + } |
|
247 | 256 | |
248 | 257 | echo ' |
249 | 258 | </select> |
@@ -267,31 +276,36 @@ discard block |
||
267 | 276 | <option value="all"', ($selected == 'all' ? ' selected' : ''), '>', $txt['search_entireforum'], ' </option>'; |
268 | 277 | |
269 | 278 | // Can't limit it to a specific topic if we are not in one |
270 | - if (!empty($context['current_topic'])) |
|
271 | - echo ' |
|
279 | + if (!empty($context['current_topic'])) { |
|
280 | + echo ' |
|
272 | 281 | <option value="topic"', ($selected == 'current_topic' ? ' selected' : ''), '>', $txt['search_thistopic'], '</option>'; |
282 | + } |
|
273 | 283 | |
274 | 284 | // Can't limit it to a specific board if we are not in one |
275 | - if (!empty($context['current_board'])) |
|
276 | - echo ' |
|
285 | + if (!empty($context['current_board'])) { |
|
286 | + echo ' |
|
277 | 287 | <option value="board"', ($selected == 'current_board' ? ' selected' : ''), '>', $txt['search_thisbrd'], '</option>'; |
288 | + } |
|
278 | 289 | |
279 | 290 | // Can't search for members if we can't see the memberlist |
280 | - if (!empty($context['allow_memberlist'])) |
|
281 | - echo ' |
|
291 | + if (!empty($context['allow_memberlist'])) { |
|
292 | + echo ' |
|
282 | 293 | <option value="members"', ($selected == 'members' ? ' selected' : ''), '>', $txt['search_members'], ' </option>'; |
294 | + } |
|
283 | 295 | |
284 | 296 | echo ' |
285 | 297 | </select>'; |
286 | 298 | |
287 | 299 | // Search within current topic? |
288 | - if (!empty($context['current_topic'])) |
|
289 | - echo ' |
|
300 | + if (!empty($context['current_topic'])) { |
|
301 | + echo ' |
|
290 | 302 | <input type="hidden" name="sd_topic" value="', $context['current_topic'], '">'; |
303 | + } |
|
291 | 304 | // If we're on a certain board, limit it to this board ;). |
292 | - elseif (!empty($context['current_board'])) |
|
293 | - echo ' |
|
305 | + elseif (!empty($context['current_board'])) { |
|
306 | + echo ' |
|
294 | 307 | <input type="hidden" name="sd_brd" value="', $context['current_board'], '">'; |
308 | + } |
|
295 | 309 | |
296 | 310 | echo ' |
297 | 311 | <input type="submit" name="search2" value="', $txt['search'], '" class="button"> |
@@ -323,12 +337,13 @@ discard block |
||
323 | 337 | </div>'; |
324 | 338 | |
325 | 339 | // Show a random news item? (or you could pick one from news_lines...) |
326 | - if (!empty($settings['enable_news']) && !empty($context['random_news_line'])) |
|
327 | - echo ' |
|
340 | + if (!empty($settings['enable_news']) && !empty($context['random_news_line'])) { |
|
341 | + echo ' |
|
328 | 342 | <div class="news"> |
329 | 343 | <h2>', $txt['news'], ': </h2> |
330 | 344 | <p>', $context['random_news_line'], '</p> |
331 | 345 | </div>'; |
346 | + } |
|
332 | 347 | |
333 | 348 | echo ' |
334 | 349 | <hr class="clear"> |
@@ -389,9 +404,10 @@ discard block |
||
389 | 404 | </ul>'; |
390 | 405 | |
391 | 406 | // Show the load time? |
392 | - if ($context['show_load_time']) |
|
393 | - echo ' |
|
407 | + if ($context['show_load_time']) { |
|
408 | + echo ' |
|
394 | 409 | <p>', sprintf($txt['page_created_full'], $context['load_time'], $context['load_queries']), '</p>'; |
410 | + } |
|
395 | 411 | |
396 | 412 | echo ' |
397 | 413 | </div> |
@@ -422,18 +438,20 @@ discard block |
||
422 | 438 | global $context, $shown_linktree, $scripturl, $txt; |
423 | 439 | |
424 | 440 | // If linktree is empty, just return - also allow an override. |
425 | - if (empty($context['linktree']) || (!empty($context['dont_default_linktree']) && !$force_show)) |
|
426 | - return; |
|
441 | + if (empty($context['linktree']) || (!empty($context['dont_default_linktree']) && !$force_show)) { |
|
442 | + return; |
|
443 | + } |
|
427 | 444 | echo ' |
428 | 445 | <div class="navigate_section"> |
429 | 446 | <ul>'; |
430 | 447 | |
431 | - if ($context['user']['is_logged']) |
|
432 | - echo ' |
|
448 | + if ($context['user']['is_logged']) { |
|
449 | + echo ' |
|
433 | 450 | <li class="unread_links"> |
434 | 451 | <a href="', $scripturl, '?action=unread" title="', $txt['unread_since_visit'], '">', $txt['view_unread_category'], '</a> |
435 | 452 | <a href="', $scripturl, '?action=unreadreplies" title="', $txt['show_unread_replies'], '">', $txt['unread_replies'], '</a> |
436 | 453 | </li>'; |
454 | + } |
|
437 | 455 | |
438 | 456 | // Each tree item has a URL and name. Some may have extra_before and extra_after. |
439 | 457 | foreach ($context['linktree'] as $link_num => $tree) |
@@ -444,25 +462,29 @@ discard block |
||
444 | 462 | // Don't show a separator for the first one. |
445 | 463 | // Better here. Always points to the next level when the linktree breaks to a second line. |
446 | 464 | // Picked a better looking HTML entity, and added support for RTL plus a span for styling. |
447 | - if ($link_num != 0) |
|
448 | - echo ' |
|
465 | + if ($link_num != 0) { |
|
466 | + echo ' |
|
449 | 467 | <span class="dividers">', $context['right_to_left'] ? ' ◄ ' : ' ► ', '</span>'; |
468 | + } |
|
450 | 469 | |
451 | 470 | // Show something before the link? |
452 | - if (isset($tree['extra_before'])) |
|
453 | - echo $tree['extra_before'], ' '; |
|
471 | + if (isset($tree['extra_before'])) { |
|
472 | + echo $tree['extra_before'], ' '; |
|
473 | + } |
|
454 | 474 | |
455 | 475 | // Show the link, including a URL if it should have one. |
456 | - if (isset($tree['url'])) |
|
457 | - echo ' |
|
476 | + if (isset($tree['url'])) { |
|
477 | + echo ' |
|
458 | 478 | <a href="' . $tree['url'] . '"><span>' . $tree['name'] . '</span></a>'; |
459 | - else |
|
460 | - echo ' |
|
479 | + } else { |
|
480 | + echo ' |
|
461 | 481 | <span>' . $tree['name'] . '</span>'; |
482 | + } |
|
462 | 483 | |
463 | 484 | // Show something after the link...? |
464 | - if (isset($tree['extra_after'])) |
|
465 | - echo ' ', $tree['extra_after']; |
|
485 | + if (isset($tree['extra_after'])) { |
|
486 | + echo ' ', $tree['extra_after']; |
|
487 | + } |
|
466 | 488 | |
467 | 489 | echo ' |
468 | 490 | </li>'; |
@@ -513,13 +535,14 @@ discard block |
||
513 | 535 | echo ' |
514 | 536 | <ul>'; |
515 | 537 | |
516 | - foreach ($childbutton['sub_buttons'] as $grandchildbutton) |
|
517 | - echo ' |
|
538 | + foreach ($childbutton['sub_buttons'] as $grandchildbutton) { |
|
539 | + echo ' |
|
518 | 540 | <li> |
519 | 541 | <a href="', $grandchildbutton['href'], '"', isset($grandchildbutton['target']) ? ' target="' . $grandchildbutton['target'] . '"' : '', '> |
520 | 542 | ', $grandchildbutton['title'], ' |
521 | 543 | </a> |
522 | 544 | </li>'; |
545 | + } |
|
523 | 546 | |
524 | 547 | echo ' |
525 | 548 | </ul>'; |
@@ -550,8 +573,9 @@ discard block |
||
550 | 573 | { |
551 | 574 | global $context, $txt; |
552 | 575 | |
553 | - if (!is_array($strip_options)) |
|
554 | - $strip_options = array(); |
|
576 | + if (!is_array($strip_options)) { |
|
577 | + $strip_options = array(); |
|
578 | + } |
|
555 | 579 | |
556 | 580 | // Create the buttons... |
557 | 581 | $buttons = array(); |
@@ -560,8 +584,9 @@ discard block |
||
560 | 584 | // As of 2.1, the 'test' for each button happens while the array is being generated. The extra 'test' check here is deprecated but kept for backward compatibility (update your mods, folks!) |
561 | 585 | if (!isset($value['test']) || !empty($context[$value['test']])) |
562 | 586 | { |
563 | - if (!isset($value['id'])) |
|
564 | - $value['id'] = $key; |
|
587 | + if (!isset($value['id'])) { |
|
588 | + $value['id'] = $key; |
|
589 | + } |
|
565 | 590 | |
566 | 591 | $button = ' |
567 | 592 | <a class="button button_strip_' . $key . (!empty($value['active']) ? ' active' : '') . (isset($value['class']) ? ' ' . $value['class'] : '') . '" ' . (!empty($value['url']) ? 'href="' . $value['url'] . '"' : '') . ' ' . (isset($value['custom']) ? ' ' . $value['custom'] : '') . '>' . $txt[$value['text']] . '</a>'; |
@@ -574,13 +599,15 @@ discard block |
||
574 | 599 | <div class="overview">'; |
575 | 600 | foreach ($value['sub_buttons'] as $element) |
576 | 601 | { |
577 | - if (isset($element['test']) && empty($context[$element['test']])) |
|
578 | - continue; |
|
602 | + if (isset($element['test']) && empty($context[$element['test']])) { |
|
603 | + continue; |
|
604 | + } |
|
579 | 605 | |
580 | 606 | $button .= ' |
581 | 607 | <a href="' . $element['url'] . '"><strong>' . $txt[$element['text']] . '</strong>'; |
582 | - if (isset($txt[$element['text'] . '_desc'])) |
|
583 | - $button .= '<br><span>' . $txt[$element['text'] . '_desc'] . '</span>'; |
|
608 | + if (isset($txt[$element['text'] . '_desc'])) { |
|
609 | + $button .= '<br><span>' . $txt[$element['text'] . '_desc'] . '</span>'; |
|
610 | + } |
|
584 | 611 | $button .= '</a>'; |
585 | 612 | } |
586 | 613 | $button .= ' |
@@ -594,8 +621,9 @@ discard block |
||
594 | 621 | } |
595 | 622 | |
596 | 623 | // No buttons? No button strip either. |
597 | - if (empty($buttons)) |
|
598 | - return; |
|
624 | + if (empty($buttons)) { |
|
625 | + return; |
|
626 | + } |
|
599 | 627 | |
600 | 628 | echo ' |
601 | 629 | <div class="buttonlist', !empty($direction) ? ' float' . $direction : '', '"', (empty($buttons) ? ' style="display: none;"' : ''), (!empty($strip_options['id']) ? ' id="' . $strip_options['id'] . '"' : ''), '> |
@@ -64,20 +64,20 @@ discard block |
||
64 | 64 | <dd> |
65 | 65 | ', $modSettings['smileys_url'], '/'; |
66 | 66 | |
67 | - if ($context['current_set']['id'] == 'default') |
|
68 | - echo '<strong>default</strong><input type="hidden" name="smiley_sets_path" id="smiley_sets_path" value="default">'; |
|
69 | - |
|
70 | - elseif (empty($context['smiley_set_dirs'])) |
|
71 | - echo ' |
|
67 | + if ($context['current_set']['id'] == 'default') { |
|
68 | + echo '<strong>default</strong><input type="hidden" name="smiley_sets_path" id="smiley_sets_path" value="default">'; |
|
69 | + } elseif (empty($context['smiley_set_dirs'])) { |
|
70 | + echo ' |
|
72 | 71 | <input type="text" name="smiley_sets_path" id="smiley_sets_path" value="', $context['current_set']['path'], '"> '; |
73 | - else |
|
72 | + } else |
|
74 | 73 | { |
75 | 74 | echo ' |
76 | 75 | <select name="smiley_sets_path" id="smiley_sets_path">'; |
77 | 76 | |
78 | - foreach ($context['smiley_set_dirs'] as $smiley_set_dir) |
|
79 | - echo ' |
|
77 | + foreach ($context['smiley_set_dirs'] as $smiley_set_dir) { |
|
78 | + echo ' |
|
80 | 79 | <option value="', $smiley_set_dir['id'], '"', $smiley_set_dir['current'] ? ' selected' : '', $smiley_set_dir['selectable'] ? '' : ' disabled', '>', $smiley_set_dir['id'], '</option>'; |
80 | + } |
|
81 | 81 | echo ' |
82 | 82 | </select> '; |
83 | 83 | } |
@@ -92,14 +92,15 @@ discard block |
||
92 | 92 | </dd>'; |
93 | 93 | |
94 | 94 | // If this is a new smiley set they have the option to import smileys already in the directory. |
95 | - if ($context['current_set']['is_new'] && !empty($modSettings['smiley_enable'])) |
|
96 | - echo ' |
|
95 | + if ($context['current_set']['is_new'] && !empty($modSettings['smiley_enable'])) { |
|
96 | + echo ' |
|
97 | 97 | <dt> |
98 | 98 | <strong><label for="smiley_sets_import">', $txt['smiley_set_import_directory'], '</label>: </strong> |
99 | 99 | </dt> |
100 | 100 | <dd> |
101 | 101 | <input type="checkbox" name="smiley_sets_import" id="smiley_sets_import" value="1"> |
102 | 102 | </dd>'; |
103 | + } |
|
103 | 104 | |
104 | 105 | echo ' |
105 | 106 | </dl> |
@@ -133,9 +134,10 @@ discard block |
||
133 | 134 | <dd> |
134 | 135 | <img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $context['current_smiley']['filename'], '" id="preview" alt=""> (', $txt['smiley_preview_using'], ': <select name="set" onchange="updatePreview();">'; |
135 | 136 | |
136 | - foreach ($context['smiley_sets'] as $smiley_set) |
|
137 | - echo ' |
|
137 | + foreach ($context['smiley_sets'] as $smiley_set) { |
|
138 | + echo ' |
|
138 | 139 | <option value="', $smiley_set['path'], '"', $context['selected_set'] == $smiley_set['path'] ? ' selected' : '', '>', $smiley_set['name'], '</option>'; |
140 | + } |
|
139 | 141 | |
140 | 142 | echo ' |
141 | 143 | </select>) |
@@ -151,17 +153,18 @@ discard block |
||
151 | 153 | </dt> |
152 | 154 | <dd>'; |
153 | 155 | |
154 | - if (empty($context['filenames'])) |
|
155 | - echo ' |
|
156 | + if (empty($context['filenames'])) { |
|
157 | + echo ' |
|
156 | 158 | <input type="text" name="smiley_filename" id="smiley_filename" value="', $context['current_smiley']['filename'], '">'; |
157 | - else |
|
159 | + } else |
|
158 | 160 | { |
159 | 161 | echo ' |
160 | 162 | <select name="smiley_filename" id="smiley_filename" onchange="updatePreview();">'; |
161 | 163 | |
162 | - foreach ($context['filenames'] as $filename) |
|
163 | - echo ' |
|
164 | + foreach ($context['filenames'] as $filename) { |
|
165 | + echo ' |
|
164 | 166 | <option value="', $filename['id'], '"', $filename['selected'] ? ' selected' : '', '>', $filename['id'], '</option>'; |
167 | + } |
|
165 | 168 | echo ' |
166 | 169 | </select>'; |
167 | 170 | } |
@@ -230,9 +233,10 @@ discard block |
||
230 | 233 | <dd> |
231 | 234 | ', $txt['smiley_preview_using'], ': <select name="set" onchange="updatePreview();selectMethod(\'existing\');">'; |
232 | 235 | |
233 | - foreach ($context['smiley_sets'] as $smiley_set) |
|
234 | - echo ' |
|
236 | + foreach ($context['smiley_sets'] as $smiley_set) { |
|
237 | + echo ' |
|
235 | 238 | <option value="', $smiley_set['path'], '"', $context['selected_set'] == $smiley_set['path'] ? ' selected' : '', '>', $smiley_set['name'], '</option>'; |
239 | + } |
|
236 | 240 | |
237 | 241 | echo ' |
238 | 242 | </select> |
@@ -242,17 +246,18 @@ discard block |
||
242 | 246 | </dt> |
243 | 247 | <dd>'; |
244 | 248 | |
245 | - if (empty($context['filenames'])) |
|
246 | - echo ' |
|
249 | + if (empty($context['filenames'])) { |
|
250 | + echo ' |
|
247 | 251 | <input type="text" name="smiley_filename" id="smiley_filename" value="', $context['current_smiley']['filename'], '" onchange="selectMethod(\'existing\');">'; |
248 | - else |
|
252 | + } else |
|
249 | 253 | { |
250 | 254 | echo ' |
251 | 255 | <select name="smiley_filename" id="smiley_filename" onchange="updatePreview();selectMethod(\'existing\');">'; |
252 | 256 | |
253 | - foreach ($context['filenames'] as $filename) |
|
254 | - echo ' |
|
257 | + foreach ($context['filenames'] as $filename) { |
|
258 | + echo ' |
|
255 | 259 | <option value="', $filename['id'], '"', $filename['selected'] ? ' selected' : '', '>', $filename['id'], '</option>'; |
260 | + } |
|
256 | 261 | echo ' |
257 | 262 | </select>'; |
258 | 263 | } |
@@ -281,14 +286,15 @@ discard block |
||
281 | 286 | |
282 | 287 | <dl id="uploadMore" style="display: none;" class="settings">'; |
283 | 288 | |
284 | - foreach ($context['smiley_sets'] as $smiley_set) |
|
285 | - echo ' |
|
289 | + foreach ($context['smiley_sets'] as $smiley_set) { |
|
290 | + echo ' |
|
286 | 291 | <dt> |
287 | 292 | ', sprintf($txt['smileys_add_upload_for'], '<strong>' . $smiley_set['name'] . '</strong>'), ': |
288 | 293 | </dt> |
289 | 294 | <dd> |
290 | 295 | <input type="file" name="individual_', $smiley_set['name'], '" onchange="selectMethod(\'upload\');"> |
291 | 296 | </dd>'; |
297 | + } |
|
292 | 298 | echo ' |
293 | 299 | </dl> |
294 | 300 | </div><!-- .windowbg2 --> |
@@ -358,27 +364,30 @@ discard block |
||
358 | 364 | |
359 | 365 | foreach ($location['rows'] as $row) |
360 | 366 | { |
361 | - if (!empty($context['move_smiley'])) |
|
362 | - echo ' |
|
367 | + if (!empty($context['move_smiley'])) { |
|
368 | + echo ' |
|
363 | 369 | <a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';row=', $row[0]['row'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>'; |
370 | + } |
|
364 | 371 | |
365 | 372 | foreach ($row as $smiley) |
366 | 373 | { |
367 | - if (empty($context['move_smiley'])) |
|
368 | - echo ' |
|
374 | + if (empty($context['move_smiley'])) { |
|
375 | + echo ' |
|
369 | 376 | <a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;move=', $smiley['id'], '"><img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" style="padding: 2px; border: 0px solid black;" alt="', $smiley['description'], '"></a>'; |
370 | - else |
|
371 | - echo ' |
|
377 | + } else { |
|
378 | + echo ' |
|
372 | 379 | <img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" style="padding: 2px;', $smiley['selected'] ? ' border: 2px solid red' : '', ';" alt="', $smiley['description'], '"> |
373 | 380 | <a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';after=', $smiley['id'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '" title="', $txt['smileys_move_here'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>'; |
381 | + } |
|
374 | 382 | } |
375 | 383 | |
376 | 384 | echo ' |
377 | 385 | <br>'; |
378 | 386 | } |
379 | - if (!empty($context['move_smiley'])) |
|
380 | - echo ' |
|
387 | + if (!empty($context['move_smiley'])) { |
|
388 | + echo ' |
|
381 | 389 | <a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';row=', $location['last_row'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>'; |
390 | + } |
|
382 | 391 | echo ' |
383 | 392 | </div><!-- .windowbg2 --> |
384 | 393 | <input type="hidden" name="reorder" value="1"> |
@@ -415,14 +424,15 @@ discard block |
||
415 | 424 | <div class="windowbg2"> |
416 | 425 | <dl class="settings">'; |
417 | 426 | |
418 | - if (!$context['new_icon']) |
|
419 | - echo ' |
|
427 | + if (!$context['new_icon']) { |
|
428 | + echo ' |
|
420 | 429 | <dt> |
421 | 430 | <strong>', $txt['smiley_preview'], ': </strong> |
422 | 431 | </dt> |
423 | 432 | <dd> |
424 | 433 | <img src="', $context['icon']['image_url'], '" alt="', $context['icon']['title'], '"> |
425 | 434 | </dd>'; |
435 | + } |
|
426 | 436 | |
427 | 437 | echo ' |
428 | 438 | <dt> |
@@ -449,9 +459,10 @@ discard block |
||
449 | 459 | echo ' |
450 | 460 | <optgroup label="', $category['name'], '">'; |
451 | 461 | |
452 | - foreach ($category['boards'] as $board) |
|
453 | - echo ' |
|
462 | + foreach ($category['boards'] as $board) { |
|
463 | + echo ' |
|
454 | 464 | <option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=>' : '', ' ', $board['name'], '</option>'; |
465 | + } |
|
455 | 466 | echo ' |
456 | 467 | </optgroup>'; |
457 | 468 | } |
@@ -466,19 +477,21 @@ discard block |
||
466 | 477 | <option value="0"', empty($context['icon']['after']) ? ' selected' : '', '>', $txt['icons_location_first_icon'], '</option>'; |
467 | 478 | |
468 | 479 | // Print the list of all the icons it can be put after... |
469 | - foreach ($context['icons'] as $id => $data) |
|
470 | - if (empty($context['icon']['id']) || $id != $context['icon']['id']) |
|
480 | + foreach ($context['icons'] as $id => $data) { |
|
481 | + if (empty($context['icon']['id']) || $id != $context['icon']['id']) |
|
471 | 482 | echo ' |
472 | 483 | <option value="', $id, '"', !empty($context['icon']['after']) && $id == $context['icon']['after'] ? ' selected' : '', '>', $txt['icons_location_after'], ': ', $data['title'], '</option>'; |
484 | + } |
|
473 | 485 | |
474 | 486 | echo ' |
475 | 487 | </select> |
476 | 488 | </dd> |
477 | 489 | </dl>'; |
478 | 490 | |
479 | - if (!$context['new_icon']) |
|
480 | - echo ' |
|
491 | + if (!$context['new_icon']) { |
|
492 | + echo ' |
|
481 | 493 | <input type="hidden" name="icon" value="', $context['icon']['id'], '">'; |
494 | + } |
|
482 | 495 | |
483 | 496 | echo ' |
484 | 497 | <input type="submit" name="icons_save" value="', $txt['smileys_save'], '" class="button"> |
@@ -945,7 +945,7 @@ |
||
945 | 945 | } |
946 | 946 | |
947 | 947 | echo isset($config_var['postinput']) ? ' |
948 | - ' . $config_var['postinput'] : '',' |
|
948 | + ' . $config_var['postinput'] : '', ' |
|
949 | 949 | </dd>'; |
950 | 950 | } |
951 | 951 | } |
@@ -64,9 +64,10 @@ discard block |
||
64 | 64 | <strong>', $txt['administrators'], ':</strong> |
65 | 65 | ', implode(', ', $context['administrators']); |
66 | 66 | // If we have lots of admins... don't show them all. |
67 | - if (!empty($context['more_admins_link'])) |
|
68 | - echo ' |
|
67 | + if (!empty($context['more_admins_link'])) { |
|
68 | + echo ' |
|
69 | 69 | (', $context['more_admins_link'], ')'; |
70 | + } |
|
70 | 71 | |
71 | 72 | echo ' |
72 | 73 | </div><!-- #version_details --> |
@@ -83,17 +84,19 @@ discard block |
||
83 | 84 | foreach ($area['areas'] as $item_id => $item) |
84 | 85 | { |
85 | 86 | // No point showing the 'home' page here, we're already on it! |
86 | - if ($area_id == 'forum' && $item_id == 'index') |
|
87 | - continue; |
|
87 | + if ($area_id == 'forum' && $item_id == 'index') { |
|
88 | + continue; |
|
89 | + } |
|
88 | 90 | |
89 | 91 | $url = isset($item['url']) ? $item['url'] : $scripturl . '?action=admin;area=' . $item_id . (!empty($context[$context['admin_menu_name']]['extra_parameters']) ? $context[$context['admin_menu_name']]['extra_parameters'] : ''); |
90 | 92 | |
91 | - if (!empty($item['icon_file'])) |
|
92 | - echo ' |
|
93 | + if (!empty($item['icon_file'])) { |
|
94 | + echo ' |
|
93 | 95 | <a href="', $url, '" class="admin_group', !empty($item['inactive']) ? ' inactive' : '', '"><img class="large_admin_menu_icon_file" src="', $item['icon_file'], '" alt="">', $item['label'], '</a>'; |
94 | - else |
|
95 | - echo ' |
|
96 | + } else { |
|
97 | + echo ' |
|
96 | 98 | <a href="', $url, '"><span class="large_', $item['icon_class'], !empty($item['inactive']) ? ' inactive' : '', '"></span>', $item['label'], '</a>'; |
99 | + } |
|
97 | 100 | } |
98 | 101 | |
99 | 102 | echo ' |
@@ -104,10 +107,11 @@ discard block |
||
104 | 107 | </div><!-- #admincenter -->'; |
105 | 108 | |
106 | 109 | // The below functions include all the scripts needed from the simplemachines.org site. The language and format are passed for internationalization. |
107 | - if (empty($modSettings['disable_smf_js'])) |
|
108 | - echo ' |
|
110 | + if (empty($modSettings['disable_smf_js'])) { |
|
111 | + echo ' |
|
109 | 112 | <script src="', $scripturl, '?action=viewsmfile;filename=current-version.js"></script> |
110 | 113 | <script src="', $scripturl, '?action=viewsmfile;filename=latest-news.js"></script>'; |
114 | + } |
|
111 | 115 | |
112 | 116 | // This sets the announcements and current versions themselves ;). |
113 | 117 | echo ' |
@@ -186,9 +190,10 @@ discard block |
||
186 | 190 | <em>', $version['version'], '</em>'; |
187 | 191 | |
188 | 192 | // more details for this item, show them a link |
189 | - if ($context['can_admin'] && isset($version['more'])) |
|
190 | - echo |
|
193 | + if ($context['can_admin'] && isset($version['more'])) { |
|
194 | + echo |
|
191 | 195 | ' <a href="', $scripturl, $version['more'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['version_check_more'], '</a>'; |
196 | + } |
|
192 | 197 | echo ' |
193 | 198 | <br>'; |
194 | 199 | } |
@@ -219,21 +224,23 @@ discard block |
||
219 | 224 | |
220 | 225 | foreach ($context['credits'] as $section) |
221 | 226 | { |
222 | - if (isset($section['pretext'])) |
|
223 | - echo ' |
|
227 | + if (isset($section['pretext'])) { |
|
228 | + echo ' |
|
224 | 229 | <p>', $section['pretext'], '</p> |
225 | 230 | <hr>'; |
231 | + } |
|
226 | 232 | |
227 | 233 | echo ' |
228 | 234 | <dl>'; |
229 | 235 | |
230 | 236 | foreach ($section['groups'] as $group) |
231 | 237 | { |
232 | - if (isset($group['title'])) |
|
233 | - echo ' |
|
238 | + if (isset($group['title'])) { |
|
239 | + echo ' |
|
234 | 240 | <dt> |
235 | 241 | <strong>', $group['title'], ':</strong> |
236 | 242 | </dt>'; |
243 | + } |
|
237 | 244 | |
238 | 245 | echo ' |
239 | 246 | <dd>', implode(', ', $group['members']), '</dd>'; |
@@ -242,10 +249,11 @@ discard block |
||
242 | 249 | echo ' |
243 | 250 | </dl>'; |
244 | 251 | |
245 | - if (isset($section['posttext'])) |
|
246 | - echo ' |
|
252 | + if (isset($section['posttext'])) { |
|
253 | + echo ' |
|
247 | 254 | <hr> |
248 | 255 | <p>', $section['posttext'], '</p>'; |
256 | + } |
|
249 | 257 | } |
250 | 258 | |
251 | 259 | echo ' |
@@ -261,9 +269,10 @@ discard block |
||
261 | 269 | smfSupportVersions.forum = "', $context['forum_version'], '";'; |
262 | 270 | |
263 | 271 | // Don't worry, none of this is logged, it's just used to give information that might be of use. |
264 | - foreach ($context['current_versions'] as $variable => $version) |
|
265 | - echo ' |
|
272 | + foreach ($context['current_versions'] as $variable => $version) { |
|
273 | + echo ' |
|
266 | 274 | smfSupportVersions.', $variable, ' = "', $version['version'], '";'; |
275 | + } |
|
267 | 276 | |
268 | 277 | // Now we just have to include the script and wait ;). |
269 | 278 | echo ' |
@@ -360,8 +369,8 @@ discard block |
||
360 | 369 | <tbody>'; |
361 | 370 | |
362 | 371 | // Loop through every source file displaying its version - using javascript. |
363 | - foreach ($context['file_versions'] as $filename => $version) |
|
364 | - echo ' |
|
372 | + foreach ($context['file_versions'] as $filename => $version) { |
|
373 | + echo ' |
|
365 | 374 | <tr class="windowbg"> |
366 | 375 | <td class="half_table"> |
367 | 376 | ', $filename, ' |
@@ -373,6 +382,7 @@ discard block |
||
373 | 382 | <em id="currentSources', $filename, '">??</em> |
374 | 383 | </td> |
375 | 384 | </tr>'; |
385 | + } |
|
376 | 386 | |
377 | 387 | // Default template files. |
378 | 388 | echo ' |
@@ -398,8 +408,8 @@ discard block |
||
398 | 408 | <table id="Default" class="table_grid"> |
399 | 409 | <tbody>'; |
400 | 410 | |
401 | - foreach ($context['default_template_versions'] as $filename => $version) |
|
402 | - echo ' |
|
411 | + foreach ($context['default_template_versions'] as $filename => $version) { |
|
412 | + echo ' |
|
403 | 413 | <tr class="windowbg"> |
404 | 414 | <td class="half_table"> |
405 | 415 | ', $filename, ' |
@@ -411,6 +421,7 @@ discard block |
||
411 | 421 | <em id="currentDefault', $filename, '">??</em> |
412 | 422 | </td> |
413 | 423 | </tr>'; |
424 | + } |
|
414 | 425 | |
415 | 426 | // Now the language files... |
416 | 427 | echo ' |
@@ -438,8 +449,8 @@ discard block |
||
438 | 449 | |
439 | 450 | foreach ($context['default_language_versions'] as $language => $files) |
440 | 451 | { |
441 | - foreach ($files as $filename => $version) |
|
442 | - echo ' |
|
452 | + foreach ($files as $filename => $version) { |
|
453 | + echo ' |
|
443 | 454 | <tr class="windowbg"> |
444 | 455 | <td class="half_table"> |
445 | 456 | ', $filename, '.<em>', $language, '</em>.php |
@@ -451,6 +462,7 @@ discard block |
||
451 | 462 | <em id="current', $filename, '.', $language, '">??</em> |
452 | 463 | </td> |
453 | 464 | </tr>'; |
465 | + } |
|
454 | 466 | } |
455 | 467 | |
456 | 468 | echo ' |
@@ -480,8 +492,8 @@ discard block |
||
480 | 492 | <table id="Templates" class="table_grid"> |
481 | 493 | <tbody>'; |
482 | 494 | |
483 | - foreach ($context['template_versions'] as $filename => $version) |
|
484 | - echo ' |
|
495 | + foreach ($context['template_versions'] as $filename => $version) { |
|
496 | + echo ' |
|
485 | 497 | <tr class="windowbg"> |
486 | 498 | <td class="half_table"> |
487 | 499 | ', $filename, ' |
@@ -493,6 +505,7 @@ discard block |
||
493 | 505 | <em id="currentTemplates', $filename, '">??</em> |
494 | 506 | </td> |
495 | 507 | </tr>'; |
508 | + } |
|
496 | 509 | |
497 | 510 | echo ' |
498 | 511 | </tbody> |
@@ -522,8 +535,8 @@ discard block |
||
522 | 535 | <table id="Tasks" class="table_grid"> |
523 | 536 | <tbody>'; |
524 | 537 | |
525 | - foreach ($context['tasks_versions'] as $filename => $version) |
|
526 | - echo ' |
|
538 | + foreach ($context['tasks_versions'] as $filename => $version) { |
|
539 | + echo ' |
|
527 | 540 | <tr class="windowbg"> |
528 | 541 | <td class="half_table"> |
529 | 542 | ', $filename, ' |
@@ -535,6 +548,7 @@ discard block |
||
535 | 548 | <em id="currentTasks', $filename, '">??</em> |
536 | 549 | </td> |
537 | 550 | </tr>'; |
551 | + } |
|
538 | 552 | |
539 | 553 | echo ' |
540 | 554 | </tbody> |
@@ -576,9 +590,10 @@ discard block |
||
576 | 590 | { |
577 | 591 | global $context, $scripturl, $txt, $modSettings; |
578 | 592 | |
579 | - if (!empty($context['saved_successful'])) |
|
580 | - echo ' |
|
593 | + if (!empty($context['saved_successful'])) { |
|
594 | + echo ' |
|
581 | 595 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
596 | + } |
|
582 | 597 | |
583 | 598 | // First section is for adding/removing words from the censored list. |
584 | 599 | echo ' |
@@ -593,11 +608,12 @@ discard block |
||
593 | 608 | <p>', $txt['admin_censored_where'], '</p>'; |
594 | 609 | |
595 | 610 | // Show text boxes for censoring [bad ] => [good ]. |
596 | - foreach ($context['censored_words'] as $vulgar => $proper) |
|
597 | - echo ' |
|
611 | + foreach ($context['censored_words'] as $vulgar => $proper) { |
|
612 | + echo ' |
|
598 | 613 | <div class="block"> |
599 | 614 | <input type="text" name="censor_vulgar[]" value="', $vulgar, '" size="30"> => <input type="text" name="censor_proper[]" value="', $proper, '" size="30"> |
600 | 615 | </div>'; |
616 | + } |
|
601 | 617 | |
602 | 618 | // Now provide a way to censor more words. |
603 | 619 | echo ' |
@@ -672,19 +688,21 @@ discard block |
||
672 | 688 | <div class="windowbg2 noup"> |
673 | 689 | ', $txt['not_done_reason']; |
674 | 690 | |
675 | - if (!empty($context['continue_percent'])) |
|
676 | - echo ' |
|
691 | + if (!empty($context['continue_percent'])) { |
|
692 | + echo ' |
|
677 | 693 | <div class="progress_bar"> |
678 | 694 | <div class="full_bar">', $context['continue_percent'], '%</div> |
679 | 695 | <div class="green_percent" style="width: ', $context['continue_percent'], '%;"> </div> |
680 | 696 | </div>'; |
697 | + } |
|
681 | 698 | |
682 | - if (!empty($context['substep_enabled'])) |
|
683 | - echo ' |
|
699 | + if (!empty($context['substep_enabled'])) { |
|
700 | + echo ' |
|
684 | 701 | <div class="progress_bar"> |
685 | 702 | <div class="full_bar">', $context['substep_title'], ' (', $context['substep_continue_percent'], '%)</div> |
686 | 703 | <div class="blue_percent" style="width: ', $context['substep_continue_percent'], '%;"> </div> |
687 | 704 | </div>'; |
705 | + } |
|
688 | 706 | |
689 | 707 | echo ' |
690 | 708 | <form action="', $scripturl, $context['continue_get_data'], '" method="post" accept-charset="', $context['character_set'], '" name="autoSubmit" id="autoSubmit"> |
@@ -719,35 +737,40 @@ discard block |
||
719 | 737 | { |
720 | 738 | global $context, $txt, $scripturl; |
721 | 739 | |
722 | - if (!empty($context['saved_successful'])) |
|
723 | - echo ' |
|
740 | + if (!empty($context['saved_successful'])) { |
|
741 | + echo ' |
|
724 | 742 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
725 | - elseif (!empty($context['saved_failed'])) |
|
726 | - echo ' |
|
743 | + } elseif (!empty($context['saved_failed'])) { |
|
744 | + echo ' |
|
727 | 745 | <div class="errorbox">', sprintf($txt['settings_not_saved'], $context['saved_failed']), '</div>'; |
746 | + } |
|
728 | 747 | |
729 | - if (!empty($context['settings_pre_javascript'])) |
|
730 | - echo ' |
|
748 | + if (!empty($context['settings_pre_javascript'])) { |
|
749 | + echo ' |
|
731 | 750 | <script>', $context['settings_pre_javascript'], '</script>'; |
751 | + } |
|
732 | 752 | |
733 | - if (!empty($context['settings_insert_above'])) |
|
734 | - echo $context['settings_insert_above']; |
|
753 | + if (!empty($context['settings_insert_above'])) { |
|
754 | + echo $context['settings_insert_above']; |
|
755 | + } |
|
735 | 756 | |
736 | 757 | echo ' |
737 | 758 | <div id="admincenter"> |
738 | 759 | <form id="admin_form_wrapper" action="', $context['post_url'], '" method="post" accept-charset="', $context['character_set'], '"', !empty($context['force_form_onsubmit']) ? ' onsubmit="' . $context['force_form_onsubmit'] . '"' : '', '>'; |
739 | 760 | |
740 | 761 | // Is there a custom title? |
741 | - if (isset($context['settings_title'])) |
|
742 | - echo ' |
|
762 | + if (isset($context['settings_title'])) { |
|
763 | + echo ' |
|
743 | 764 | <div class="cat_bar"> |
744 | 765 | <h3 class="catbg">', $context['settings_title'], '</h3> |
745 | 766 | </div>'; |
767 | + } |
|
746 | 768 | |
747 | 769 | // Have we got a message to display? |
748 | - if (!empty($context['settings_message'])) |
|
749 | - echo ' |
|
770 | + if (!empty($context['settings_message'])) { |
|
771 | + echo ' |
|
750 | 772 | <div class="information">', $context['settings_message'], '</div>'; |
773 | + } |
|
751 | 774 | |
752 | 775 | // Now actually loop through all the variables. |
753 | 776 | $is_open = false; |
@@ -800,8 +823,9 @@ discard block |
||
800 | 823 | // Hang about? Are you pulling my leg - a callback?! |
801 | 824 | if (is_array($config_var) && $config_var['type'] == 'callback') |
802 | 825 | { |
803 | - if (function_exists('template_callback_' . $config_var['name'])) |
|
804 | - call_user_func('template_callback_' . $config_var['name']); |
|
826 | + if (function_exists('template_callback_' . $config_var['name'])) { |
|
827 | + call_user_func('template_callback_' . $config_var['name']); |
|
828 | + } |
|
805 | 829 | |
806 | 830 | continue; |
807 | 831 | } |
@@ -831,9 +855,10 @@ discard block |
||
831 | 855 | $text_types = array('color', 'date', 'datetime', 'datetime-local', 'email', 'month', 'time'); |
832 | 856 | |
833 | 857 | // Show the [?] button. |
834 | - if ($config_var['help']) |
|
835 | - echo ' |
|
858 | + if ($config_var['help']) { |
|
859 | + echo ' |
|
836 | 860 | <a id="setting_', $config_var['name'], '_help" href="', $scripturl, '?action=helpadmin;help=', $config_var['help'], '" onclick="return reqOverlayDiv(this.href);"><span class="generic_icons help" title="', $txt['help'], '"></span></a> '; |
861 | + } |
|
837 | 862 | |
838 | 863 | echo ' |
839 | 864 | <a id="setting_', $config_var['name'], '"></a> <span', ($config_var['disabled'] ? ' style="color: #777777;"' : ($config_var['invalid'] ? ' class="error"' : '')), '><label for="', $config_var['name'], '">', $config_var['label'], '</label>', $subtext, ($config_var['type'] == 'password' ? '<br><em>' . $txt['admin_confirm_password'] . '</em>' : ''), '</span> |
@@ -842,22 +867,25 @@ discard block |
||
842 | 867 | $config_var['preinput']; |
843 | 868 | |
844 | 869 | // Show a check box. |
845 | - if ($config_var['type'] == 'check') |
|
846 | - echo ' |
|
870 | + if ($config_var['type'] == 'check') { |
|
871 | + echo ' |
|
847 | 872 | <input type="checkbox"', $javascript, $disabled, ' name="', $config_var['name'], '" id="', $config_var['name'], '"', ($config_var['value'] ? ' checked' : ''), ' value="1">'; |
873 | + } |
|
848 | 874 | // Escape (via htmlspecialchars.) the text box. |
849 | - elseif ($config_var['type'] == 'password') |
|
850 | - echo ' |
|
875 | + elseif ($config_var['type'] == 'password') { |
|
876 | + echo ' |
|
851 | 877 | <input type="password"', $disabled, $javascript, ' name="', $config_var['name'], '[0]"', ($config_var['size'] ? ' size="' . $config_var['size'] . '"' : ''), ' value="*#fakepass#*" onfocus="this.value = \'\'; this.form.', $config_var['name'], '.disabled = false;"><br> |
852 | 878 | <input type="password" disabled id="', $config_var['name'], '" name="', $config_var['name'], '[1]"', ($config_var['size'] ? ' size="' . $config_var['size'] . '"' : ''), '>'; |
879 | + } |
|
853 | 880 | // Show a selection box. |
854 | 881 | elseif ($config_var['type'] == 'select') |
855 | 882 | { |
856 | 883 | echo ' |
857 | 884 | <select name="', $config_var['name'], '" id="', $config_var['name'], '" ', $javascript, $disabled, (!empty($config_var['multiple']) ? ' multiple="multiple"' : ''), (!empty($config_var['multiple']) && !empty($config_var['size']) ? ' size="' . $config_var['size'] . '"' : ''), '>'; |
858 | - foreach ($config_var['data'] as $option) |
|
859 | - echo ' |
|
885 | + foreach ($config_var['data'] as $option) { |
|
886 | + echo ' |
|
860 | 887 | <option value="', $option[0], '"', (!empty($config_var['value']) && ($option[0] == $config_var['value'] || (!empty($config_var['multiple']) && in_array($option[0], $config_var['value']))) ? ' selected' : ''), '>', $option[1], '</option>'; |
888 | + } |
|
861 | 889 | echo ' |
862 | 890 | </select>'; |
863 | 891 | } |
@@ -874,16 +902,18 @@ discard block |
||
874 | 902 | |
875 | 903 | foreach ($context['board_list'] as $id_cat => $cat) |
876 | 904 | { |
877 | - if (!$first) |
|
878 | - echo ' |
|
905 | + if (!$first) { |
|
906 | + echo ' |
|
879 | 907 | <hr>'; |
908 | + } |
|
880 | 909 | echo ' |
881 | 910 | <strong>', $cat['name'], '</strong> |
882 | 911 | <ul>'; |
883 | 912 | |
884 | - foreach ($cat['boards'] as $id_board => $brd) |
|
885 | - echo ' |
|
913 | + foreach ($cat['boards'] as $id_board => $brd) { |
|
914 | + echo ' |
|
886 | 915 | <li><label><input type="checkbox" name="', $config_var['name'], '[', $brd['id'], ']" value="1"', in_array($brd['id'], $config_var['value']) ? ' checked' : '', '> ', $brd['child_level'] > 0 ? str_repeat(' ', $brd['child_level']) : '', $brd['name'], '</label></li>'; |
916 | + } |
|
887 | 917 | |
888 | 918 | echo ' |
889 | 919 | </ul>'; |
@@ -893,12 +923,14 @@ discard block |
||
893 | 923 | </fieldset>'; |
894 | 924 | } |
895 | 925 | // Text area? |
896 | - elseif ($config_var['type'] == 'large_text') |
|
897 | - echo ' |
|
926 | + elseif ($config_var['type'] == 'large_text') { |
|
927 | + echo ' |
|
898 | 928 | <textarea rows="', (!empty($config_var['size']) ? $config_var['size'] : (!empty($config_var['rows']) ? $config_var['rows'] : 4)), '" cols="', (!empty($config_var['cols']) ? $config_var['cols'] : 30), '" ', $javascript, $disabled, ' name="', $config_var['name'], '" id="', $config_var['name'], '">', $config_var['value'], '</textarea>'; |
929 | + } |
|
899 | 930 | // Permission group? |
900 | - elseif ($config_var['type'] == 'permissions') |
|
901 | - theme_inline_permissions($config_var['name']); |
|
931 | + elseif ($config_var['type'] == 'permissions') { |
|
932 | + theme_inline_permissions($config_var['name']); |
|
933 | + } |
|
902 | 934 | |
903 | 935 | // BBC selection? |
904 | 936 | elseif ($config_var['type'] == 'bbc') |
@@ -910,20 +942,22 @@ discard block |
||
910 | 942 | |
911 | 943 | foreach ($context['bbc_columns'] as $bbcColumn) |
912 | 944 | { |
913 | - foreach ($bbcColumn as $bbcTag) |
|
914 | - echo ' |
|
945 | + foreach ($bbcColumn as $bbcTag) { |
|
946 | + echo ' |
|
915 | 947 | <li class="list_bbc floatleft"> |
916 | 948 | <input type="checkbox" name="', $config_var['name'], '_enabledTags[]" id="tag_', $config_var['name'], '_', $bbcTag['tag'], '" value="', $bbcTag['tag'], '"', !in_array($bbcTag['tag'], $context['bbc_sections'][$config_var['name']]['disabled']) ? ' checked' : '', '> <label for="tag_', $config_var['name'], '_', $bbcTag['tag'], '">', $bbcTag['tag'], '</label>', $bbcTag['show_help'] ? ' (<a href="' . $scripturl . '?action=helpadmin;help=tag_' . $bbcTag['tag'] . '" onclick="return reqOverlayDiv(this.href);">?</a>)' : '', ' |
917 | 949 | </li>'; |
950 | + } |
|
918 | 951 | } |
919 | 952 | echo ' </ul> |
920 | 953 | <input type="checkbox" id="bbc_', $config_var['name'], '_select_all" onclick="invertAll(this, this.form, \'', $config_var['name'], '_enabledTags\');"', $context['bbc_sections'][$config_var['name']]['all_selected'] ? ' checked' : '', '> <label for="bbc_', $config_var['name'], '_select_all"><em>', $txt['bbcTagsToUse_select_all'], '</em></label> |
921 | 954 | </fieldset>'; |
922 | 955 | } |
923 | 956 | // A simple message? |
924 | - elseif ($config_var['type'] == 'var_message') |
|
925 | - echo ' |
|
957 | + elseif ($config_var['type'] == 'var_message') { |
|
958 | + echo ' |
|
926 | 959 | <div', !empty($config_var['name']) ? ' id="' . $config_var['name'] . '"' : '', '>', $config_var['var_message'], '</div>'; |
960 | + } |
|
927 | 961 | // Assume it must be a text box |
928 | 962 | else |
929 | 963 | { |
@@ -948,63 +982,70 @@ discard block |
||
948 | 982 | ' . $config_var['postinput'] : '',' |
949 | 983 | </dd>'; |
950 | 984 | } |
951 | - } |
|
952 | - |
|
953 | - else |
|
985 | + } else |
|
954 | 986 | { |
955 | 987 | // Just show a separator. |
956 | - if ($config_var == '') |
|
957 | - echo ' |
|
988 | + if ($config_var == '') { |
|
989 | + echo ' |
|
958 | 990 | </dl> |
959 | 991 | <hr> |
960 | 992 | <dl class="settings">'; |
961 | - else |
|
962 | - echo ' |
|
993 | + } else { |
|
994 | + echo ' |
|
963 | 995 | <dd> |
964 | 996 | <strong>' . $config_var . '</strong> |
965 | 997 | </dd>'; |
998 | + } |
|
966 | 999 | } |
967 | 1000 | } |
968 | 1001 | |
969 | - if ($is_open) |
|
970 | - echo ' |
|
1002 | + if ($is_open) { |
|
1003 | + echo ' |
|
971 | 1004 | </dl>'; |
1005 | + } |
|
972 | 1006 | |
973 | - if (empty($context['settings_save_dont_show'])) |
|
974 | - echo ' |
|
1007 | + if (empty($context['settings_save_dont_show'])) { |
|
1008 | + echo ' |
|
975 | 1009 | <input type="submit" value="', $txt['save'], '"', (!empty($context['save_disabled']) ? ' disabled' : ''), (!empty($context['settings_save_onclick']) ? ' onclick="' . $context['settings_save_onclick'] . '"' : ''), ' class="button">'; |
1010 | + } |
|
976 | 1011 | |
977 | - if ($is_open) |
|
978 | - echo ' |
|
1012 | + if ($is_open) { |
|
1013 | + echo ' |
|
979 | 1014 | </div><!-- .windowbg2 -->'; |
1015 | + } |
|
980 | 1016 | |
981 | 1017 | |
982 | 1018 | // At least one token has to be used! |
983 | - if (isset($context['admin-ssc_token'])) |
|
984 | - echo ' |
|
1019 | + if (isset($context['admin-ssc_token'])) { |
|
1020 | + echo ' |
|
985 | 1021 | <input type="hidden" name="', $context['admin-ssc_token_var'], '" value="', $context['admin-ssc_token'], '">'; |
1022 | + } |
|
986 | 1023 | |
987 | - if (isset($context['admin-dbsc_token'])) |
|
988 | - echo ' |
|
1024 | + if (isset($context['admin-dbsc_token'])) { |
|
1025 | + echo ' |
|
989 | 1026 | <input type="hidden" name="', $context['admin-dbsc_token_var'], '" value="', $context['admin-dbsc_token'], '">'; |
1027 | + } |
|
990 | 1028 | |
991 | - if (isset($context['admin-mp_token'])) |
|
992 | - echo ' |
|
1029 | + if (isset($context['admin-mp_token'])) { |
|
1030 | + echo ' |
|
993 | 1031 | <input type="hidden" name="', $context['admin-mp_token_var'], '" value="', $context['admin-mp_token'], '">'; |
1032 | + } |
|
994 | 1033 | |
995 | 1034 | echo ' |
996 | 1035 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
997 | 1036 | </form> |
998 | 1037 | </div><!-- #admincenter -->'; |
999 | 1038 | |
1000 | - if (!empty($context['settings_post_javascript'])) |
|
1001 | - echo ' |
|
1039 | + if (!empty($context['settings_post_javascript'])) { |
|
1040 | + echo ' |
|
1002 | 1041 | <script> |
1003 | 1042 | ', $context['settings_post_javascript'], ' |
1004 | 1043 | </script>'; |
1044 | + } |
|
1005 | 1045 | |
1006 | - if (!empty($context['settings_insert_below'])) |
|
1007 | - echo $context['settings_insert_below']; |
|
1046 | + if (!empty($context['settings_insert_below'])) { |
|
1047 | + echo $context['settings_insert_below']; |
|
1048 | + } |
|
1008 | 1049 | |
1009 | 1050 | // We may have added a board listing. If we did, we need to make it work. |
1010 | 1051 | addInlineJavascript(' |
@@ -1027,9 +1068,10 @@ discard block |
||
1027 | 1068 | { |
1028 | 1069 | global $context, $txt; |
1029 | 1070 | |
1030 | - if (!empty($context['saved_successful'])) |
|
1031 | - echo ' |
|
1071 | + if (!empty($context['saved_successful'])) { |
|
1072 | + echo ' |
|
1032 | 1073 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
1074 | + } |
|
1033 | 1075 | |
1034 | 1076 | // Standard fields. |
1035 | 1077 | template_show_list('standard_profile_fields'); |
@@ -1062,11 +1104,12 @@ discard block |
||
1062 | 1104 | if (isset($_GET['msg'])) |
1063 | 1105 | { |
1064 | 1106 | loadLanguage('Errors'); |
1065 | - if (isset($txt['custom_option_' . $_GET['msg']])) |
|
1066 | - echo ' |
|
1107 | + if (isset($txt['custom_option_' . $_GET['msg']])) { |
|
1108 | + echo ' |
|
1067 | 1109 | <div class="errorbox">', |
1068 | 1110 | $txt['custom_option_' . $_GET['msg']], ' |
1069 | 1111 | </div>'; |
1112 | + } |
|
1070 | 1113 | } |
1071 | 1114 | |
1072 | 1115 | echo ' |
@@ -1133,9 +1176,10 @@ discard block |
||
1133 | 1176 | <dd> |
1134 | 1177 | <select name="placement" id="placement">'; |
1135 | 1178 | |
1136 | - foreach ($context['cust_profile_fields_placement'] as $order => $name) |
|
1137 | - echo ' |
|
1179 | + foreach ($context['cust_profile_fields_placement'] as $order => $name) { |
|
1180 | + echo ' |
|
1138 | 1181 | <option value="', $order, '"', $context['field']['placement'] == $order ? ' selected' : '', '>', $txt['custom_profile_placement_' . $name], '</option>'; |
1182 | + } |
|
1139 | 1183 | |
1140 | 1184 | echo ' |
1141 | 1185 | </select> |
@@ -1159,9 +1203,10 @@ discard block |
||
1159 | 1203 | <dd> |
1160 | 1204 | <select name="field_type" id="field_type" onchange="updateInputBoxes();">'; |
1161 | 1205 | |
1162 | - foreach (array('text', 'textarea', 'select', 'radio', 'check') as $field_type) |
|
1163 | - echo ' |
|
1206 | + foreach (array('text', 'textarea', 'select', 'radio', 'check') as $field_type) { |
|
1207 | + echo ' |
|
1164 | 1208 | <option value="', $field_type, '"', $context['field']['type'] == $field_type ? ' selected' : '', '>', $txt['custom_profile_type_' . $field_type], '</option>'; |
1209 | + } |
|
1165 | 1210 | |
1166 | 1211 | echo ' |
1167 | 1212 | </select> |
@@ -1262,9 +1307,10 @@ discard block |
||
1262 | 1307 | </fieldset> |
1263 | 1308 | <input type="submit" name="save" value="', $txt['save'], '" class="button">'; |
1264 | 1309 | |
1265 | - if ($context['fid']) |
|
1266 | - echo ' |
|
1310 | + if ($context['fid']) { |
|
1311 | + echo ' |
|
1267 | 1312 | <input type="submit" name="delete" value="', $txt['delete'], '" data-confirm="', $txt['custom_edit_delete_sure'], '" class="button you_sure">'; |
1313 | + } |
|
1268 | 1314 | |
1269 | 1315 | echo ' |
1270 | 1316 | </div><!-- .windowbg2 --> |
@@ -1307,8 +1353,7 @@ discard block |
||
1307 | 1353 | { |
1308 | 1354 | echo ' |
1309 | 1355 | <p class="centertext"><strong>', $txt['admin_search_results_none'], '</strong></p>'; |
1310 | - } |
|
1311 | - else |
|
1356 | + } else |
|
1312 | 1357 | { |
1313 | 1358 | echo ' |
1314 | 1359 | <ol class="search_results">'; |
@@ -1335,9 +1380,10 @@ discard block |
||
1335 | 1380 | <li> |
1336 | 1381 | <a href="', $result['url'], '"><strong>', $result['name'], '</strong></a> [', isset($txt['admin_search_section_' . $result['type']]) ? $txt['admin_search_section_' . $result['type']] : $result['type'], ']'; |
1337 | 1382 | |
1338 | - if ($result['help']) |
|
1339 | - echo ' |
|
1383 | + if ($result['help']) { |
|
1384 | + echo ' |
|
1340 | 1385 | <p class="double_height">', $result['help'], '</p>'; |
1386 | + } |
|
1341 | 1387 | |
1342 | 1388 | echo ' |
1343 | 1389 | </li>'; |
@@ -1377,10 +1423,11 @@ discard block |
||
1377 | 1423 | <strong>', $txt['setup_verification_answer'], '</strong> |
1378 | 1424 | </dd>'; |
1379 | 1425 | |
1380 | - if (!empty($context['qa_by_lang'][$lang_id])) |
|
1381 | - foreach ($context['qa_by_lang'][$lang_id] as $q_id) |
|
1426 | + if (!empty($context['qa_by_lang'][$lang_id])) { |
|
1427 | + foreach ($context['qa_by_lang'][$lang_id] as $q_id) |
|
1382 | 1428 | { |
1383 | 1429 | $question = $context['question_answers'][$q_id]; |
1430 | + } |
|
1384 | 1431 | |
1385 | 1432 | echo ' |
1386 | 1433 | <dt> |
@@ -1388,9 +1435,10 @@ discard block |
||
1388 | 1435 | </dt> |
1389 | 1436 | <dd>'; |
1390 | 1437 | |
1391 | - foreach ($question['answers'] as $answer) |
|
1392 | - echo ' |
|
1438 | + foreach ($question['answers'] as $answer) { |
|
1439 | + echo ' |
|
1393 | 1440 | <input type="text" name="answer[', $lang_id, '][', $q_id, '][]" value="', $answer, '" size="50" class="verification_answer">'; |
1441 | + } |
|
1394 | 1442 | |
1395 | 1443 | echo ' |
1396 | 1444 | <div class="qa_add_answer"><a href="javascript:void(0);" onclick="return addAnswer(this);">[ ', $txt['setup_verification_add_answer'], ' ]</a></div> |
@@ -1429,11 +1477,12 @@ discard block |
||
1429 | 1477 | ', $txt['errors_found'], ': |
1430 | 1478 | <ul>'; |
1431 | 1479 | |
1432 | - foreach ($context['repair_errors'] as $error) |
|
1433 | - echo ' |
|
1480 | + foreach ($context['repair_errors'] as $error) { |
|
1481 | + echo ' |
|
1434 | 1482 | <li> |
1435 | 1483 | ', $error, ' |
1436 | 1484 | </li>'; |
1485 | + } |
|
1437 | 1486 | |
1438 | 1487 | echo ' |
1439 | 1488 | </ul> |
@@ -1443,16 +1492,15 @@ discard block |
||
1443 | 1492 | <p class="padding"> |
1444 | 1493 | <strong><a href="', $scripturl, '?action=admin;area=repairboards;fixErrors;', $context['session_var'], '=', $context['session_id'], '">', $txt['yes'], '</a> - <a href="', $scripturl, '?action=admin;area=maintain">', $txt['no'], '</a></strong> |
1445 | 1494 | </p>'; |
1446 | - } |
|
1447 | - else |
|
1448 | - echo ' |
|
1495 | + } else { |
|
1496 | + echo ' |
|
1449 | 1497 | <p>', $txt['maintain_no_errors'], '</p> |
1450 | 1498 | <p class="padding"> |
1451 | 1499 | <a href="', $scripturl, '?action=admin;area=maintain;sa=routine">', $txt['maintain_return'], '</a> |
1452 | 1500 | </p>'; |
1501 | + } |
|
1453 | 1502 | |
1454 | - } |
|
1455 | - else |
|
1503 | + } else |
|
1456 | 1504 | { |
1457 | 1505 | if (!empty($context['redirect_to_recount'])) |
1458 | 1506 | { |
@@ -1464,8 +1512,7 @@ discard block |
||
1464 | 1512 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
1465 | 1513 | <input type="submit" name="recount" id="recount_now" value="', $txt['errors_recount_now'], '"> |
1466 | 1514 | </form>'; |
1467 | - } |
|
1468 | - else |
|
1515 | + } else |
|
1469 | 1516 | { |
1470 | 1517 | echo ' |
1471 | 1518 | <p>', $txt['errors_fixed'], '</p> |
@@ -1619,8 +1666,8 @@ discard block |
||
1619 | 1666 | { |
1620 | 1667 | global $context, $txt; |
1621 | 1668 | |
1622 | - if ($context['user']['is_admin']) |
|
1623 | - echo ' |
|
1669 | + if ($context['user']['is_admin']) { |
|
1670 | + echo ' |
|
1624 | 1671 | <span class="floatright admin_search"> |
1625 | 1672 | <span class="generic_icons filter centericon"></span> |
1626 | 1673 | <input type="search" name="search_term" value="', $txt['admin_search'], '" onclick="if (this.value == \'', $txt['admin_search'], '\') this.value = \'\';"> |
@@ -1631,6 +1678,7 @@ discard block |
||
1631 | 1678 | </select> |
1632 | 1679 | <input type="submit" name="search_go" id="search_go" value="', $txt['admin_search_go'], '" class="button"> |
1633 | 1680 | </span>'; |
1634 | -} |
|
1681 | + } |
|
1682 | + } |
|
1635 | 1683 | |
1636 | 1684 | ?> |
1637 | 1685 | \ No newline at end of file |
@@ -27,9 +27,10 @@ discard block |
||
27 | 27 | <h3 class="catbg"> |
28 | 28 | <span class="floatleft">', $txt['members_list'], '</span>'; |
29 | 29 | |
30 | - if (!isset($context['old_search'])) |
|
31 | - echo ' |
|
30 | + if (!isset($context['old_search'])) { |
|
31 | + echo ' |
|
32 | 32 | <span class="floatright">', $context['letter_links'], '</span>'; |
33 | + } |
|
33 | 34 | echo ' |
34 | 35 | </h3> |
35 | 36 | </div>'; |
@@ -44,19 +45,22 @@ discard block |
||
44 | 45 | foreach ($context['columns'] as $key => $column) |
45 | 46 | { |
46 | 47 | // @TODO maybe find something nicer? |
47 | - if ($key == 'email_address' && !$context['can_send_email']) |
|
48 | - continue; |
|
48 | + if ($key == 'email_address' && !$context['can_send_email']) { |
|
49 | + continue; |
|
50 | + } |
|
49 | 51 | |
50 | 52 | // This is a selected column, so underline it or some such. |
51 | - if ($column['selected']) |
|
52 | - echo ' |
|
53 | + if ($column['selected']) { |
|
54 | + echo ' |
|
53 | 55 | <th scope="col" class="', $key, isset($column['class']) ? ' ' . $column['class'] : '', ' selected" style="width: auto;"' . (isset($column['colspan']) ? ' colspan="' . $column['colspan'] . '"' : '') . '> |
54 | 56 | <a href="' . $column['href'] . '" rel="nofollow">' . $column['label'] . '</a><span class="generic_icons sort_' . $context['sort_direction'] . '"></span></th>'; |
57 | + } |
|
55 | 58 | // This is just some column... show the link and be done with it. |
56 | - else |
|
57 | - echo ' |
|
59 | + else { |
|
60 | + echo ' |
|
58 | 61 | <th scope="col" class="', $key, isset($column['class']) ? ' ' . $column['class'] : '', '"', isset($column['width']) ? ' style="width: ' . $column['width'] . '"' : '', isset($column['colspan']) ? ' colspan="' . $column['colspan'] . '"' : '', '> |
59 | 62 | ', $column['link'], '</th>'; |
63 | + } |
|
60 | 64 | } |
61 | 65 | echo ' |
62 | 66 | </tr> |
@@ -75,9 +79,10 @@ discard block |
||
75 | 79 | </td> |
76 | 80 | <td class="lefttext">', $member['link'], '</td>'; |
77 | 81 | |
78 | - if (!isset($context['disabled_fields']['website'])) |
|
79 | - echo ' |
|
82 | + if (!isset($context['disabled_fields']['website'])) { |
|
83 | + echo ' |
|
80 | 84 | <td class="centertext website_url">', $member['website']['url'] != '' ? '<a href="' . $member['website']['url'] . '" target="_blank"><span class="generic_icons www" title="' . $member['website']['title'] . '"></span></a>' : '', '</td>'; |
85 | + } |
|
81 | 86 | |
82 | 87 | // Group and date. |
83 | 88 | echo ' |
@@ -90,11 +95,12 @@ discard block |
||
90 | 95 | <td class="centertext" style="white-space: nowrap; width: 15px">', $member['posts'], '</td> |
91 | 96 | <td class="centertext statsbar" style="width: 120px">'; |
92 | 97 | |
93 | - if (!empty($member['post_percent'])) |
|
94 | - echo ' |
|
98 | + if (!empty($member['post_percent'])) { |
|
99 | + echo ' |
|
95 | 100 | <div class="bar" style="width: ', $member['post_percent'] + 4, 'px;"> |
96 | 101 | <div style="width: ', $member['post_percent'], 'px;"></div> |
97 | 102 | </div>'; |
103 | + } |
|
98 | 104 | |
99 | 105 | echo ' |
100 | 106 | </td>'; |
@@ -103,9 +109,10 @@ discard block |
||
103 | 109 | // Show custom fields marked to be shown here |
104 | 110 | if (!empty($context['custom_profile_fields']['columns'])) |
105 | 111 | { |
106 | - foreach ($context['custom_profile_fields']['columns'] as $key => $column) |
|
107 | - echo ' |
|
112 | + foreach ($context['custom_profile_fields']['columns'] as $key => $column) { |
|
113 | + echo ' |
|
108 | 114 | <td class="righttext">', $member['options'][$key], '</td>'; |
115 | + } |
|
109 | 116 | } |
110 | 117 | |
111 | 118 | echo ' |
@@ -113,11 +120,12 @@ discard block |
||
113 | 120 | } |
114 | 121 | } |
115 | 122 | // No members? |
116 | - else |
|
117 | - echo ' |
|
123 | + else { |
|
124 | + echo ' |
|
118 | 125 | <tr> |
119 | 126 | <td colspan="', $context['colspan'], '" class="windowbg">', $txt['search_no_results'], '</td> |
120 | 127 | </tr>'; |
128 | + } |
|
121 | 129 | |
122 | 130 | echo ' |
123 | 131 | </tbody> |
@@ -130,9 +138,10 @@ discard block |
||
130 | 138 | <div class="pagelinks floatleft">', $context['page_index'], '</div>'; |
131 | 139 | |
132 | 140 | // If it is displaying the result of a search show a "search again" link to edit their criteria. |
133 | - if (isset($context['old_search'])) |
|
134 | - echo ' |
|
141 | + if (isset($context['old_search'])) { |
|
142 | + echo ' |
|
135 | 143 | <a class="button" href="', $scripturl, '?action=mlist;sa=search;search=', $context['old_search_value'], '">', $txt['mlist_search_again'], '</a>'; |
144 | + } |
|
136 | 145 | echo ' |
137 | 146 | </div> |
138 | 147 | </div><!-- #memberlist -->'; |