@@ -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,11 +216,12 @@ 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>'; |
| 224 | + } |
|
| 222 | 225 | } |
| 223 | 226 | |
| 224 | 227 | echo ' |
@@ -22,30 +22,32 @@ discard block |
||
| 22 | 22 | <div id="calendar">'; |
| 23 | 23 | |
| 24 | 24 | // Show the mini-blocks if they're enabled. |
| 25 | - if (empty($context['blocks_disabled'])) |
|
| 26 | - echo ' |
|
| 25 | + if (empty($context['blocks_disabled'])) { |
|
| 26 | + echo ' |
|
| 27 | 27 | <div id="month_grid"> |
| 28 | 28 | ', template_show_month_grid('prev', true), ' |
| 29 | 29 | ', template_show_month_grid('current', true), ' |
| 30 | 30 | ', template_show_month_grid('next', true), ' |
| 31 | 31 | </div>'; |
| 32 | + } |
|
| 32 | 33 | |
| 33 | 34 | // What view are we showing? |
| 34 | - if ($context['calendar_view'] == 'viewlist') |
|
| 35 | - echo ' |
|
| 35 | + if ($context['calendar_view'] == 'viewlist') { |
|
| 36 | + echo ' |
|
| 36 | 37 | <div id="main_grid"> |
| 37 | 38 | ', template_show_upcoming_list('main'), ' |
| 38 | 39 | </div>'; |
| 39 | - elseif ($context['calendar_view'] == 'viewweek') |
|
| 40 | - echo ' |
|
| 40 | + } elseif ($context['calendar_view'] == 'viewweek') { |
|
| 41 | + echo ' |
|
| 41 | 42 | <div id="main_grid"> |
| 42 | 43 | ', template_show_week_grid('main'), ' |
| 43 | 44 | </div>'; |
| 44 | - else |
|
| 45 | - echo ' |
|
| 45 | + } else { |
|
| 46 | + echo ' |
|
| 46 | 47 | <div id="main_grid"> |
| 47 | 48 | ', template_show_month_grid('main'), ' |
| 48 | 49 | </div>'; |
| 50 | + } |
|
| 49 | 51 | |
| 50 | 52 | // Close our wrapper. |
| 51 | 53 | echo ' |
@@ -64,20 +66,22 @@ discard block |
||
| 64 | 66 | global $context, $scripturl, $txt; |
| 65 | 67 | |
| 66 | 68 | // Bail out if we have nothing to work with |
| 67 | - if (!isset($context['calendar_grid_' . $grid_name])) |
|
| 68 | - return false; |
|
| 69 | + if (!isset($context['calendar_grid_' . $grid_name])) { |
|
| 70 | + return false; |
|
| 71 | + } |
|
| 69 | 72 | |
| 70 | 73 | // Protect programmer sanity |
| 71 | 74 | $calendar_data = &$context['calendar_grid_' . $grid_name]; |
| 72 | 75 | |
| 73 | 76 | // Do we want a title? |
| 74 | - if (empty($calendar_data['disable_title'])) |
|
| 75 | - echo ' |
|
| 77 | + if (empty($calendar_data['disable_title'])) { |
|
| 78 | + echo ' |
|
| 76 | 79 | <div class="cat_bar"> |
| 77 | 80 | <h3 class="catbg centertext largetext"> |
| 78 | 81 | <a href="', $scripturl, '?action=calendar;viewlist;year=', $calendar_data['start_year'], ';month=', $calendar_data['start_month'], ';day=', $calendar_data['start_day'], '">', $txt['calendar_upcoming'], '</a> |
| 79 | 82 | </h3> |
| 80 | 83 | </div>'; |
| 84 | + } |
|
| 81 | 85 | |
| 82 | 86 | // Give the user some controls to work with |
| 83 | 87 | template_calendar_top($calendar_data); |
@@ -100,11 +104,13 @@ discard block |
||
| 100 | 104 | <li class="windowbg"> |
| 101 | 105 | <strong class="event_title">', $event['link'], '</strong>'; |
| 102 | 106 | |
| 103 | - if ($event['can_edit']) |
|
| 104 | - echo ' <a href="' . $event['modify_href'] . '"><span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span></a>'; |
|
| 107 | + if ($event['can_edit']) { |
|
| 108 | + echo ' <a href="' . $event['modify_href'] . '"><span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span></a>'; |
|
| 109 | + } |
|
| 105 | 110 | |
| 106 | - if ($event['can_export']) |
|
| 107 | - echo ' <a href="' . $event['export_href'] . '"><span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span></a>'; |
|
| 111 | + if ($event['can_export']) { |
|
| 112 | + echo ' <a href="' . $event['export_href'] . '"><span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span></a>'; |
|
| 113 | + } |
|
| 108 | 114 | |
| 109 | 115 | echo ' |
| 110 | 116 | <br>'; |
@@ -112,14 +118,14 @@ discard block |
||
| 112 | 118 | if (!empty($event['allday'])) |
| 113 | 119 | { |
| 114 | 120 | echo '<time datetime="' . $event['start_iso_gmdate'] . '">', trim($event['start_date_local']), '</time>', ($event['start_date'] != $event['end_date']) ? ' – <time datetime="' . $event['end_iso_gmdate'] . '">' . trim($event['end_date_local']) . '</time>' : ''; |
| 115 | - } |
|
| 116 | - else |
|
| 121 | + } else |
|
| 117 | 122 | { |
| 118 | 123 | // Display event info relative to user's local timezone |
| 119 | 124 | echo '<time datetime="' . $event['start_iso_gmdate'] . '">', trim($event['start_date_local']), ', ', trim($event['start_time_local']), '</time> – <time datetime="' . $event['end_iso_gmdate'] . '">'; |
| 120 | 125 | |
| 121 | - if ($event['start_date_local'] != $event['end_date_local']) |
|
| 122 | - echo trim($event['end_date_local']) . ', '; |
|
| 126 | + if ($event['start_date_local'] != $event['end_date_local']) { |
|
| 127 | + echo trim($event['end_date_local']) . ', '; |
|
| 128 | + } |
|
| 123 | 129 | |
| 124 | 130 | echo trim($event['end_time_local']); |
| 125 | 131 | |
@@ -128,23 +134,27 @@ discard block |
||
| 128 | 134 | { |
| 129 | 135 | echo '</time> (<time datetime="' . $event['start_iso_gmdate'] . '">'; |
| 130 | 136 | |
| 131 | - if ($event['start_date_orig'] != $event['start_date_local'] || $event['end_date_orig'] != $event['end_date_local'] || $event['start_date_orig'] != $event['end_date_orig']) |
|
| 132 | - echo trim($event['start_date_orig']), ', '; |
|
| 137 | + if ($event['start_date_orig'] != $event['start_date_local'] || $event['end_date_orig'] != $event['end_date_local'] || $event['start_date_orig'] != $event['end_date_orig']) { |
|
| 138 | + echo trim($event['start_date_orig']), ', '; |
|
| 139 | + } |
|
| 133 | 140 | |
| 134 | 141 | echo trim($event['start_time_orig']), '</time> – <time datetime="' . $event['end_iso_gmdate'] . '">'; |
| 135 | 142 | |
| 136 | - if ($event['start_date_orig'] != $event['end_date_orig']) |
|
| 137 | - echo trim($event['end_date_orig']) . ', '; |
|
| 143 | + if ($event['start_date_orig'] != $event['end_date_orig']) { |
|
| 144 | + echo trim($event['end_date_orig']) . ', '; |
|
| 145 | + } |
|
| 138 | 146 | |
| 139 | 147 | echo trim($event['end_time_orig']), ' ', $event['tz_abbrev'], '</time>)'; |
| 140 | 148 | } |
| 141 | 149 | // Event is scheduled in the user's own timezone? Let 'em know, just to avoid confusion |
| 142 | - else |
|
| 143 | - echo ' ', $event['tz_abbrev'], '</time>'; |
|
| 150 | + else { |
|
| 151 | + echo ' ', $event['tz_abbrev'], '</time>'; |
|
| 152 | + } |
|
| 144 | 153 | } |
| 145 | 154 | |
| 146 | - if (!empty($event['location'])) |
|
| 147 | - echo '<br>', $event['location']; |
|
| 155 | + if (!empty($event['location'])) { |
|
| 156 | + echo '<br>', $event['location']; |
|
| 157 | + } |
|
| 148 | 158 | |
| 149 | 159 | echo ' |
| 150 | 160 | </li>'; |
@@ -176,8 +186,9 @@ discard block |
||
| 176 | 186 | |
| 177 | 187 | $birthdays = array(); |
| 178 | 188 | |
| 179 | - foreach ($date as $member) |
|
| 180 | - $birthdays[] = '<a href="' . $scripturl . '?action=profile;u=' . $member['id'] . '">' . $member['name'] . (isset($member['age']) ? ' (' . $member['age'] . ')' : '') . '</a>'; |
|
| 189 | + foreach ($date as $member) { |
|
| 190 | + $birthdays[] = '<a href="' . $scripturl . '?action=profile;u=' . $member['id'] . '">' . $member['name'] . (isset($member['age']) ? ' (' . $member['age'] . ')' : '') . '</a>'; |
|
| 191 | + } |
|
| 181 | 192 | |
| 182 | 193 | echo implode(', ', $birthdays); |
| 183 | 194 | |
@@ -208,8 +219,9 @@ discard block |
||
| 208 | 219 | $date_local = $date['date_local']; |
| 209 | 220 | unset($date['date_local']); |
| 210 | 221 | |
| 211 | - foreach ($date as $holiday) |
|
| 212 | - $holidays[] = $holiday . ' (' . $date_local . ')'; |
|
| 222 | + foreach ($date as $holiday) { |
|
| 223 | + $holidays[] = $holiday . ' (' . $date_local . ')'; |
|
| 224 | + } |
|
| 213 | 225 | } |
| 214 | 226 | |
| 215 | 227 | echo implode(', ', $holidays); |
@@ -233,17 +245,19 @@ discard block |
||
| 233 | 245 | global $context, $txt, $scripturl, $modSettings; |
| 234 | 246 | |
| 235 | 247 | // If the grid doesn't exist, no point in proceeding. |
| 236 | - if (!isset($context['calendar_grid_' . $grid_name])) |
|
| 237 | - return false; |
|
| 248 | + if (!isset($context['calendar_grid_' . $grid_name])) { |
|
| 249 | + return false; |
|
| 250 | + } |
|
| 238 | 251 | |
| 239 | 252 | // A handy little pointer variable. |
| 240 | 253 | $calendar_data = &$context['calendar_grid_' . $grid_name]; |
| 241 | 254 | |
| 242 | 255 | // Some conditions for whether or not we should show the week links *here*. |
| 243 | - if (isset($calendar_data['show_week_links']) && ($calendar_data['show_week_links'] == 3 || (($calendar_data['show_week_links'] == 1 && $is_mini === true) || $calendar_data['show_week_links'] == 2 && $is_mini === false))) |
|
| 244 | - $show_week_links = true; |
|
| 245 | - else |
|
| 246 | - $show_week_links = false; |
|
| 256 | + if (isset($calendar_data['show_week_links']) && ($calendar_data['show_week_links'] == 3 || (($calendar_data['show_week_links'] == 1 && $is_mini === true) || $calendar_data['show_week_links'] == 2 && $is_mini === false))) { |
|
| 257 | + $show_week_links = true; |
|
| 258 | + } else { |
|
| 259 | + $show_week_links = false; |
|
| 260 | + } |
|
| 247 | 261 | |
| 248 | 262 | // Assuming that we've not disabled it, show the title block! |
| 249 | 263 | if (empty($calendar_data['disable_title'])) |
@@ -253,18 +267,20 @@ discard block |
||
| 253 | 267 | <h3 class="catbg centertext largetext">'; |
| 254 | 268 | |
| 255 | 269 | // Previous Link: If we're showing prev / next and it's not a mini-calendar. |
| 256 | - if (empty($calendar_data['previous_calendar']['disabled']) && $calendar_data['show_next_prev'] && $is_mini === false) |
|
| 257 | - echo ' |
|
| 270 | + if (empty($calendar_data['previous_calendar']['disabled']) && $calendar_data['show_next_prev'] && $is_mini === false) { |
|
| 271 | + echo ' |
|
| 258 | 272 | <span class="floatleft"> |
| 259 | 273 | <a href="', $calendar_data['previous_calendar']['href'], '">«</a> |
| 260 | 274 | </span>'; |
| 275 | + } |
|
| 261 | 276 | |
| 262 | 277 | // Next Link: if we're showing prev / next and it's not a mini-calendar. |
| 263 | - if (empty($calendar_data['next_calendar']['disabled']) && $calendar_data['show_next_prev'] && $is_mini === false) |
|
| 264 | - echo ' |
|
| 278 | + if (empty($calendar_data['next_calendar']['disabled']) && $calendar_data['show_next_prev'] && $is_mini === false) { |
|
| 279 | + echo ' |
|
| 265 | 280 | <span class="floatright"> |
| 266 | 281 | <a href="', $calendar_data['next_calendar']['href'], '">»</a> |
| 267 | 282 | </span>'; |
| 283 | + } |
|
| 268 | 284 | |
| 269 | 285 | // Arguably the most exciting part, the title! |
| 270 | 286 | echo ' |
@@ -274,8 +290,9 @@ discard block |
||
| 274 | 290 | } |
| 275 | 291 | |
| 276 | 292 | // Show the controls on main grids |
| 277 | - if ($is_mini === false) |
|
| 278 | - template_calendar_top($calendar_data); |
|
| 293 | + if ($is_mini === false) { |
|
| 294 | + template_calendar_top($calendar_data); |
|
| 295 | + } |
|
| 279 | 296 | |
| 280 | 297 | // Finally, the main calendar table. |
| 281 | 298 | echo ' |
@@ -288,14 +305,16 @@ discard block |
||
| 288 | 305 | <tr>'; |
| 289 | 306 | |
| 290 | 307 | // If we're showing week links, there's an extra column ahead of the week links, so let's think ahead and be prepared! |
| 291 | - if ($show_week_links === true) |
|
| 292 | - echo ' |
|
| 308 | + if ($show_week_links === true) { |
|
| 309 | + echo ' |
|
| 293 | 310 | <th></th>'; |
| 311 | + } |
|
| 294 | 312 | |
| 295 | 313 | // Now, loop through each actual day of the week. |
| 296 | - foreach ($calendar_data['week_days'] as $day) |
|
| 297 | - echo ' |
|
| 314 | + foreach ($calendar_data['week_days'] as $day) { |
|
| 315 | + echo ' |
|
| 298 | 316 | <th class="days" scope="col">', !empty($calendar_data['short_day_titles']) || $is_mini === true ? $txt['days_short'][$day] : $txt['days'][$day], '</th>'; |
| 317 | + } |
|
| 299 | 318 | |
| 300 | 319 | echo ' |
| 301 | 320 | </tr>'; |
@@ -314,11 +333,12 @@ discard block |
||
| 314 | 333 | <tr class="days_wrapper">'; |
| 315 | 334 | |
| 316 | 335 | // This is where we add the actual week link, if enabled on this location. |
| 317 | - if ($show_week_links === true) |
|
| 318 | - echo ' |
|
| 336 | + if ($show_week_links === true) { |
|
| 337 | + echo ' |
|
| 319 | 338 | <td class="windowbg2 weeks"> |
| 320 | 339 | <a href="', $scripturl, '?action=calendar;viewweek;year=', $calendar_data['current_year'], ';month=', $calendar_data['current_month'], ';day=', $week['days'][0]['day'], '" title="', $txt['calendar_view_week'], '">»</a> |
| 321 | 340 | </td>'; |
| 341 | + } |
|
| 322 | 342 | |
| 323 | 343 | // Now loop through each day in the week we're on. |
| 324 | 344 | foreach ($week['days'] as $day) |
@@ -335,27 +355,29 @@ discard block |
||
| 335 | 355 | // Additional classes are given for events, holidays, and birthdays. |
| 336 | 356 | if (!empty($day['events']) && !empty($calendar_data['highlight']['events'])) |
| 337 | 357 | { |
| 338 | - if ($is_mini === true && in_array($calendar_data['highlight']['events'], array(1, 3))) |
|
| 339 | - $classes[] = 'events'; |
|
| 340 | - elseif ($is_mini === false && in_array($calendar_data['highlight']['events'], array(2, 3))) |
|
| 341 | - $classes[] = 'events'; |
|
| 358 | + if ($is_mini === true && in_array($calendar_data['highlight']['events'], array(1, 3))) { |
|
| 359 | + $classes[] = 'events'; |
|
| 360 | + } elseif ($is_mini === false && in_array($calendar_data['highlight']['events'], array(2, 3))) { |
|
| 361 | + $classes[] = 'events'; |
|
| 362 | + } |
|
| 342 | 363 | } |
| 343 | 364 | if (!empty($day['holidays']) && !empty($calendar_data['highlight']['holidays'])) |
| 344 | 365 | { |
| 345 | - if ($is_mini === true && in_array($calendar_data['highlight']['holidays'], array(1, 3))) |
|
| 346 | - $classes[] = 'holidays'; |
|
| 347 | - elseif ($is_mini === false && in_array($calendar_data['highlight']['holidays'], array(2, 3))) |
|
| 348 | - $classes[] = 'holidays'; |
|
| 366 | + if ($is_mini === true && in_array($calendar_data['highlight']['holidays'], array(1, 3))) { |
|
| 367 | + $classes[] = 'holidays'; |
|
| 368 | + } elseif ($is_mini === false && in_array($calendar_data['highlight']['holidays'], array(2, 3))) { |
|
| 369 | + $classes[] = 'holidays'; |
|
| 370 | + } |
|
| 349 | 371 | } |
| 350 | 372 | if (!empty($day['birthdays']) && !empty($calendar_data['highlight']['birthdays'])) |
| 351 | 373 | { |
| 352 | - if ($is_mini === true && in_array($calendar_data['highlight']['birthdays'], array(1, 3))) |
|
| 353 | - $classes[] = 'birthdays'; |
|
| 354 | - elseif ($is_mini === false && in_array($calendar_data['highlight']['birthdays'], array(2, 3))) |
|
| 355 | - $classes[] = 'birthdays'; |
|
| 374 | + if ($is_mini === true && in_array($calendar_data['highlight']['birthdays'], array(1, 3))) { |
|
| 375 | + $classes[] = 'birthdays'; |
|
| 376 | + } elseif ($is_mini === false && in_array($calendar_data['highlight']['birthdays'], array(2, 3))) { |
|
| 377 | + $classes[] = 'birthdays'; |
|
| 378 | + } |
|
| 356 | 379 | } |
| 357 | - } |
|
| 358 | - else |
|
| 380 | + } else |
|
| 359 | 381 | { |
| 360 | 382 | // Default Classes (either compact or comfortable and disabled). |
| 361 | 383 | $classes[] = !empty($calendar_data['size']) && $calendar_data['size'] == 'small' ? 'compact' : 'comfortable'; |
@@ -374,25 +396,27 @@ discard block |
||
| 374 | 396 | $title_prefix = !empty($day['is_first_of_month']) && $context['current_month'] == $calendar_data['current_month'] && $is_mini === false ? (!empty($calendar_data['short_month_titles']) ? $txt['months_short'][$calendar_data['current_month']] . ' ' : $txt['months_titles'][$calendar_data['current_month']] . ' ') : ''; |
| 375 | 397 | |
| 376 | 398 | // The actual day number - be it a link, or just plain old text! |
| 377 | - if (!empty($modSettings['cal_daysaslink']) && $context['can_post']) |
|
| 378 | - echo ' |
|
| 399 | + if (!empty($modSettings['cal_daysaslink']) && $context['can_post']) { |
|
| 400 | + echo ' |
|
| 379 | 401 | <a href="', $scripturl, '?action=calendar;sa=post;year=', $calendar_data['current_year'], ';month=', $calendar_data['current_month'], ';day=', $day['day'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="day_text">', $title_prefix, $day['day'], '</span></a>'; |
| 380 | - elseif ($is_mini) |
|
| 381 | - echo ' |
|
| 402 | + } elseif ($is_mini) { |
|
| 403 | + echo ' |
|
| 382 | 404 | <a href="', $scripturl, '?action=calendar;', $context['calendar_view'], ';year=', $calendar_data['current_year'], ';month=', $calendar_data['current_month'], ';day=', $day['day'], '"><span class="day_text">', $title_prefix, $day['day'], '</span></a>'; |
| 383 | - else |
|
| 384 | - echo ' |
|
| 405 | + } else { |
|
| 406 | + echo ' |
|
| 385 | 407 | <span class="day_text">', $title_prefix, $day['day'], '</span>'; |
| 408 | + } |
|
| 386 | 409 | |
| 387 | 410 | // A lot of stuff, we're not showing on mini-calendars to conserve space. |
| 388 | 411 | if ($is_mini === false) |
| 389 | 412 | { |
| 390 | 413 | // Holidays are always fun, let's show them! |
| 391 | - if (!empty($day['holidays'])) |
|
| 392 | - echo ' |
|
| 414 | + if (!empty($day['holidays'])) { |
|
| 415 | + echo ' |
|
| 393 | 416 | <div class="smalltext holiday"> |
| 394 | 417 | <span>', $txt['calendar_prompt'], '</span> ', implode(', ', $day['holidays']), ' |
| 395 | 418 | </div>'; |
| 419 | + } |
|
| 396 | 420 | |
| 397 | 421 | // Happy Birthday Dear Member! |
| 398 | 422 | if (!empty($day['birthdays'])) |
@@ -410,15 +434,17 @@ discard block |
||
| 410 | 434 | echo '<a href="', $scripturl, '?action=profile;u=', $member['id'], '"><span class="fix_rtl_names">', $member['name'], '</span>', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] || ($count == 10 && $use_js_hide) ? '' : ', '; |
| 411 | 435 | |
| 412 | 436 | // 9...10! Let's stop there. |
| 413 | - if ($birthday_count == 10 && $use_js_hide) |
|
| 414 | - // !!TODO - Inline CSS and JavaScript should be moved. |
|
| 437 | + if ($birthday_count == 10 && $use_js_hide) { |
|
| 438 | + // !!TODO - Inline CSS and JavaScript should be moved. |
|
| 415 | 439 | echo '<span class="hidelink" id="bdhidelink_', $day['day'], '">...<br><a href="', $scripturl, '?action=calendar;month=', $calendar_data['current_month'], ';year=', $calendar_data['current_year'], ';showbd" onclick="document.getElementById(\'bdhide_', $day['day'], '\').style.display = \'\'; document.getElementById(\'bdhidelink_', $day['day'], '\').style.display = \'none\'; return false;">(', sprintf($txt['calendar_click_all'], count($day['birthdays'])), ')</a></span><span id="bdhide_', $day['day'], '" style="display: none;">, '; |
| 440 | + } |
|
| 416 | 441 | |
| 417 | 442 | ++$birthday_count; |
| 418 | 443 | } |
| 419 | - if ($use_js_hide) |
|
| 420 | - echo ' |
|
| 444 | + if ($use_js_hide) { |
|
| 445 | + echo ' |
|
| 421 | 446 | </span>'; |
| 447 | + } |
|
| 422 | 448 | |
| 423 | 449 | echo ' |
| 424 | 450 | </div><!-- .smalltext -->'; |
@@ -429,8 +455,9 @@ discard block |
||
| 429 | 455 | { |
| 430 | 456 | // Sort events by start time (all day events will be listed first) |
| 431 | 457 | uasort($day['events'], function($a, $b) { |
| 432 | - if ($a['start_timestamp'] == $b['start_timestamp']) |
|
| 433 | - return 0; |
|
| 458 | + if ($a['start_timestamp'] == $b['start_timestamp']) { |
|
| 459 | + return 0; |
|
| 460 | + } |
|
| 434 | 461 | |
| 435 | 462 | return ($a['start_timestamp'] < $b['start_timestamp']) ? -1 : 1; |
| 436 | 463 | }); |
@@ -450,20 +477,22 @@ discard block |
||
| 450 | 477 | ', $event['link'], '<br> |
| 451 | 478 | <span class="event_time', empty($event_icons_needed) ? ' floatright' : '', '">'; |
| 452 | 479 | |
| 453 | - if (!empty($event['start_time_local']) && $event['starts_today'] == true) |
|
| 454 | - echo trim(str_replace(':00 ', ' ', $event['start_time_local'])); |
|
| 455 | - elseif (!empty($event['end_time_local']) && $event['ends_today'] == true) |
|
| 456 | - echo strtolower($txt['ends']), ' ', trim(str_replace(':00 ', ' ', $event['end_time_local'])); |
|
| 457 | - elseif (!empty($event['allday'])) |
|
| 458 | - echo $txt['calendar_allday']; |
|
| 480 | + if (!empty($event['start_time_local']) && $event['starts_today'] == true) { |
|
| 481 | + echo trim(str_replace(':00 ', ' ', $event['start_time_local'])); |
|
| 482 | + } elseif (!empty($event['end_time_local']) && $event['ends_today'] == true) { |
|
| 483 | + echo strtolower($txt['ends']), ' ', trim(str_replace(':00 ', ' ', $event['end_time_local'])); |
|
| 484 | + } elseif (!empty($event['allday'])) { |
|
| 485 | + echo $txt['calendar_allday']; |
|
| 486 | + } |
|
| 459 | 487 | |
| 460 | 488 | echo ' |
| 461 | 489 | </span>'; |
| 462 | 490 | |
| 463 | - if (!empty($event['location'])) |
|
| 464 | - echo ' |
|
| 491 | + if (!empty($event['location'])) { |
|
| 492 | + echo ' |
|
| 465 | 493 | <br> |
| 466 | 494 | <span class="event_location', empty($event_icons_needed) ? ' floatright' : '', '">' . $event['location'] . '</span>'; |
| 495 | + } |
|
| 467 | 496 | |
| 468 | 497 | if ($event['can_edit'] || $event['can_export']) |
| 469 | 498 | { |
@@ -471,18 +500,20 @@ discard block |
||
| 471 | 500 | <span class="modify_event_links">'; |
| 472 | 501 | |
| 473 | 502 | // If they can edit the event, show an icon they can click on.... |
| 474 | - if ($event['can_edit']) |
|
| 475 | - echo ' |
|
| 503 | + if ($event['can_edit']) { |
|
| 504 | + echo ' |
|
| 476 | 505 | <a class="modify_event" href="', $event['modify_href'], '"> |
| 477 | 506 | <span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span> |
| 478 | 507 | </a>'; |
| 508 | + } |
|
| 479 | 509 | |
| 480 | 510 | // Exporting! |
| 481 | - if ($event['can_export']) |
|
| 482 | - echo ' |
|
| 511 | + if ($event['can_export']) { |
|
| 512 | + echo ' |
|
| 483 | 513 | <a class="modify_event" href="', $event['export_href'], '"> |
| 484 | 514 | <span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span> |
| 485 | 515 | </a>'; |
| 516 | + } |
|
| 486 | 517 | |
| 487 | 518 | echo ' |
| 488 | 519 | </span><br class="clear">'; |
@@ -501,10 +532,11 @@ discard block |
||
| 501 | 532 | // Otherwise, assuming it's not a mini-calendar, we can show previous / next month days! |
| 502 | 533 | elseif ($is_mini === false) |
| 503 | 534 | { |
| 504 | - if (empty($current_month_started) && !empty($context['calendar_grid_prev'])) |
|
| 505 | - echo '<a href="', $scripturl, '?action=calendar;year=', $context['calendar_grid_prev']['current_year'], ';month=', $context['calendar_grid_prev']['current_month'], '">', $context['calendar_grid_prev']['last_of_month'] - $calendar_data['shift']-- +1, '</a>'; |
|
| 506 | - elseif (!empty($current_month_started) && !empty($context['calendar_grid_next'])) |
|
| 507 | - echo '<a href="', $scripturl, '?action=calendar;year=', $context['calendar_grid_next']['current_year'], ';month=', $context['calendar_grid_next']['current_month'], '">', $current_month_started + 1 == $count ? (!empty($calendar_data['short_month_titles']) ? $txt['months_short'][$context['calendar_grid_next']['current_month']] . ' ' : $txt['months_titles'][$context['calendar_grid_next']['current_month']] . ' ') : '', $final_count++, '</a>'; |
|
| 535 | + if (empty($current_month_started) && !empty($context['calendar_grid_prev'])) { |
|
| 536 | + echo '<a href="', $scripturl, '?action=calendar;year=', $context['calendar_grid_prev']['current_year'], ';month=', $context['calendar_grid_prev']['current_month'], '">', $context['calendar_grid_prev']['last_of_month'] - $calendar_data['shift']-- +1, '</a>'; |
|
| 537 | + } elseif (!empty($current_month_started) && !empty($context['calendar_grid_next'])) { |
|
| 538 | + echo '<a href="', $scripturl, '?action=calendar;year=', $context['calendar_grid_next']['current_year'], ';month=', $context['calendar_grid_next']['current_month'], '">', $current_month_started + 1 == $count ? (!empty($calendar_data['short_month_titles']) ? $txt['months_short'][$context['calendar_grid_next']['current_month']] . ' ' : $txt['months_titles'][$context['calendar_grid_next']['current_month']] . ' ') : '', $final_count++, '</a>'; |
|
| 539 | + } |
|
| 508 | 540 | } |
| 509 | 541 | |
| 510 | 542 | // Close this day and increase var count. |
@@ -534,8 +566,9 @@ discard block |
||
| 534 | 566 | global $context, $txt, $scripturl, $modSettings; |
| 535 | 567 | |
| 536 | 568 | // We might have no reason to proceed, if the variable isn't there. |
| 537 | - if (!isset($context['calendar_grid_' . $grid_name])) |
|
| 538 | - return false; |
|
| 569 | + if (!isset($context['calendar_grid_' . $grid_name])) { |
|
| 570 | + return false; |
|
| 571 | + } |
|
| 539 | 572 | |
| 540 | 573 | // Handy pointer. |
| 541 | 574 | $calendar_data = &$context['calendar_grid_' . $grid_name]; |
@@ -552,22 +585,25 @@ discard block |
||
| 552 | 585 | <h3 class="catbg centertext largetext">'; |
| 553 | 586 | |
| 554 | 587 | // Previous Week Link... |
| 555 | - if (empty($calendar_data['previous_calendar']['disabled']) && !empty($calendar_data['show_next_prev'])) |
|
| 556 | - echo ' |
|
| 588 | + if (empty($calendar_data['previous_calendar']['disabled']) && !empty($calendar_data['show_next_prev'])) { |
|
| 589 | + echo ' |
|
| 557 | 590 | <span class="floatleft"> |
| 558 | 591 | <a href="', $calendar_data['previous_week']['href'], '">«</a> |
| 559 | 592 | </span>'; |
| 593 | + } |
|
| 560 | 594 | |
| 561 | 595 | // Next Week Link... |
| 562 | - if (empty($calendar_data['next_calendar']['disabled']) && !empty($calendar_data['show_next_prev'])) |
|
| 563 | - echo ' |
|
| 596 | + if (empty($calendar_data['next_calendar']['disabled']) && !empty($calendar_data['show_next_prev'])) { |
|
| 597 | + echo ' |
|
| 564 | 598 | <span class="floatright"> |
| 565 | 599 | <a href="', $calendar_data['next_week']['href'], '">»</a> |
| 566 | 600 | </span>'; |
| 601 | + } |
|
| 567 | 602 | |
| 568 | 603 | // The Month Title + Week Number... |
| 569 | - if (!empty($calendar_data['week_title'])) |
|
| 570 | - echo $calendar_data['week_title']; |
|
| 604 | + if (!empty($calendar_data['week_title'])) { |
|
| 605 | + echo $calendar_data['week_title']; |
|
| 606 | + } |
|
| 571 | 607 | |
| 572 | 608 | echo ' |
| 573 | 609 | </h3> |
@@ -608,11 +644,12 @@ discard block |
||
| 608 | 644 | <td class="', implode(' ', $classes), ' act_day">'; |
| 609 | 645 | |
| 610 | 646 | // Should the day number be a link? |
| 611 | - if (!empty($modSettings['cal_daysaslink']) && $context['can_post']) |
|
| 612 | - echo ' |
|
| 647 | + if (!empty($modSettings['cal_daysaslink']) && $context['can_post']) { |
|
| 648 | + echo ' |
|
| 613 | 649 | <a href="', $scripturl, '?action=calendar;sa=post;month=', $month_data['current_month'], ';year=', $month_data['current_year'], ';day=', $day['day'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['days'][$day['day_of_week']], ' - ', $day['day'], '</a>'; |
| 614 | - else |
|
| 615 | - echo $txt['days'][$day['day_of_week']], ' - ', $day['day']; |
|
| 650 | + } else { |
|
| 651 | + echo $txt['days'][$day['day_of_week']], ' - ', $day['day']; |
|
| 652 | + } |
|
| 616 | 653 | |
| 617 | 654 | echo ' |
| 618 | 655 | </td> |
@@ -623,8 +660,9 @@ discard block |
||
| 623 | 660 | { |
| 624 | 661 | // Sort events by start time (all day events will be listed first) |
| 625 | 662 | uasort($day['events'], function($a, $b) { |
| 626 | - if ($a['start_timestamp'] == $b['start_timestamp']) |
|
| 627 | - return 0; |
|
| 663 | + if ($a['start_timestamp'] == $b['start_timestamp']) { |
|
| 664 | + return 0; |
|
| 665 | + } |
|
| 628 | 666 | return ($a['start_timestamp'] < $b['start_timestamp']) ? -1 : 1; |
| 629 | 667 | }); |
| 630 | 668 | |
@@ -638,35 +676,39 @@ discard block |
||
| 638 | 676 | echo $event['link'], '<br> |
| 639 | 677 | <span class="event_time', empty($event_icons_needed) ? ' floatright' : '', '">'; |
| 640 | 678 | |
| 641 | - if (!empty($event['start_time_local'])) |
|
| 642 | - echo trim($event['start_time_local']), !empty($event['end_time_local']) ? ' – ' . trim($event['end_time_local']) : ''; |
|
| 643 | - else |
|
| 644 | - echo $txt['calendar_allday']; |
|
| 679 | + if (!empty($event['start_time_local'])) { |
|
| 680 | + echo trim($event['start_time_local']), !empty($event['end_time_local']) ? ' – ' . trim($event['end_time_local']) : ''; |
|
| 681 | + } else { |
|
| 682 | + echo $txt['calendar_allday']; |
|
| 683 | + } |
|
| 645 | 684 | |
| 646 | 685 | echo ' |
| 647 | 686 | </span>'; |
| 648 | 687 | |
| 649 | - if (!empty($event['location'])) |
|
| 650 | - echo '<br> |
|
| 688 | + if (!empty($event['location'])) { |
|
| 689 | + echo '<br> |
|
| 651 | 690 | <span class="event_location', empty($event_icons_needed) ? ' floatright' : '', '">' . $event['location'] . '</span>'; |
| 691 | + } |
|
| 652 | 692 | |
| 653 | 693 | if (!empty($event_icons_needed)) |
| 654 | 694 | { |
| 655 | 695 | echo ' <span class="modify_event_links">'; |
| 656 | 696 | |
| 657 | 697 | // If they can edit the event, show a star they can click on.... |
| 658 | - if (!empty($event['can_edit'])) |
|
| 659 | - echo ' |
|
| 698 | + if (!empty($event['can_edit'])) { |
|
| 699 | + echo ' |
|
| 660 | 700 | <a class="modify_event" href="', $event['modify_href'], '"> |
| 661 | 701 | <span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span> |
| 662 | 702 | </a>'; |
| 703 | + } |
|
| 663 | 704 | |
| 664 | 705 | // Can we export? Sweet. |
| 665 | - if (!empty($event['can_export'])) |
|
| 666 | - echo ' |
|
| 706 | + if (!empty($event['can_export'])) { |
|
| 707 | + echo ' |
|
| 667 | 708 | <a class="modify_event" href="', $event['export_href'], '"> |
| 668 | 709 | <span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span> |
| 669 | 710 | </a>'; |
| 711 | + } |
|
| 670 | 712 | |
| 671 | 713 | echo ' |
| 672 | 714 | </span><br class="clear">'; |
@@ -684,22 +726,23 @@ discard block |
||
| 684 | 726 | </div> |
| 685 | 727 | <br class="clear">'; |
| 686 | 728 | } |
| 687 | - } |
|
| 688 | - else |
|
| 729 | + } else |
|
| 689 | 730 | { |
| 690 | - if (!empty($context['can_post'])) |
|
| 691 | - echo ' |
|
| 731 | + if (!empty($context['can_post'])) { |
|
| 732 | + echo ' |
|
| 692 | 733 | <div class="week_add_event"> |
| 693 | 734 | <a href="', $scripturl, '?action=calendar;sa=post;month=', $month_data['current_month'], ';year=', $month_data['current_year'], ';day=', $day['day'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['calendar_post_event'], '</a> |
| 694 | 735 | </div>'; |
| 736 | + } |
|
| 695 | 737 | } |
| 696 | 738 | echo ' |
| 697 | 739 | </td> |
| 698 | 740 | <td class="', implode(' ', $classes), !empty($day['holidays']) ? ' holidays' : ' disabled', ' holiday_col" data-css-prefix="' . $txt['calendar_prompt'] . ' ">'; |
| 699 | 741 | |
| 700 | 742 | // Show any holidays! |
| 701 | - if (!empty($day['holidays'])) |
|
| 702 | - echo implode('<br>', $day['holidays']); |
|
| 743 | + if (!empty($day['holidays'])) { |
|
| 744 | + echo implode('<br>', $day['holidays']); |
|
| 745 | + } |
|
| 703 | 746 | |
| 704 | 747 | echo ' |
| 705 | 748 | </td> |
@@ -708,11 +751,12 @@ discard block |
||
| 708 | 751 | // Show any birthdays... |
| 709 | 752 | if (!empty($day['birthdays'])) |
| 710 | 753 | { |
| 711 | - foreach ($day['birthdays'] as $member) |
|
| 712 | - echo ' |
|
| 754 | + foreach ($day['birthdays'] as $member) { |
|
| 755 | + echo ' |
|
| 713 | 756 | <a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['name'], '</a> |
| 714 | 757 | ', isset($member['age']) ? ' (' . $member['age'] . ')' : '', ' |
| 715 | 758 | ', $member['is_last'] ? '' : '<br>'; |
| 759 | + } |
|
| 716 | 760 | } |
| 717 | 761 | echo ' |
| 718 | 762 | </td> |
@@ -758,26 +802,27 @@ discard block |
||
| 758 | 802 | <input type="text" name="end_date" id="end_date" maxlength="10" value="', $calendar_data['end_date'], '" tabindex="', $context['tabindex']++, '" class="date_input end" data-type="date"> |
| 759 | 803 | <input type="submit" class="button" style="float:none" id="view_button" value="', $txt['view'], '"> |
| 760 | 804 | </form>'; |
| 761 | - } |
|
| 762 | - else |
|
| 805 | + } else |
|
| 763 | 806 | { |
| 764 | 807 | echo' |
| 765 | 808 | <form action="', $scripturl, '?action=calendar" id="calendar_navigation" method="post" accept-charset="', $context['character_set'], '"> |
| 766 | 809 | <select name="month" id="input_month">'; |
| 767 | 810 | |
| 768 | 811 | // Show a select box with all the months. |
| 769 | - foreach ($txt['months_short'] as $number => $month) |
|
| 770 | - echo ' |
|
| 812 | + foreach ($txt['months_short'] as $number => $month) { |
|
| 813 | + echo ' |
|
| 771 | 814 | <option value="', $number, '"', $number == $context['current_month'] ? ' selected' : '', '>', $month, '</option>'; |
| 815 | + } |
|
| 772 | 816 | |
| 773 | 817 | echo ' |
| 774 | 818 | </select> |
| 775 | 819 | <select name="year">'; |
| 776 | 820 | |
| 777 | 821 | // Show a link for every year... |
| 778 | - for ($year = $context['calendar_resources']['min_year']; $year <= $context['calendar_resources']['max_year']; $year++) |
|
| 779 | - echo ' |
|
| 822 | + for ($year = $context['calendar_resources']['min_year']; $year <= $context['calendar_resources']['max_year']; $year++) { |
|
| 823 | + echo ' |
|
| 780 | 824 | <option value="', $year, '"', $year == $context['current_year'] ? ' selected' : '', '>', $year, '</option>'; |
| 825 | + } |
|
| 781 | 826 | |
| 782 | 827 | echo ' |
| 783 | 828 | </select> |
@@ -799,9 +844,10 @@ discard block |
||
| 799 | 844 | echo ' |
| 800 | 845 | <form action="', $scripturl, '?action=calendar;sa=post" method="post" name="postevent" accept-charset="', $context['character_set'], '" onsubmit="submitonce(this);">'; |
| 801 | 846 | |
| 802 | - if (!empty($context['event']['new'])) |
|
| 803 | - echo ' |
|
| 847 | + if (!empty($context['event']['new'])) { |
|
| 848 | + echo ' |
|
| 804 | 849 | <input type="hidden" name="eventid" value="', $context['event']['eventid'], '">'; |
| 850 | + } |
|
| 805 | 851 | |
| 806 | 852 | // Start the main table. |
| 807 | 853 | echo ' |
@@ -812,8 +858,8 @@ discard block |
||
| 812 | 858 | </h3> |
| 813 | 859 | </div>'; |
| 814 | 860 | |
| 815 | - if (!empty($context['post_error']['messages'])) |
|
| 816 | - echo ' |
|
| 861 | + if (!empty($context['post_error']['messages'])) { |
|
| 862 | + echo ' |
|
| 817 | 863 | <div class="errorbox"> |
| 818 | 864 | <dl class="event_error"> |
| 819 | 865 | <dt> |
@@ -824,6 +870,7 @@ discard block |
||
| 824 | 870 | </dt> |
| 825 | 871 | </dl> |
| 826 | 872 | </div>'; |
| 873 | + } |
|
| 827 | 874 | |
| 828 | 875 | echo ' |
| 829 | 876 | <div class="roundframe noup"> |
@@ -851,9 +898,10 @@ discard block |
||
| 851 | 898 | echo ' |
| 852 | 899 | <optgroup label="', $category['name'], '">'; |
| 853 | 900 | |
| 854 | - foreach ($category['boards'] as $board) |
|
| 855 | - echo ' |
|
| 901 | + foreach ($category['boards'] as $board) { |
|
| 902 | + echo ' |
|
| 856 | 903 | <option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=>' : '', ' ', $board['name'], '</option>'; |
| 904 | + } |
|
| 857 | 905 | echo ' |
| 858 | 906 | </optgroup>'; |
| 859 | 907 | } |
@@ -889,9 +937,10 @@ discard block |
||
| 889 | 937 | <span class="label">', $txt['calendar_timezone'], '</span> |
| 890 | 938 | <select name="tz" id="tz"', !empty($context['event']['allday']) ? ' disabled' : '', '>'; |
| 891 | 939 | |
| 892 | - foreach ($context['all_timezones'] as $tz => $tzname) |
|
| 893 | - echo ' |
|
| 940 | + foreach ($context['all_timezones'] as $tz => $tzname) { |
|
| 941 | + echo ' |
|
| 894 | 942 | <option value="', $tz, '"', $tz == $context['event']['tz'] ? ' selected' : '', '>', $tzname, '</option>'; |
| 943 | + } |
|
| 895 | 944 | |
| 896 | 945 | echo ' |
| 897 | 946 | </select> |
@@ -907,9 +956,10 @@ discard block |
||
| 907 | 956 | <input type="submit" value="', empty($context['event']['new']) ? $txt['save'] : $txt['post'], '" class="button">'; |
| 908 | 957 | |
| 909 | 958 | // Delete button? |
| 910 | - if (empty($context['event']['new'])) |
|
| 911 | - echo ' |
|
| 959 | + if (empty($context['event']['new'])) { |
|
| 960 | + echo ' |
|
| 912 | 961 | <input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['calendar_confirm_delete'], '" class="button you_sure">'; |
| 962 | + } |
|
| 913 | 963 | |
| 914 | 964 | echo ' |
| 915 | 965 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -937,9 +987,10 @@ discard block |
||
| 937 | 987 | echo ' |
| 938 | 988 | <td style="padding-', $alt ? 'right' : 'left', ': 1.5em;">'; |
| 939 | 989 | |
| 940 | - foreach ($v as $i) |
|
| 941 | - echo ' |
|
| 990 | + foreach ($v as $i) { |
|
| 991 | + echo ' |
|
| 942 | 992 | <img src="', $context['offimg'], '" alt="" id="', $t, '_', $i, '"><br>'; |
| 993 | + } |
|
| 943 | 994 | |
| 944 | 995 | echo ' |
| 945 | 996 | </td>'; |
@@ -960,9 +1011,10 @@ discard block |
||
| 960 | 1011 | |
| 961 | 1012 | foreach ($context['clockicons'] as $t => $v) |
| 962 | 1013 | { |
| 963 | - foreach ($v as $i) |
|
| 964 | - echo ' |
|
| 1014 | + foreach ($v as $i) { |
|
| 1015 | + echo ' |
|
| 965 | 1016 | icons[\'', $t, '_', $i, '\'] = document.getElementById(\'', $t, '_', $i, '\');'; |
| 1017 | + } |
|
| 966 | 1018 | } |
| 967 | 1019 | |
| 968 | 1020 | echo ' |
@@ -987,13 +1039,14 @@ discard block |
||
| 987 | 1039 | |
| 988 | 1040 | foreach ($context['clockicons'] as $t => $v) |
| 989 | 1041 | { |
| 990 | - foreach ($v as $i) |
|
| 991 | - echo ' |
|
| 1042 | + foreach ($v as $i) { |
|
| 1043 | + echo ' |
|
| 992 | 1044 | if (', $t, ' >= ', $i, ') |
| 993 | 1045 | { |
| 994 | 1046 | turnon.push("', $t, '_', $i, '"); |
| 995 | 1047 | ', $t, ' -= ', $i, '; |
| 996 | 1048 | }'; |
| 1049 | + } |
|
| 997 | 1050 | } |
| 998 | 1051 | |
| 999 | 1052 | echo ' |
@@ -1037,9 +1090,10 @@ discard block |
||
| 1037 | 1090 | <tr class="', $alt ? 'windowbg2' : 'windowbg', '"> |
| 1038 | 1091 | <td>'; |
| 1039 | 1092 | |
| 1040 | - foreach ($v as $i) |
|
| 1041 | - echo ' |
|
| 1093 | + foreach ($v as $i) { |
|
| 1094 | + echo ' |
|
| 1042 | 1095 | <img src="', $context['offimg'], '" alt="" id="', $t, '_', $i, '" style="padding: 2px;">'; |
| 1096 | + } |
|
| 1043 | 1097 | |
| 1044 | 1098 | echo ' |
| 1045 | 1099 | </td> |
@@ -1061,9 +1115,10 @@ discard block |
||
| 1061 | 1115 | |
| 1062 | 1116 | foreach ($context['clockicons'] as $t => $v) |
| 1063 | 1117 | { |
| 1064 | - foreach ($v as $i) |
|
| 1065 | - echo ' |
|
| 1118 | + foreach ($v as $i) { |
|
| 1119 | + echo ' |
|
| 1066 | 1120 | icons[\'', $t, '_', $i, '\'] = document.getElementById(\'', $t, '_', $i, '\');'; |
| 1121 | + } |
|
| 1067 | 1122 | } |
| 1068 | 1123 | |
| 1069 | 1124 | echo ' |
@@ -1080,13 +1135,14 @@ discard block |
||
| 1080 | 1135 | |
| 1081 | 1136 | foreach ($context['clockicons'] as $t => $v) |
| 1082 | 1137 | { |
| 1083 | - foreach ($v as $i) |
|
| 1084 | - echo ' |
|
| 1138 | + foreach ($v as $i) { |
|
| 1139 | + echo ' |
|
| 1085 | 1140 | if (', $t, ' >= ', $i, ') |
| 1086 | 1141 | { |
| 1087 | 1142 | turnon.push("', $t, '_', $i, '"); |
| 1088 | 1143 | ', $t, ' -= ', $i, '; |
| 1089 | 1144 | }'; |
| 1145 | + } |
|
| 1090 | 1146 | } |
| 1091 | 1147 | |
| 1092 | 1148 | echo ' |
@@ -1130,9 +1186,10 @@ discard block |
||
| 1130 | 1186 | <tr class="', $alt ? 'windowbg2' : 'windowbg', '"> |
| 1131 | 1187 | <td>'; |
| 1132 | 1188 | |
| 1133 | - foreach ($v as $i) |
|
| 1134 | - echo ' |
|
| 1189 | + foreach ($v as $i) { |
|
| 1190 | + echo ' |
|
| 1135 | 1191 | <img src="', $context['offimg'], '" alt="" id="', $t, '_', $i, '" style="padding: 2px;">'; |
| 1192 | + } |
|
| 1136 | 1193 | |
| 1137 | 1194 | echo ' |
| 1138 | 1195 | </td> |
@@ -1148,9 +1205,10 @@ discard block |
||
| 1148 | 1205 | |
| 1149 | 1206 | foreach ($context['clockicons'] as $t => $v) |
| 1150 | 1207 | { |
| 1151 | - foreach ($v as $i) |
|
| 1152 | - echo ' |
|
| 1208 | + foreach ($v as $i) { |
|
| 1209 | + echo ' |
|
| 1153 | 1210 | icons[\'', $t, '_', $i, '\'] = document.getElementById(\'', $t, '_', $i, '\');'; |
| 1211 | + } |
|
| 1154 | 1212 | } |
| 1155 | 1213 | |
| 1156 | 1214 | echo ' |
@@ -1171,13 +1229,14 @@ discard block |
||
| 1171 | 1229 | |
| 1172 | 1230 | foreach ($context['clockicons'] as $t => $v) |
| 1173 | 1231 | { |
| 1174 | - foreach ($v as $i) |
|
| 1175 | - echo ' |
|
| 1232 | + foreach ($v as $i) { |
|
| 1233 | + echo ' |
|
| 1176 | 1234 | if (', $t, ' >= ', $i, ') |
| 1177 | 1235 | { |
| 1178 | 1236 | turnon.push("', $t, '_', $i, '"); |
| 1179 | 1237 | ', $t, ' -= ', $i, '; |
| 1180 | 1238 | }'; |
| 1239 | + } |
|
| 1181 | 1240 | } |
| 1182 | 1241 | |
| 1183 | 1242 | echo ' |
@@ -1221,9 +1280,10 @@ discard block |
||
| 1221 | 1280 | <tr class="', $alt ? 'windowbg2' : 'windowbg', '"> |
| 1222 | 1281 | <td>'; |
| 1223 | 1282 | |
| 1224 | - foreach ($v as $i) |
|
| 1225 | - echo ' |
|
| 1283 | + foreach ($v as $i) { |
|
| 1284 | + echo ' |
|
| 1226 | 1285 | <img src="', $i ? $context['onimg'] : $context['offimg'], '" alt="" style="padding: 2px;">'; |
| 1286 | + } |
|
| 1227 | 1287 | |
| 1228 | 1288 | echo ' |
| 1229 | 1289 | </td> |
@@ -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> |
@@ -141,10 +146,11 @@ discard block |
||
| 141 | 146 | <select name="copy_from"> |
| 142 | 147 | <option value="empty">(', $txt['permissions_select_membergroup'], ')</option>'; |
| 143 | 148 | |
| 144 | - foreach ($context['groups'] as $group) |
|
| 145 | - if ($group['id'] != 1) |
|
| 149 | + foreach ($context['groups'] as $group) { |
|
| 150 | + if ($group['id'] != 1) |
|
| 146 | 151 | echo ' |
| 147 | 152 | <option value="', $group['id'], '">', $group['name'], '</option>'; |
| 153 | + } |
|
| 148 | 154 | |
| 149 | 155 | echo ' |
| 150 | 156 | </select> |
@@ -154,9 +160,10 @@ discard block |
||
| 154 | 160 | <option value="add">', $txt['permissions_add'], '...</option> |
| 155 | 161 | <option value="clear">', $txt['permissions_remove'], '...</option>'; |
| 156 | 162 | |
| 157 | - if (!empty($modSettings['permission_enable_deny'])) |
|
| 158 | - echo ' |
|
| 163 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
| 164 | + echo ' |
|
| 159 | 165 | <option value="deny">', $txt['permissions_deny'], '...</option>'; |
| 166 | + } |
|
| 160 | 167 | |
| 161 | 168 | echo ' |
| 162 | 169 | </select> |
@@ -167,31 +174,35 @@ discard block |
||
| 167 | 174 | |
| 168 | 175 | foreach ($context['permissions'] as $permissionType) |
| 169 | 176 | { |
| 170 | - if ($permissionType['id'] == 'membergroup' && !empty($context['profile'])) |
|
| 171 | - continue; |
|
| 177 | + if ($permissionType['id'] == 'membergroup' && !empty($context['profile'])) { |
|
| 178 | + continue; |
|
| 179 | + } |
|
| 172 | 180 | |
| 173 | 181 | foreach ($permissionType['columns'] as $column) |
| 174 | 182 | { |
| 175 | 183 | foreach ($column as $permissionGroup) |
| 176 | 184 | { |
| 177 | - if ($permissionGroup['hidden']) |
|
| 178 | - continue; |
|
| 185 | + if ($permissionGroup['hidden']) { |
|
| 186 | + continue; |
|
| 187 | + } |
|
| 179 | 188 | |
| 180 | 189 | echo ' |
| 181 | 190 | <option value="" disabled>[', $permissionGroup['name'], ']</option>'; |
| 182 | 191 | |
| 183 | 192 | foreach ($permissionGroup['permissions'] as $perm) |
| 184 | 193 | { |
| 185 | - if ($perm['hidden']) |
|
| 186 | - continue; |
|
| 194 | + if ($perm['hidden']) { |
|
| 195 | + continue; |
|
| 196 | + } |
|
| 187 | 197 | |
| 188 | - if ($perm['has_own_any']) |
|
| 189 | - echo ' |
|
| 198 | + if ($perm['has_own_any']) { |
|
| 199 | + echo ' |
|
| 190 | 200 | <option value="', $permissionType['id'], '/', $perm['own']['id'], '"> ', $perm['name'], ' (', $perm['own']['name'], ')</option> |
| 191 | 201 | <option value="', $permissionType['id'], '/', $perm['any']['id'], '"> ', $perm['name'], ' (', $perm['any']['name'], ')</option>'; |
| 192 | - else |
|
| 193 | - echo ' |
|
| 202 | + } else { |
|
| 203 | + echo ' |
|
| 194 | 204 | <option value="', $permissionType['id'], '/', $perm['id'], '"> ', $perm['name'], '</option>'; |
| 205 | + } |
|
| 195 | 206 | } |
| 196 | 207 | } |
| 197 | 208 | } |
@@ -256,9 +267,10 @@ discard block |
||
| 256 | 267 | } |
| 257 | 268 | </script>'; |
| 258 | 269 | |
| 259 | - if (!empty($context['profile'])) |
|
| 260 | - echo ' |
|
| 270 | + if (!empty($context['profile'])) { |
|
| 271 | + echo ' |
|
| 261 | 272 | <input type="hidden" name="pid" value="', $context['profile']['id'], '">'; |
| 273 | + } |
|
| 262 | 274 | |
| 263 | 275 | echo ' |
| 264 | 276 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -303,9 +315,10 @@ discard block |
||
| 303 | 315 | <h3 class="subbg">', $category['name'], '</h3> |
| 304 | 316 | </div>'; |
| 305 | 317 | |
| 306 | - if (!empty($category['boards'])) |
|
| 307 | - echo ' |
|
| 318 | + if (!empty($category['boards'])) { |
|
| 319 | + echo ' |
|
| 308 | 320 | <ul class="perm_boards flow_hidden">'; |
| 321 | + } |
|
| 309 | 322 | |
| 310 | 323 | foreach ($category['boards'] as $board) |
| 311 | 324 | { |
@@ -321,33 +334,36 @@ discard block |
||
| 321 | 334 | echo ' |
| 322 | 335 | <select name="boardprofile[', $board['id'], ']">'; |
| 323 | 336 | |
| 324 | - foreach ($context['profiles'] as $id => $profile) |
|
| 325 | - echo ' |
|
| 337 | + foreach ($context['profiles'] as $id => $profile) { |
|
| 338 | + echo ' |
|
| 326 | 339 | <option value="', $id, '"', $id == $board['profile'] ? ' selected' : '', '>', $profile['name'], '</option>'; |
| 340 | + } |
|
| 327 | 341 | |
| 328 | 342 | echo ' |
| 329 | 343 | </select>'; |
| 330 | - } |
|
| 331 | - else |
|
| 332 | - echo ' |
|
| 344 | + } else { |
|
| 345 | + echo ' |
|
| 333 | 346 | <a href="', $scripturl, '?action=admin;area=permissions;sa=index;pid=', $board['profile'], ';', $context['session_var'], '=', $context['session_id'], '">', $board['profile_name'], '</a>'; |
| 347 | + } |
|
| 334 | 348 | |
| 335 | 349 | echo ' |
| 336 | 350 | </span> |
| 337 | 351 | </li>'; |
| 338 | 352 | } |
| 339 | 353 | |
| 340 | - if (!empty($category['boards'])) |
|
| 341 | - echo ' |
|
| 354 | + if (!empty($category['boards'])) { |
|
| 355 | + echo ' |
|
| 342 | 356 | </ul>'; |
| 357 | + } |
|
| 343 | 358 | } |
| 344 | 359 | |
| 345 | - if ($context['edit_all']) |
|
| 346 | - echo ' |
|
| 360 | + if ($context['edit_all']) { |
|
| 361 | + echo ' |
|
| 347 | 362 | <input type="submit" name="save_changes" value="', $txt['save'], '" class="button">'; |
| 348 | - else |
|
| 349 | - echo ' |
|
| 363 | + } else { |
|
| 364 | + echo ' |
|
| 350 | 365 | <a class="button" href="', $scripturl, '?action=admin;area=permissions;sa=board;edit;', $context['session_var'], '=', $context['session_id'], '">', $txt['permissions_board_all'], '</a>'; |
| 366 | + } |
|
| 351 | 367 | |
| 352 | 368 | echo ' |
| 353 | 369 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -387,12 +403,13 @@ discard block |
||
| 387 | 403 | <tr class="windowbg"> |
| 388 | 404 | <td>'; |
| 389 | 405 | |
| 390 | - if (!empty($context['show_rename_boxes']) && $profile['can_edit']) |
|
| 391 | - echo ' |
|
| 406 | + if (!empty($context['show_rename_boxes']) && $profile['can_edit']) { |
|
| 407 | + echo ' |
|
| 392 | 408 | <input type="text" name="rename_profile[', $profile['id'], ']" value="', $profile['name'], '">'; |
| 393 | - else |
|
| 394 | - echo ' |
|
| 409 | + } else { |
|
| 410 | + echo ' |
|
| 395 | 411 | <a href="', $scripturl, '?action=admin;area=permissions;sa=index;pid=', $profile['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $profile['name'], '</a>'; |
| 412 | + } |
|
| 396 | 413 | |
| 397 | 414 | echo ' |
| 398 | 415 | </td> |
@@ -412,9 +429,10 @@ discard block |
||
| 412 | 429 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 413 | 430 | <input type="hidden" name="', $context['admin-mpp_token_var'], '" value="', $context['admin-mpp_token'], '">'; |
| 414 | 431 | |
| 415 | - if ($context['can_edit_something']) |
|
| 416 | - echo ' |
|
| 432 | + if ($context['can_edit_something']) { |
|
| 433 | + echo ' |
|
| 417 | 434 | <input type="submit" name="rename" value="', empty($context['show_rename_boxes']) ? $txt['permissions_profile_rename'] : $txt['permissions_commit'], '" class="button">'; |
| 435 | + } |
|
| 418 | 436 | |
| 419 | 437 | echo ' |
| 420 | 438 | <input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" class="button" ', !empty($context['show_rename_boxes']) ? ' style="display:none"' : '', '> |
@@ -439,9 +457,10 @@ discard block |
||
| 439 | 457 | <dd> |
| 440 | 458 | <select name="copy_from">'; |
| 441 | 459 | |
| 442 | - foreach ($context['profiles'] as $id => $profile) |
|
| 443 | - echo ' |
|
| 460 | + foreach ($context['profiles'] as $id => $profile) { |
|
| 461 | + echo ' |
|
| 444 | 462 | <option value="', $id, '">', $profile['name'], '</option>'; |
| 463 | + } |
|
| 445 | 464 | |
| 446 | 465 | echo ' |
| 447 | 466 | </select> |
@@ -463,13 +482,13 @@ discard block |
||
| 463 | 482 | global $context, $scripturl, $txt, $modSettings; |
| 464 | 483 | |
| 465 | 484 | // Cannot be edited? |
| 466 | - if (!$context['profile']['can_modify']) |
|
| 467 | - echo ' |
|
| 485 | + if (!$context['profile']['can_modify']) { |
|
| 486 | + echo ' |
|
| 468 | 487 | <div class="errorbox"> |
| 469 | 488 | ', sprintf($txt['permission_cannot_edit'], $scripturl . '?action=admin;area=permissions;sa=profiles'), ' |
| 470 | 489 | </div>'; |
| 471 | - else |
|
| 472 | - echo ' |
|
| 490 | + } else { |
|
| 491 | + echo ' |
|
| 473 | 492 | <script> |
| 474 | 493 | window.smf_usedDeny = false; |
| 475 | 494 | |
@@ -481,27 +500,30 @@ discard block |
||
| 481 | 500 | return true; |
| 482 | 501 | } |
| 483 | 502 | </script>'; |
| 503 | + } |
|
| 484 | 504 | |
| 485 | 505 | echo ' |
| 486 | 506 | <div id="admincenter"> |
| 487 | 507 | <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();">'; |
| 488 | 508 | |
| 489 | - if (!empty($modSettings['permission_enable_deny']) && $context['group']['id'] != -1) |
|
| 490 | - echo ' |
|
| 509 | + if (!empty($modSettings['permission_enable_deny']) && $context['group']['id'] != -1) { |
|
| 510 | + echo ' |
|
| 491 | 511 | <div class="information"> |
| 492 | 512 | ', $txt['permissions_option_desc'], ' |
| 493 | 513 | </div>'; |
| 514 | + } |
|
| 494 | 515 | |
| 495 | 516 | echo ' |
| 496 | 517 | <div class="cat_bar"> |
| 497 | 518 | <h3 class="catbg">'; |
| 498 | 519 | |
| 499 | - if ($context['permission_type'] == 'board') |
|
| 500 | - echo ' |
|
| 520 | + if ($context['permission_type'] == 'board') { |
|
| 521 | + echo ' |
|
| 501 | 522 | ', $txt['permissions_local_for'], ' "', $context['group']['name'], '" ', $txt['permissions_on'], ' "', $context['profile']['name'], '"'; |
| 502 | - else |
|
| 503 | - echo ' |
|
| 523 | + } else { |
|
| 524 | + echo ' |
|
| 504 | 525 | ', $context['permission_type'] == 'membergroup' ? $txt['permissions_general'] : $txt['permissions_board'], ' - "', $context['group']['name'], '"'; |
| 526 | + } |
|
| 505 | 527 | echo ' |
| 506 | 528 | </h3> |
| 507 | 529 | </div>'; |
@@ -524,15 +546,17 @@ discard block |
||
| 524 | 546 | template_modify_group_display('board'); |
| 525 | 547 | } |
| 526 | 548 | |
| 527 | - if ($context['profile']['can_modify']) |
|
| 528 | - echo ' |
|
| 549 | + if ($context['profile']['can_modify']) { |
|
| 550 | + echo ' |
|
| 529 | 551 | <div class="padding"> |
| 530 | 552 | <input type="submit" value="', $txt['permissions_commit'], '" class="button"> |
| 531 | 553 | </div>'; |
| 554 | + } |
|
| 532 | 555 | |
| 533 | - foreach ($context['hidden_perms'] as $hidden_perm) |
|
| 534 | - echo ' |
|
| 556 | + foreach ($context['hidden_perms'] as $hidden_perm) { |
|
| 557 | + echo ' |
|
| 535 | 558 | <input type="hidden" name="perm[', $hidden_perm[0], '][', $hidden_perm[1], ']" value="', $hidden_perm[2], '">'; |
| 559 | + } |
|
| 536 | 560 | |
| 537 | 561 | echo ' |
| 538 | 562 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -560,17 +584,19 @@ discard block |
||
| 560 | 584 | |
| 561 | 585 | foreach ($column as $permissionGroup) |
| 562 | 586 | { |
| 563 | - if (empty($permissionGroup['permissions'])) |
|
| 564 | - continue; |
|
| 587 | + if (empty($permissionGroup['permissions'])) { |
|
| 588 | + continue; |
|
| 589 | + } |
|
| 565 | 590 | |
| 566 | 591 | // Are we likely to have something in this group to display or is it all hidden? |
| 567 | 592 | $has_display_content = false; |
| 568 | 593 | if (!$permissionGroup['hidden']) |
| 569 | 594 | { |
| 570 | 595 | // Before we go any further check we are going to have some data to print otherwise we just have a silly heading. |
| 571 | - foreach ($permissionGroup['permissions'] as $permission) |
|
| 572 | - if (!$permission['hidden']) |
|
| 596 | + foreach ($permissionGroup['permissions'] as $permission) { |
|
| 597 | + if (!$permission['hidden']) |
|
| 573 | 598 | $has_display_content = true; |
| 599 | + } |
|
| 574 | 600 | |
| 575 | 601 | if ($has_display_content) |
| 576 | 602 | { |
@@ -579,10 +605,11 @@ discard block |
||
| 579 | 605 | <th></th> |
| 580 | 606 | <th', $context['group']['id'] == -1 ? ' colspan="2"' : '', ' class="smalltext">', $permissionGroup['name'], '</th>'; |
| 581 | 607 | |
| 582 | - if ($context['group']['id'] != -1) |
|
| 583 | - echo ' |
|
| 608 | + if ($context['group']['id'] != -1) { |
|
| 609 | + echo ' |
|
| 584 | 610 | <th>', $txt['permissions_option_own'], '</th> |
| 585 | 611 | <th>', $txt['permissions_option_any'], '</th>'; |
| 612 | + } |
|
| 586 | 613 | |
| 587 | 614 | echo ' |
| 588 | 615 | </tr>'; |
@@ -605,17 +632,18 @@ discard block |
||
| 605 | 632 | // Guests can't do their own thing. |
| 606 | 633 | if ($context['group']['id'] != -1) |
| 607 | 634 | { |
| 608 | - if (empty($modSettings['permission_enable_deny'])) |
|
| 609 | - echo ' |
|
| 635 | + if (empty($modSettings['permission_enable_deny'])) { |
|
| 636 | + echo ' |
|
| 610 | 637 | <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, '>'; |
| 611 | - else |
|
| 638 | + } else |
|
| 612 | 639 | { |
| 613 | 640 | echo ' |
| 614 | 641 | <select name="perm[', $permission_type['id'], '][', $permission['own']['id'], ']" ', $disable_field, '>'; |
| 615 | 642 | |
| 616 | - foreach (array('on', 'off', 'deny') as $c) |
|
| 617 | - echo ' |
|
| 643 | + foreach (array('on', 'off', 'deny') as $c) { |
|
| 644 | + echo ' |
|
| 618 | 645 | <option ', $permission['own']['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>'; |
| 646 | + } |
|
| 619 | 647 | echo ' |
| 620 | 648 | </select>'; |
| 621 | 649 | } |
@@ -625,39 +653,41 @@ discard block |
||
| 625 | 653 | <td>'; |
| 626 | 654 | } |
| 627 | 655 | |
| 628 | - if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) |
|
| 629 | - echo ' |
|
| 656 | + if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) { |
|
| 657 | + echo ' |
|
| 630 | 658 | <input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['any']['id'], ']"', $permission['any']['select'] == 'on' ? ' checked="checked"' : '', ' value="on" ', $disable_field, '>'; |
| 631 | - else |
|
| 659 | + } else |
|
| 632 | 660 | { |
| 633 | 661 | echo ' |
| 634 | 662 | <select name="perm[', $permission_type['id'], '][', $permission['any']['id'], ']" ', $disable_field, '>'; |
| 635 | 663 | |
| 636 | - foreach (array('on', 'off', 'deny') as $c) |
|
| 637 | - echo ' |
|
| 664 | + foreach (array('on', 'off', 'deny') as $c) { |
|
| 665 | + echo ' |
|
| 638 | 666 | <option ', $permission['any']['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>'; |
| 667 | + } |
|
| 639 | 668 | echo ' |
| 640 | 669 | </select>'; |
| 641 | 670 | } |
| 642 | - } |
|
| 643 | - else |
|
| 671 | + } else |
|
| 644 | 672 | { |
| 645 | - if ($context['group']['id'] != -1) |
|
| 646 | - echo ' |
|
| 673 | + if ($context['group']['id'] != -1) { |
|
| 674 | + echo ' |
|
| 647 | 675 | </td> |
| 648 | 676 | <td>'; |
| 677 | + } |
|
| 649 | 678 | |
| 650 | - if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) |
|
| 651 | - echo ' |
|
| 679 | + if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) { |
|
| 680 | + echo ' |
|
| 652 | 681 | <input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['id'], ']"', $permission['select'] == 'on' ? ' checked="checked"' : '', ' value="on" ', $disable_field, '>'; |
| 653 | - else |
|
| 682 | + } else |
|
| 654 | 683 | { |
| 655 | 684 | echo ' |
| 656 | 685 | <select name="perm[', $permission_type['id'], '][', $permission['id'], ']" ', $disable_field, '>'; |
| 657 | 686 | |
| 658 | - foreach (array('on', 'off', 'deny') as $c) |
|
| 659 | - echo ' |
|
| 687 | + foreach (array('on', 'off', 'deny') as $c) { |
|
| 688 | + echo ' |
|
| 660 | 689 | <option ', $permission['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>'; |
| 690 | + } |
|
| 661 | 691 | echo ' |
| 662 | 692 | </select>'; |
| 663 | 693 | } |
@@ -689,11 +719,11 @@ discard block |
||
| 689 | 719 | <fieldset id="', $context['current_permission'], '"> |
| 690 | 720 | <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>'; |
| 691 | 721 | |
| 692 | - if (empty($modSettings['permission_enable_deny'])) |
|
| 693 | - echo ' |
|
| 722 | + if (empty($modSettings['permission_enable_deny'])) { |
|
| 723 | + echo ' |
|
| 694 | 724 | <ul>'; |
| 695 | - else |
|
| 696 | - echo ' |
|
| 725 | + } else { |
|
| 726 | + echo ' |
|
| 697 | 727 | <div class="information">', $txt['permissions_option_desc'], '</div> |
| 698 | 728 | <dl class="settings"> |
| 699 | 729 | <dt> |
@@ -703,47 +733,52 @@ discard block |
||
| 703 | 733 | </dt> |
| 704 | 734 | <dd> |
| 705 | 735 | </dd>'; |
| 736 | + } |
|
| 706 | 737 | |
| 707 | 738 | foreach ($context['member_groups'] as $group) |
| 708 | 739 | { |
| 709 | - if (!empty($modSettings['permission_enable_deny'])) |
|
| 710 | - echo ' |
|
| 740 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
| 741 | + echo ' |
|
| 711 | 742 | <dt>'; |
| 712 | - else |
|
| 713 | - echo ' |
|
| 743 | + } else { |
|
| 744 | + echo ' |
|
| 714 | 745 | <li>'; |
| 746 | + } |
|
| 715 | 747 | |
| 716 | - if (empty($modSettings['permission_enable_deny'])) |
|
| 717 | - echo ' |
|
| 748 | + if (empty($modSettings['permission_enable_deny'])) { |
|
| 749 | + echo ' |
|
| 718 | 750 | <input type="checkbox" name="', $context['current_permission'], '[', $group['id'], ']" value="on"', $group['status'] == 'on' ? ' checked' : '', '>'; |
| 719 | - else |
|
| 720 | - echo ' |
|
| 751 | + } else { |
|
| 752 | + echo ' |
|
| 721 | 753 | <span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="on"', $group['status'] == 'on' ? ' checked' : '', '></span> |
| 722 | 754 | <span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="off"', $group['status'] == 'off' ? ' checked' : '', '></span> |
| 723 | 755 | <span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="deny"', $group['status'] == 'deny' ? ' checked' : '', '></span>'; |
| 756 | + } |
|
| 724 | 757 | |
| 725 | - if (!empty($modSettings['permission_enable_deny'])) |
|
| 726 | - echo ' |
|
| 758 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
| 759 | + echo ' |
|
| 727 | 760 | </dt> |
| 728 | 761 | <dd> |
| 729 | 762 | <span', $group['is_postgroup'] ? ' style="font-style: italic;"' : '', '>', $group['name'], '</span> |
| 730 | 763 | </dd>'; |
| 731 | - else |
|
| 732 | - echo ' |
|
| 764 | + } else { |
|
| 765 | + echo ' |
|
| 733 | 766 | <span', $group['is_postgroup'] ? ' style="font-style: italic;"' : '', '>', $group['name'], '</span> |
| 734 | 767 | </li>'; |
| 768 | + } |
|
| 735 | 769 | } |
| 736 | 770 | |
| 737 | - if (empty($modSettings['permission_enable_deny'])) |
|
| 738 | - echo ' |
|
| 771 | + if (empty($modSettings['permission_enable_deny'])) { |
|
| 772 | + echo ' |
|
| 739 | 773 | <li> |
| 740 | 774 | <input type="checkbox" onclick="invertAll(this, this.form, \''. $context['current_permission'] . '[\');"> |
| 741 | 775 | <span>', $txt['check_all'], '</span> |
| 742 | 776 | </li> |
| 743 | 777 | </ul>'; |
| 744 | - else |
|
| 745 | - echo ' |
|
| 778 | + } else { |
|
| 779 | + echo ' |
|
| 746 | 780 | </dl>'; |
| 781 | + } |
|
| 747 | 782 | |
| 748 | 783 | echo ' |
| 749 | 784 | </fieldset> |
@@ -783,9 +818,10 @@ discard block |
||
| 783 | 818 | if (!empty($modSettings['postmod_active'])) |
| 784 | 819 | { |
| 785 | 820 | // Got advanced permissions - if so warn! |
| 786 | - if (!empty($modSettings['permission_enable_deny'])) |
|
| 787 | - echo ' |
|
| 821 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
| 822 | + echo ' |
|
| 788 | 823 | <div class="information">', $txt['permissions_post_moderation_deny_note'], '</div>'; |
| 824 | + } |
|
| 789 | 825 | |
| 790 | 826 | echo ' |
| 791 | 827 | <div class="padding"> |
@@ -800,10 +836,11 @@ discard block |
||
| 800 | 836 | ', $txt['permissions_post_moderation_select'], ': |
| 801 | 837 | <select name="pid" onchange="document.forms.postmodForm.submit();">'; |
| 802 | 838 | |
| 803 | - foreach ($context['profiles'] as $profile) |
|
| 804 | - if ($profile['can_modify']) |
|
| 839 | + foreach ($context['profiles'] as $profile) { |
|
| 840 | + if ($profile['can_modify']) |
|
| 805 | 841 | echo ' |
| 806 | 842 | <option value="', $profile['id'], '"', $profile['id'] == $context['current_profile'] ? ' selected' : '', '>', $profile['name'], '</option>'; |
| 843 | + } |
|
| 807 | 844 | |
| 808 | 845 | echo ' |
| 809 | 846 | </select> |
@@ -824,11 +861,12 @@ discard block |
||
| 824 | 861 | ', $txt['permissions_post_moderation_replies_any'], ' |
| 825 | 862 | </th>'; |
| 826 | 863 | |
| 827 | - if ($modSettings['attachmentEnable'] == 1) |
|
| 828 | - echo ' |
|
| 864 | + if ($modSettings['attachmentEnable'] == 1) { |
|
| 865 | + echo ' |
|
| 829 | 866 | <th class="centercol" colspan="3"> |
| 830 | 867 | ', $txt['permissions_post_moderation_attachments'], ' |
| 831 | 868 | </th>'; |
| 869 | + } |
|
| 832 | 870 | |
| 833 | 871 | echo ' |
| 834 | 872 | </tr> |
@@ -846,11 +884,12 @@ discard block |
||
| 846 | 884 | <th><span class="generic_icons post_moderation_moderate"></span></th> |
| 847 | 885 | <th><span class="generic_icons post_moderation_deny"></span></th>'; |
| 848 | 886 | |
| 849 | - if ($modSettings['attachmentEnable'] == 1) |
|
| 850 | - echo ' |
|
| 887 | + if ($modSettings['attachmentEnable'] == 1) { |
|
| 888 | + echo ' |
|
| 851 | 889 | <th><span class="generic_icons post_moderation_allow"></span></th> |
| 852 | 890 | <th><span class="generic_icons post_moderation_moderate"></span></th> |
| 853 | 891 | <th><span class="generic_icons post_moderation_deny"></span></th>'; |
| 892 | + } |
|
| 854 | 893 | |
| 855 | 894 | echo ' |
| 856 | 895 | </tr> |
@@ -864,10 +903,11 @@ discard block |
||
| 864 | 903 | <td class="half_table"> |
| 865 | 904 | <span ', ($group['color'] ? 'style="color: ' . $group['color'] . '"' : ''), '>', $group['name'], '</span>'; |
| 866 | 905 | |
| 867 | - if (!empty($group['children'])) |
|
| 868 | - echo ' |
|
| 906 | + if (!empty($group['children'])) { |
|
| 907 | + echo ' |
|
| 869 | 908 | <br> |
| 870 | 909 | <span class="smalltext">', $txt['permissions_includes_inherited'], ': "', implode('", "', $group['children']), '"</span>'; |
| 910 | + } |
|
| 871 | 911 | |
| 872 | 912 | echo ' |
| 873 | 913 | </td> |
@@ -882,11 +922,11 @@ discard block |
||
| 882 | 922 | </td>'; |
| 883 | 923 | |
| 884 | 924 | // Guests can't have "own" permissions |
| 885 | - if ($group['id'] == '-1') |
|
| 886 | - echo ' |
|
| 925 | + if ($group['id'] == '-1') { |
|
| 926 | + echo ' |
|
| 887 | 927 | <td colspan="3"></td>'; |
| 888 | - else |
|
| 889 | - echo ' |
|
| 928 | + } else { |
|
| 929 | + echo ' |
|
| 890 | 930 | <td class="centercol"> |
| 891 | 931 | <input type="radio" name="replies_own[', $group['id'], ']" value="allow"', $group['replies_own'] == 'allow' ? ' checked' : '', '> |
| 892 | 932 | </td> |
@@ -896,6 +936,7 @@ discard block |
||
| 896 | 936 | <td class="centercol"> |
| 897 | 937 | <input type="radio" name="replies_own[', $group['id'], ']" value="disallow"', $group['replies_own'] == 'disallow' ? ' checked' : '', '> |
| 898 | 938 | </td>'; |
| 939 | + } |
|
| 899 | 940 | |
| 900 | 941 | echo ' |
| 901 | 942 | <td class="centercol"> |
@@ -908,8 +949,8 @@ discard block |
||
| 908 | 949 | <input type="radio" name="replies_any[', $group['id'], ']" value="disallow"', $group['replies_any'] == 'disallow' ? ' checked' : '', '> |
| 909 | 950 | </td>'; |
| 910 | 951 | |
| 911 | - if ($modSettings['attachmentEnable'] == 1) |
|
| 912 | - echo ' |
|
| 952 | + if ($modSettings['attachmentEnable'] == 1) { |
|
| 953 | + echo ' |
|
| 913 | 954 | <td class="centercol"> |
| 914 | 955 | <input type="radio" name="attachment[', $group['id'], ']" value="allow"', $group['attachment'] == 'allow' ? ' checked' : '', '> |
| 915 | 956 | </td> |
@@ -919,6 +960,7 @@ discard block |
||
| 919 | 960 | <td class="centercol"> |
| 920 | 961 | <input type="radio" name="attachment[', $group['id'], ']" value="disallow"', $group['attachment'] == 'disallow' ? ' checked' : '', '> |
| 921 | 962 | </td>'; |
| 963 | + } |
|
| 922 | 964 | |
| 923 | 965 | echo ' |
| 924 | 966 | </tr>'; |
@@ -22,24 +22,26 @@ discard block |
||
| 22 | 22 | <script>'; |
| 23 | 23 | |
| 24 | 24 | // When using Go Back due to fatal_error, allow the form to be re-submitted with changes. |
| 25 | - if (isBrowser('is_firefox')) |
|
| 26 | - echo ' |
|
| 25 | + if (isBrowser('is_firefox')) { |
|
| 26 | + echo ' |
|
| 27 | 27 | window.addEventListener("pageshow", reActivate, false);'; |
| 28 | + } |
|
| 28 | 29 | |
| 29 | 30 | // Start with message icons - and any missing from this theme. |
| 30 | 31 | echo ' |
| 31 | 32 | var icon_urls = {'; |
| 32 | 33 | |
| 33 | - foreach ($context['icons'] as $icon) |
|
| 34 | - echo ' |
|
| 34 | + foreach ($context['icons'] as $icon) { |
|
| 35 | + echo ' |
|
| 35 | 36 | \'', $icon['value'], '\': \'', $icon['url'], '\'', $icon['is_last'] ? '' : ','; |
| 37 | + } |
|
| 36 | 38 | |
| 37 | 39 | echo ' |
| 38 | 40 | };'; |
| 39 | 41 | |
| 40 | 42 | // If this is a poll - use some javascript to ensure the user doesn't create a poll with illegal option combinations. |
| 41 | - if ($context['make_poll']) |
|
| 42 | - echo ' |
|
| 43 | + if ($context['make_poll']) { |
|
| 44 | + echo ' |
|
| 43 | 45 | var pollOptionNum = 0, pollTabIndex; |
| 44 | 46 | var pollOptionId = ', $context['last_choice_id'], '; |
| 45 | 47 | function addPollOption() |
@@ -58,11 +60,13 @@ discard block |
||
| 58 | 60 | |
| 59 | 61 | setOuterHTML(document.getElementById(\'pollMoreOptions\'), ', JavaScriptEscape('<dt><label for="options-'), ' + pollOptionId + ', JavaScriptEscape('">' . $txt['option'] . ' '), ' + pollOptionNum + ', JavaScriptEscape('</label>:</dt><dd><input type="text" name="options['), ' + pollOptionId + ', JavaScriptEscape(']" id="options-'), ' + pollOptionId + ', JavaScriptEscape('" value="" size="80" maxlength="255" tabindex="'), ' + pollTabIndex + ', JavaScriptEscape('"></dd><p id="pollMoreOptions"></p>'), '); |
| 60 | 62 | }'; |
| 63 | + } |
|
| 61 | 64 | |
| 62 | 65 | // If we are making a calendar event we want to ensure we show the current days in a month etc... this is done here. |
| 63 | - if ($context['make_event']) |
|
| 64 | - echo ' |
|
| 66 | + if ($context['make_event']) { |
|
| 67 | + echo ' |
|
| 65 | 68 | var monthLength = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];'; |
| 69 | + } |
|
| 66 | 70 | |
| 67 | 71 | // End of the javascript, start the form and display the link tree. |
| 68 | 72 | echo ' |
@@ -83,9 +87,10 @@ discard block |
||
| 83 | 87 | </div> |
| 84 | 88 | <br>'; |
| 85 | 89 | |
| 86 | - if ($context['make_event'] && (!$context['event']['new'] || !empty($context['current_board']))) |
|
| 87 | - echo ' |
|
| 90 | + if ($context['make_event'] && (!$context['event']['new'] || !empty($context['current_board']))) { |
|
| 91 | + echo ' |
|
| 88 | 92 | <input type="hidden" name="eventid" value="', $context['event']['id'], '">'; |
| 93 | + } |
|
| 89 | 94 | |
| 90 | 95 | // Start the main table. |
| 91 | 96 | echo ' |
@@ -110,26 +115,29 @@ discard block |
||
| 110 | 115 | </div>'; |
| 111 | 116 | |
| 112 | 117 | // If this won't be approved let them know! |
| 113 | - if (!$context['becomes_approved']) |
|
| 114 | - echo ' |
|
| 118 | + if (!$context['becomes_approved']) { |
|
| 119 | + echo ' |
|
| 115 | 120 | <div class="noticebox"> |
| 116 | 121 | <em>', $txt['wait_for_approval'], '</em> |
| 117 | 122 | <input type="hidden" name="not_approved" value="1"> |
| 118 | 123 | </div>'; |
| 124 | + } |
|
| 119 | 125 | |
| 120 | 126 | // If it's locked, show a message to warn the replier. |
| 121 | - if (!empty($context['locked'])) |
|
| 122 | - echo ' |
|
| 127 | + if (!empty($context['locked'])) { |
|
| 128 | + echo ' |
|
| 123 | 129 | <div class="errorbox"> |
| 124 | 130 | ', $txt['topic_locked_no_reply'], ' |
| 125 | 131 | </div>'; |
| 132 | + } |
|
| 126 | 133 | |
| 127 | - if (!empty($modSettings['drafts_post_enabled'])) |
|
| 128 | - echo ' |
|
| 134 | + if (!empty($modSettings['drafts_post_enabled'])) { |
|
| 135 | + echo ' |
|
| 129 | 136 | <div id="draft_section" class="infobox"', isset($context['draft_saved']) ? '' : ' style="display: none;"', '>', |
| 130 | 137 | sprintf($txt['draft_saved'], $scripturl . '?action=profile;u=' . $context['user']['id'] . ';area=showdrafts'), ' |
| 131 | 138 | ', (!empty($modSettings['drafts_keep_days']) ? ' <strong>' . sprintf($txt['draft_save_warning'], $modSettings['drafts_keep_days']) . '</strong>' : ''), ' |
| 132 | 139 | </div>'; |
| 140 | + } |
|
| 133 | 141 | |
| 134 | 142 | // The post header... important stuff |
| 135 | 143 | echo ' |
@@ -139,14 +147,15 @@ discard block |
||
| 139 | 147 | // Mod & theme authors can use the 'integrate_post_end' hook to modify or add to these (see Post.php) |
| 140 | 148 | if (!empty($context['posting_fields']) && is_array($context['posting_fields'])) |
| 141 | 149 | { |
| 142 | - foreach ($context['posting_fields'] as $pfid => $pf) |
|
| 143 | - echo ' |
|
| 150 | + foreach ($context['posting_fields'] as $pfid => $pf) { |
|
| 151 | + echo ' |
|
| 144 | 152 | <dt class="clear', !is_numeric($pfid) ? ' pf_' . $pfid : '', '"> |
| 145 | 153 | ', $pf['dt'], ' |
| 146 | 154 | </dt> |
| 147 | 155 | <dd', !is_numeric($pfid) ? ' class="pf_' . $pfid . '"' : '', '> |
| 148 | 156 | ', preg_replace('~<(input|select|textarea|button|area|a|object)\b~', '<$1 tabindex="' . $context['tabindex']++ . '"', $pf['dd']), ' |
| 149 | 157 | </dd>'; |
| 158 | + } |
|
| 150 | 159 | } |
| 151 | 160 | |
| 152 | 161 | echo ' |
@@ -180,9 +189,10 @@ discard block |
||
| 180 | 189 | echo ' |
| 181 | 190 | <optgroup label="', $category['name'], '">'; |
| 182 | 191 | |
| 183 | - foreach ($category['boards'] as $board) |
|
| 184 | - echo ' |
|
| 192 | + foreach ($category['boards'] as $board) { |
|
| 193 | + echo ' |
|
| 185 | 194 | <option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=>' : '', ' ', $board['name'], '</option>'; |
| 195 | + } |
|
| 186 | 196 | echo ' |
| 187 | 197 | </optgroup>'; |
| 188 | 198 | } |
@@ -218,9 +228,10 @@ discard block |
||
| 218 | 228 | <span class="label">', $txt['calendar_timezone'], '</span> |
| 219 | 229 | <select name="tz" id="tz"', !empty($context['event']['allday']) ? ' disabled' : '', '>'; |
| 220 | 230 | |
| 221 | - foreach ($context['all_timezones'] as $tz => $tzname) |
|
| 222 | - echo ' |
|
| 231 | + foreach ($context['all_timezones'] as $tz => $tzname) { |
|
| 232 | + echo ' |
|
| 223 | 233 | <option value="', $tz, '"', $tz == $context['event']['tz'] ? ' selected' : '', '>', $tzname, '</option>'; |
| 234 | + } |
|
| 224 | 235 | |
| 225 | 236 | echo ' |
| 226 | 237 | </select> |
@@ -249,14 +260,15 @@ discard block |
||
| 249 | 260 | </dd>'; |
| 250 | 261 | |
| 251 | 262 | // Loop through all the choices and print them out. |
| 252 | - foreach ($context['choices'] as $choice) |
|
| 253 | - echo ' |
|
| 263 | + foreach ($context['choices'] as $choice) { |
|
| 264 | + echo ' |
|
| 254 | 265 | <dt> |
| 255 | 266 | <label for="options-', $choice['id'], '">', $txt['option'], ' ', $choice['number'], '</label>: |
| 256 | 267 | </dt> |
| 257 | 268 | <dd> |
| 258 | 269 | <input type="text" name="options[', $choice['id'], ']" id="options-', $choice['id'], '" value="', $choice['label'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="255"> |
| 259 | 270 | </dd>'; |
| 271 | + } |
|
| 260 | 272 | |
| 261 | 273 | echo ' |
| 262 | 274 | <p id="pollMoreOptions"></p> |
@@ -286,14 +298,15 @@ discard block |
||
| 286 | 298 | <input type="checkbox" id="poll_change_vote" name="poll_change_vote"', !empty($context['poll']['change_vote']) ? ' checked' : '', '> |
| 287 | 299 | </dd>'; |
| 288 | 300 | |
| 289 | - if ($context['poll_options']['guest_vote_enabled']) |
|
| 290 | - echo ' |
|
| 301 | + if ($context['poll_options']['guest_vote_enabled']) { |
|
| 302 | + echo ' |
|
| 291 | 303 | <dt> |
| 292 | 304 | <label for="poll_guest_vote">', $txt['poll_guest_vote'], ':</label> |
| 293 | 305 | </dt> |
| 294 | 306 | <dd> |
| 295 | 307 | <input type="checkbox" id="poll_guest_vote" name="poll_guest_vote"', !empty($context['poll_options']['guest_vote']) ? ' checked' : '', '> |
| 296 | 308 | </dd>'; |
| 309 | + } |
|
| 297 | 310 | |
| 298 | 311 | echo ' |
| 299 | 312 | <dt> |
@@ -314,8 +327,8 @@ discard block |
||
| 314 | 327 | ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'); |
| 315 | 328 | |
| 316 | 329 | // If we're editing and displaying edit details, show a box where they can say why |
| 317 | - if (isset($context['editing']) && $modSettings['show_modify']) |
|
| 318 | - echo ' |
|
| 330 | + if (isset($context['editing']) && $modSettings['show_modify']) { |
|
| 331 | + echo ' |
|
| 319 | 332 | <dl> |
| 320 | 333 | <dt class="clear"> |
| 321 | 334 | <span id="caption_edit_reason">', $txt['reason_for_edit'], ':</span> |
@@ -324,20 +337,23 @@ discard block |
||
| 324 | 337 | <input type="text" name="modify_reason"', isset($context['last_modified_reason']) ? ' value="' . $context['last_modified_reason'] . '"' : '', ' tabindex="', $context['tabindex']++, '" size="80" maxlength="80"> |
| 325 | 338 | </dd> |
| 326 | 339 | </dl>'; |
| 340 | + } |
|
| 327 | 341 | |
| 328 | 342 | // If this message has been edited in the past - display when it was. |
| 329 | - if (isset($context['last_modified'])) |
|
| 330 | - echo ' |
|
| 343 | + if (isset($context['last_modified'])) { |
|
| 344 | + echo ' |
|
| 331 | 345 | <div class="padding smalltext"> |
| 332 | 346 | ', $context['last_modified_text'], ' |
| 333 | 347 | </div>'; |
| 348 | + } |
|
| 334 | 349 | |
| 335 | 350 | // If the admin has enabled the hiding of the additional options - show a link and image for it. |
| 336 | - if (!empty($modSettings['additional_options_collapsable'])) |
|
| 337 | - echo ' |
|
| 351 | + if (!empty($modSettings['additional_options_collapsable'])) { |
|
| 352 | + echo ' |
|
| 338 | 353 | <div id="postAdditionalOptionsHeader"> |
| 339 | 354 | <strong><a href="#" id="postMoreExpandLink"> ', $context['can_post_attachment'] ? $txt['post_additionalopt_attach'] : $txt['post_additionalopt'], '</a></strong> |
| 340 | 355 | </div>'; |
| 356 | + } |
|
| 341 | 357 | |
| 342 | 358 | echo ' |
| 343 | 359 | <div id="postAdditionalOptions">'; |
@@ -370,19 +386,21 @@ discard block |
||
| 370 | 386 | ', $txt['uncheck_unwatchd_attach'], ': |
| 371 | 387 | </dd>'; |
| 372 | 388 | |
| 373 | - foreach ($context['current_attachments'] as $attachment) |
|
| 374 | - echo ' |
|
| 389 | + foreach ($context['current_attachments'] as $attachment) { |
|
| 390 | + echo ' |
|
| 375 | 391 | <dd class="smalltext"> |
| 376 | 392 | <label for="attachment_', $attachment['attachID'], '"><input type="checkbox" id="attachment_', $attachment['attachID'], '" name="attach_del[]" value="', $attachment['attachID'], '"', empty($attachment['unchecked']) ? ' checked' : '', '> ', $attachment['name'], (empty($attachment['approved']) ? ' (' . $txt['awaiting_approval'] . ')' : ''), |
| 377 | 393 | !empty($modSettings['attachmentPostLimit']) || !empty($modSettings['attachmentSizeLimit']) ? sprintf($txt['attach_kb'], comma_format(round(max($attachment['size'], 1024) / 1024), 0)) : '', '</label> |
| 378 | 394 | </dd>'; |
| 395 | + } |
|
| 379 | 396 | |
| 380 | 397 | echo ' |
| 381 | 398 | </dl>'; |
| 382 | 399 | |
| 383 | - if (!empty($context['files_in_session_warning'])) |
|
| 384 | - echo ' |
|
| 400 | + if (!empty($context['files_in_session_warning'])) { |
|
| 401 | + echo ' |
|
| 385 | 402 | <div class="smalltext">', $context['files_in_session_warning'], '</div>'; |
| 403 | + } |
|
| 386 | 404 | } |
| 387 | 405 | |
| 388 | 406 | // Is the user allowed to post any additional ones? If so give them the boxes to do it! |
@@ -443,8 +461,8 @@ discard block |
||
| 443 | 461 | ', empty($modSettings['attachmentSizeLimit']) ? '' : ('<input type="hidden" name="MAX_FILE_SIZE" value="' . $modSettings['attachmentSizeLimit'] * 1024 . '">'); |
| 444 | 462 | |
| 445 | 463 | // Show more boxes if they aren't approaching that limit. |
| 446 | - if ($context['num_allowed_attachments'] > 1) |
|
| 447 | - echo ' |
|
| 464 | + if ($context['num_allowed_attachments'] > 1) { |
|
| 465 | + echo ' |
|
| 448 | 466 | <script> |
| 449 | 467 | var allowed_attachments = ', $context['num_allowed_attachments'], '; |
| 450 | 468 | var current_attachment = 1; |
@@ -464,6 +482,7 @@ discard block |
||
| 464 | 482 | <a href="#" onclick="addAttachment(); return false;">(', $txt['more_attachments'], ')</a> |
| 465 | 483 | </div><!-- .fallback --> |
| 466 | 484 | </div><!-- #attachUpload -->'; |
| 485 | + } |
|
| 467 | 486 | |
| 468 | 487 | echo ' |
| 469 | 488 | </dd>'; |
@@ -475,21 +494,25 @@ discard block |
||
| 475 | 494 | <dd class="smalltext">'; |
| 476 | 495 | |
| 477 | 496 | // Show some useful information such as allowed extensions, maximum size and amount of attachments allowed. |
| 478 | - if (!empty($modSettings['attachmentCheckExtensions'])) |
|
| 479 | - echo ' |
|
| 497 | + if (!empty($modSettings['attachmentCheckExtensions'])) { |
|
| 498 | + echo ' |
|
| 480 | 499 | ', $txt['allowed_types'], ': ', $context['allowed_extensions'], '<br>'; |
| 500 | + } |
|
| 481 | 501 | |
| 482 | - if (!empty($context['attachment_restrictions'])) |
|
| 483 | - echo ' |
|
| 502 | + if (!empty($context['attachment_restrictions'])) { |
|
| 503 | + echo ' |
|
| 484 | 504 | ', $txt['attach_restrictions'], ' ', implode(', ', $context['attachment_restrictions']), '<br>'; |
| 505 | + } |
|
| 485 | 506 | |
| 486 | - if ($context['num_allowed_attachments'] == 0) |
|
| 487 | - echo ' |
|
| 507 | + if ($context['num_allowed_attachments'] == 0) { |
|
| 508 | + echo ' |
|
| 488 | 509 | ', $txt['attach_limit_nag'], '<br>'; |
| 510 | + } |
|
| 489 | 511 | |
| 490 | - if (!$context['can_post_attachment_unapproved']) |
|
| 491 | - echo ' |
|
| 512 | + if (!$context['can_post_attachment_unapproved']) { |
|
| 513 | + echo ' |
|
| 492 | 514 | <span class="alert">', $txt['attachment_requires_approval'], '</span>', '<br>'; |
| 515 | + } |
|
| 493 | 516 | |
| 494 | 517 | echo ' |
| 495 | 518 | </dd> |
@@ -513,24 +536,26 @@ discard block |
||
| 513 | 536 | <dt><strong>', $txt['subject'], '</strong></dt> |
| 514 | 537 | <dd><strong>', $txt['draft_saved_on'], '</strong></dd>'; |
| 515 | 538 | |
| 516 | - foreach ($context['drafts'] as $draft) |
|
| 517 | - echo ' |
|
| 539 | + foreach ($context['drafts'] as $draft) { |
|
| 540 | + echo ' |
|
| 518 | 541 | <dt>', $draft['link'], '</dt> |
| 519 | 542 | <dd>', $draft['poster_time'], '</dd>'; |
| 543 | + } |
|
| 520 | 544 | echo ' |
| 521 | 545 | </dl> |
| 522 | 546 | </div>'; |
| 523 | 547 | } |
| 524 | 548 | |
| 525 | 549 | // Is visual verification enabled? |
| 526 | - if ($context['require_verification']) |
|
| 527 | - echo ' |
|
| 550 | + if ($context['require_verification']) { |
|
| 551 | + echo ' |
|
| 528 | 552 | <div class="post_verification"> |
| 529 | 553 | <span', !empty($context['post_error']['need_qr_verification']) ? ' class="error"' : '', '> |
| 530 | 554 | <strong>', $txt['verification'], ':</strong> |
| 531 | 555 | </span> |
| 532 | 556 | ', template_control_verification($context['visual_verification_id'], 'all'), ' |
| 533 | 557 | </div>'; |
| 558 | + } |
|
| 534 | 559 | |
| 535 | 560 | // Finally, the submit buttons. |
| 536 | 561 | echo ' |
@@ -539,9 +564,10 @@ discard block |
||
| 539 | 564 | ', template_control_richedit_buttons($context['post_box_name']); |
| 540 | 565 | |
| 541 | 566 | // Option to delete an event if user is editing one. |
| 542 | - if ($context['make_event'] && !$context['event']['new']) |
|
| 543 | - echo ' |
|
| 567 | + if ($context['make_event'] && !$context['event']['new']) { |
|
| 568 | + echo ' |
|
| 544 | 569 | <input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'] ,'" class="button you_sure">'; |
| 570 | + } |
|
| 545 | 571 | |
| 546 | 572 | echo ' |
| 547 | 573 | </span> |
@@ -550,9 +576,10 @@ discard block |
||
| 550 | 576 | <br class="clear">'; |
| 551 | 577 | |
| 552 | 578 | // Assuming this isn't a new topic pass across the last message id. |
| 553 | - if (isset($context['topic_last_message'])) |
|
| 554 | - echo ' |
|
| 579 | + if (isset($context['topic_last_message'])) { |
|
| 580 | + echo ' |
|
| 555 | 581 | <input type="hidden" name="last_msg" value="', $context['topic_last_message'], '">'; |
| 582 | + } |
|
| 556 | 583 | |
| 557 | 584 | echo ' |
| 558 | 585 | <input type="hidden" name="additional_options" id="additional_options" value="', $context['show_additional_options'] ? '1' : '0', '"> |
@@ -694,9 +721,10 @@ discard block |
||
| 694 | 721 | |
| 695 | 722 | newPostsHTML += \'<div class="windowbg\' + (++reply_counter % 2 == 0 ? \'2\' : \'\') + \'"><div id="msg\' + newPosts[i].getAttribute("id") + \'"><div class="floatleft"><h5>', $txt['posted_by'], ': \' + newPosts[i].getElementsByTagName("poster")[0].firstChild.nodeValue + \'</h5><span class="smalltext">« <strong>', $txt['on'], ':</strong> \' + newPosts[i].getElementsByTagName("time")[0].firstChild.nodeValue + \' »</span> <span class="new_posts" id="image_new_\' + newPosts[i].getAttribute("id") + \'">', $txt['new'], '</span></div>\';'; |
| 696 | 723 | |
| 697 | - if ($context['can_quote']) |
|
| 698 | - echo ' |
|
| 724 | + if ($context['can_quote']) { |
|
| 725 | + echo ' |
|
| 699 | 726 | newPostsHTML += \'<ul class="quickbuttons" id="msg_\' + newPosts[i].getAttribute("id") + \'_quote"><li><a href="#postmodify" onclick="return insertQuoteFast(\\\'\' + newPosts[i].getAttribute("id") + \'\\\');" class="quote_button"><span>', $txt['quote'], '</span><\' + \'/a></li></ul>\';'; |
| 727 | + } |
|
| 700 | 728 | |
| 701 | 729 | echo ' |
| 702 | 730 | newPostsHTML += \'<br class="clear">\'; |
@@ -739,8 +767,8 @@ discard block |
||
| 739 | 767 | }'; |
| 740 | 768 | |
| 741 | 769 | // Code for showing and hiding additional options. |
| 742 | - if (!empty($modSettings['additional_options_collapsable'])) |
|
| 743 | - echo ' |
|
| 770 | + if (!empty($modSettings['additional_options_collapsable'])) { |
|
| 771 | + echo ' |
|
| 744 | 772 | var oSwapAdditionalOptions = new smc_Toggle({ |
| 745 | 773 | bToggleEnabled: true, |
| 746 | 774 | bCurrentlyCollapsed: ', $context['show_additional_options'] ? 'false' : 'true', ', |
@@ -768,10 +796,11 @@ discard block |
||
| 768 | 796 | } |
| 769 | 797 | ] |
| 770 | 798 | });'; |
| 799 | + } |
|
| 771 | 800 | |
| 772 | 801 | // Code for showing and hiding drafts |
| 773 | - if (!empty($context['drafts'])) |
|
| 774 | - echo ' |
|
| 802 | + if (!empty($context['drafts'])) { |
|
| 803 | + echo ' |
|
| 775 | 804 | var oSwapDraftOptions = new smc_Toggle({ |
| 776 | 805 | bToggleEnabled: true, |
| 777 | 806 | bCurrentlyCollapsed: true, |
@@ -793,6 +822,7 @@ discard block |
||
| 793 | 822 | } |
| 794 | 823 | ] |
| 795 | 824 | });'; |
| 825 | + } |
|
| 796 | 826 | |
| 797 | 827 | echo ' |
| 798 | 828 | var oEditorID = "', $context['post_box_name'] ,'"; |
@@ -813,8 +843,9 @@ discard block |
||
| 813 | 843 | foreach ($context['previous_posts'] as $post) |
| 814 | 844 | { |
| 815 | 845 | $ignoring = false; |
| 816 | - if (!empty($post['is_ignored'])) |
|
| 817 | - $ignored_posts[] = $ignoring = $post['id']; |
|
| 846 | + if (!empty($post['is_ignored'])) { |
|
| 847 | + $ignored_posts[] = $ignoring = $post['id']; |
|
| 848 | + } |
|
| 818 | 849 | |
| 819 | 850 | echo ' |
| 820 | 851 | <div class="windowbg"> |
@@ -824,22 +855,24 @@ discard block |
||
| 824 | 855 | </h5> |
| 825 | 856 | - ', $post['time']; |
| 826 | 857 | |
| 827 | - if ($context['can_quote']) |
|
| 828 | - echo ' |
|
| 858 | + if ($context['can_quote']) { |
|
| 859 | + echo ' |
|
| 829 | 860 | <ul class="quickbuttons" id="msg_', $post['id'], '_quote"> |
| 830 | 861 | <li style="display:none;" id="quoteSelected_', $post['id'], '" data-msgid="', $post['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'] ,'</a></li> |
| 831 | 862 | <li id="post_modify"><a href="#postmodify" onclick="return insertQuoteFast(', $post['id'], ');"><span class="generic_icons quote"></span>', $txt['quote'], '</a></li> |
| 832 | 863 | </ul>'; |
| 864 | + } |
|
| 833 | 865 | |
| 834 | 866 | echo ' |
| 835 | 867 | <br class="clear">'; |
| 836 | 868 | |
| 837 | - if ($ignoring) |
|
| 838 | - echo ' |
|
| 869 | + if ($ignoring) { |
|
| 870 | + echo ' |
|
| 839 | 871 | <div id="msg_', $post['id'], '_ignored_prompt" class="smalltext"> |
| 840 | 872 | ', $txt['ignoring_user'], ' |
| 841 | 873 | <a href="#" id="msg_', $post['id'], '_ignored_link" style="display: none;">', $txt['show_ignore_user_post'], '</a> |
| 842 | 874 | </div>'; |
| 875 | + } |
|
| 843 | 876 | |
| 844 | 877 | echo ' |
| 845 | 878 | <div class="list_posts smalltext" id="msg_', $post['id'], '_body" data-msgid="', $post['id'], '">', $post['message'], '</div> |
@@ -993,10 +1026,10 @@ discard block |
||
| 993 | 1026 | <div id="temporary_posting_area" style="display: none;"></div> |
| 994 | 1027 | <script>'; |
| 995 | 1028 | |
| 996 | - if ($context['close_window']) |
|
| 997 | - echo ' |
|
| 1029 | + if ($context['close_window']) { |
|
| 1030 | + echo ' |
|
| 998 | 1031 | window.close();'; |
| 999 | - else |
|
| 1032 | + } else |
|
| 1000 | 1033 | { |
| 1001 | 1034 | // Lucky for us, Internet Explorer has an "innerText" feature which basically converts entities <--> text. Use it if possible ;) |
| 1002 | 1035 | echo ' |
@@ -1050,11 +1083,12 @@ discard block |
||
| 1050 | 1083 | </p> |
| 1051 | 1084 | <ul>'; |
| 1052 | 1085 | |
| 1053 | - foreach ($context['groups'] as $group) |
|
| 1054 | - echo ' |
|
| 1086 | + foreach ($context['groups'] as $group) { |
|
| 1087 | + echo ' |
|
| 1055 | 1088 | <li> |
| 1056 | 1089 | <label for="who_', $group['id'], '"><input type="checkbox" name="who[', $group['id'], ']" id="who_', $group['id'], '" value="', $group['id'], '" checked> ', $group['name'], '</label> <em>(', $group['member_count'], ')</em> |
| 1057 | 1090 | </li>'; |
| 1091 | + } |
|
| 1058 | 1092 | |
| 1059 | 1093 | echo ' |
| 1060 | 1094 | <li> |
@@ -18,11 +18,12 @@ discard block |
||
| 18 | 18 | global $context, $settings, $options, $scripturl, $modSettings, $txt; |
| 19 | 19 | |
| 20 | 20 | // Let them know why their message became unapproved. |
| 21 | - if ($context['becomesUnapproved']) |
|
| 22 | - echo ' |
|
| 21 | + if ($context['becomesUnapproved']) { |
|
| 22 | + echo ' |
|
| 23 | 23 | <div class="noticebox"> |
| 24 | 24 | ', $txt['post_becomesUnapproved'], ' |
| 25 | 25 | </div>'; |
| 26 | + } |
|
| 26 | 27 | |
| 27 | 28 | if (!empty($context['boards']) && (!empty($options['show_children']) || $context['start'] == 0)) |
| 28 | 29 | { |
@@ -46,17 +47,19 @@ discard block |
||
| 46 | 47 | </a>'; |
| 47 | 48 | |
| 48 | 49 | // Has it outstanding posts for approval? |
| 49 | - if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics'])) |
|
| 50 | - echo ' |
|
| 50 | + if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics'])) { |
|
| 51 | + echo ' |
|
| 51 | 52 | <a href="', $scripturl, '?action=moderate;area=postmod;sa=', ($board['unapproved_topics'] > 0 ? 'topics' : 'posts'), ';brd=', $board['id'], ';', $context['session_var'], '=', $context['session_id'], '" title="', sprintf($txt['unapproved_posts'], $board['unapproved_topics'], $board['unapproved_posts']), '" class="moderation_link">(!)</a>'; |
| 53 | + } |
|
| 52 | 54 | |
| 53 | 55 | echo ' |
| 54 | 56 | <p class="board_description">', $board['description'], '</p>'; |
| 55 | 57 | |
| 56 | 58 | // Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.) |
| 57 | - if (!empty($board['moderators']) || !empty($board['moderator_groups'])) |
|
| 58 | - echo ' |
|
| 59 | + if (!empty($board['moderators']) || !empty($board['moderator_groups'])) { |
|
| 60 | + echo ' |
|
| 59 | 61 | <p class="moderators">', count($board['link_moderators']) === 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $board['link_moderators']), '</p>'; |
| 62 | + } |
|
| 60 | 63 | |
| 61 | 64 | // Show some basic information about the number of posts, etc. |
| 62 | 65 | echo ' |
@@ -68,9 +71,10 @@ discard block |
||
| 68 | 71 | </div> |
| 69 | 72 | <div class="lastpost lpr_border">'; |
| 70 | 73 | |
| 71 | - if (!empty($board['last_post']['id'])) |
|
| 72 | - echo ' |
|
| 74 | + if (!empty($board['last_post']['id'])) { |
|
| 75 | + echo ' |
|
| 73 | 76 | <p>', $board['last_post']['last_post_message'], '</p>'; |
| 77 | + } |
|
| 74 | 78 | |
| 75 | 79 | echo ' |
| 76 | 80 | </div>'; |
@@ -84,14 +88,16 @@ discard block |
||
| 84 | 88 | id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */ |
| 85 | 89 | foreach ($board['children'] as $child) |
| 86 | 90 | { |
| 87 | - if (!$child['is_redirect']) |
|
| 88 | - $child['link'] = ''. ($child['new'] ? '<a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><span class="new_posts">' . $txt['new'] . '</span></a>' : '') . '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="board_new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . '</a>'; |
|
| 89 | - else |
|
| 90 | - $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>'; |
|
| 91 | + if (!$child['is_redirect']) { |
|
| 92 | + $child['link'] = ''. ($child['new'] ? '<a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><span class="new_posts">' . $txt['new'] . '</span></a>' : '') . '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="board_new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . '</a>'; |
|
| 93 | + } else { |
|
| 94 | + $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>'; |
|
| 95 | + } |
|
| 91 | 96 | |
| 92 | 97 | // Has it posts awaiting approval? |
| 93 | - if ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics'])) |
|
| 94 | - $child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>'; |
|
| 98 | + if ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics'])) { |
|
| 99 | + $child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>'; |
|
| 100 | + } |
|
| 95 | 101 | |
| 96 | 102 | $children[] = $child['new'] ? '<span class="strong">' . $child['link'] . '</span>' : '<span>' . $child['link'] . '</span>'; |
| 97 | 103 | } |
@@ -111,8 +117,9 @@ discard block |
||
| 111 | 117 | } |
| 112 | 118 | |
| 113 | 119 | // They can only mark read if they are logged in and it's enabled! |
| 114 | - if (!$context['user']['is_logged']) |
|
| 115 | - unset($context['normal_buttons']['markread']); |
|
| 120 | + if (!$context['user']['is_logged']) { |
|
| 121 | + unset($context['normal_buttons']['markread']); |
|
| 122 | + } |
|
| 116 | 123 | |
| 117 | 124 | if (!$context['no_topic_listing']) |
| 118 | 125 | { |
@@ -139,13 +146,15 @@ discard block |
||
| 139 | 146 | <h3>', $context['name'], '</h3> |
| 140 | 147 | <p>'; |
| 141 | 148 | |
| 142 | - if ($context['description'] != '') |
|
| 143 | - echo ' |
|
| 149 | + if ($context['description'] != '') { |
|
| 150 | + echo ' |
|
| 144 | 151 | ', $context['description']; |
| 152 | + } |
|
| 145 | 153 | |
| 146 | - if (!empty($context['moderators'])) |
|
| 147 | - echo ' |
|
| 154 | + if (!empty($context['moderators'])) { |
|
| 155 | + echo ' |
|
| 148 | 156 | ', count($context['moderators']) === 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $context['link_moderators']), '.'; |
| 157 | + } |
|
| 149 | 158 | |
| 150 | 159 | echo ' |
| 151 | 160 | </p> |
@@ -153,9 +162,10 @@ discard block |
||
| 153 | 162 | } |
| 154 | 163 | |
| 155 | 164 | // If Quick Moderation is enabled start the form. |
| 156 | - if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) |
|
| 157 | - echo ' |
|
| 165 | + if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) { |
|
| 166 | + echo ' |
|
| 158 | 167 | <form action="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '" class="clear" name="quickModForm" id="quickModForm">'; |
| 168 | + } |
|
| 159 | 169 | |
| 160 | 170 | echo ' |
| 161 | 171 | <div id="messageindex">'; |
@@ -165,11 +175,11 @@ discard block |
||
| 165 | 175 | echo ' |
| 166 | 176 | <div class="information">'; |
| 167 | 177 | |
| 168 | - if ($settings['display_who_viewing'] == 1) |
|
| 169 | - echo count($context['view_members']), ' ', count($context['view_members']) === 1 ? $txt['who_member'] : $txt['members']; |
|
| 170 | - |
|
| 171 | - else |
|
| 172 | - echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . (empty($context['view_num_hidden']) || $context['can_moderate_forum'] ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')'); |
|
| 178 | + if ($settings['display_who_viewing'] == 1) { |
|
| 179 | + echo count($context['view_members']), ' ', count($context['view_members']) === 1 ? $txt['who_member'] : $txt['members']; |
|
| 180 | + } else { |
|
| 181 | + echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . (empty($context['view_num_hidden']) || $context['can_moderate_forum'] ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')'); |
|
| 182 | + } |
|
| 173 | 183 | echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_board']; |
| 174 | 184 | |
| 175 | 185 | echo ' |
@@ -189,32 +199,36 @@ discard block |
||
| 189 | 199 | <div class="lastpost">', $context['topics_headers']['last_post'], '</div>'; |
| 190 | 200 | |
| 191 | 201 | // Show a "select all" box for quick moderation? |
| 192 | - if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1) |
|
| 193 | - echo ' |
|
| 202 | + if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1) { |
|
| 203 | + echo ' |
|
| 194 | 204 | <div class="moderation"> |
| 195 | 205 | <input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');"> |
| 196 | 206 | </div>'; |
| 207 | + } |
|
| 197 | 208 | |
| 198 | 209 | // If it's on in "image" mode, don't show anything but the column. |
| 199 | - elseif (!empty($context['can_quick_mod'])) |
|
| 200 | - echo ' |
|
| 210 | + elseif (!empty($context['can_quick_mod'])) { |
|
| 211 | + echo ' |
|
| 201 | 212 | <div class="moderation"></div>'; |
| 213 | + } |
|
| 202 | 214 | } |
| 203 | 215 | |
| 204 | 216 | // No topics... just say, "sorry bub". |
| 205 | - else |
|
| 206 | - echo ' |
|
| 217 | + else { |
|
| 218 | + echo ' |
|
| 207 | 219 | <h3 class="titlebg">', $txt['topic_alert_none'], '</h3>'; |
| 220 | + } |
|
| 208 | 221 | |
| 209 | 222 | echo ' |
| 210 | 223 | </div><!-- #topic_header -->'; |
| 211 | 224 | |
| 212 | 225 | // If this person can approve items and we have some awaiting approval tell them. |
| 213 | - if (!empty($context['unapproved_posts_message'])) |
|
| 214 | - echo ' |
|
| 226 | + if (!empty($context['unapproved_posts_message'])) { |
|
| 227 | + echo ' |
|
| 215 | 228 | <div class="information"> |
| 216 | 229 | <span class="alert">!</span> ', $context['unapproved_posts_message'], ' |
| 217 | 230 | </div>'; |
| 231 | + } |
|
| 218 | 232 | |
| 219 | 233 | // Contain the topic list |
| 220 | 234 | echo ' |
@@ -235,25 +249,30 @@ discard block |
||
| 235 | 249 | echo ' |
| 236 | 250 | <div class="icons floatright">'; |
| 237 | 251 | |
| 238 | - if ($topic['is_watched']) |
|
| 239 | - echo ' |
|
| 252 | + if ($topic['is_watched']) { |
|
| 253 | + echo ' |
|
| 240 | 254 | <span class="generic_icons watch" title="', $txt['watching_this_topic'], '"></span>'; |
| 255 | + } |
|
| 241 | 256 | |
| 242 | - if ($topic['is_locked']) |
|
| 243 | - echo ' |
|
| 257 | + if ($topic['is_locked']) { |
|
| 258 | + echo ' |
|
| 244 | 259 | <span class="generic_icons lock"></span>'; |
| 260 | + } |
|
| 245 | 261 | |
| 246 | - if ($topic['is_sticky']) |
|
| 247 | - echo ' |
|
| 262 | + if ($topic['is_sticky']) { |
|
| 263 | + echo ' |
|
| 248 | 264 | <span class="generic_icons sticky"></span>'; |
| 265 | + } |
|
| 249 | 266 | |
| 250 | - if ($topic['is_redirect']) |
|
| 251 | - echo ' |
|
| 267 | + if ($topic['is_redirect']) { |
|
| 268 | + echo ' |
|
| 252 | 269 | <span class="generic_icons move"></span>'; |
| 270 | + } |
|
| 253 | 271 | |
| 254 | - if ($topic['is_poll']) |
|
| 255 | - echo ' |
|
| 272 | + if ($topic['is_poll']) { |
|
| 273 | + echo ' |
|
| 256 | 274 | <span class="generic_icons poll"></span>'; |
| 275 | + } |
|
| 257 | 276 | |
| 258 | 277 | echo ' |
| 259 | 278 | </div>'; |
@@ -285,26 +304,31 @@ discard block |
||
| 285 | 304 | echo ' |
| 286 | 305 | <div class="moderation">'; |
| 287 | 306 | |
| 288 | - if ($options['display_quick_mod'] == 1) |
|
| 289 | - echo ' |
|
| 307 | + if ($options['display_quick_mod'] == 1) { |
|
| 308 | + echo ' |
|
| 290 | 309 | <input type="checkbox" name="topics[]" value="', $topic['id'], '">'; |
| 291 | - else |
|
| 310 | + } else |
|
| 292 | 311 | { |
| 293 | 312 | // Check permissions on each and show only the ones they are allowed to use. |
| 294 | - if ($topic['quick_mod']['remove']) |
|
| 295 | - echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=remove;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons delete" title="', $txt['remove_topic'], '"></span></a>'; |
|
| 313 | + if ($topic['quick_mod']['remove']) { |
|
| 314 | + echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=remove;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons delete" title="', $txt['remove_topic'], '"></span></a>'; |
|
| 315 | + } |
|
| 296 | 316 | |
| 297 | - if ($topic['quick_mod']['lock']) |
|
| 298 | - echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=lock;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons lock" title="', $topic['is_locked'] ? $txt['set_unlock'] : $txt['set_lock'], '"></span></a>'; |
|
| 317 | + if ($topic['quick_mod']['lock']) { |
|
| 318 | + echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=lock;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons lock" title="', $topic['is_locked'] ? $txt['set_unlock'] : $txt['set_lock'], '"></span></a>'; |
|
| 319 | + } |
|
| 299 | 320 | |
| 300 | - if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) |
|
| 301 | - echo '<br>'; |
|
| 321 | + if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) { |
|
| 322 | + echo '<br>'; |
|
| 323 | + } |
|
| 302 | 324 | |
| 303 | - if ($topic['quick_mod']['sticky']) |
|
| 304 | - echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=sticky;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons sticky" title="', $topic['is_sticky'] ? $txt['set_nonsticky'] : $txt['set_sticky'], '"></span></a>'; |
|
| 325 | + if ($topic['quick_mod']['sticky']) { |
|
| 326 | + echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=sticky;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons sticky" title="', $topic['is_sticky'] ? $txt['set_nonsticky'] : $txt['set_sticky'], '"></span></a>'; |
|
| 327 | + } |
|
| 305 | 328 | |
| 306 | - if ($topic['quick_mod']['move']) |
|
| 307 | - echo '<a href="', $scripturl, '?action=movetopic;current_board=', $context['current_board'], ';board=', $context['current_board'], '.', $context['start'], ';topic=', $topic['id'], '.0"><span class="generic_icons move" title="', $txt['move_topic'], '"></span></a>'; |
|
| 329 | + if ($topic['quick_mod']['move']) { |
|
| 330 | + echo '<a href="', $scripturl, '?action=movetopic;current_board=', $context['current_board'], ';board=', $context['current_board'], '.', $context['start'], ';topic=', $topic['id'], '.0"><span class="generic_icons move" title="', $txt['move_topic'], '"></span></a>'; |
|
| 331 | + } |
|
| 308 | 332 | } |
| 309 | 333 | echo ' |
| 310 | 334 | </div><!-- .moderation -->'; |
@@ -322,18 +346,20 @@ discard block |
||
| 322 | 346 | <select class="qaction" name="qaction"', $context['can_move'] ? ' onchange="this.form.move_to.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '> |
| 323 | 347 | <option value="">--------</option>'; |
| 324 | 348 | |
| 325 | - foreach ($context['qmod_actions'] as $qmod_action) |
|
| 326 | - if ($context['can_' . $qmod_action]) |
|
| 349 | + foreach ($context['qmod_actions'] as $qmod_action) { |
|
| 350 | + if ($context['can_' . $qmod_action]) |
|
| 327 | 351 | echo ' |
| 328 | 352 | <option value="' . $qmod_action . '">' . $txt['quick_mod_' . $qmod_action] . '</option>'; |
| 353 | + } |
|
| 329 | 354 | |
| 330 | 355 | echo ' |
| 331 | 356 | </select>'; |
| 332 | 357 | |
| 333 | 358 | // Show a list of boards they can move the topic to. |
| 334 | - if ($context['can_move']) |
|
| 335 | - echo ' |
|
| 359 | + if ($context['can_move']) { |
|
| 360 | + echo ' |
|
| 336 | 361 | <span id="quick_mod_jump_to"></span>'; |
| 362 | + } |
|
| 337 | 363 | |
| 338 | 364 | echo ' |
| 339 | 365 | <input type="submit" value="', $txt['quick_mod_go'], '" onclick="return document.forms.quickModForm.qaction.value != \'\' && confirm(\'', $txt['quickmod_confirm'], '\');" class="button qaction"> |
@@ -344,10 +370,11 @@ discard block |
||
| 344 | 370 | </div><!-- #messageindex -->'; |
| 345 | 371 | |
| 346 | 372 | // Finish off the form - again. |
| 347 | - if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) |
|
| 348 | - echo ' |
|
| 373 | + if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) { |
|
| 374 | + echo ' |
|
| 349 | 375 | <input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '"> |
| 350 | 376 | </form>'; |
| 377 | + } |
|
| 351 | 378 | |
| 352 | 379 | // Mobile action buttons (bottom) |
| 353 | 380 | echo ' |
@@ -369,8 +396,8 @@ discard block |
||
| 369 | 396 | // Show breadcrumbs at the bottom too. |
| 370 | 397 | theme_linktree(); |
| 371 | 398 | |
| 372 | - if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) |
|
| 373 | - echo ' |
|
| 399 | + if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) { |
|
| 400 | + echo ' |
|
| 374 | 401 | <script> |
| 375 | 402 | if (typeof(window.XMLHttpRequest) != "undefined") |
| 376 | 403 | aJumpTo[aJumpTo.length] = new JumpTo({ |
@@ -389,6 +416,7 @@ discard block |
||
| 389 | 416 | sCustomName: "move_to" |
| 390 | 417 | }); |
| 391 | 418 | </script>'; |
| 419 | + } |
|
| 392 | 420 | |
| 393 | 421 | // Javascript for inline editing. |
| 394 | 422 | echo ' |
@@ -425,8 +453,8 @@ discard block |
||
| 425 | 453 | <div class="information"> |
| 426 | 454 | <p class="floatright" id="message_index_jump_to"></p>'; |
| 427 | 455 | |
| 428 | - if (empty($context['no_topic_listing'])) |
|
| 429 | - echo ' |
|
| 456 | + if (empty($context['no_topic_listing'])) { |
|
| 457 | + echo ' |
|
| 430 | 458 | <p class="floatleft">', !empty($modSettings['enableParticipation']) && $context['user']['is_logged'] ? ' |
| 431 | 459 | <img src="' . $settings['images_url'] . '/icons/profile_sm.png" alt="" class="centericon"> ' . $txt['participation_caption'] . '<br>' : '', ' |
| 432 | 460 | '. ($modSettings['pollMode'] == '1' ? '<span class="generic_icons poll centericon"></span> ' . $txt['poll'] : '') . '<br> |
@@ -436,9 +464,10 @@ discard block |
||
| 436 | 464 | <span class="generic_icons lock centericon"></span> ' . $txt['locked_topic'] . '<br> |
| 437 | 465 | <span class="generic_icons sticky centericon"></span> ' . $txt['sticky_topic'] . '<br> |
| 438 | 466 | </p>'; |
| 467 | + } |
|
| 439 | 468 | |
| 440 | - if (!empty($context['jump_to'])) |
|
| 441 | - echo ' |
|
| 469 | + if (!empty($context['jump_to'])) { |
|
| 470 | + echo ' |
|
| 442 | 471 | <script> |
| 443 | 472 | if (typeof(window.XMLHttpRequest) != "undefined") |
| 444 | 473 | aJumpTo[aJumpTo.length] = new JumpTo({ |
@@ -454,6 +483,7 @@ discard block |
||
| 454 | 483 | sGoButtonLabel: "', $txt['quick_mod_go'], '" |
| 455 | 484 | }); |
| 456 | 485 | </script>'; |
| 486 | + } |
|
| 457 | 487 | |
| 458 | 488 | echo ' |
| 459 | 489 | <br class="clear"> |
@@ -40,9 +40,10 @@ discard block |
||
| 40 | 40 | <option value="0000"', $context['holiday']['year'] == '0000' ? ' selected' : '', '>', $txt['every_year'], '</option>'; |
| 41 | 41 | |
| 42 | 42 | // Show a list of all the years we allow... |
| 43 | - for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++) |
|
| 44 | - echo ' |
|
| 43 | + for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++) { |
|
| 44 | + echo ' |
|
| 45 | 45 | <option value="', $year, '"', $year == $context['holiday']['year'] ? ' selected' : '', '>', $year, '</option>'; |
| 46 | + } |
|
| 46 | 47 | |
| 47 | 48 | echo ' |
| 48 | 49 | </select> |
@@ -50,9 +51,10 @@ discard block |
||
| 50 | 51 | <select name="month" id="month" onchange="generateDays();">'; |
| 51 | 52 | |
| 52 | 53 | // There are 12 months per year - ensure that they all get listed. |
| 53 | - for ($month = 1; $month <= 12; $month++) |
|
| 54 | - echo ' |
|
| 54 | + for ($month = 1; $month <= 12; $month++) { |
|
| 55 | + echo ' |
|
| 55 | 56 | <option value="', $month, '"', $month == $context['holiday']['month'] ? ' selected' : '', '>', $txt['months'][$month], '</option>'; |
| 57 | + } |
|
| 56 | 58 | |
| 57 | 59 | echo ' |
| 58 | 60 | </select> |
@@ -60,23 +62,25 @@ discard block |
||
| 60 | 62 | <select name="day" id="day" onchange="generateDays();">'; |
| 61 | 63 | |
| 62 | 64 | // This prints out all the days in the current month - this changes dynamically as we switch months. |
| 63 | - for ($day = 1; $day <= $context['holiday']['last_day']; $day++) |
|
| 64 | - echo ' |
|
| 65 | + for ($day = 1; $day <= $context['holiday']['last_day']; $day++) { |
|
| 66 | + echo ' |
|
| 65 | 67 | <option value="', $day, '"', $day == $context['holiday']['day'] ? ' selected' : '', '>', $day, '</option>'; |
| 68 | + } |
|
| 66 | 69 | |
| 67 | 70 | echo ' |
| 68 | 71 | </select> |
| 69 | 72 | </dd> |
| 70 | 73 | </dl>'; |
| 71 | 74 | |
| 72 | - if ($context['is_new']) |
|
| 73 | - echo ' |
|
| 75 | + if ($context['is_new']) { |
|
| 76 | + echo ' |
|
| 74 | 77 | <input type="submit" value="', $txt['holidays_button_add'], '" class="button">'; |
| 75 | - else |
|
| 76 | - echo ' |
|
| 78 | + } else { |
|
| 79 | + echo ' |
|
| 77 | 80 | <input type="submit" name="edit" value="', $txt['holidays_button_edit'], '" class="button"> |
| 78 | 81 | <input type="submit" name="delete" value="', $txt['holidays_button_remove'], '" class="button"> |
| 79 | 82 | <input type="hidden" name="holiday" value="', $context['holiday']['id'], '">'; |
| 83 | + } |
|
| 80 | 84 | echo ' |
| 81 | 85 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 82 | 86 | </div><!-- .windowbg2 --> |
@@ -24,11 +24,12 @@ discard block |
||
| 24 | 24 | <h3 class="catbg">', $txt['paid_' . $context['action_type'] . '_subscription'], '</h3> |
| 25 | 25 | </div>'; |
| 26 | 26 | |
| 27 | - if (!empty($context['disable_groups'])) |
|
| 28 | - echo ' |
|
| 27 | + if (!empty($context['disable_groups'])) { |
|
| 28 | + echo ' |
|
| 29 | 29 | <div class="information"> |
| 30 | 30 | <span class="alert">', $txt['paid_mod_edit_note'], '</span> |
| 31 | 31 | </div>'; |
| 32 | + } |
|
| 32 | 33 | |
| 33 | 34 | echo ' |
| 34 | 35 | <div class="windowbg2"> |
@@ -69,9 +70,10 @@ discard block |
||
| 69 | 70 | <option value="0"', $context['sub']['prim_group'] == 0 ? ' selected' : '', '>', $txt['paid_mod_no_group'], '</option>'; |
| 70 | 71 | |
| 71 | 72 | // Put each group into the box. |
| 72 | - foreach ($context['groups'] as $id => $name) |
|
| 73 | - echo ' |
|
| 73 | + foreach ($context['groups'] as $id => $name) { |
|
| 74 | + echo ' |
|
| 74 | 75 | <option value="', $id, '"', $context['sub']['prim_group'] == $id ? ' selected' : '', '>', $name, '</option>'; |
| 76 | + } |
|
| 75 | 77 | |
| 76 | 78 | echo ' |
| 77 | 79 | </select> |
@@ -83,12 +85,13 @@ discard block |
||
| 83 | 85 | <dd>'; |
| 84 | 86 | |
| 85 | 87 | // Put a checkbox in for each group |
| 86 | - foreach ($context['groups'] as $id => $name) |
|
| 87 | - echo ' |
|
| 88 | + foreach ($context['groups'] as $id => $name) { |
|
| 89 | + echo ' |
|
| 88 | 90 | <label for="addgroup_', $id, '"> |
| 89 | 91 | <input type="checkbox" id="addgroup_', $id, '" name="addgroup[', $id, ']"', in_array($id, $context['sub']['add_groups']) ? ' checked' : '', !empty($context['disable_groups']) ? ' disabled' : '', '> |
| 90 | 92 | <span class="smalltext">', $name, '</span> |
| 91 | 93 | </label><br>'; |
| 94 | + } |
|
| 92 | 95 | |
| 93 | 96 | echo ' |
| 94 | 97 | </dd> |
@@ -142,8 +145,8 @@ discard block |
||
| 142 | 145 | <fieldset>'; |
| 143 | 146 | |
| 144 | 147 | //!! Removed until implemented |
| 145 | - if (!empty($sdflsdhglsdjgs)) |
|
| 146 | - echo ' |
|
| 148 | + if (!empty($sdflsdhglsdjgs)) { |
|
| 149 | + echo ' |
|
| 147 | 150 | <dl class="settings"> |
| 148 | 151 | <dt> |
| 149 | 152 | <label for="allow_partial_check">', $txt['paid_mod_allow_partial'], '</label>:<br><span class="smalltext">', $txt['paid_mod_allow_partial_desc'], '</span> |
@@ -152,6 +155,7 @@ discard block |
||
| 152 | 155 | <input type="checkbox" name="allow_partial" id="allow_partial_check"', empty($context['sub']['allow_partial']) ? '' : ' checked', '> |
| 153 | 156 | </dd> |
| 154 | 157 | </dl>'; |
| 158 | + } |
|
| 155 | 159 | |
| 156 | 160 | echo ' |
| 157 | 161 | <div class="information"> |
@@ -250,8 +254,8 @@ discard block |
||
| 250 | 254 | <dl class="settings">'; |
| 251 | 255 | |
| 252 | 256 | // Do we need a username? |
| 253 | - if ($context['action_type'] == 'add') |
|
| 254 | - echo ' |
|
| 257 | + if ($context['action_type'] == 'add') { |
|
| 258 | + echo ' |
|
| 255 | 259 | <dt> |
| 256 | 260 | <strong>', $txt['paid_username'], ':</strong><br> |
| 257 | 261 | <span class="smalltext">', $txt['one_username'], '</span> |
@@ -259,6 +263,7 @@ discard block |
||
| 259 | 263 | <dd> |
| 260 | 264 | <input type="text" name="name" id="name_control" value="', $context['sub']['username'], '" size="30"> |
| 261 | 265 | </dd>'; |
| 266 | + } |
|
| 262 | 267 | |
| 263 | 268 | echo ' |
| 264 | 269 | <dt> |
@@ -276,9 +281,10 @@ discard block |
||
| 276 | 281 | <select name="year" id="year" onchange="generateDays();">'; |
| 277 | 282 | |
| 278 | 283 | // Show a list of all the years we allow... |
| 279 | - for ($year = 2005; $year <= 2030; $year++) |
|
| 280 | - echo ' |
|
| 284 | + for ($year = 2005; $year <= 2030; $year++) { |
|
| 285 | + echo ' |
|
| 281 | 286 | <option value="', $year, '"', $year == $context['sub']['start']['year'] ? ' selected' : '', '>', $year, '</option>'; |
| 287 | + } |
|
| 282 | 288 | |
| 283 | 289 | echo ' |
| 284 | 290 | </select> |
@@ -286,9 +292,10 @@ discard block |
||
| 286 | 292 | <select name="month" id="month" onchange="generateDays();">'; |
| 287 | 293 | |
| 288 | 294 | // There are 12 months per year - ensure that they all get listed. |
| 289 | - for ($month = 1; $month <= 12; $month++) |
|
| 290 | - echo ' |
|
| 295 | + for ($month = 1; $month <= 12; $month++) { |
|
| 296 | + echo ' |
|
| 291 | 297 | <option value="', $month, '"', $month == $context['sub']['start']['month'] ? ' selected' : '', '>', $txt['months'][$month], '</option>'; |
| 298 | + } |
|
| 292 | 299 | |
| 293 | 300 | echo ' |
| 294 | 301 | </select> |
@@ -296,9 +303,10 @@ discard block |
||
| 296 | 303 | <select name="day" id="day">'; |
| 297 | 304 | |
| 298 | 305 | // This prints out all the days in the current month - this changes dynamically as we switch months. |
| 299 | - for ($day = 1; $day <= $context['sub']['start']['last_day']; $day++) |
|
| 300 | - echo ' |
|
| 306 | + for ($day = 1; $day <= $context['sub']['start']['last_day']; $day++) { |
|
| 307 | + echo ' |
|
| 301 | 308 | <option value="', $day, '"', $day == $context['sub']['start']['day'] ? ' selected' : '', '>', $day, '</option>'; |
| 309 | + } |
|
| 302 | 310 | |
| 303 | 311 | echo ' |
| 304 | 312 | </select> |
@@ -310,9 +318,10 @@ discard block |
||
| 310 | 318 | <select name="yearend" id="yearend" onchange="generateDays(\'end\');">'; |
| 311 | 319 | |
| 312 | 320 | // Show a list of all the years we allow... |
| 313 | - for ($year = 2005; $year <= 2030; $year++) |
|
| 314 | - echo ' |
|
| 321 | + for ($year = 2005; $year <= 2030; $year++) { |
|
| 322 | + echo ' |
|
| 315 | 323 | <option value="', $year, '"', $year == $context['sub']['end']['year'] ? ' selected' : '', '>', $year, '</option>'; |
| 324 | + } |
|
| 316 | 325 | |
| 317 | 326 | echo ' |
| 318 | 327 | </select> |
@@ -320,9 +329,10 @@ discard block |
||
| 320 | 329 | <select name="monthend" id="monthend" onchange="generateDays(\'end\');">'; |
| 321 | 330 | |
| 322 | 331 | // There are 12 months per year - ensure that they all get listed. |
| 323 | - for ($month = 1; $month <= 12; $month++) |
|
| 324 | - echo ' |
|
| 332 | + for ($month = 1; $month <= 12; $month++) { |
|
| 333 | + echo ' |
|
| 325 | 334 | <option value="', $month, '"', $month == $context['sub']['end']['month'] ? ' selected' : '', '>', $txt['months'][$month], '</option>'; |
| 335 | + } |
|
| 326 | 336 | |
| 327 | 337 | echo ' |
| 328 | 338 | </select> |
@@ -330,9 +340,10 @@ discard block |
||
| 330 | 340 | <select name="dayend" id="dayend">'; |
| 331 | 341 | |
| 332 | 342 | // This prints out all the days in the current month - this changes dynamically as we switch months. |
| 333 | - for ($day = 1; $day <= $context['sub']['end']['last_day']; $day++) |
|
| 334 | - echo ' |
|
| 343 | + for ($day = 1; $day <= $context['sub']['end']['last_day']; $day++) { |
|
| 344 | + echo ' |
|
| 335 | 345 | <option value="', $day, '"', $day == $context['sub']['end']['day'] ? ' selected' : '', '>', $day, '</option>'; |
| 346 | + } |
|
| 336 | 347 | |
| 337 | 348 | echo ' |
| 338 | 349 | </select> |
@@ -371,8 +382,8 @@ discard block |
||
| 371 | 382 | <div class="windowbg"> |
| 372 | 383 | <ul>'; |
| 373 | 384 | |
| 374 | - foreach ($context['pending_payments'] as $id => $payment) |
|
| 375 | - echo ' |
|
| 385 | + foreach ($context['pending_payments'] as $id => $payment) { |
|
| 386 | + echo ' |
|
| 376 | 387 | <li> |
| 377 | 388 | ', $payment['desc'], ' |
| 378 | 389 | <span class="floatleft"> |
@@ -382,6 +393,7 @@ discard block |
||
| 382 | 393 | <a href="', $scripturl, '?action=admin;area=paidsubscribe;sa=modifyuser;lid=', $context['log_id'], ';pending=', $id, ';remove">', $txt['pending_payments_remove'], '</a> |
| 383 | 394 | </span> |
| 384 | 395 | </li>'; |
| 396 | + } |
|
| 385 | 397 | |
| 386 | 398 | echo ' |
| 387 | 399 | </ul> |
@@ -406,12 +418,12 @@ discard block |
||
| 406 | 418 | <h3 class="catbg">', $txt['subscriptions'], '</h3> |
| 407 | 419 | </div>'; |
| 408 | 420 | |
| 409 | - if (empty($context['subscriptions'])) |
|
| 410 | - echo ' |
|
| 421 | + if (empty($context['subscriptions'])) { |
|
| 422 | + echo ' |
|
| 411 | 423 | <div class="information"> |
| 412 | 424 | ', $txt['paid_subs_none'], ' |
| 413 | 425 | </div>'; |
| 414 | - else |
|
| 426 | + } else |
|
| 415 | 427 | { |
| 416 | 428 | echo ' |
| 417 | 429 | <div class="information"> |
@@ -423,8 +435,9 @@ discard block |
||
| 423 | 435 | { |
| 424 | 436 | |
| 425 | 437 | // Ignore the inactive ones... |
| 426 | - if (empty($subscription['active'])) |
|
| 427 | - continue; |
|
| 438 | + if (empty($subscription['active'])) { |
|
| 439 | + continue; |
|
| 440 | + } |
|
| 428 | 441 | |
| 429 | 442 | echo ' |
| 430 | 443 | <div class="cat_bar"> |
@@ -434,9 +447,10 @@ discard block |
||
| 434 | 447 | <p><strong>', $subscription['name'], '</strong></p> |
| 435 | 448 | <p class="smalltext">', $subscription['desc'], '</p>'; |
| 436 | 449 | |
| 437 | - if (!$subscription['flexible']) |
|
| 438 | - echo ' |
|
| 450 | + if (!$subscription['flexible']) { |
|
| 451 | + echo ' |
|
| 439 | 452 | <div><strong>', $txt['paid_duration'], ':</strong> ', $subscription['length'], '</div>'; |
| 453 | + } |
|
| 440 | 454 | |
| 441 | 455 | if ($context['user']['is_owner']) |
| 442 | 456 | { |
@@ -449,24 +463,25 @@ discard block |
||
| 449 | 463 | <select name="cur[', $subscription['id'], ']">'; |
| 450 | 464 | |
| 451 | 465 | // Print out the costs for this one. |
| 452 | - foreach ($subscription['costs'] as $duration => $value) |
|
| 453 | - echo ' |
|
| 466 | + foreach ($subscription['costs'] as $duration => $value) { |
|
| 467 | + echo ' |
|
| 454 | 468 | <option value="', $duration, '">', sprintf($modSettings['paid_currency_symbol'], $value), '/', $txt[$duration], '</option>'; |
| 469 | + } |
|
| 455 | 470 | |
| 456 | 471 | echo ' |
| 457 | 472 | </select>'; |
| 458 | - } |
|
| 459 | - else |
|
| 460 | - echo ' |
|
| 473 | + } else { |
|
| 474 | + echo ' |
|
| 461 | 475 | ', sprintf($modSettings['paid_currency_symbol'], $subscription['costs']['fixed']); |
| 476 | + } |
|
| 462 | 477 | |
| 463 | 478 | echo ' |
| 464 | 479 | <hr> |
| 465 | 480 | <input type="submit" name="sub_id[', $subscription['id'], ']" value="', $txt['paid_order'], '" class="button">'; |
| 466 | - } |
|
| 467 | - else |
|
| 468 | - echo ' |
|
| 481 | + } else { |
|
| 482 | + echo ' |
|
| 469 | 483 | <a href="', $scripturl, '?action=admin;area=paidsubscribe;sa=modifyuser;sid=', $subscription['id'], ';uid=', $context['member']['id'], (empty($context['current'][$subscription['id']]) ? '' : ';lid=' . $context['current'][$subscription['id']]['id']), '">', empty($context['current'][$subscription['id']]) ? $txt['paid_admin_add'] : $txt['paid_edit_subscription'], '</a>'; |
| 484 | + } |
|
| 470 | 485 | |
| 471 | 486 | echo ' |
| 472 | 487 | </div><!-- .windowbg -->'; |
@@ -493,19 +508,20 @@ discard block |
||
| 493 | 508 | </thead> |
| 494 | 509 | <tbody>'; |
| 495 | 510 | |
| 496 | - if (empty($context['current'])) |
|
| 497 | - echo ' |
|
| 511 | + if (empty($context['current'])) { |
|
| 512 | + echo ' |
|
| 498 | 513 | <tr class="windowbg"> |
| 499 | 514 | <td colspan="4"> |
| 500 | 515 | ', $txt['paid_none_yet'], ' |
| 501 | 516 | </td> |
| 502 | 517 | </tr>'; |
| 518 | + } |
|
| 503 | 519 | |
| 504 | 520 | foreach ($context['current'] as $sub) |
| 505 | 521 | { |
| 506 | 522 | |
| 507 | - if (!$sub['hide']) |
|
| 508 | - echo ' |
|
| 523 | + if (!$sub['hide']) { |
|
| 524 | + echo ' |
|
| 509 | 525 | <tr class="windowbg"> |
| 510 | 526 | <td> |
| 511 | 527 | ', (allowedTo('admin_forum') ? '<a href="' . $scripturl . '?action=admin;area=paidsubscribe;sa=modifyuser;lid=' . $sub['id'] . '">' . $sub['name'] . '</a>' : $sub['name']), ' |
@@ -516,6 +532,7 @@ discard block |
||
| 516 | 532 | <td>', $sub['start'], '</td> |
| 517 | 533 | <td>', $sub['end'], '</td> |
| 518 | 534 | </tr>'; |
| 535 | + } |
|
| 519 | 536 | } |
| 520 | 537 | |
| 521 | 538 | echo ' |
@@ -567,15 +584,17 @@ discard block |
||
| 567 | 584 | ', $gateway['desc'], '<br> |
| 568 | 585 | <form action="', $gateway['form'], '" method="post">'; |
| 569 | 586 | |
| 570 | - if (!empty($gateway['javascript'])) |
|
| 571 | - echo ' |
|
| 587 | + if (!empty($gateway['javascript'])) { |
|
| 588 | + echo ' |
|
| 572 | 589 | <script> |
| 573 | 590 | ', $gateway['javascript'], ' |
| 574 | 591 | </script>'; |
| 592 | + } |
|
| 575 | 593 | |
| 576 | - foreach ($gateway['hidden'] as $name => $value) |
|
| 577 | - echo ' |
|
| 594 | + foreach ($gateway['hidden'] as $name => $value) { |
|
| 595 | + echo ' |
|
| 578 | 596 | <input type="hidden" id="', $gateway['id'], '_', $name, '" name="', $name, '" value="', $value, '">'; |
| 597 | + } |
|
| 579 | 598 | |
| 580 | 599 | echo ' |
| 581 | 600 | <br> |
@@ -65,9 +65,10 @@ discard block |
||
| 65 | 65 | ', implode(', ', $context['administrators']); |
| 66 | 66 | |
| 67 | 67 | // If we have lots of admins... don't show them all. |
| 68 | - if (!empty($context['more_admins_link'])) |
|
| 69 | - echo ' |
|
| 68 | + if (!empty($context['more_admins_link'])) { |
|
| 69 | + echo ' |
|
| 70 | 70 | (', $context['more_admins_link'], ')'; |
| 71 | + } |
|
| 71 | 72 | |
| 72 | 73 | echo ' |
| 73 | 74 | </div><!-- #version_details --> |
@@ -84,17 +85,19 @@ discard block |
||
| 84 | 85 | foreach ($area['areas'] as $item_id => $item) |
| 85 | 86 | { |
| 86 | 87 | // No point showing the 'home' page here, we're already on it! |
| 87 | - if ($area_id == 'forum' && $item_id == 'index') |
|
| 88 | - continue; |
|
| 88 | + if ($area_id == 'forum' && $item_id == 'index') { |
|
| 89 | + continue; |
|
| 90 | + } |
|
| 89 | 91 | |
| 90 | 92 | $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'] : ''); |
| 91 | 93 | |
| 92 | - if (!empty($item['icon_file'])) |
|
| 93 | - echo ' |
|
| 94 | + if (!empty($item['icon_file'])) { |
|
| 95 | + echo ' |
|
| 94 | 96 | <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>'; |
| 95 | - else |
|
| 96 | - echo ' |
|
| 97 | + } else { |
|
| 98 | + echo ' |
|
| 97 | 99 | <a href="', $url, '"><span class="large_', $item['icon_class'], !empty($item['inactive']) ? ' inactive' : '', '"></span>', $item['label'], '</a>'; |
| 100 | + } |
|
| 98 | 101 | } |
| 99 | 102 | |
| 100 | 103 | echo ' |
@@ -105,10 +108,11 @@ discard block |
||
| 105 | 108 | </div><!-- #admincenter -->'; |
| 106 | 109 | |
| 107 | 110 | // The below functions include all the scripts needed from the simplemachines.org site. The language and format are passed for internationalization. |
| 108 | - if (empty($modSettings['disable_smf_js'])) |
|
| 109 | - echo ' |
|
| 111 | + if (empty($modSettings['disable_smf_js'])) { |
|
| 112 | + echo ' |
|
| 110 | 113 | <script src="', $scripturl, '?action=viewsmfile;filename=current-version.js"></script> |
| 111 | 114 | <script src="', $scripturl, '?action=viewsmfile;filename=latest-news.js"></script>'; |
| 115 | + } |
|
| 112 | 116 | |
| 113 | 117 | // This sets the announcements and current versions themselves ;). |
| 114 | 118 | echo ' |
@@ -187,9 +191,10 @@ discard block |
||
| 187 | 191 | <em>', $version['version'], '</em>'; |
| 188 | 192 | |
| 189 | 193 | // more details for this item, show them a link |
| 190 | - if ($context['can_admin'] && isset($version['more'])) |
|
| 191 | - echo |
|
| 194 | + if ($context['can_admin'] && isset($version['more'])) { |
|
| 195 | + echo |
|
| 192 | 196 | ' <a href="', $scripturl, $version['more'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['version_check_more'], '</a>'; |
| 197 | + } |
|
| 193 | 198 | echo ' |
| 194 | 199 | <br>'; |
| 195 | 200 | } |
@@ -220,21 +225,23 @@ discard block |
||
| 220 | 225 | |
| 221 | 226 | foreach ($context['credits'] as $section) |
| 222 | 227 | { |
| 223 | - if (isset($section['pretext'])) |
|
| 224 | - echo ' |
|
| 228 | + if (isset($section['pretext'])) { |
|
| 229 | + echo ' |
|
| 225 | 230 | <p>', $section['pretext'], '</p> |
| 226 | 231 | <hr>'; |
| 232 | + } |
|
| 227 | 233 | |
| 228 | 234 | echo ' |
| 229 | 235 | <dl>'; |
| 230 | 236 | |
| 231 | 237 | foreach ($section['groups'] as $group) |
| 232 | 238 | { |
| 233 | - if (isset($group['title'])) |
|
| 234 | - echo ' |
|
| 239 | + if (isset($group['title'])) { |
|
| 240 | + echo ' |
|
| 235 | 241 | <dt> |
| 236 | 242 | <strong>', $group['title'], ':</strong> |
| 237 | 243 | </dt>'; |
| 244 | + } |
|
| 238 | 245 | |
| 239 | 246 | echo ' |
| 240 | 247 | <dd>', implode(', ', $group['members']), '</dd>'; |
@@ -243,10 +250,11 @@ discard block |
||
| 243 | 250 | echo ' |
| 244 | 251 | </dl>'; |
| 245 | 252 | |
| 246 | - if (isset($section['posttext'])) |
|
| 247 | - echo ' |
|
| 253 | + if (isset($section['posttext'])) { |
|
| 254 | + echo ' |
|
| 248 | 255 | <hr> |
| 249 | 256 | <p>', $section['posttext'], '</p>'; |
| 257 | + } |
|
| 250 | 258 | } |
| 251 | 259 | |
| 252 | 260 | echo ' |
@@ -262,9 +270,10 @@ discard block |
||
| 262 | 270 | smfSupportVersions.forum = "', $context['forum_version'], '";'; |
| 263 | 271 | |
| 264 | 272 | // Don't worry, none of this is logged, it's just used to give information that might be of use. |
| 265 | - foreach ($context['current_versions'] as $variable => $version) |
|
| 266 | - echo ' |
|
| 273 | + foreach ($context['current_versions'] as $variable => $version) { |
|
| 274 | + echo ' |
|
| 267 | 275 | smfSupportVersions.', $variable, ' = "', $version['version'], '";'; |
| 276 | + } |
|
| 268 | 277 | |
| 269 | 278 | // Now we just have to include the script and wait ;). |
| 270 | 279 | echo ' |
@@ -361,8 +370,8 @@ discard block |
||
| 361 | 370 | <tbody>'; |
| 362 | 371 | |
| 363 | 372 | // Loop through every source file displaying its version - using javascript. |
| 364 | - foreach ($context['file_versions'] as $filename => $version) |
|
| 365 | - echo ' |
|
| 373 | + foreach ($context['file_versions'] as $filename => $version) { |
|
| 374 | + echo ' |
|
| 366 | 375 | <tr class="windowbg"> |
| 367 | 376 | <td class="half_table"> |
| 368 | 377 | ', $filename, ' |
@@ -374,6 +383,7 @@ discard block |
||
| 374 | 383 | <em id="currentSources', $filename, '">??</em> |
| 375 | 384 | </td> |
| 376 | 385 | </tr>'; |
| 386 | + } |
|
| 377 | 387 | |
| 378 | 388 | // Default template files. |
| 379 | 389 | echo ' |
@@ -399,8 +409,8 @@ discard block |
||
| 399 | 409 | <table id="Default" class="table_grid"> |
| 400 | 410 | <tbody>'; |
| 401 | 411 | |
| 402 | - foreach ($context['default_template_versions'] as $filename => $version) |
|
| 403 | - echo ' |
|
| 412 | + foreach ($context['default_template_versions'] as $filename => $version) { |
|
| 413 | + echo ' |
|
| 404 | 414 | <tr class="windowbg"> |
| 405 | 415 | <td class="half_table"> |
| 406 | 416 | ', $filename, ' |
@@ -412,6 +422,7 @@ discard block |
||
| 412 | 422 | <em id="currentDefault', $filename, '">??</em> |
| 413 | 423 | </td> |
| 414 | 424 | </tr>'; |
| 425 | + } |
|
| 415 | 426 | |
| 416 | 427 | // Now the language files... |
| 417 | 428 | echo ' |
@@ -439,8 +450,8 @@ discard block |
||
| 439 | 450 | |
| 440 | 451 | foreach ($context['default_language_versions'] as $language => $files) |
| 441 | 452 | { |
| 442 | - foreach ($files as $filename => $version) |
|
| 443 | - echo ' |
|
| 453 | + foreach ($files as $filename => $version) { |
|
| 454 | + echo ' |
|
| 444 | 455 | <tr class="windowbg"> |
| 445 | 456 | <td class="half_table"> |
| 446 | 457 | ', $filename, '.<em>', $language, '</em>.php |
@@ -452,6 +463,7 @@ discard block |
||
| 452 | 463 | <em id="current', $filename, '.', $language, '">??</em> |
| 453 | 464 | </td> |
| 454 | 465 | </tr>'; |
| 466 | + } |
|
| 455 | 467 | } |
| 456 | 468 | |
| 457 | 469 | echo ' |
@@ -481,8 +493,8 @@ discard block |
||
| 481 | 493 | <table id="Templates" class="table_grid"> |
| 482 | 494 | <tbody>'; |
| 483 | 495 | |
| 484 | - foreach ($context['template_versions'] as $filename => $version) |
|
| 485 | - echo ' |
|
| 496 | + foreach ($context['template_versions'] as $filename => $version) { |
|
| 497 | + echo ' |
|
| 486 | 498 | <tr class="windowbg"> |
| 487 | 499 | <td class="half_table"> |
| 488 | 500 | ', $filename, ' |
@@ -494,6 +506,7 @@ discard block |
||
| 494 | 506 | <em id="currentTemplates', $filename, '">??</em> |
| 495 | 507 | </td> |
| 496 | 508 | </tr>'; |
| 509 | + } |
|
| 497 | 510 | |
| 498 | 511 | echo ' |
| 499 | 512 | </tbody> |
@@ -523,8 +536,8 @@ discard block |
||
| 523 | 536 | <table id="Tasks" class="table_grid"> |
| 524 | 537 | <tbody>'; |
| 525 | 538 | |
| 526 | - foreach ($context['tasks_versions'] as $filename => $version) |
|
| 527 | - echo ' |
|
| 539 | + foreach ($context['tasks_versions'] as $filename => $version) { |
|
| 540 | + echo ' |
|
| 528 | 541 | <tr class="windowbg"> |
| 529 | 542 | <td class="half_table"> |
| 530 | 543 | ', $filename, ' |
@@ -536,6 +549,7 @@ discard block |
||
| 536 | 549 | <em id="currentTasks', $filename, '">??</em> |
| 537 | 550 | </td> |
| 538 | 551 | </tr>'; |
| 552 | + } |
|
| 539 | 553 | |
| 540 | 554 | echo ' |
| 541 | 555 | </tbody> |
@@ -577,9 +591,10 @@ discard block |
||
| 577 | 591 | { |
| 578 | 592 | global $context, $scripturl, $txt, $modSettings; |
| 579 | 593 | |
| 580 | - if (!empty($context['saved_successful'])) |
|
| 581 | - echo ' |
|
| 594 | + if (!empty($context['saved_successful'])) { |
|
| 595 | + echo ' |
|
| 582 | 596 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
| 597 | + } |
|
| 583 | 598 | |
| 584 | 599 | // First section is for adding/removing words from the censored list. |
| 585 | 600 | echo ' |
@@ -594,11 +609,12 @@ discard block |
||
| 594 | 609 | <p>', $txt['admin_censored_where'], '</p>'; |
| 595 | 610 | |
| 596 | 611 | // Show text boxes for censoring [bad ] => [good ]. |
| 597 | - foreach ($context['censored_words'] as $vulgar => $proper) |
|
| 598 | - echo ' |
|
| 612 | + foreach ($context['censored_words'] as $vulgar => $proper) { |
|
| 613 | + echo ' |
|
| 599 | 614 | <div class="block"> |
| 600 | 615 | <input type="text" name="censor_vulgar[]" value="', $vulgar, '" size="30"> => <input type="text" name="censor_proper[]" value="', $proper, '" size="30"> |
| 601 | 616 | </div>'; |
| 617 | + } |
|
| 602 | 618 | |
| 603 | 619 | // Now provide a way to censor more words. |
| 604 | 620 | echo ' |
@@ -673,19 +689,21 @@ discard block |
||
| 673 | 689 | <div class="windowbg2 noup"> |
| 674 | 690 | ', $txt['not_done_reason']; |
| 675 | 691 | |
| 676 | - if (!empty($context['continue_percent'])) |
|
| 677 | - echo ' |
|
| 692 | + if (!empty($context['continue_percent'])) { |
|
| 693 | + echo ' |
|
| 678 | 694 | <div class="progress_bar"> |
| 679 | 695 | <div class="full_bar">', $context['continue_percent'], '%</div> |
| 680 | 696 | <div class="green_percent" style="width: ', $context['continue_percent'], '%;"></div> |
| 681 | 697 | </div>'; |
| 698 | + } |
|
| 682 | 699 | |
| 683 | - if (!empty($context['substep_enabled'])) |
|
| 684 | - echo ' |
|
| 700 | + if (!empty($context['substep_enabled'])) { |
|
| 701 | + echo ' |
|
| 685 | 702 | <div class="progress_bar"> |
| 686 | 703 | <div class="full_bar">', $context['substep_title'], ' (', $context['substep_continue_percent'], '%)</div> |
| 687 | 704 | <div class="blue_percent" style="width: ', $context['substep_continue_percent'], '%;"></div> |
| 688 | 705 | </div>'; |
| 706 | + } |
|
| 689 | 707 | |
| 690 | 708 | echo ' |
| 691 | 709 | <form action="', $scripturl, $context['continue_get_data'], '" method="post" accept-charset="', $context['character_set'], '" name="autoSubmit" id="autoSubmit"> |
@@ -720,35 +738,40 @@ discard block |
||
| 720 | 738 | { |
| 721 | 739 | global $context, $txt, $scripturl; |
| 722 | 740 | |
| 723 | - if (!empty($context['saved_successful'])) |
|
| 724 | - echo ' |
|
| 741 | + if (!empty($context['saved_successful'])) { |
|
| 742 | + echo ' |
|
| 725 | 743 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
| 726 | - elseif (!empty($context['saved_failed'])) |
|
| 727 | - echo ' |
|
| 744 | + } elseif (!empty($context['saved_failed'])) { |
|
| 745 | + echo ' |
|
| 728 | 746 | <div class="errorbox">', sprintf($txt['settings_not_saved'], $context['saved_failed']), '</div>'; |
| 747 | + } |
|
| 729 | 748 | |
| 730 | - if (!empty($context['settings_pre_javascript'])) |
|
| 731 | - echo ' |
|
| 749 | + if (!empty($context['settings_pre_javascript'])) { |
|
| 750 | + echo ' |
|
| 732 | 751 | <script>', $context['settings_pre_javascript'], '</script>'; |
| 752 | + } |
|
| 733 | 753 | |
| 734 | - if (!empty($context['settings_insert_above'])) |
|
| 735 | - echo $context['settings_insert_above']; |
|
| 754 | + if (!empty($context['settings_insert_above'])) { |
|
| 755 | + echo $context['settings_insert_above']; |
|
| 756 | + } |
|
| 736 | 757 | |
| 737 | 758 | echo ' |
| 738 | 759 | <div id="admincenter"> |
| 739 | 760 | <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'] . '"' : '', '>'; |
| 740 | 761 | |
| 741 | 762 | // Is there a custom title? |
| 742 | - if (isset($context['settings_title'])) |
|
| 743 | - echo ' |
|
| 763 | + if (isset($context['settings_title'])) { |
|
| 764 | + echo ' |
|
| 744 | 765 | <div class="cat_bar"> |
| 745 | 766 | <h3 class="catbg">', $context['settings_title'], '</h3> |
| 746 | 767 | </div>'; |
| 768 | + } |
|
| 747 | 769 | |
| 748 | 770 | // Have we got a message to display? |
| 749 | - if (!empty($context['settings_message'])) |
|
| 750 | - echo ' |
|
| 771 | + if (!empty($context['settings_message'])) { |
|
| 772 | + echo ' |
|
| 751 | 773 | <div class="information">', $context['settings_message'], '</div>'; |
| 774 | + } |
|
| 752 | 775 | |
| 753 | 776 | // Now actually loop through all the variables. |
| 754 | 777 | $is_open = false; |
@@ -801,8 +824,9 @@ discard block |
||
| 801 | 824 | // Hang about? Are you pulling my leg - a callback?! |
| 802 | 825 | if (is_array($config_var) && $config_var['type'] == 'callback') |
| 803 | 826 | { |
| 804 | - if (function_exists('template_callback_' . $config_var['name'])) |
|
| 805 | - call_user_func('template_callback_' . $config_var['name']); |
|
| 827 | + if (function_exists('template_callback_' . $config_var['name'])) { |
|
| 828 | + call_user_func('template_callback_' . $config_var['name']); |
|
| 829 | + } |
|
| 806 | 830 | |
| 807 | 831 | continue; |
| 808 | 832 | } |
@@ -832,9 +856,10 @@ discard block |
||
| 832 | 856 | $text_types = array('color', 'date', 'datetime', 'datetime-local', 'email', 'month', 'time'); |
| 833 | 857 | |
| 834 | 858 | // Show the [?] button. |
| 835 | - if ($config_var['help']) |
|
| 836 | - echo ' |
|
| 859 | + if ($config_var['help']) { |
|
| 860 | + echo ' |
|
| 837 | 861 | <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> '; |
| 862 | + } |
|
| 838 | 863 | |
| 839 | 864 | echo ' |
| 840 | 865 | <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> |
@@ -843,23 +868,26 @@ discard block |
||
| 843 | 868 | $config_var['preinput']; |
| 844 | 869 | |
| 845 | 870 | // Show a check box. |
| 846 | - if ($config_var['type'] == 'check') |
|
| 847 | - echo ' |
|
| 871 | + if ($config_var['type'] == 'check') { |
|
| 872 | + echo ' |
|
| 848 | 873 | <input type="checkbox"', $javascript, $disabled, ' name="', $config_var['name'], '" id="', $config_var['name'], '"', ($config_var['value'] ? ' checked' : ''), ' value="1">'; |
| 874 | + } |
|
| 849 | 875 | // Escape (via htmlspecialchars.) the text box. |
| 850 | - elseif ($config_var['type'] == 'password') |
|
| 851 | - echo ' |
|
| 876 | + elseif ($config_var['type'] == 'password') { |
|
| 877 | + echo ' |
|
| 852 | 878 | <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> |
| 853 | 879 | <input type="password" disabled id="', $config_var['name'], '" name="', $config_var['name'], '[1]"', ($config_var['size'] ? ' size="' . $config_var['size'] . '"' : ''), '>'; |
| 880 | + } |
|
| 854 | 881 | // Show a selection box. |
| 855 | 882 | elseif ($config_var['type'] == 'select') |
| 856 | 883 | { |
| 857 | 884 | echo ' |
| 858 | 885 | <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'] . '"' : ''), '>'; |
| 859 | 886 | |
| 860 | - foreach ($config_var['data'] as $option) |
|
| 861 | - echo ' |
|
| 887 | + foreach ($config_var['data'] as $option) { |
|
| 888 | + echo ' |
|
| 862 | 889 | <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>'; |
| 890 | + } |
|
| 863 | 891 | echo ' |
| 864 | 892 | </select>'; |
| 865 | 893 | } |
@@ -876,16 +904,18 @@ discard block |
||
| 876 | 904 | |
| 877 | 905 | foreach ($context['board_list'] as $id_cat => $cat) |
| 878 | 906 | { |
| 879 | - if (!$first) |
|
| 880 | - echo ' |
|
| 907 | + if (!$first) { |
|
| 908 | + echo ' |
|
| 881 | 909 | <hr>'; |
| 910 | + } |
|
| 882 | 911 | echo ' |
| 883 | 912 | <strong>', $cat['name'], '</strong> |
| 884 | 913 | <ul>'; |
| 885 | 914 | |
| 886 | - foreach ($cat['boards'] as $id_board => $brd) |
|
| 887 | - echo ' |
|
| 915 | + foreach ($cat['boards'] as $id_board => $brd) { |
|
| 916 | + echo ' |
|
| 888 | 917 | <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>'; |
| 918 | + } |
|
| 889 | 919 | |
| 890 | 920 | echo ' |
| 891 | 921 | </ul>'; |
@@ -895,12 +925,14 @@ discard block |
||
| 895 | 925 | </fieldset>'; |
| 896 | 926 | } |
| 897 | 927 | // Text area? |
| 898 | - elseif ($config_var['type'] == 'large_text') |
|
| 899 | - echo ' |
|
| 928 | + elseif ($config_var['type'] == 'large_text') { |
|
| 929 | + echo ' |
|
| 900 | 930 | <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>'; |
| 931 | + } |
|
| 901 | 932 | // Permission group? |
| 902 | - elseif ($config_var['type'] == 'permissions') |
|
| 903 | - theme_inline_permissions($config_var['name']); |
|
| 933 | + elseif ($config_var['type'] == 'permissions') { |
|
| 934 | + theme_inline_permissions($config_var['name']); |
|
| 935 | + } |
|
| 904 | 936 | |
| 905 | 937 | // BBC selection? |
| 906 | 938 | elseif ($config_var['type'] == 'bbc') |
@@ -912,22 +944,24 @@ discard block |
||
| 912 | 944 | |
| 913 | 945 | foreach ($context['bbc_columns'] as $bbcColumn) |
| 914 | 946 | { |
| 915 | - foreach ($bbcColumn as $bbcTag) |
|
| 916 | - echo ' |
|
| 947 | + foreach ($bbcColumn as $bbcTag) { |
|
| 948 | + echo ' |
|
| 917 | 949 | <li class="list_bbc floatleft"> |
| 918 | 950 | <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>)' : '', ' |
| 919 | 951 | </li>'; |
| 952 | + } |
|
| 920 | 953 | } |
| 921 | 954 | echo ' </ul> |
| 922 | 955 | <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> |
| 923 | 956 | </fieldset>'; |
| 924 | 957 | } |
| 925 | 958 | // A simple message? |
| 926 | - elseif ($config_var['type'] == 'var_message') |
|
| 927 | - echo ' |
|
| 959 | + elseif ($config_var['type'] == 'var_message') { |
|
| 960 | + echo ' |
|
| 928 | 961 | <div', !empty($config_var['name']) ? ' id="' . $config_var['name'] . '"' : '', '> |
| 929 | 962 | ', $config_var['var_message'], ' |
| 930 | 963 | </div>'; |
| 964 | + } |
|
| 931 | 965 | // Assume it must be a text box |
| 932 | 966 | else |
| 933 | 967 | { |
@@ -952,62 +986,70 @@ discard block |
||
| 952 | 986 | ' . $config_var['postinput'] : '',' |
| 953 | 987 | </dd>'; |
| 954 | 988 | } |
| 955 | - } |
|
| 956 | - else |
|
| 989 | + } else |
|
| 957 | 990 | { |
| 958 | 991 | // Just show a separator. |
| 959 | - if ($config_var == '') |
|
| 960 | - echo ' |
|
| 992 | + if ($config_var == '') { |
|
| 993 | + echo ' |
|
| 961 | 994 | </dl> |
| 962 | 995 | <hr> |
| 963 | 996 | <dl class="settings">'; |
| 964 | - else |
|
| 965 | - echo ' |
|
| 997 | + } else { |
|
| 998 | + echo ' |
|
| 966 | 999 | <dd> |
| 967 | 1000 | <strong>' . $config_var . '</strong> |
| 968 | 1001 | </dd>'; |
| 1002 | + } |
|
| 969 | 1003 | } |
| 970 | 1004 | } |
| 971 | 1005 | |
| 972 | - if ($is_open) |
|
| 973 | - echo ' |
|
| 1006 | + if ($is_open) { |
|
| 1007 | + echo ' |
|
| 974 | 1008 | </dl>'; |
| 1009 | + } |
|
| 975 | 1010 | |
| 976 | - if (empty($context['settings_save_dont_show'])) |
|
| 977 | - echo ' |
|
| 1011 | + if (empty($context['settings_save_dont_show'])) { |
|
| 1012 | + echo ' |
|
| 978 | 1013 | <input type="submit" value="', $txt['save'], '"', (!empty($context['save_disabled']) ? ' disabled' : ''), (!empty($context['settings_save_onclick']) ? ' onclick="' . $context['settings_save_onclick'] . '"' : ''), ' class="button">'; |
| 1014 | + } |
|
| 979 | 1015 | |
| 980 | - if ($is_open) |
|
| 981 | - echo ' |
|
| 1016 | + if ($is_open) { |
|
| 1017 | + echo ' |
|
| 982 | 1018 | </div><!-- .windowbg2 -->'; |
| 1019 | + } |
|
| 983 | 1020 | |
| 984 | 1021 | |
| 985 | 1022 | // At least one token has to be used! |
| 986 | - if (isset($context['admin-ssc_token'])) |
|
| 987 | - echo ' |
|
| 1023 | + if (isset($context['admin-ssc_token'])) { |
|
| 1024 | + echo ' |
|
| 988 | 1025 | <input type="hidden" name="', $context['admin-ssc_token_var'], '" value="', $context['admin-ssc_token'], '">'; |
| 1026 | + } |
|
| 989 | 1027 | |
| 990 | - if (isset($context['admin-dbsc_token'])) |
|
| 991 | - echo ' |
|
| 1028 | + if (isset($context['admin-dbsc_token'])) { |
|
| 1029 | + echo ' |
|
| 992 | 1030 | <input type="hidden" name="', $context['admin-dbsc_token_var'], '" value="', $context['admin-dbsc_token'], '">'; |
| 1031 | + } |
|
| 993 | 1032 | |
| 994 | - if (isset($context['admin-mp_token'])) |
|
| 995 | - echo ' |
|
| 1033 | + if (isset($context['admin-mp_token'])) { |
|
| 1034 | + echo ' |
|
| 996 | 1035 | <input type="hidden" name="', $context['admin-mp_token_var'], '" value="', $context['admin-mp_token'], '">'; |
| 1036 | + } |
|
| 997 | 1037 | |
| 998 | 1038 | echo ' |
| 999 | 1039 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 1000 | 1040 | </form> |
| 1001 | 1041 | </div><!-- #admincenter -->'; |
| 1002 | 1042 | |
| 1003 | - if (!empty($context['settings_post_javascript'])) |
|
| 1004 | - echo ' |
|
| 1043 | + if (!empty($context['settings_post_javascript'])) { |
|
| 1044 | + echo ' |
|
| 1005 | 1045 | <script> |
| 1006 | 1046 | ', $context['settings_post_javascript'], ' |
| 1007 | 1047 | </script>'; |
| 1048 | + } |
|
| 1008 | 1049 | |
| 1009 | - if (!empty($context['settings_insert_below'])) |
|
| 1010 | - echo $context['settings_insert_below']; |
|
| 1050 | + if (!empty($context['settings_insert_below'])) { |
|
| 1051 | + echo $context['settings_insert_below']; |
|
| 1052 | + } |
|
| 1011 | 1053 | |
| 1012 | 1054 | // We may have added a board listing. If we did, we need to make it work. |
| 1013 | 1055 | addInlineJavascript(' |
@@ -1030,9 +1072,10 @@ discard block |
||
| 1030 | 1072 | { |
| 1031 | 1073 | global $context, $txt; |
| 1032 | 1074 | |
| 1033 | - if (!empty($context['saved_successful'])) |
|
| 1034 | - echo ' |
|
| 1075 | + if (!empty($context['saved_successful'])) { |
|
| 1076 | + echo ' |
|
| 1035 | 1077 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
| 1078 | + } |
|
| 1036 | 1079 | |
| 1037 | 1080 | // Standard fields. |
| 1038 | 1081 | template_show_list('standard_profile_fields'); |
@@ -1066,11 +1109,12 @@ discard block |
||
| 1066 | 1109 | { |
| 1067 | 1110 | loadLanguage('Errors'); |
| 1068 | 1111 | |
| 1069 | - if (isset($txt['custom_option_' . $_GET['msg']])) |
|
| 1070 | - echo ' |
|
| 1112 | + if (isset($txt['custom_option_' . $_GET['msg']])) { |
|
| 1113 | + echo ' |
|
| 1071 | 1114 | <div class="errorbox">', |
| 1072 | 1115 | $txt['custom_option_' . $_GET['msg']], ' |
| 1073 | 1116 | </div>'; |
| 1117 | + } |
|
| 1074 | 1118 | } |
| 1075 | 1119 | |
| 1076 | 1120 | echo ' |
@@ -1137,9 +1181,10 @@ discard block |
||
| 1137 | 1181 | <dd> |
| 1138 | 1182 | <select name="placement" id="placement">'; |
| 1139 | 1183 | |
| 1140 | - foreach ($context['cust_profile_fields_placement'] as $order => $name) |
|
| 1141 | - echo ' |
|
| 1184 | + foreach ($context['cust_profile_fields_placement'] as $order => $name) { |
|
| 1185 | + echo ' |
|
| 1142 | 1186 | <option value="', $order, '"', $context['field']['placement'] == $order ? ' selected' : '', '>', $txt['custom_profile_placement_' . $name], '</option>'; |
| 1187 | + } |
|
| 1143 | 1188 | |
| 1144 | 1189 | echo ' |
| 1145 | 1190 | </select> |
@@ -1163,9 +1208,10 @@ discard block |
||
| 1163 | 1208 | <dd> |
| 1164 | 1209 | <select name="field_type" id="field_type" onchange="updateInputBoxes();">'; |
| 1165 | 1210 | |
| 1166 | - foreach (array('text', 'textarea', 'select', 'radio', 'check') as $field_type) |
|
| 1167 | - echo ' |
|
| 1211 | + foreach (array('text', 'textarea', 'select', 'radio', 'check') as $field_type) { |
|
| 1212 | + echo ' |
|
| 1168 | 1213 | <option value="', $field_type, '"', $context['field']['type'] == $field_type ? ' selected' : '', '>', $txt['custom_profile_type_' . $field_type], '</option>'; |
| 1214 | + } |
|
| 1169 | 1215 | |
| 1170 | 1216 | echo ' |
| 1171 | 1217 | </select> |
@@ -1197,9 +1243,10 @@ discard block |
||
| 1197 | 1243 | </dt> |
| 1198 | 1244 | <dd id="options_dd">'; |
| 1199 | 1245 | |
| 1200 | - foreach ($context['field']['options'] as $k => $option) |
|
| 1201 | - echo ' |
|
| 1246 | + foreach ($context['field']['options'] as $k => $option) { |
|
| 1247 | + echo ' |
|
| 1202 | 1248 | ', $k == 0 ? '' : '<br>', '<input type="radio" name="default_select" value="', $k, '"', $context['field']['default_select'] == $option ? ' checked' : '', '><input type="text" name="select_option[', $k, ']" value="', $option, '">'; |
| 1249 | + } |
|
| 1203 | 1250 | |
| 1204 | 1251 | echo ' |
| 1205 | 1252 | <span id="addopt"></span> |
@@ -1263,9 +1310,10 @@ discard block |
||
| 1263 | 1310 | </fieldset> |
| 1264 | 1311 | <input type="submit" name="save" value="', $txt['save'], '" class="button">'; |
| 1265 | 1312 | |
| 1266 | - if ($context['fid']) |
|
| 1267 | - echo ' |
|
| 1313 | + if ($context['fid']) { |
|
| 1314 | + echo ' |
|
| 1268 | 1315 | <input type="submit" name="delete" value="', $txt['delete'], '" data-confirm="', $txt['custom_edit_delete_sure'], '" class="button you_sure">'; |
| 1316 | + } |
|
| 1269 | 1317 | |
| 1270 | 1318 | echo ' |
| 1271 | 1319 | </div><!-- .windowbg2 --> |
@@ -1312,8 +1360,7 @@ discard block |
||
| 1312 | 1360 | <p class="centertext"> |
| 1313 | 1361 | <strong>', $txt['admin_search_results_none'], '</strong> |
| 1314 | 1362 | </p>'; |
| 1315 | - } |
|
| 1316 | - else |
|
| 1363 | + } else |
|
| 1317 | 1364 | { |
| 1318 | 1365 | echo ' |
| 1319 | 1366 | <ol class="search_results">'; |
@@ -1340,9 +1387,10 @@ discard block |
||
| 1340 | 1387 | <li> |
| 1341 | 1388 | <a href="', $result['url'], '"><strong>', $result['name'], '</strong></a> [', isset($txt['admin_search_section_' . $result['type']]) ? $txt['admin_search_section_' . $result['type']] : $result['type'], ']'; |
| 1342 | 1389 | |
| 1343 | - if ($result['help']) |
|
| 1344 | - echo ' |
|
| 1390 | + if ($result['help']) { |
|
| 1391 | + echo ' |
|
| 1345 | 1392 | <p class="double_height">', $result['help'], '</p>'; |
| 1393 | + } |
|
| 1346 | 1394 | |
| 1347 | 1395 | echo ' |
| 1348 | 1396 | </li>'; |
@@ -1382,10 +1430,11 @@ discard block |
||
| 1382 | 1430 | <strong>', $txt['setup_verification_answer'], '</strong> |
| 1383 | 1431 | </dd>'; |
| 1384 | 1432 | |
| 1385 | - if (!empty($context['qa_by_lang'][$lang_id])) |
|
| 1386 | - foreach ($context['qa_by_lang'][$lang_id] as $q_id) |
|
| 1433 | + if (!empty($context['qa_by_lang'][$lang_id])) { |
|
| 1434 | + foreach ($context['qa_by_lang'][$lang_id] as $q_id) |
|
| 1387 | 1435 | { |
| 1388 | 1436 | $question = $context['question_answers'][$q_id]; |
| 1437 | + } |
|
| 1389 | 1438 | |
| 1390 | 1439 | echo ' |
| 1391 | 1440 | <dt> |
@@ -1393,9 +1442,10 @@ discard block |
||
| 1393 | 1442 | </dt> |
| 1394 | 1443 | <dd>'; |
| 1395 | 1444 | |
| 1396 | - foreach ($question['answers'] as $answer) |
|
| 1397 | - echo ' |
|
| 1445 | + foreach ($question['answers'] as $answer) { |
|
| 1446 | + echo ' |
|
| 1398 | 1447 | <input type="text" name="answer[', $lang_id, '][', $q_id, '][]" value="', $answer, '" size="50" class="verification_answer">'; |
| 1448 | + } |
|
| 1399 | 1449 | |
| 1400 | 1450 | echo ' |
| 1401 | 1451 | <div class="qa_add_answer"><a href="javascript:void(0);" onclick="return addAnswer(this);">[ ', $txt['setup_verification_add_answer'], ' ]</a></div> |
@@ -1434,11 +1484,12 @@ discard block |
||
| 1434 | 1484 | ', $txt['errors_found'], ': |
| 1435 | 1485 | <ul>'; |
| 1436 | 1486 | |
| 1437 | - foreach ($context['repair_errors'] as $error) |
|
| 1438 | - echo ' |
|
| 1487 | + foreach ($context['repair_errors'] as $error) { |
|
| 1488 | + echo ' |
|
| 1439 | 1489 | <li> |
| 1440 | 1490 | ', $error, ' |
| 1441 | 1491 | </li>'; |
| 1492 | + } |
|
| 1442 | 1493 | |
| 1443 | 1494 | echo ' |
| 1444 | 1495 | </ul> |
@@ -1448,16 +1499,15 @@ discard block |
||
| 1448 | 1499 | <p class="padding"> |
| 1449 | 1500 | <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> |
| 1450 | 1501 | </p>'; |
| 1451 | - } |
|
| 1452 | - else |
|
| 1453 | - echo ' |
|
| 1502 | + } else { |
|
| 1503 | + echo ' |
|
| 1454 | 1504 | <p>', $txt['maintain_no_errors'], '</p> |
| 1455 | 1505 | <p class="padding"> |
| 1456 | 1506 | <a href="', $scripturl, '?action=admin;area=maintain;sa=routine">', $txt['maintain_return'], '</a> |
| 1457 | 1507 | </p>'; |
| 1508 | + } |
|
| 1458 | 1509 | |
| 1459 | - } |
|
| 1460 | - else |
|
| 1510 | + } else |
|
| 1461 | 1511 | { |
| 1462 | 1512 | if (!empty($context['redirect_to_recount'])) |
| 1463 | 1513 | { |
@@ -1469,8 +1519,7 @@ discard block |
||
| 1469 | 1519 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 1470 | 1520 | <input type="submit" name="recount" id="recount_now" value="', $txt['errors_recount_now'], '"> |
| 1471 | 1521 | </form>'; |
| 1472 | - } |
|
| 1473 | - else |
|
| 1522 | + } else |
|
| 1474 | 1523 | { |
| 1475 | 1524 | echo ' |
| 1476 | 1525 | <p>', $txt['errors_fixed'], '</p> |
@@ -1561,9 +1610,10 @@ discard block |
||
| 1561 | 1610 | <tr class="windowbg"> |
| 1562 | 1611 | <td class="equal_table">', $key, '</td>'; |
| 1563 | 1612 | |
| 1564 | - foreach ($setting as $key_lm => $value) |
|
| 1565 | - echo ' |
|
| 1613 | + foreach ($setting as $key_lm => $value) { |
|
| 1614 | + echo ' |
|
| 1566 | 1615 | <td class="equal_table">', $value, '</td>'; |
| 1616 | + } |
|
| 1567 | 1617 | |
| 1568 | 1618 | echo ' |
| 1569 | 1619 | </tr>'; |
@@ -1623,8 +1673,8 @@ discard block |
||
| 1623 | 1673 | { |
| 1624 | 1674 | global $context, $txt; |
| 1625 | 1675 | |
| 1626 | - if ($context['user']['is_admin']) |
|
| 1627 | - echo ' |
|
| 1676 | + if ($context['user']['is_admin']) { |
|
| 1677 | + echo ' |
|
| 1628 | 1678 | <span class="floatright admin_search"> |
| 1629 | 1679 | <span class="generic_icons filter centericon"></span> |
| 1630 | 1680 | <input type="search" name="search_term" value="', $txt['admin_search'], '" onclick="if (this.value == \'', $txt['admin_search'], '\') this.value = \'\';"> |
@@ -1635,6 +1685,7 @@ discard block |
||
| 1635 | 1685 | </select> |
| 1636 | 1686 | <input type="submit" name="search_go" id="search_go" value="', $txt['admin_search_go'], '" class="button"> |
| 1637 | 1687 | </span>'; |
| 1638 | -} |
|
| 1688 | + } |
|
| 1689 | + } |
|
| 1639 | 1690 | |
| 1640 | 1691 | ?> |
| 1641 | 1692 | \ No newline at end of file |
@@ -31,9 +31,10 @@ discard block |
||
| 31 | 31 | echo ' |
| 32 | 32 | <ul id="smf_slider" class="roundframe">'; |
| 33 | 33 | |
| 34 | - foreach ($context['news_lines'] as $news) |
|
| 35 | - echo ' |
|
| 34 | + foreach ($context['news_lines'] as $news) { |
|
| 35 | + echo ' |
|
| 36 | 36 | <li>', $news, '</li>'; |
| 37 | + } |
|
| 37 | 38 | |
| 38 | 39 | echo ' |
| 39 | 40 | </ul> |
@@ -65,8 +66,9 @@ discard block |
||
| 65 | 66 | foreach ($context['categories'] as $category) |
| 66 | 67 | { |
| 67 | 68 | // If theres no parent boards we can see, avoid showing an empty category (unless its collapsed) |
| 68 | - if (empty($category['boards']) && !$category['is_collapsed']) |
|
| 69 | - continue; |
|
| 69 | + if (empty($category['boards']) && !$category['is_collapsed']) { |
|
| 70 | + continue; |
|
| 71 | + } |
|
| 70 | 72 | |
| 71 | 73 | echo ' |
| 72 | 74 | <div class="main_container"> |
@@ -74,9 +76,10 @@ discard block |
||
| 74 | 76 | <h3 class="catbg">'; |
| 75 | 77 | |
| 76 | 78 | // If this category even can collapse, show a link to collapse it. |
| 77 | - if ($category['can_collapse']) |
|
| 78 | - echo ' |
|
| 79 | + if ($category['can_collapse']) { |
|
| 80 | + echo ' |
|
| 79 | 81 | <span id="category_', $category['id'], '_upshrink" class="', $category['is_collapsed'] ? 'toggle_down' : 'toggle_up', ' floatright" data-collapsed="', (int) $category['is_collapsed'], '" title="', !$category['is_collapsed'] ? $txt['hide_category'] : $txt['show_category'], '" style="display: none;"></span>'; |
| 82 | + } |
|
| 80 | 83 | |
| 81 | 84 | echo ' |
| 82 | 85 | ', $category['link'], ' |
@@ -106,10 +109,11 @@ discard block |
||
| 106 | 109 | </div>'; |
| 107 | 110 | |
| 108 | 111 | // Won't somebody think of the children! |
| 109 | - if (function_exists('template_bi_' . $board['type'] . '_children')) |
|
| 110 | - call_user_func('template_bi_' . $board['type'] . '_children', $board); |
|
| 111 | - else |
|
| 112 | - template_bi_board_children($board); |
|
| 112 | + if (function_exists('template_bi_' . $board['type'] . '_children')) { |
|
| 113 | + call_user_func('template_bi_' . $board['type'] . '_children', $board); |
|
| 114 | + } else { |
|
| 115 | + template_bi_board_children($board); |
|
| 116 | + } |
|
| 113 | 117 | |
| 114 | 118 | echo ' |
| 115 | 119 | </div><!-- #board_[id] -->'; |
@@ -124,12 +128,13 @@ discard block |
||
| 124 | 128 | </div><!-- #boardindex_table -->'; |
| 125 | 129 | |
| 126 | 130 | // Show the mark all as read button? |
| 127 | - if ($context['user']['is_logged'] && !empty($context['categories'])) |
|
| 128 | - echo ' |
|
| 131 | + if ($context['user']['is_logged'] && !empty($context['categories'])) { |
|
| 132 | + echo ' |
|
| 129 | 133 | <div class="mark_read"> |
| 130 | 134 | ', template_button_strip($context['mark_read_button'], 'right'), ' |
| 131 | 135 | </div>'; |
| 132 | -} |
|
| 136 | + } |
|
| 137 | + } |
|
| 133 | 138 | |
| 134 | 139 | /** |
| 135 | 140 | * Outputs the board icon for a standard board. |
@@ -173,18 +178,20 @@ discard block |
||
| 173 | 178 | </a>'; |
| 174 | 179 | |
| 175 | 180 | // Has it outstanding posts for approval? |
| 176 | - if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics'])) |
|
| 177 | - echo ' |
|
| 181 | + if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics'])) { |
|
| 182 | + echo ' |
|
| 178 | 183 | <a href="', $scripturl, '?action=moderate;area=postmod;sa=', ($board['unapproved_topics'] > 0 ? 'topics' : 'posts'), ';brd=', $board['id'], ';', $context['session_var'], '=', $context['session_id'], '" title="', sprintf($txt['unapproved_posts'], $board['unapproved_topics'], $board['unapproved_posts']), '" class="moderation_link">(!)</a>'; |
| 184 | + } |
|
| 179 | 185 | |
| 180 | 186 | echo ' |
| 181 | 187 | <p class="board_description">', $board['description'], '</p>'; |
| 182 | 188 | |
| 183 | 189 | // Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.) |
| 184 | - if (!empty($board['link_moderators'])) |
|
| 185 | - echo ' |
|
| 190 | + if (!empty($board['link_moderators'])) { |
|
| 191 | + echo ' |
|
| 186 | 192 | <p class="moderators">', count($board['link_moderators']) == 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $board['link_moderators']), '</p>'; |
| 187 | -} |
|
| 193 | + } |
|
| 194 | + } |
|
| 188 | 195 | |
| 189 | 196 | /** |
| 190 | 197 | * Outputs the board stats for a standard board. |
@@ -225,10 +232,11 @@ discard block |
||
| 225 | 232 | */ |
| 226 | 233 | function template_bi_board_lastpost($board) |
| 227 | 234 | { |
| 228 | - if (!empty($board['last_post']['id'])) |
|
| 229 | - echo ' |
|
| 235 | + if (!empty($board['last_post']['id'])) { |
|
| 236 | + echo ' |
|
| 230 | 237 | <p>', $board['last_post']['last_post_message'], '</p>'; |
| 231 | -} |
|
| 238 | + } |
|
| 239 | + } |
|
| 232 | 240 | |
| 233 | 241 | /** |
| 234 | 242 | * Outputs the board children for a standard board. |
@@ -248,14 +256,16 @@ discard block |
||
| 248 | 256 | id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */ |
| 249 | 257 | foreach ($board['children'] as $child) |
| 250 | 258 | { |
| 251 | - if (!$child['is_redirect']) |
|
| 252 | - $child['link'] = ''. ($child['new'] ? '<a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><span class="new_posts">' . $txt['new'] . '</span></a>' : '') . '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="board_new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . '</a>'; |
|
| 253 | - else |
|
| 254 | - $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . ' - ' . $child['short_description'] . '">' . $child['name'] . '</a>'; |
|
| 259 | + if (!$child['is_redirect']) { |
|
| 260 | + $child['link'] = ''. ($child['new'] ? '<a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><span class="new_posts">' . $txt['new'] . '</span></a>' : '') . '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="board_new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . '</a>'; |
|
| 261 | + } else { |
|
| 262 | + $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . ' - ' . $child['short_description'] . '">' . $child['name'] . '</a>'; |
|
| 263 | + } |
|
| 255 | 264 | |
| 256 | 265 | // Has it posts awaiting approval? |
| 257 | - if ($child['can_approve_posts'] && ($child['unapproved_posts'] || $child['unapproved_topics'])) |
|
| 258 | - $child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>'; |
|
| 266 | + if ($child['can_approve_posts'] && ($child['unapproved_posts'] || $child['unapproved_topics'])) { |
|
| 267 | + $child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>'; |
|
| 268 | + } |
|
| 259 | 269 | |
| 260 | 270 | $children[] = $child['new'] ? '<span class="strong">' . $child['link'] . '</span>' : '<span>' . $child['link'] . '</span>'; |
| 261 | 271 | } |
@@ -282,8 +292,9 @@ discard block |
||
| 282 | 292 | { |
| 283 | 293 | global $context, $options, $txt; |
| 284 | 294 | |
| 285 | - if (empty($context['info_center'])) |
|
| 286 | - return; |
|
| 295 | + if (empty($context['info_center'])) { |
|
| 296 | + return; |
|
| 297 | + } |
|
| 287 | 298 | |
| 288 | 299 | // Here's where the "Info Center" starts... |
| 289 | 300 | echo ' |
@@ -383,14 +394,15 @@ discard block |
||
| 383 | 394 | /* Each post in latest_posts has: |
| 384 | 395 | board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.), |
| 385 | 396 | subject, short_subject (shortened with...), time, link, and href. */ |
| 386 | - foreach ($context['latest_posts'] as $post) |
|
| 387 | - echo ' |
|
| 397 | + foreach ($context['latest_posts'] as $post) { |
|
| 398 | + echo ' |
|
| 388 | 399 | <tr class="windowbg"> |
| 389 | 400 | <td class="recentpost"><strong>', $post['link'], '</strong></td> |
| 390 | 401 | <td class="recentposter">', $post['poster']['link'], '</td> |
| 391 | 402 | <td class="recentboard">', $post['board']['link'], '</td> |
| 392 | 403 | <td class="recenttime">', $post['time'], '</td> |
| 393 | 404 | </tr>'; |
| 405 | + } |
|
| 394 | 406 | echo ' |
| 395 | 407 | </table>'; |
| 396 | 408 | } |
@@ -414,11 +426,12 @@ discard block |
||
| 414 | 426 | </div>'; |
| 415 | 427 | |
| 416 | 428 | // Holidays like "Christmas", "Chanukah", and "We Love [Unknown] Day" :P |
| 417 | - if (!empty($context['calendar_holidays'])) |
|
| 418 | - echo ' |
|
| 429 | + if (!empty($context['calendar_holidays'])) { |
|
| 430 | + echo ' |
|
| 419 | 431 | <p class="inline holiday"> |
| 420 | 432 | <span>', $txt['calendar_prompt'], '</span> ', implode(', ', $context['calendar_holidays']), ' |
| 421 | 433 | </p>'; |
| 434 | + } |
|
| 422 | 435 | |
| 423 | 436 | // People's birthdays. Like mine. And yours, I guess. Kidding. |
| 424 | 437 | if (!empty($context['calendar_birthdays'])) |
@@ -428,9 +441,10 @@ discard block |
||
| 428 | 441 | <span class="birthday">', $context['calendar_only_today'] ? $txt['birthdays'] : $txt['birthdays_upcoming'], '</span>'; |
| 429 | 442 | |
| 430 | 443 | // Each member in calendar_birthdays has: id, name (person), age (if they have one set?), is_last. (last in list?), and is_today (birthday is today?) |
| 431 | - foreach ($context['calendar_birthdays'] as $member) |
|
| 432 | - echo ' |
|
| 444 | + foreach ($context['calendar_birthdays'] as $member) { |
|
| 445 | + echo ' |
|
| 433 | 446 | <a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['is_today'] ? '<strong class="fix_rtl_names">' : '', $member['name'], $member['is_today'] ? '</strong>' : '', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '' : ', '; |
| 447 | + } |
|
| 434 | 448 | |
| 435 | 449 | echo ' |
| 436 | 450 | </p>'; |
@@ -445,9 +459,10 @@ discard block |
||
| 445 | 459 | |
| 446 | 460 | // Each event in calendar_events should have: |
| 447 | 461 | // title, href, is_last, can_edit (are they allowed?), modify_href, and is_today. |
| 448 | - foreach ($context['calendar_events'] as $event) |
|
| 449 | - echo ' |
|
| 462 | + foreach ($context['calendar_events'] as $event) { |
|
| 463 | + echo ' |
|
| 450 | 464 | ', $event['can_edit'] ? '<a href="' . $event['modify_href'] . '" title="' . $txt['calendar_edit'] . '"><span class="generic_icons calendar_modify"></span></a> ' : '', $event['href'] == '' ? '' : '<a href="' . $event['href'] . '">', $event['is_today'] ? '<strong>' . $event['title'] . '</strong>' : $event['title'], $event['href'] == '' ? '' : '</a>', $event['is_last'] ? '<br>' : ', '; |
| 465 | + } |
|
| 451 | 466 | echo ' |
| 452 | 467 | </p>'; |
| 453 | 468 | } |
@@ -493,17 +508,21 @@ discard block |
||
| 493 | 508 | // Handle hidden users and buddies. |
| 494 | 509 | $bracketList = array(); |
| 495 | 510 | |
| 496 | - if ($context['show_buddies']) |
|
| 497 | - $bracketList[] = comma_format($context['num_buddies']) . ' ' . ($context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies']); |
|
| 511 | + if ($context['show_buddies']) { |
|
| 512 | + $bracketList[] = comma_format($context['num_buddies']) . ' ' . ($context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies']); |
|
| 513 | + } |
|
| 498 | 514 | |
| 499 | - if (!empty($context['num_spiders'])) |
|
| 500 | - $bracketList[] = comma_format($context['num_spiders']) . ' ' . ($context['num_spiders'] == 1 ? $txt['spider'] : $txt['spiders']); |
|
| 515 | + if (!empty($context['num_spiders'])) { |
|
| 516 | + $bracketList[] = comma_format($context['num_spiders']) . ' ' . ($context['num_spiders'] == 1 ? $txt['spider'] : $txt['spiders']); |
|
| 517 | + } |
|
| 501 | 518 | |
| 502 | - if (!empty($context['num_users_hidden'])) |
|
| 503 | - $bracketList[] = comma_format($context['num_users_hidden']) . ' ' . ($context['num_spiders'] == 1 ? $txt['hidden'] : $txt['hidden_s']); |
|
| 519 | + if (!empty($context['num_users_hidden'])) { |
|
| 520 | + $bracketList[] = comma_format($context['num_users_hidden']) . ' ' . ($context['num_spiders'] == 1 ? $txt['hidden'] : $txt['hidden_s']); |
|
| 521 | + } |
|
| 504 | 522 | |
| 505 | - if (!empty($bracketList)) |
|
| 506 | - echo ' (' . implode(', ', $bracketList) . ')'; |
|
| 523 | + if (!empty($bracketList)) { |
|
| 524 | + echo ' (' . implode(', ', $bracketList) . ')'; |
|
| 525 | + } |
|
| 507 | 526 | |
| 508 | 527 | echo $context['show_who'] ? '</a>' : '', ' |
| 509 | 528 | |
@@ -517,9 +536,10 @@ discard block |
||
| 517 | 536 | ', sprintf($txt['users_active'], $modSettings['lastActive']), ': ', implode(', ', $context['list_users_online']); |
| 518 | 537 | |
| 519 | 538 | // Showing membergroups? |
| 520 | - if (!empty($settings['show_group_key']) && !empty($context['membergroups'])) |
|
| 521 | - echo ' |
|
| 539 | + if (!empty($settings['show_group_key']) && !empty($context['membergroups'])) { |
|
| 540 | + echo ' |
|
| 522 | 541 | <span class="membergroups">' . implode(', ', $context['membergroups']) . '</span>'; |
| 542 | + } |
|
| 523 | 543 | } |
| 524 | 544 | |
| 525 | 545 | echo ' |