@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | // Loop through each column and add a table header. |
| 86 | 86 | foreach ($cur_list['headers'] as $col_header) |
| 87 | 87 | echo ' |
| 88 | - <th scope="col" id="header_', $list_id, '_', $col_header['id'], '" class="' , $col_header['id'], empty($col_header['class']) ? '' : $col_header['class'] , '"', empty($col_header['style']) ? '' : ' style="' . $col_header['style'] . '"', empty($col_header['colspan']) ? '' : ' colspan="' . $col_header['colspan'] . '"', '> |
|
| 88 | + <th scope="col" id="header_', $list_id, '_', $col_header['id'], '" class="', $col_header['id'], empty($col_header['class']) ? '' : $col_header['class'], '"', empty($col_header['style']) ? '' : ' style="' . $col_header['style'] . '"', empty($col_header['colspan']) ? '' : ' colspan="' . $col_header['colspan'] . '"', '> |
|
| 89 | 89 | ', empty($col_header['href']) ? '' : '<a href="' . $col_header['href'] . '" rel="nofollow">', empty($col_header['label']) ? '' : $col_header['label'], empty($col_header['href']) ? '' : (empty($col_header['sort_image']) ? '</a>' : ' <span class="generic_icons sort_' . $col_header['sort_image'] . '"></span></a>'), ' |
| 90 | 90 | </th>'; |
| 91 | 91 | |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | if (!empty($row['data'])) |
| 118 | 118 | foreach ($row['data'] as $row_id => $row_data) |
| 119 | 119 | echo ' |
| 120 | - <td class="', $row_id, empty($row_data['class']) ? '' : ' ' . $row_data['class'] .'', '"', empty($row_data['style']) ? '' : ' style="' . $row_data['style'] . '"', '> |
|
| 120 | + <td class="', $row_id, empty($row_data['class']) ? '' : ' ' . $row_data['class'] . '', '"', empty($row_data['style']) ? '' : ' style="' . $row_data['style'] . '"', '> |
|
| 121 | 121 | ', $row_data['value'], ' |
| 122 | 122 | </td>'; |
| 123 | 123 | |
@@ -22,27 +22,31 @@ discard block |
||
| 22 | 22 | // Get a shortcut to the current list. |
| 23 | 23 | $list_id = $list_id === null ? (!empty($context['default_list']) ? $context['default_list'] : '') : $list_id; |
| 24 | 24 | |
| 25 | - if (empty($list_id) || empty($context[$list_id])) |
|
| 26 | - return; |
|
| 25 | + if (empty($list_id) || empty($context[$list_id])) { |
|
| 26 | + return; |
|
| 27 | + } |
|
| 27 | 28 | |
| 28 | 29 | $cur_list = &$context[$list_id]; |
| 29 | 30 | |
| 30 | 31 | // These are the main tabs that is used all around the template. |
| 31 | - if (isset($cur_list['list_menu'], $cur_list['list_menu']['show_on']) && ($cur_list['list_menu']['show_on'] == 'both' || $cur_list['list_menu']['show_on'] == 'top')) |
|
| 32 | - template_create_list_menu($cur_list['list_menu'], 'top'); |
|
| 32 | + if (isset($cur_list['list_menu'], $cur_list['list_menu']['show_on']) && ($cur_list['list_menu']['show_on'] == 'both' || $cur_list['list_menu']['show_on'] == 'top')) { |
|
| 33 | + template_create_list_menu($cur_list['list_menu'], 'top'); |
|
| 34 | + } |
|
| 33 | 35 | |
| 34 | - if (isset($cur_list['form'])) |
|
| 35 | - echo ' |
|
| 36 | + if (isset($cur_list['form'])) { |
|
| 37 | + echo ' |
|
| 36 | 38 | <form action="', $cur_list['form']['href'], '" method="post"', empty($cur_list['form']['name']) ? '' : ' name="' . $cur_list['form']['name'] . '" id="' . $cur_list['form']['name'] . '"', ' accept-charset="', $context['character_set'], '">'; |
| 39 | + } |
|
| 37 | 40 | |
| 38 | 41 | // Show the title of the table (if any). |
| 39 | - if (!empty($cur_list['title'])) |
|
| 40 | - echo ' |
|
| 42 | + if (!empty($cur_list['title'])) { |
|
| 43 | + echo ' |
|
| 41 | 44 | <div class="cat_bar"> |
| 42 | 45 | <h3 class="catbg"> |
| 43 | 46 | ', $cur_list['title'], ' |
| 44 | 47 | </h3> |
| 45 | 48 | </div>'; |
| 49 | + } |
|
| 46 | 50 | |
| 47 | 51 | if (isset($cur_list['additional_rows']['after_title'])) |
| 48 | 52 | { |
@@ -55,20 +59,23 @@ discard block |
||
| 55 | 59 | </div>'; |
| 56 | 60 | } |
| 57 | 61 | |
| 58 | - if (isset($cur_list['additional_rows']['top_of_list'])) |
|
| 59 | - template_additional_rows('top_of_list', $cur_list); |
|
| 62 | + if (isset($cur_list['additional_rows']['top_of_list'])) { |
|
| 63 | + template_additional_rows('top_of_list', $cur_list); |
|
| 64 | + } |
|
| 60 | 65 | |
| 61 | 66 | if ((!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) || isset($cur_list['additional_rows']['above_column_headers'])) |
| 62 | 67 | { |
| 63 | 68 | // Show the page index (if this list doesn't intend to show all items). |
| 64 | - if (!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) |
|
| 65 | - echo ' |
|
| 69 | + if (!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) { |
|
| 70 | + echo ' |
|
| 66 | 71 | <div class="floatleft"> |
| 67 | 72 | <div class="pagesection">', $cur_list['page_index'], '</div> |
| 68 | 73 | </div>'; |
| 74 | + } |
|
| 69 | 75 | |
| 70 | - if (isset($cur_list['additional_rows']['above_column_headers'])) |
|
| 71 | - template_additional_rows('above_column_headers', $cur_list); |
|
| 76 | + if (isset($cur_list['additional_rows']['above_column_headers'])) { |
|
| 77 | + template_additional_rows('above_column_headers', $cur_list); |
|
| 78 | + } |
|
| 72 | 79 | } |
| 73 | 80 | |
| 74 | 81 | echo ' |
@@ -83,11 +90,12 @@ discard block |
||
| 83 | 90 | <tr class="title_bar">'; |
| 84 | 91 | |
| 85 | 92 | // Loop through each column and add a table header. |
| 86 | - foreach ($cur_list['headers'] as $col_header) |
|
| 87 | - echo ' |
|
| 93 | + foreach ($cur_list['headers'] as $col_header) { |
|
| 94 | + echo ' |
|
| 88 | 95 | <th scope="col" id="header_', $list_id, '_', $col_header['id'], '" class="' , $col_header['id'], empty($col_header['class']) ? '' : $col_header['class'] , '"', empty($col_header['style']) ? '' : ' style="' . $col_header['style'] . '"', empty($col_header['colspan']) ? '' : ' colspan="' . $col_header['colspan'] . '"', '> |
| 89 | 96 | ', empty($col_header['href']) ? '' : '<a href="' . $col_header['href'] . '" rel="nofollow">', empty($col_header['label']) ? '' : $col_header['label'], empty($col_header['href']) ? '' : (empty($col_header['sort_image']) ? '</a>' : ' <span class="generic_icons sort_' . $col_header['sort_image'] . '"></span></a>'), ' |
| 90 | 97 | </th>'; |
| 98 | + } |
|
| 91 | 99 | |
| 92 | 100 | echo ' |
| 93 | 101 | </tr> |
@@ -98,13 +106,14 @@ discard block |
||
| 98 | 106 | <tbody>'; |
| 99 | 107 | |
| 100 | 108 | // Show a nice message informing there are no items in this list. |
| 101 | - if (empty($cur_list['rows']) && !empty($cur_list['no_items_label'])) |
|
| 102 | - echo ' |
|
| 109 | + if (empty($cur_list['rows']) && !empty($cur_list['no_items_label'])) { |
|
| 110 | + echo ' |
|
| 103 | 111 | <tr class="windowbg"> |
| 104 | 112 | <td colspan="', $cur_list['num_columns'], '" class="', !empty($cur_list['no_items_align']) ? $cur_list['no_items_align'] : 'centertext', '"> |
| 105 | 113 | ', $cur_list['no_items_label'], ' |
| 106 | 114 | </td> |
| 107 | 115 | </tr>'; |
| 116 | + } |
|
| 108 | 117 | |
| 109 | 118 | // Show the list rows. |
| 110 | 119 | elseif (!empty($cur_list['rows'])) |
@@ -114,12 +123,13 @@ discard block |
||
| 114 | 123 | echo ' |
| 115 | 124 | <tr class="windowbg', empty($row['class']) ? '' : ' ' . $row['class'], '"', empty($row['style']) ? '' : ' style="' . $row['style'] . '"', ' id="list_', $list_id, '_', $id, '">'; |
| 116 | 125 | |
| 117 | - if (!empty($row['data'])) |
|
| 118 | - foreach ($row['data'] as $row_id => $row_data) |
|
| 126 | + if (!empty($row['data'])) { |
|
| 127 | + foreach ($row['data'] as $row_id => $row_data) |
|
| 119 | 128 | echo ' |
| 120 | 129 | <td class="', $row_id, empty($row_data['class']) ? '' : ' ' . $row_data['class'] .'', '"', empty($row_data['style']) ? '' : ' style="' . $row_data['style'] . '"', '> |
| 121 | 130 | ', $row_data['value'], ' |
| 122 | 131 | </td>'; |
| 132 | + } |
|
| 123 | 133 | |
| 124 | 134 | echo ' |
| 125 | 135 | </tr>'; |
@@ -136,46 +146,53 @@ discard block |
||
| 136 | 146 | <div class="flow_auto">'; |
| 137 | 147 | |
| 138 | 148 | // Show the page index (if this list doesn't intend to show all items). |
| 139 | - if (!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) |
|
| 140 | - echo ' |
|
| 149 | + if (!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) { |
|
| 150 | + echo ' |
|
| 141 | 151 | <div class="floatleft"> |
| 142 | 152 | <div class="pagesection">', $cur_list['page_index'], '</div> |
| 143 | 153 | </div>'; |
| 154 | + } |
|
| 144 | 155 | |
| 145 | - if (isset($cur_list['additional_rows']['below_table_data'])) |
|
| 146 | - template_additional_rows('below_table_data', $cur_list); |
|
| 156 | + if (isset($cur_list['additional_rows']['below_table_data'])) { |
|
| 157 | + template_additional_rows('below_table_data', $cur_list); |
|
| 158 | + } |
|
| 147 | 159 | |
| 148 | 160 | echo ' |
| 149 | 161 | </div>'; |
| 150 | 162 | } |
| 151 | 163 | |
| 152 | - if (isset($cur_list['additional_rows']['bottom_of_list'])) |
|
| 153 | - template_additional_rows('bottom_of_list', $cur_list); |
|
| 164 | + if (isset($cur_list['additional_rows']['bottom_of_list'])) { |
|
| 165 | + template_additional_rows('bottom_of_list', $cur_list); |
|
| 166 | + } |
|
| 154 | 167 | |
| 155 | 168 | if (isset($cur_list['form'])) |
| 156 | 169 | { |
| 157 | - foreach ($cur_list['form']['hidden_fields'] as $name => $value) |
|
| 158 | - echo ' |
|
| 170 | + foreach ($cur_list['form']['hidden_fields'] as $name => $value) { |
|
| 171 | + echo ' |
|
| 159 | 172 | <input type="hidden" name="', $name, '" value="', $value, '">'; |
| 173 | + } |
|
| 160 | 174 | |
| 161 | - if (isset($cur_list['form']['token'])) |
|
| 162 | - echo ' |
|
| 175 | + if (isset($cur_list['form']['token'])) { |
|
| 176 | + echo ' |
|
| 163 | 177 | <input type="hidden" name="', $context[$cur_list['form']['token'] . '_token_var'], '" value="', $context[$cur_list['form']['token'] . '_token'], '">'; |
| 178 | + } |
|
| 164 | 179 | |
| 165 | 180 | echo ' |
| 166 | 181 | </form>'; |
| 167 | 182 | } |
| 168 | 183 | |
| 169 | 184 | // Tabs at the bottom. Usually bottom aligned. |
| 170 | - if (isset($cur_list['list_menu'], $cur_list['list_menu']['show_on']) && ($cur_list['list_menu']['show_on'] == 'both' || $cur_list['list_menu']['show_on'] == 'bottom')) |
|
| 171 | - template_create_list_menu($cur_list['list_menu'], 'bottom'); |
|
| 185 | + if (isset($cur_list['list_menu'], $cur_list['list_menu']['show_on']) && ($cur_list['list_menu']['show_on'] == 'both' || $cur_list['list_menu']['show_on'] == 'bottom')) { |
|
| 186 | + template_create_list_menu($cur_list['list_menu'], 'bottom'); |
|
| 187 | + } |
|
| 172 | 188 | |
| 173 | - if (isset($cur_list['javascript'])) |
|
| 174 | - echo ' |
|
| 189 | + if (isset($cur_list['javascript'])) { |
|
| 190 | + echo ' |
|
| 175 | 191 | <script> |
| 176 | 192 | ', $cur_list['javascript'], ' |
| 177 | 193 | </script>'; |
| 178 | -} |
|
| 194 | + } |
|
| 195 | + } |
|
| 179 | 196 | |
| 180 | 197 | /** |
| 181 | 198 | * This template displays additional rows above or below the list. |
@@ -185,12 +202,13 @@ discard block |
||
| 185 | 202 | */ |
| 186 | 203 | function template_additional_rows($row_position, $cur_list) |
| 187 | 204 | { |
| 188 | - foreach ($cur_list['additional_rows'][$row_position] as $row) |
|
| 189 | - echo ' |
|
| 205 | + foreach ($cur_list['additional_rows'][$row_position] as $row) { |
|
| 206 | + echo ' |
|
| 190 | 207 | <div class="additional_row', empty($row['class']) ? '' : ' ' . $row['class'], '"', empty($row['style']) ? '' : ' style="' . $row['style'] . '"', '> |
| 191 | 208 | ', $row['value'], ' |
| 192 | 209 | </div>'; |
| 193 | -} |
|
| 210 | + } |
|
| 211 | + } |
|
| 194 | 212 | |
| 195 | 213 | /** |
| 196 | 214 | * This function creates a menu |
@@ -249,18 +267,19 @@ discard block |
||
| 249 | 267 | |
| 250 | 268 | foreach ($list_menu['links'] as $link) |
| 251 | 269 | { |
| 252 | - if ($link['is_selected']) |
|
| 253 | - echo ' |
|
| 270 | + if ($link['is_selected']) { |
|
| 271 | + echo ' |
|
| 254 | 272 | <td class="', $direction == 'top' ? 'mirror' : 'main', 'tab_active_', $first, '"></td> |
| 255 | 273 | <td class="', $direction == 'top' ? 'mirrortab' : 'maintab', '_active_back"> |
| 256 | 274 | <a href="', $link['href'], '">', $link['label'], '</a> |
| 257 | 275 | </td> |
| 258 | 276 | <td class="', $direction == 'top' ? 'mirror' : 'main', 'tab_active_', $last, '"></td>'; |
| 259 | - else |
|
| 260 | - echo ' |
|
| 277 | + } else { |
|
| 278 | + echo ' |
|
| 261 | 279 | <td class="', $direction == 'top' ? 'mirror' : 'main', 'tab_back"> |
| 262 | 280 | <a href="', $link['href'], '">', $link['label'], '</a> |
| 263 | 281 | </td>'; |
| 282 | + } |
|
| 264 | 283 | } |
| 265 | 284 | |
| 266 | 285 | echo ' |
@@ -271,12 +290,12 @@ discard block |
||
| 271 | 290 | <td></td>' : '', ' |
| 272 | 291 | </tr> |
| 273 | 292 | </table>'; |
| 274 | - } |
|
| 275 | - elseif (isset($list_menu['style']) && $list_menu['style'] == 'buttons') |
|
| 293 | + } elseif (isset($list_menu['style']) && $list_menu['style'] == 'buttons') |
|
| 276 | 294 | { |
| 277 | 295 | $links = array(); |
| 278 | - foreach ($list_menu['links'] as $link) |
|
| 279 | - $links[] = '<a href="' . $link['href'] . '">' . $link['label'] . '</a>'; |
|
| 296 | + foreach ($list_menu['links'] as $link) { |
|
| 297 | + $links[] = '<a href="' . $link['href'] . '">' . $link['label'] . '</a>'; |
|
| 298 | + } |
|
| 280 | 299 | |
| 281 | 300 | echo ' |
| 282 | 301 | <table style="margin-', $list_menu['position'], ': 10px; width: 100%;"> |
@@ -106,7 +106,7 @@ |
||
| 106 | 106 | if (!empty($context['custom_profile_fields']['columns'])) |
| 107 | 107 | foreach ($context['custom_profile_fields']['columns'] as $key => $column) |
| 108 | 108 | echo ' |
| 109 | - <td class="' , $key , ' centertext">', $member['options'][$key], '</td>'; |
|
| 109 | + <td class="' , $key, ' centertext">', $member['options'][$key], '</td>'; |
|
| 110 | 110 | |
| 111 | 111 | echo ' |
| 112 | 112 | </tr>'; |
@@ -27,9 +27,10 @@ discard block |
||
| 27 | 27 | <h3 class="catbg"> |
| 28 | 28 | <span class="floatleft">', $txt['members_list'], '</span>'; |
| 29 | 29 | |
| 30 | - if (!isset($context['old_search'])) |
|
| 31 | - echo ' |
|
| 30 | + if (!isset($context['old_search'])) { |
|
| 31 | + echo ' |
|
| 32 | 32 | <span class="floatright">', $context['letter_links'], '</span>'; |
| 33 | + } |
|
| 33 | 34 | echo ' |
| 34 | 35 | </h3> |
| 35 | 36 | </div>'; |
@@ -44,20 +45,23 @@ discard block |
||
| 44 | 45 | foreach ($context['columns'] as $key => $column) |
| 45 | 46 | { |
| 46 | 47 | // @TODO maybe find something nicer? |
| 47 | - if ($key == 'email_address' && !$context['can_send_email']) |
|
| 48 | - continue; |
|
| 48 | + if ($key == 'email_address' && !$context['can_send_email']) { |
|
| 49 | + continue; |
|
| 50 | + } |
|
| 49 | 51 | |
| 50 | 52 | // This is a selected column, so underline it or some such. |
| 51 | - if ($column['selected']) |
|
| 52 | - echo ' |
|
| 53 | + if ($column['selected']) { |
|
| 54 | + echo ' |
|
| 53 | 55 | <th scope="col" class="', $key, isset($column['class']) ? ' ' . $column['class'] : '', ' selected" style="width: auto;"' . (isset($column['colspan']) ? ' colspan="' . $column['colspan'] . '"' : '') . '> |
| 54 | 56 | <a href="' . $column['href'] . '" rel="nofollow">' . $column['label'] . '</a><span class="generic_icons sort_' . $context['sort_direction'] . '"></span></th>'; |
| 57 | + } |
|
| 55 | 58 | |
| 56 | 59 | // This is just some column... show the link and be done with it. |
| 57 | - else |
|
| 58 | - echo ' |
|
| 60 | + else { |
|
| 61 | + echo ' |
|
| 59 | 62 | <th scope="col" class="', $key, isset($column['class']) ? ' ' . $column['class'] : '', '"', isset($column['width']) ? ' style="width: ' . $column['width'] . '"' : '', isset($column['colspan']) ? ' colspan="' . $column['colspan'] . '"' : '', '> |
| 60 | 63 | ', $column['link'], '</th>'; |
| 64 | + } |
|
| 61 | 65 | } |
| 62 | 66 | |
| 63 | 67 | echo ' |
@@ -77,9 +81,10 @@ discard block |
||
| 77 | 81 | </td> |
| 78 | 82 | <td class="real_name lefttext">', $member['link'], '</td>'; |
| 79 | 83 | |
| 80 | - if (!isset($context['disabled_fields']['website'])) |
|
| 81 | - echo ' |
|
| 84 | + if (!isset($context['disabled_fields']['website'])) { |
|
| 85 | + echo ' |
|
| 82 | 86 | <td class="website_url centertext">', $member['website']['url'] != '' ? '<a href="' . $member['website']['url'] . '" target="_blank" rel="noopener"><span class="generic_icons www" title="' . $member['website']['title'] . '"></span></a>' : '', '</td>'; |
| 87 | + } |
|
| 83 | 88 | |
| 84 | 89 | // Group and date. |
| 85 | 90 | echo ' |
@@ -92,32 +97,35 @@ discard block |
||
| 92 | 97 | <td class="post_count centertext">', $member['posts'], '</td> |
| 93 | 98 | <td class="statsbar">'; |
| 94 | 99 | |
| 95 | - if (!empty($member['post_percent'])) |
|
| 96 | - echo ' |
|
| 100 | + if (!empty($member['post_percent'])) { |
|
| 101 | + echo ' |
|
| 97 | 102 | <div class="generic_bar"> |
| 98 | 103 | <div class="bar" style="width: ', $member['post_percent'], '%;"></div> |
| 99 | 104 | </div>'; |
| 105 | + } |
|
| 100 | 106 | |
| 101 | 107 | echo ' |
| 102 | 108 | </td>'; |
| 103 | 109 | } |
| 104 | 110 | |
| 105 | 111 | // Show custom fields marked to be shown here |
| 106 | - if (!empty($context['custom_profile_fields']['columns'])) |
|
| 107 | - foreach ($context['custom_profile_fields']['columns'] as $key => $column) |
|
| 112 | + if (!empty($context['custom_profile_fields']['columns'])) { |
|
| 113 | + foreach ($context['custom_profile_fields']['columns'] as $key => $column) |
|
| 108 | 114 | echo ' |
| 109 | 115 | <td class="' , $key , ' centertext">', $member['options'][$key], '</td>'; |
| 116 | + } |
|
| 110 | 117 | |
| 111 | 118 | echo ' |
| 112 | 119 | </tr>'; |
| 113 | 120 | } |
| 114 | 121 | } |
| 115 | 122 | // No members? |
| 116 | - else |
|
| 117 | - echo ' |
|
| 123 | + else { |
|
| 124 | + echo ' |
|
| 118 | 125 | <tr> |
| 119 | 126 | <td colspan="', $context['colspan'], '" class="windowbg">', $txt['search_no_results'], '</td> |
| 120 | 127 | </tr>'; |
| 128 | + } |
|
| 121 | 129 | |
| 122 | 130 | echo ' |
| 123 | 131 | </tbody> |
@@ -130,11 +138,12 @@ discard block |
||
| 130 | 138 | <div class="pagelinks floatleft">', $context['page_index'], '</div>'; |
| 131 | 139 | |
| 132 | 140 | // If it is displaying the result of a search show a "search again" link to edit their criteria. |
| 133 | - if (isset($context['old_search'])) |
|
| 134 | - echo ' |
|
| 141 | + if (isset($context['old_search'])) { |
|
| 142 | + echo ' |
|
| 135 | 143 | <div class="buttonlist floatright"> |
| 136 | 144 | <a class="button" href="', $scripturl, '?action=mlist;sa=search;search=', $context['old_search_value'], '">', $txt['mlist_search_again'], '</a> |
| 137 | 145 | </div>'; |
| 146 | + } |
|
| 138 | 147 | echo ' |
| 139 | 148 | </div> |
| 140 | 149 | </div><!-- #memberlist -->'; |
@@ -174,12 +183,13 @@ discard block |
||
| 174 | 183 | <dd> |
| 175 | 184 | <ul>'; |
| 176 | 185 | |
| 177 | - foreach ($context['search_fields'] as $id => $title) |
|
| 178 | - echo ' |
|
| 186 | + foreach ($context['search_fields'] as $id => $title) { |
|
| 187 | + echo ' |
|
| 179 | 188 | <li> |
| 180 | 189 | <input type="checkbox" name="fields[]" id="fields-', $id, '" value="', $id, '"', in_array($id, $context['search_defaults']) ? ' checked' : '', '> |
| 181 | 190 | <label for="fields-', $id, '">', $title, '</label> |
| 182 | 191 | </li>'; |
| 192 | + } |
|
| 183 | 193 | |
| 184 | 194 | echo ' |
| 185 | 195 | </ul> |