@@ -23,11 +23,13 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | $editor_context = &$context['controls']['richedit'][$editor_id]; |
| 25 | 25 | |
| 26 | - if ($smileyContainer === null) |
|
| 27 | - $editor_context['sce_options']['emoticonsEnabled'] = false; |
|
| 26 | + if ($smileyContainer === null) { |
|
| 27 | + $editor_context['sce_options']['emoticonsEnabled'] = false; |
|
| 28 | + } |
|
| 28 | 29 | |
| 29 | - if ($bbcContainer === null) |
|
| 30 | - $editor_context['sce_options']['toolbar'] = ''; |
|
| 30 | + if ($bbcContainer === null) { |
|
| 31 | + $editor_context['sce_options']['toolbar'] = ''; |
|
| 32 | + } |
|
| 31 | 33 | |
| 32 | 34 | echo ' |
| 33 | 35 | <textarea class="editor" name="', $editor_id, '" id="', $editor_id, '" cols="600" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onchange="storeCaret(this);" tabindex="', $context['tabindex']++, '" style="width: ', $editor_context['width'], '; height: ', $editor_context['height'], ';', isset($context['post_error']['no_message']) || isset($context['post_error']['long_message']) ? 'border: 1px solid red;' : '', '"', !empty($context['editor']['required']) ? ' required' : '', '>', $editor_context['value'], '</textarea> |
@@ -40,18 +42,21 @@ discard block |
||
| 40 | 42 | var textarea = $("#', $editor_id, '").get(0); |
| 41 | 43 | sceditor.create(textarea, ', $smcFunc['json_encode']($editor_context['sce_options'], JSON_PRETTY_PRINT), ');'; |
| 42 | 44 | |
| 43 | - if ($editor_context['sce_options']['emoticonsEnabled']) |
|
| 44 | - echo ' |
|
| 45 | + if ($editor_context['sce_options']['emoticonsEnabled']) { |
|
| 46 | + echo ' |
|
| 45 | 47 | sceditor.instance(textarea).createPermanentDropDown();'; |
| 48 | + } |
|
| 46 | 49 | |
| 47 | - if (empty($editor_context['rich_active'])) |
|
| 48 | - echo ' |
|
| 50 | + if (empty($editor_context['rich_active'])) { |
|
| 51 | + echo ' |
|
| 49 | 52 | sceditor.instance(textarea).toggleSourceMode();'; |
| 53 | + } |
|
| 50 | 54 | |
| 51 | - if (isset($context['post_error']['no_message']) || isset($context['post_error']['long_message'])) |
|
| 52 | - echo ' |
|
| 55 | + if (isset($context['post_error']['no_message']) || isset($context['post_error']['long_message'])) { |
|
| 56 | + echo ' |
|
| 53 | 57 | $(".sceditor-container").find("textarea").each(function() {$(this).css({border: "1px solid red"})}); |
| 54 | 58 | $(".sceditor-container").find("iframe").each(function() {$(this).css({border: "1px solid red"})});'; |
| 59 | + } |
|
| 55 | 60 | |
| 56 | 61 | echo ' |
| 57 | 62 | });'; |
@@ -88,42 +93,47 @@ discard block |
||
| 88 | 93 | |
| 89 | 94 | $tempTab = $context['tabindex']; |
| 90 | 95 | |
| 91 | - if (!empty($context['drafts_pm_save'])) |
|
| 92 | - $tempTab++; |
|
| 93 | - elseif (!empty($context['drafts_save'])) |
|
| 94 | - $tempTab++; |
|
| 95 | - elseif ($editor_context['preview_type']) |
|
| 96 | - $tempTab++; |
|
| 97 | - elseif ($context['show_spellchecking']) |
|
| 98 | - $tempTab++; |
|
| 96 | + if (!empty($context['drafts_pm_save'])) { |
|
| 97 | + $tempTab++; |
|
| 98 | + } elseif (!empty($context['drafts_save'])) { |
|
| 99 | + $tempTab++; |
|
| 100 | + } elseif ($editor_context['preview_type']) { |
|
| 101 | + $tempTab++; |
|
| 102 | + } elseif ($context['show_spellchecking']) { |
|
| 103 | + $tempTab++; |
|
| 104 | + } |
|
| 99 | 105 | |
| 100 | 106 | $tempTab++; |
| 101 | 107 | $context['tabindex'] = $tempTab; |
| 102 | 108 | |
| 103 | - if (!empty($context['drafts_pm_save'])) |
|
| 104 | - echo ' |
|
| 109 | + if (!empty($context['drafts_pm_save'])) { |
|
| 110 | + echo ' |
|
| 105 | 111 | <input type="submit" name="save_draft" value="', $txt['draft_save'], '" tabindex="', --$tempTab, '" onclick="submitThisOnce(this);" accesskey="d" class="button"> |
| 106 | 112 | <input type="hidden" id="id_pm_draft" name="id_pm_draft" value="', empty($context['id_pm_draft']) ? 0 : $context['id_pm_draft'], '">'; |
| 113 | + } |
|
| 107 | 114 | |
| 108 | - if (!empty($context['drafts_save'])) |
|
| 109 | - echo ' |
|
| 115 | + if (!empty($context['drafts_save'])) { |
|
| 116 | + echo ' |
|
| 110 | 117 | <input type="submit" name="save_draft" value="', $txt['draft_save'], '" tabindex="', --$tempTab, '" onclick="return confirm(' . JavaScriptEscape($txt['draft_save_note']) . ') && submitThisOnce(this);" accesskey="d" class="button"> |
| 111 | 118 | <input type="hidden" id="id_draft" name="id_draft" value="', empty($context['id_draft']) ? 0 : $context['id_draft'], '">'; |
| 119 | + } |
|
| 112 | 120 | |
| 113 | - if ($context['show_spellchecking']) |
|
| 114 | - echo ' |
|
| 121 | + if ($context['show_spellchecking']) { |
|
| 122 | + echo ' |
|
| 115 | 123 | <input type="button" value="', $txt['spell_check'], '" tabindex="', --$tempTab, '" onclick="oEditorHandle_', $editor_id, '.spellCheckStart();" class="button">'; |
| 124 | + } |
|
| 116 | 125 | |
| 117 | - if ($editor_context['preview_type']) |
|
| 118 | - echo ' |
|
| 126 | + if ($editor_context['preview_type']) { |
|
| 127 | + echo ' |
|
| 119 | 128 | <input type="submit" name="preview" value="', isset($editor_context['labels']['preview_button']) ? $editor_context['labels']['preview_button'] : $txt['preview'], '" tabindex="', --$tempTab, '" onclick="', $editor_context['preview_type'] == 2 ? '' : 'return submitThisOnce(this);', '" accesskey="p" class="button">'; |
| 129 | + } |
|
| 120 | 130 | |
| 121 | 131 | echo ' |
| 122 | 132 | <input type="submit" value="', isset($editor_context['labels']['post_button']) ? $editor_context['labels']['post_button'] : $txt['post'], '" name="post" tabindex="', --$tempTab, '" onclick="return submitThisOnce(this);" accesskey="s" class="button">'; |
| 123 | 133 | |
| 124 | 134 | // Load in the PM autosaver if it's enabled |
| 125 | - if (!empty($context['drafts_pm_save']) && !empty($context['drafts_autosave'])) |
|
| 126 | - echo ' |
|
| 135 | + if (!empty($context['drafts_pm_save']) && !empty($context['drafts_autosave'])) { |
|
| 136 | + echo ' |
|
| 127 | 137 | <span class="righttext padding" style="display: block"> |
| 128 | 138 | <span id="throbber" style="display:none"><img src="' . $settings['images_url'] . '/loading_sm.gif" alt="" class="centericon"></span> |
| 129 | 139 | <span id="draft_lastautosave" ></span> |
@@ -141,10 +151,11 @@ discard block |
||
| 141 | 151 | iFreq: ', (empty($modSettings['drafts_autosave_frequency']) ? 60000 : $modSettings['drafts_autosave_frequency'] * 1000), ' |
| 142 | 152 | }); |
| 143 | 153 | </script>'; |
| 154 | + } |
|
| 144 | 155 | |
| 145 | 156 | // Start an instance of the auto saver if its enabled |
| 146 | - if (!empty($context['drafts_save']) && !empty($context['drafts_autosave'])) |
|
| 147 | - echo ' |
|
| 157 | + if (!empty($context['drafts_save']) && !empty($context['drafts_autosave'])) { |
|
| 158 | + echo ' |
|
| 148 | 159 | <span class="righttext padding" style="display: block"> |
| 149 | 160 | <span id="throbber" style="display:none"><img src="', $settings['images_url'], '/loading_sm.gif" alt="" class="centericon"></span> |
| 150 | 161 | <span id="draft_lastautosave" ></span> |
@@ -161,7 +172,8 @@ discard block |
||
| 161 | 172 | iFreq: ', $context['drafts_autosave_frequency'], ' |
| 162 | 173 | }); |
| 163 | 174 | </script>'; |
| 164 | -} |
|
| 175 | + } |
|
| 176 | + } |
|
| 165 | 177 | |
| 166 | 178 | /** |
| 167 | 179 | * This template displays a verification form |
@@ -178,51 +190,57 @@ discard block |
||
| 178 | 190 | $verify_context = &$context['controls']['verification'][$verify_id]; |
| 179 | 191 | |
| 180 | 192 | // Keep track of where we are. |
| 181 | - if (empty($verify_context['tracking']) || $reset) |
|
| 182 | - $verify_context['tracking'] = 0; |
|
| 193 | + if (empty($verify_context['tracking']) || $reset) { |
|
| 194 | + $verify_context['tracking'] = 0; |
|
| 195 | + } |
|
| 183 | 196 | |
| 184 | 197 | // How many items are there to display in total. |
| 185 | 198 | $total_items = count($verify_context['questions']) + ($verify_context['show_visual'] || $verify_context['can_recaptcha'] ? 1 : 0); |
| 186 | 199 | |
| 187 | 200 | // If we've gone too far, stop. |
| 188 | - if ($verify_context['tracking'] > $total_items) |
|
| 189 | - return false; |
|
| 201 | + if ($verify_context['tracking'] > $total_items) { |
|
| 202 | + return false; |
|
| 203 | + } |
|
| 190 | 204 | |
| 191 | 205 | // Loop through each item to show them. |
| 192 | 206 | for ($i = 0; $i < $total_items; $i++) |
| 193 | 207 | { |
| 194 | 208 | // If we're after a single item only show it if we're in the right place. |
| 195 | - if ($display_type == 'single' && $verify_context['tracking'] != $i) |
|
| 196 | - continue; |
|
| 209 | + if ($display_type == 'single' && $verify_context['tracking'] != $i) { |
|
| 210 | + continue; |
|
| 211 | + } |
|
| 197 | 212 | |
| 198 | - if ($display_type != 'single') |
|
| 199 | - echo ' |
|
| 213 | + if ($display_type != 'single') { |
|
| 214 | + echo ' |
|
| 200 | 215 | <div id="verification_control_', $i, '" class="verification_control">'; |
| 216 | + } |
|
| 201 | 217 | |
| 202 | 218 | // Display empty field, but only if we have one, and it's the first time. |
| 203 | - if ($verify_context['empty_field'] && empty($i)) |
|
| 204 | - echo ' |
|
| 219 | + if ($verify_context['empty_field'] && empty($i)) { |
|
| 220 | + echo ' |
|
| 205 | 221 | <div class="smalltext vv_special"> |
| 206 | 222 | ', $txt['visual_verification_hidden'], ': |
| 207 | 223 | <input type="text" name="', $_SESSION[$verify_id . '_vv']['empty_field'], '" autocomplete="off" size="30" value=""> |
| 208 | 224 | </div>'; |
| 225 | + } |
|
| 209 | 226 | |
| 210 | 227 | // Do the actual stuff |
| 211 | 228 | if ($i == 0 && ($verify_context['show_visual'] || $verify_context['can_recaptcha'])) |
| 212 | 229 | { |
| 213 | 230 | if ($verify_context['show_visual']) |
| 214 | 231 | { |
| 215 | - if ($context['use_graphic_library']) |
|
| 216 | - echo ' |
|
| 232 | + if ($context['use_graphic_library']) { |
|
| 233 | + echo ' |
|
| 217 | 234 | <img src="', $verify_context['image_href'], '" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '">'; |
| 218 | - else |
|
| 219 | - echo ' |
|
| 235 | + } else { |
|
| 236 | + echo ' |
|
| 220 | 237 | <img src="', $verify_context['image_href'], ';letter=1" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_1"> |
| 221 | 238 | <img src="', $verify_context['image_href'], ';letter=2" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_2"> |
| 222 | 239 | <img src="', $verify_context['image_href'], ';letter=3" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_3"> |
| 223 | 240 | <img src="', $verify_context['image_href'], ';letter=4" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_4"> |
| 224 | 241 | <img src="', $verify_context['image_href'], ';letter=5" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_5"> |
| 225 | 242 | <img src="', $verify_context['image_href'], ';letter=6" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_6">'; |
| 243 | + } |
|
| 226 | 244 | |
| 227 | 245 | echo ' |
| 228 | 246 | <div class="smalltext" style="margin: 4px 0 8px 0;"> |
@@ -240,8 +258,7 @@ discard block |
||
| 240 | 258 | <br> |
| 241 | 259 | <script type="text/javascript" src="https://www.google.com/recaptcha/api.js?hl='.$lang.'"></script>'; |
| 242 | 260 | } |
| 243 | - } |
|
| 244 | - else |
|
| 261 | + } else |
|
| 245 | 262 | { |
| 246 | 263 | // Where in the question array is this question? |
| 247 | 264 | $qIndex = $verify_context['show_visual'] ? $i - 1 : $i; |
@@ -253,21 +270,24 @@ discard block |
||
| 253 | 270 | </div>'; |
| 254 | 271 | } |
| 255 | 272 | |
| 256 | - if ($display_type != 'single') |
|
| 257 | - echo ' |
|
| 273 | + if ($display_type != 'single') { |
|
| 274 | + echo ' |
|
| 258 | 275 | </div><!-- #verification_control_[i] -->'; |
| 276 | + } |
|
| 259 | 277 | |
| 260 | 278 | // If we were displaying just one and we did it, break. |
| 261 | - if ($display_type == 'single' && $verify_context['tracking'] == $i) |
|
| 262 | - break; |
|
| 279 | + if ($display_type == 'single' && $verify_context['tracking'] == $i) { |
|
| 280 | + break; |
|
| 281 | + } |
|
| 263 | 282 | } |
| 264 | 283 | |
| 265 | 284 | // Assume we found something, always. |
| 266 | 285 | $verify_context['tracking']++; |
| 267 | 286 | |
| 268 | 287 | // Tell something displaying piecemeal to keep going. |
| 269 | - if ($display_type == 'single') |
|
| 270 | - return true; |
|
| 271 | -} |
|
| 288 | + if ($display_type == 'single') { |
|
| 289 | + return true; |
|
| 290 | + } |
|
| 291 | + } |
|
| 272 | 292 | |
| 273 | 293 | ?> |
| 274 | 294 | \ No newline at end of file |
@@ -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 | template_post_header(); |
@@ -162,9 +170,10 @@ discard block |
||
| 162 | 170 | echo ' |
| 163 | 171 | <optgroup label="', $category['name'], '">'; |
| 164 | 172 | |
| 165 | - foreach ($category['boards'] as $board) |
|
| 166 | - echo ' |
|
| 173 | + foreach ($category['boards'] as $board) { |
|
| 174 | + echo ' |
|
| 167 | 175 | <option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=>' : '', ' ', $board['name'], '</option>'; |
| 176 | + } |
|
| 168 | 177 | echo ' |
| 169 | 178 | </optgroup>'; |
| 170 | 179 | } |
@@ -200,9 +209,10 @@ discard block |
||
| 200 | 209 | <span class="label">', $txt['calendar_timezone'], '</span> |
| 201 | 210 | <select name="tz" id="tz"', !empty($context['event']['allday']) ? ' disabled' : '', '>'; |
| 202 | 211 | |
| 203 | - foreach ($context['all_timezones'] as $tz => $tzname) |
|
| 204 | - echo ' |
|
| 212 | + foreach ($context['all_timezones'] as $tz => $tzname) { |
|
| 213 | + echo ' |
|
| 205 | 214 | <option', is_numeric($tz) ? ' value="" disabled' : ' value="' . $tz . '"', $tz === $context['event']['tz'] ? ' selected' : '', '>', $tzname, '</option>'; |
| 215 | + } |
|
| 206 | 216 | |
| 207 | 217 | echo ' |
| 208 | 218 | </select> |
@@ -231,14 +241,15 @@ discard block |
||
| 231 | 241 | </dd>'; |
| 232 | 242 | |
| 233 | 243 | // Loop through all the choices and print them out. |
| 234 | - foreach ($context['choices'] as $choice) |
|
| 235 | - echo ' |
|
| 244 | + foreach ($context['choices'] as $choice) { |
|
| 245 | + echo ' |
|
| 236 | 246 | <dt> |
| 237 | 247 | <label for="options-', $choice['id'], '">', $txt['option'], ' ', $choice['number'], '</label>: |
| 238 | 248 | </dt> |
| 239 | 249 | <dd> |
| 240 | 250 | <input type="text" name="options[', $choice['id'], ']" id="options-', $choice['id'], '" value="', $choice['label'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="255"> |
| 241 | 251 | </dd>'; |
| 252 | + } |
|
| 242 | 253 | |
| 243 | 254 | echo ' |
| 244 | 255 | <p id="pollMoreOptions"></p> |
@@ -268,14 +279,15 @@ discard block |
||
| 268 | 279 | <input type="checkbox" id="poll_change_vote" name="poll_change_vote"', !empty($context['poll']['change_vote']) ? ' checked' : '', '> |
| 269 | 280 | </dd>'; |
| 270 | 281 | |
| 271 | - if ($context['poll_options']['guest_vote_enabled']) |
|
| 272 | - echo ' |
|
| 282 | + if ($context['poll_options']['guest_vote_enabled']) { |
|
| 283 | + echo ' |
|
| 273 | 284 | <dt> |
| 274 | 285 | <label for="poll_guest_vote">', $txt['poll_guest_vote'], ':</label> |
| 275 | 286 | </dt> |
| 276 | 287 | <dd> |
| 277 | 288 | <input type="checkbox" id="poll_guest_vote" name="poll_guest_vote"', !empty($context['poll_options']['guest_vote']) ? ' checked' : '', '> |
| 278 | 289 | </dd>'; |
| 290 | + } |
|
| 279 | 291 | |
| 280 | 292 | echo ' |
| 281 | 293 | <dt> |
@@ -296,8 +308,8 @@ discard block |
||
| 296 | 308 | ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'); |
| 297 | 309 | |
| 298 | 310 | // If we're editing and displaying edit details, show a box where they can say why |
| 299 | - if (isset($context['editing']) && $modSettings['show_modify']) |
|
| 300 | - echo ' |
|
| 311 | + if (isset($context['editing']) && $modSettings['show_modify']) { |
|
| 312 | + echo ' |
|
| 301 | 313 | <dl> |
| 302 | 314 | <dt class="clear"> |
| 303 | 315 | <span id="caption_edit_reason">', $txt['reason_for_edit'], ':</span> |
@@ -306,20 +318,23 @@ discard block |
||
| 306 | 318 | <input type="text" name="modify_reason"', isset($context['last_modified_reason']) ? ' value="' . $context['last_modified_reason'] . '"' : '', ' tabindex="', $context['tabindex']++, '" size="80" maxlength="80"> |
| 307 | 319 | </dd> |
| 308 | 320 | </dl>'; |
| 321 | + } |
|
| 309 | 322 | |
| 310 | 323 | // If this message has been edited in the past - display when it was. |
| 311 | - if (isset($context['last_modified'])) |
|
| 312 | - echo ' |
|
| 324 | + if (isset($context['last_modified'])) { |
|
| 325 | + echo ' |
|
| 313 | 326 | <div class="padding smalltext"> |
| 314 | 327 | ', $context['last_modified_text'], ' |
| 315 | 328 | </div>'; |
| 329 | + } |
|
| 316 | 330 | |
| 317 | 331 | // If the admin has enabled the hiding of the additional options - show a link and image for it. |
| 318 | - if (!empty($modSettings['additional_options_collapsable'])) |
|
| 319 | - echo ' |
|
| 332 | + if (!empty($modSettings['additional_options_collapsable'])) { |
|
| 333 | + echo ' |
|
| 320 | 334 | <div id="postAdditionalOptionsHeader"> |
| 321 | 335 | <strong><a href="#" id="postMoreExpandLink"> ', $context['can_post_attachment'] ? $txt['post_additionalopt_attach'] : $txt['post_additionalopt'], '</a></strong> |
| 322 | 336 | </div>'; |
| 337 | + } |
|
| 323 | 338 | |
| 324 | 339 | echo ' |
| 325 | 340 | <div id="postAdditionalOptions">'; |
@@ -352,19 +367,21 @@ discard block |
||
| 352 | 367 | ', $txt['uncheck_unwatchd_attach'], ': |
| 353 | 368 | </dd>'; |
| 354 | 369 | |
| 355 | - foreach ($context['current_attachments'] as $attachment) |
|
| 356 | - echo ' |
|
| 370 | + foreach ($context['current_attachments'] as $attachment) { |
|
| 371 | + echo ' |
|
| 357 | 372 | <dd class="smalltext"> |
| 358 | 373 | <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'] . ')' : ''), |
| 359 | 374 | !empty($modSettings['attachmentPostLimit']) || !empty($modSettings['attachmentSizeLimit']) ? sprintf($txt['attach_kb'], comma_format(round(max($attachment['size'], 1024) / 1024), 0)) : '', '</label> |
| 360 | 375 | </dd>'; |
| 376 | + } |
|
| 361 | 377 | |
| 362 | 378 | echo ' |
| 363 | 379 | </dl>'; |
| 364 | 380 | |
| 365 | - if (!empty($context['files_in_session_warning'])) |
|
| 366 | - echo ' |
|
| 381 | + if (!empty($context['files_in_session_warning'])) { |
|
| 382 | + echo ' |
|
| 367 | 383 | <div class="smalltext">', $context['files_in_session_warning'], '</div>'; |
| 384 | + } |
|
| 368 | 385 | } |
| 369 | 386 | |
| 370 | 387 | // Is the user allowed to post any additional ones? If so give them the boxes to do it! |
@@ -429,13 +446,14 @@ discard block |
||
| 429 | 446 | <div class="fallback"> |
| 430 | 447 | <input type="file" multiple="multiple" name="attachment[]" id="attachment1" class="fallback"> (<a href="javascript:void(0);" onclick="cleanFileInput(\'attachment1\');">', $txt['clean_attach'], '</a>)'; |
| 431 | 448 | |
| 432 | - if (!empty($modSettings['attachmentSizeLimit'])) |
|
| 433 | - echo ' |
|
| 449 | + if (!empty($modSettings['attachmentSizeLimit'])) { |
|
| 450 | + echo ' |
|
| 434 | 451 | <input type="hidden" name="MAX_FILE_SIZE" value="' . $modSettings['attachmentSizeLimit'] * 1024 . '">'; |
| 452 | + } |
|
| 435 | 453 | |
| 436 | 454 | // Show more boxes if they aren't approaching that limit. |
| 437 | - if ($context['num_allowed_attachments'] > 1) |
|
| 438 | - echo ' |
|
| 455 | + if ($context['num_allowed_attachments'] > 1) { |
|
| 456 | + echo ' |
|
| 439 | 457 | <script> |
| 440 | 458 | var allowed_attachments = ', $context['num_allowed_attachments'], '; |
| 441 | 459 | var current_attachment = 1; |
@@ -455,6 +473,7 @@ discard block |
||
| 455 | 473 | <a href="#" onclick="addAttachment(); return false;">(', $txt['more_attachments'], ')</a> |
| 456 | 474 | </div><!-- .fallback --> |
| 457 | 475 | </div><!-- #attachUpload -->'; |
| 476 | + } |
|
| 458 | 477 | |
| 459 | 478 | echo ' |
| 460 | 479 | </dd>'; |
@@ -466,21 +485,25 @@ discard block |
||
| 466 | 485 | <dd class="smalltext">'; |
| 467 | 486 | |
| 468 | 487 | // Show some useful information such as allowed extensions, maximum size and amount of attachments allowed. |
| 469 | - if (!empty($modSettings['attachmentCheckExtensions'])) |
|
| 470 | - echo ' |
|
| 488 | + if (!empty($modSettings['attachmentCheckExtensions'])) { |
|
| 489 | + echo ' |
|
| 471 | 490 | ', $txt['allowed_types'], ': ', $context['allowed_extensions'], '<br>'; |
| 491 | + } |
|
| 472 | 492 | |
| 473 | - if (!empty($context['attachment_restrictions'])) |
|
| 474 | - echo ' |
|
| 493 | + if (!empty($context['attachment_restrictions'])) { |
|
| 494 | + echo ' |
|
| 475 | 495 | ', $txt['attach_restrictions'], ' ', implode(', ', $context['attachment_restrictions']), '<br>'; |
| 496 | + } |
|
| 476 | 497 | |
| 477 | - if ($context['num_allowed_attachments'] == 0) |
|
| 478 | - echo ' |
|
| 498 | + if ($context['num_allowed_attachments'] == 0) { |
|
| 499 | + echo ' |
|
| 479 | 500 | ', $txt['attach_limit_nag'], '<br>'; |
| 501 | + } |
|
| 480 | 502 | |
| 481 | - if (!$context['can_post_attachment_unapproved']) |
|
| 482 | - echo ' |
|
| 503 | + if (!$context['can_post_attachment_unapproved']) { |
|
| 504 | + echo ' |
|
| 483 | 505 | <span class="alert">', $txt['attachment_requires_approval'], '</span>', '<br>'; |
| 506 | + } |
|
| 484 | 507 | |
| 485 | 508 | echo ' |
| 486 | 509 | </dd> |
@@ -504,24 +527,26 @@ discard block |
||
| 504 | 527 | <dt><strong>', $txt['subject'], '</strong></dt> |
| 505 | 528 | <dd><strong>', $txt['draft_saved_on'], '</strong></dd>'; |
| 506 | 529 | |
| 507 | - foreach ($context['drafts'] as $draft) |
|
| 508 | - echo ' |
|
| 530 | + foreach ($context['drafts'] as $draft) { |
|
| 531 | + echo ' |
|
| 509 | 532 | <dt>', $draft['link'], '</dt> |
| 510 | 533 | <dd>', $draft['poster_time'], '</dd>'; |
| 534 | + } |
|
| 511 | 535 | echo ' |
| 512 | 536 | </dl> |
| 513 | 537 | </div>'; |
| 514 | 538 | } |
| 515 | 539 | |
| 516 | 540 | // Is visual verification enabled? |
| 517 | - if ($context['require_verification']) |
|
| 518 | - echo ' |
|
| 541 | + if ($context['require_verification']) { |
|
| 542 | + echo ' |
|
| 519 | 543 | <div class="post_verification"> |
| 520 | 544 | <span', !empty($context['post_error']['need_qr_verification']) ? ' class="error"' : '', '> |
| 521 | 545 | <strong>', $txt['verification'], ':</strong> |
| 522 | 546 | </span> |
| 523 | 547 | ', template_control_verification($context['visual_verification_id'], 'all'), ' |
| 524 | 548 | </div>'; |
| 549 | + } |
|
| 525 | 550 | |
| 526 | 551 | // Finally, the submit buttons. |
| 527 | 552 | echo ' |
@@ -530,9 +555,10 @@ discard block |
||
| 530 | 555 | ', template_control_richedit_buttons($context['post_box_name']); |
| 531 | 556 | |
| 532 | 557 | // Option to delete an event if user is editing one. |
| 533 | - if ($context['make_event'] && !$context['event']['new']) |
|
| 534 | - echo ' |
|
| 558 | + if ($context['make_event'] && !$context['event']['new']) { |
|
| 559 | + echo ' |
|
| 535 | 560 | <input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'] ,'" class="button you_sure">'; |
| 561 | + } |
|
| 536 | 562 | |
| 537 | 563 | echo ' |
| 538 | 564 | </span> |
@@ -541,9 +567,10 @@ discard block |
||
| 541 | 567 | <br class="clear">'; |
| 542 | 568 | |
| 543 | 569 | // Assuming this isn't a new topic pass across the last message id. |
| 544 | - if (isset($context['topic_last_message'])) |
|
| 545 | - echo ' |
|
| 570 | + if (isset($context['topic_last_message'])) { |
|
| 571 | + echo ' |
|
| 546 | 572 | <input type="hidden" name="last_msg" value="', $context['topic_last_message'], '">'; |
| 573 | + } |
|
| 547 | 574 | |
| 548 | 575 | echo ' |
| 549 | 576 | <input type="hidden" name="additional_options" id="additional_options" value="', $context['show_additional_options'] ? '1' : '0', '"> |
@@ -564,13 +591,14 @@ discard block |
||
| 564 | 591 | </h5> |
| 565 | 592 | - %PostTime% » <span class="new_posts" id="image_new_%PostID%">' . $txt['new'] . '</span>'; |
| 566 | 593 | |
| 567 | - if ($context['can_quote']) |
|
| 568 | - $newPostsHTML .= ' |
|
| 594 | + if ($context['can_quote']) { |
|
| 595 | + $newPostsHTML .= ' |
|
| 569 | 596 | <ul class="quickbuttons sf-js-enabled sf-arrows" id="msg_%PostID%_quote" style="touch-action: pan-y;"> |
| 570 | 597 | <li id="post_modify"> |
| 571 | 598 | <a href="#postmodify" onclick="return insertQuoteFast(%PostID%);" class="quote_button"><span class="generic_icons quote"></span>' . $txt['quote'] . '</a> |
| 572 | 599 | </li> |
| 573 | 600 | </ul>'; |
| 601 | + } |
|
| 574 | 602 | |
| 575 | 603 | $newPostsHTML .= ' |
| 576 | 604 | <br class="clear"> |
@@ -596,16 +624,17 @@ discard block |
||
| 596 | 624 | sSessionVar: ', JavaScriptEscape($context['session_var']), ', |
| 597 | 625 | newPostsTemplate:', JavaScriptEscape($newPostsHTML); |
| 598 | 626 | |
| 599 | - if (!empty($context['current_board'])) |
|
| 600 | - echo ', |
|
| 627 | + if (!empty($context['current_board'])) { |
|
| 628 | + echo ', |
|
| 601 | 629 | iCurrentBoard: ', $context['current_board'], ''; |
| 630 | + } |
|
| 602 | 631 | |
| 603 | 632 | echo ' |
| 604 | 633 | });'; |
| 605 | 634 | |
| 606 | 635 | // Code for showing and hiding additional options. |
| 607 | - if (!empty($modSettings['additional_options_collapsable'])) |
|
| 608 | - echo ' |
|
| 636 | + if (!empty($modSettings['additional_options_collapsable'])) { |
|
| 637 | + echo ' |
|
| 609 | 638 | var oSwapAdditionalOptions = new smc_Toggle({ |
| 610 | 639 | bToggleEnabled: true, |
| 611 | 640 | bCurrentlyCollapsed: ', $context['show_additional_options'] ? 'false' : 'true', ', |
@@ -633,10 +662,11 @@ discard block |
||
| 633 | 662 | } |
| 634 | 663 | ] |
| 635 | 664 | });'; |
| 665 | + } |
|
| 636 | 666 | |
| 637 | 667 | // Code for showing and hiding drafts |
| 638 | - if (!empty($context['drafts'])) |
|
| 639 | - echo ' |
|
| 668 | + if (!empty($context['drafts'])) { |
|
| 669 | + echo ' |
|
| 640 | 670 | var oSwapDraftOptions = new smc_Toggle({ |
| 641 | 671 | bToggleEnabled: true, |
| 642 | 672 | bCurrentlyCollapsed: true, |
@@ -658,6 +688,7 @@ discard block |
||
| 658 | 688 | } |
| 659 | 689 | ] |
| 660 | 690 | });'; |
| 691 | + } |
|
| 661 | 692 | |
| 662 | 693 | echo ' |
| 663 | 694 | var oEditorID = "', $context['post_box_name'] ,'"; |
@@ -678,8 +709,9 @@ discard block |
||
| 678 | 709 | foreach ($context['previous_posts'] as $post) |
| 679 | 710 | { |
| 680 | 711 | $ignoring = false; |
| 681 | - if (!empty($post['is_ignored'])) |
|
| 682 | - $ignored_posts[] = $ignoring = $post['id']; |
|
| 712 | + if (!empty($post['is_ignored'])) { |
|
| 713 | + $ignored_posts[] = $ignoring = $post['id']; |
|
| 714 | + } |
|
| 683 | 715 | |
| 684 | 716 | echo ' |
| 685 | 717 | <div class="windowbg"> |
@@ -689,22 +721,24 @@ discard block |
||
| 689 | 721 | </h5> |
| 690 | 722 | - ', $post['time']; |
| 691 | 723 | |
| 692 | - if ($context['can_quote']) |
|
| 693 | - echo ' |
|
| 724 | + if ($context['can_quote']) { |
|
| 725 | + echo ' |
|
| 694 | 726 | <ul class="quickbuttons" id="msg_', $post['id'], '_quote"> |
| 695 | 727 | <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> |
| 696 | 728 | <li id="post_modify"><a href="#postmodify" onclick="return insertQuoteFast(', $post['id'], ');"><span class="generic_icons quote"></span>', $txt['quote'], '</a></li> |
| 697 | 729 | </ul>'; |
| 730 | + } |
|
| 698 | 731 | |
| 699 | 732 | echo ' |
| 700 | 733 | <br class="clear">'; |
| 701 | 734 | |
| 702 | - if ($ignoring) |
|
| 703 | - echo ' |
|
| 735 | + if ($ignoring) { |
|
| 736 | + echo ' |
|
| 704 | 737 | <div id="msg_', $post['id'], '_ignored_prompt" class="smalltext"> |
| 705 | 738 | ', $txt['ignoring_user'], ' |
| 706 | 739 | <a href="#" id="msg_', $post['id'], '_ignored_link" style="display: none;">', $txt['show_ignore_user_post'], '</a> |
| 707 | 740 | </div>'; |
| 741 | + } |
|
| 708 | 742 | |
| 709 | 743 | echo ' |
| 710 | 744 | <div class="list_posts smalltext" id="msg_', $post['id'], '_body" data-msgid="', $post['id'], '">', $post['message'], '</div> |
@@ -859,10 +893,10 @@ discard block |
||
| 859 | 893 | <div id="temporary_posting_area" style="display: none;"></div> |
| 860 | 894 | <script>'; |
| 861 | 895 | |
| 862 | - if ($context['close_window']) |
|
| 863 | - echo ' |
|
| 896 | + if ($context['close_window']) { |
|
| 897 | + echo ' |
|
| 864 | 898 | window.close();'; |
| 865 | - else |
|
| 899 | + } else |
|
| 866 | 900 | { |
| 867 | 901 | // Lucky for us, Internet Explorer has an "innerText" feature which basically converts entities <--> text. Use it if possible ;) |
| 868 | 902 | echo ' |
@@ -916,11 +950,12 @@ discard block |
||
| 916 | 950 | </p> |
| 917 | 951 | <ul>'; |
| 918 | 952 | |
| 919 | - foreach ($context['groups'] as $group) |
|
| 920 | - echo ' |
|
| 953 | + foreach ($context['groups'] as $group) { |
|
| 954 | + echo ' |
|
| 921 | 955 | <li> |
| 922 | 956 | <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> |
| 923 | 957 | </li>'; |
| 958 | + } |
|
| 924 | 959 | |
| 925 | 960 | echo ' |
| 926 | 961 | <li> |
@@ -1027,28 +1062,32 @@ discard block |
||
| 1027 | 1062 | foreach ($context['posting_fields'] as $pfid => $pf) |
| 1028 | 1063 | { |
| 1029 | 1064 | // We need both a label and an input |
| 1030 | - if (empty($pf['label']) || empty($pf['input'])) |
|
| 1031 | - continue; |
|
| 1065 | + if (empty($pf['label']) || empty($pf['input'])) { |
|
| 1066 | + continue; |
|
| 1067 | + } |
|
| 1032 | 1068 | |
| 1033 | 1069 | // The labels are pretty simple... |
| 1034 | 1070 | echo ' |
| 1035 | 1071 | <dt class="clear pf_', $pfid, '">'; |
| 1036 | 1072 | |
| 1037 | 1073 | // Any leading HTML before the label |
| 1038 | - if (!empty($pf['label']['before'])) |
|
| 1039 | - echo ' |
|
| 1074 | + if (!empty($pf['label']['before'])) { |
|
| 1075 | + echo ' |
|
| 1040 | 1076 | ', $pf['label']['before']; |
| 1077 | + } |
|
| 1041 | 1078 | |
| 1042 | - if (!empty($pf['label']['html'])) |
|
| 1043 | - echo $pf['label']['html']; |
|
| 1044 | - else |
|
| 1045 | - echo ' |
|
| 1079 | + if (!empty($pf['label']['html'])) { |
|
| 1080 | + echo $pf['label']['html']; |
|
| 1081 | + } else { |
|
| 1082 | + echo ' |
|
| 1046 | 1083 | <label for="', !empty($pf['input']['attributes']['name']) ? $pf['input']['attributes']['name'] : $pfid, '" id="caption_', $pfid, '"', !empty($pf['label']['class']) ? ' class="' . $pf['label']['class'] . '"' : '', '>', $pf['label']['text'], '</label>'; |
| 1084 | + } |
|
| 1047 | 1085 | |
| 1048 | 1086 | // Any trailing HTML after the label |
| 1049 | - if (!empty($pf['label']['after'])) |
|
| 1050 | - echo ' |
|
| 1087 | + if (!empty($pf['label']['after'])) { |
|
| 1088 | + echo ' |
|
| 1051 | 1089 | ', $pf['label']['after']; |
| 1090 | + } |
|
| 1052 | 1091 | |
| 1053 | 1092 | echo ' |
| 1054 | 1093 | </dt>'; |
@@ -1058,9 +1097,10 @@ discard block |
||
| 1058 | 1097 | <dd class="pf_', $pfid, '">'; |
| 1059 | 1098 | |
| 1060 | 1099 | // Any leading HTML before the main input |
| 1061 | - if (!empty($pf['input']['before'])) |
|
| 1062 | - echo ' |
|
| 1100 | + if (!empty($pf['input']['before'])) { |
|
| 1101 | + echo ' |
|
| 1063 | 1102 | ', $pf['input']['before']; |
| 1103 | + } |
|
| 1064 | 1104 | |
| 1065 | 1105 | // If there is a literal HTML string already defined, just print it. |
| 1066 | 1106 | if (!empty($pf['input']['html'])) |
@@ -1073,17 +1113,19 @@ discard block |
||
| 1073 | 1113 | echo ' |
| 1074 | 1114 | <input type="', $pf['input']['type'], '"'; |
| 1075 | 1115 | |
| 1076 | - if (empty($pf['input']['attributes']['name'])) |
|
| 1077 | - echo ' name="', $pfid, '"'; |
|
| 1116 | + if (empty($pf['input']['attributes']['name'])) { |
|
| 1117 | + echo ' name="', $pfid, '"'; |
|
| 1118 | + } |
|
| 1078 | 1119 | |
| 1079 | 1120 | if (!empty($pf['input']['attributes']) && is_array($pf['input']['attributes'])) |
| 1080 | 1121 | { |
| 1081 | 1122 | foreach ($pf['input']['attributes'] as $attribute => $value) |
| 1082 | 1123 | { |
| 1083 | - if (is_bool($value)) |
|
| 1084 | - echo $value ? ' ' . $attribute : ''; |
|
| 1085 | - else |
|
| 1086 | - echo ' ', $attribute, '="', $value, '"'; |
|
| 1124 | + if (is_bool($value)) { |
|
| 1125 | + echo $value ? ' ' . $attribute : ''; |
|
| 1126 | + } else { |
|
| 1127 | + echo ' ', $attribute, '="', $value, '"'; |
|
| 1128 | + } |
|
| 1087 | 1129 | } |
| 1088 | 1130 | } |
| 1089 | 1131 | |
@@ -1095,19 +1137,21 @@ discard block |
||
| 1095 | 1137 | echo ' |
| 1096 | 1138 | <textarea'; |
| 1097 | 1139 | |
| 1098 | - if (empty($pf['input']['attributes']['name'])) |
|
| 1099 | - echo ' name="', $pfid, '"'; |
|
| 1140 | + if (empty($pf['input']['attributes']['name'])) { |
|
| 1141 | + echo ' name="', $pfid, '"'; |
|
| 1142 | + } |
|
| 1100 | 1143 | |
| 1101 | 1144 | if (!empty($pf['input']['attributes']) && is_array($pf['input']['attributes'])) |
| 1102 | 1145 | { |
| 1103 | 1146 | foreach ($pf['input']['attributes'] as $attribute => $value) |
| 1104 | 1147 | { |
| 1105 | - if ($attribute === 'value') |
|
| 1106 | - continue; |
|
| 1107 | - elseif (is_bool($value)) |
|
| 1108 | - echo $value ? ' ' . $attribute : ''; |
|
| 1109 | - else |
|
| 1110 | - echo ' ', $attribute, '="', $value, '"'; |
|
| 1148 | + if ($attribute === 'value') { |
|
| 1149 | + continue; |
|
| 1150 | + } elseif (is_bool($value)) { |
|
| 1151 | + echo $value ? ' ' . $attribute : ''; |
|
| 1152 | + } else { |
|
| 1153 | + echo ' ', $attribute, '="', $value, '"'; |
|
| 1154 | + } |
|
| 1111 | 1155 | } |
| 1112 | 1156 | } |
| 1113 | 1157 | |
@@ -1120,17 +1164,19 @@ discard block |
||
| 1120 | 1164 | echo ' |
| 1121 | 1165 | <select'; |
| 1122 | 1166 | |
| 1123 | - if (empty($pf['input']['attributes']['name'])) |
|
| 1124 | - echo ' name="', $pfid, '"'; |
|
| 1167 | + if (empty($pf['input']['attributes']['name'])) { |
|
| 1168 | + echo ' name="', $pfid, '"'; |
|
| 1169 | + } |
|
| 1125 | 1170 | |
| 1126 | 1171 | if (!empty($pf['input']['attributes']) && is_array($pf['input']['attributes'])) |
| 1127 | 1172 | { |
| 1128 | 1173 | foreach ($pf['input']['attributes'] as $attribute => $value) |
| 1129 | 1174 | { |
| 1130 | - if (is_bool($value)) |
|
| 1131 | - echo $value ? ' ' . $attribute : ''; |
|
| 1132 | - else |
|
| 1133 | - echo ' ', $attribute, '="', $value, '"'; |
|
| 1175 | + if (is_bool($value)) { |
|
| 1176 | + echo $value ? ' ' . $attribute : ''; |
|
| 1177 | + } else { |
|
| 1178 | + echo ' ', $attribute, '="', $value, '"'; |
|
| 1179 | + } |
|
| 1134 | 1180 | } |
| 1135 | 1181 | } |
| 1136 | 1182 | |
@@ -1145,17 +1191,19 @@ discard block |
||
| 1145 | 1191 | echo ' |
| 1146 | 1192 | <optgroup'; |
| 1147 | 1193 | |
| 1148 | - if (empty($option['attributes']['label'])) |
|
| 1149 | - echo ' label="', $optlabel, '"'; |
|
| 1194 | + if (empty($option['attributes']['label'])) { |
|
| 1195 | + echo ' label="', $optlabel, '"'; |
|
| 1196 | + } |
|
| 1150 | 1197 | |
| 1151 | 1198 | if (!empty($option['attributes']) && is_array($option['attributes'])) |
| 1152 | 1199 | { |
| 1153 | 1200 | foreach ($option['attributes'] as $attribute => $value) |
| 1154 | 1201 | { |
| 1155 | - if (is_bool($value)) |
|
| 1156 | - echo $value ? ' ' . $attribute : ''; |
|
| 1157 | - else |
|
| 1158 | - echo ' ', $attribute, '="', $value, '"'; |
|
| 1202 | + if (is_bool($value)) { |
|
| 1203 | + echo $value ? ' ' . $attribute : ''; |
|
| 1204 | + } else { |
|
| 1205 | + echo ' ', $attribute, '="', $value, '"'; |
|
| 1206 | + } |
|
| 1159 | 1207 | } |
| 1160 | 1208 | } |
| 1161 | 1209 | |
@@ -1168,10 +1216,11 @@ discard block |
||
| 1168 | 1216 | |
| 1169 | 1217 | foreach ($grouped_option['attributes'] as $attribute => $value) |
| 1170 | 1218 | { |
| 1171 | - if (is_bool($value)) |
|
| 1172 | - echo $value ? ' ' . $attribute : ''; |
|
| 1173 | - else |
|
| 1174 | - echo ' ', $attribute, '="', $value, '"'; |
|
| 1219 | + if (is_bool($value)) { |
|
| 1220 | + echo $value ? ' ' . $attribute : ''; |
|
| 1221 | + } else { |
|
| 1222 | + echo ' ', $attribute, '="', $value, '"'; |
|
| 1223 | + } |
|
| 1175 | 1224 | } |
| 1176 | 1225 | |
| 1177 | 1226 | echo '>', $grouped_optlabel, '</option>'; |
@@ -1189,10 +1238,11 @@ discard block |
||
| 1189 | 1238 | |
| 1190 | 1239 | foreach ($option['attributes'] as $attribute => $value) |
| 1191 | 1240 | { |
| 1192 | - if (is_bool($value)) |
|
| 1193 | - echo $value ? ' ' . $attribute : ''; |
|
| 1194 | - else |
|
| 1195 | - echo ' ', $attribute, '="', $value, '"'; |
|
| 1241 | + if (is_bool($value)) { |
|
| 1242 | + echo $value ? ' ' . $attribute : ''; |
|
| 1243 | + } else { |
|
| 1244 | + echo ' ', $attribute, '="', $value, '"'; |
|
| 1245 | + } |
|
| 1196 | 1246 | } |
| 1197 | 1247 | |
| 1198 | 1248 | echo '>', $optlabel, '</option>'; |
@@ -1213,12 +1263,13 @@ discard block |
||
| 1213 | 1263 | { |
| 1214 | 1264 | foreach ($pf['input']['attributes'] as $attribute => $value) |
| 1215 | 1265 | { |
| 1216 | - if ($attribute === 'name') |
|
| 1217 | - continue; |
|
| 1218 | - elseif (is_bool($value)) |
|
| 1219 | - echo $value ? ' ' . $attribute : ''; |
|
| 1220 | - else |
|
| 1221 | - echo ' ', $attribute, '="', $value, '"'; |
|
| 1266 | + if ($attribute === 'name') { |
|
| 1267 | + continue; |
|
| 1268 | + } elseif (is_bool($value)) { |
|
| 1269 | + echo $value ? ' ' . $attribute : ''; |
|
| 1270 | + } else { |
|
| 1271 | + echo ' ', $attribute, '="', $value, '"'; |
|
| 1272 | + } |
|
| 1222 | 1273 | } |
| 1223 | 1274 | } |
| 1224 | 1275 | |
@@ -1231,10 +1282,11 @@ discard block |
||
| 1231 | 1282 | |
| 1232 | 1283 | foreach ($option['attributes'] as $attribute => $value) |
| 1233 | 1284 | { |
| 1234 | - if (is_bool($value)) |
|
| 1235 | - echo $value ? ' ' . $attribute : ''; |
|
| 1236 | - else |
|
| 1237 | - echo ' ', $attribute, '="', $value, '"'; |
|
| 1285 | + if (is_bool($value)) { |
|
| 1286 | + echo $value ? ' ' . $attribute : ''; |
|
| 1287 | + } else { |
|
| 1288 | + echo ' ', $attribute, '="', $value, '"'; |
|
| 1289 | + } |
|
| 1238 | 1290 | } |
| 1239 | 1291 | |
| 1240 | 1292 | echo ' tabindex="', $context['tabindex']++, '">', $optlabel, '</input>'; |
@@ -1245,9 +1297,10 @@ discard block |
||
| 1245 | 1297 | } |
| 1246 | 1298 | |
| 1247 | 1299 | // Any trailing HTML after the main input |
| 1248 | - if (!empty($pf['input']['after'])) |
|
| 1249 | - echo ' |
|
| 1300 | + if (!empty($pf['input']['after'])) { |
|
| 1301 | + echo ' |
|
| 1250 | 1302 | ', $pf['input']['after']; |
| 1303 | + } |
|
| 1251 | 1304 | |
| 1252 | 1305 | echo ' |
| 1253 | 1306 | </dd>'; |