@@ -46,9 +46,10 @@ discard block |
||
46 | 46 | |
47 | 47 | foreach ($prefs as $member => $pref_option) |
48 | 48 | { |
49 | - foreach ($alert_bits as $type => $bitvalue) |
|
50 | - if ($pref_option['member_report'] & $bitvalue) |
|
49 | + foreach ($alert_bits as $type => $bitvalue) { |
|
50 | + if ($pref_option['member_report'] & $bitvalue) |
|
51 | 51 | $notifies[$type][] = $member; |
52 | + } |
|
52 | 53 | } |
53 | 54 | |
54 | 55 | // Firstly, anyone who wants alerts. |
@@ -109,8 +110,9 @@ discard block |
||
109 | 110 | ); |
110 | 111 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
111 | 112 | { |
112 | - if (empty($row['lngfile'])) |
|
113 | - $row['lngfile'] = $language; |
|
113 | + if (empty($row['lngfile'])) { |
|
114 | + $row['lngfile'] = $language; |
|
115 | + } |
|
114 | 116 | $emails[$row['lngfile']][$row['id_member']] = $row['email_address']; |
115 | 117 | } |
116 | 118 | $smcFunc['db_free_result']($request); |
@@ -129,8 +131,9 @@ discard block |
||
129 | 131 | $emaildata = loadEmailTemplate('report_member_profile', $replacements, empty($modSettings['userLanguage']) ? $language : $this_lang); |
130 | 132 | |
131 | 133 | // And do the actual sending... |
132 | - foreach ($recipients as $id_member => $email_address) |
|
133 | - sendmail($email_address, $emaildata['subject'], $emaildata['body'], null, 'ureport' . $this->_details['report_id'], $emaildata['is_html'], 2); |
|
134 | + foreach ($recipients as $id_member => $email_address) { |
|
135 | + sendmail($email_address, $emaildata['subject'], $emaildata['body'], null, 'ureport' . $this->_details['report_id'], $emaildata['is_html'], 2); |
|
136 | + } |
|
134 | 137 | } |
135 | 138 | } |
136 | 139 |
@@ -54,8 +54,9 @@ discard block |
||
54 | 54 | } |
55 | 55 | $smcFunc['db_free_result']($request); |
56 | 56 | |
57 | - if (empty($members)) |
|
58 | - return true; |
|
57 | + if (empty($members)) { |
|
58 | + return true; |
|
59 | + } |
|
59 | 60 | |
60 | 61 | require_once($sourcedir . '/Subs-Notify.php'); |
61 | 62 | $members = array_unique($members); |
@@ -103,14 +104,15 @@ discard block |
||
103 | 104 | } |
104 | 105 | |
105 | 106 | // Insert the alerts if any |
106 | - if (!empty($alert_rows)) |
|
107 | - $smcFunc['db_insert']('', |
|
107 | + if (!empty($alert_rows)) { |
|
108 | + $smcFunc['db_insert']('', |
|
108 | 109 | '{db_prefix}user_alerts', |
109 | 110 | array('alert_time' => 'int', 'id_member' => 'int', 'id_member_started' => 'int', 'member_name' => 'string', |
110 | 111 | 'content_type' => 'string', 'content_id' => 'int', 'content_action' => 'string', 'is_read' => 'int', 'extra' => 'string'), |
111 | 112 | $alert_rows, |
112 | 113 | array() |
113 | 114 | ); |
115 | + } |
|
114 | 116 | |
115 | 117 | return true; |
116 | 118 | } |
@@ -43,9 +43,10 @@ discard block |
||
43 | 43 | |
44 | 44 | foreach ($prefs as $member => $pref_option) |
45 | 45 | { |
46 | - foreach ($alert_bits as $type => $bitvalue) |
|
47 | - if ($pref_option['member_register'] & $bitvalue) |
|
46 | + foreach ($alert_bits as $type => $bitvalue) { |
|
47 | + if ($pref_option['member_register'] & $bitvalue) |
|
48 | 48 | $notifies[$type][] = $member; |
49 | + } |
|
49 | 50 | } |
50 | 51 | |
51 | 52 | // Firstly, anyone who wants alerts. |
@@ -101,8 +102,9 @@ discard block |
||
101 | 102 | ); |
102 | 103 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
103 | 104 | { |
104 | - if (empty($row['lngfile'])) |
|
105 | - $row['lngfile'] = $language; |
|
105 | + if (empty($row['lngfile'])) { |
|
106 | + $row['lngfile'] = $language; |
|
107 | + } |
|
106 | 108 | $emails[$row['lngfile']][$row['id_member']] = $row['email_address']; |
107 | 109 | } |
108 | 110 | $smcFunc['db_free_result']($request); |
@@ -126,8 +128,9 @@ discard block |
||
126 | 128 | $emaildata = loadEmailTemplate($emailtype, $replacements, empty($modSettings['userLanguage']) ? $language : $this_lang); |
127 | 129 | |
128 | 130 | // And do the actual sending... |
129 | - foreach ($recipients as $id_member => $email_address) |
|
130 | - sendmail($email_address, $emaildata['subject'], $emaildata['body'], null, 'newmember' . $this->_details['new_member_id'], $emaildata['is_html'], 0); |
|
131 | + foreach ($recipients as $id_member => $email_address) { |
|
132 | + sendmail($email_address, $emaildata['subject'], $emaildata['body'], null, 'newmember' . $this->_details['new_member_id'], $emaildata['is_html'], 0); |
|
133 | + } |
|
131 | 134 | } |
132 | 135 | } |
133 | 136 |
@@ -40,8 +40,9 @@ discard block |
||
40 | 40 | 'current_board' => $this->_details['board_id'], |
41 | 41 | ) |
42 | 42 | ); |
43 | - while ($row = $smcFunc['db_fetch_assoc']($request)) |
|
44 | - $members[] = $row['id_member']; |
|
43 | + while ($row = $smcFunc['db_fetch_assoc']($request)) { |
|
44 | + $members[] = $row['id_member']; |
|
45 | + } |
|
45 | 46 | $smcFunc['db_free_result']($request); |
46 | 47 | |
47 | 48 | // Thirdly, anyone assigned to be a moderator of this group as a group->board moderator. |
@@ -58,8 +59,9 @@ discard block |
||
58 | 59 | ) |
59 | 60 | ); |
60 | 61 | |
61 | - while ($row = $smcFunc['db_fetch_assoc']($request)) |
|
62 | - $members[] = $row['id_member']; |
|
62 | + while ($row = $smcFunc['db_fetch_assoc']($request)) { |
|
63 | + $members[] = $row['id_member']; |
|
64 | + } |
|
63 | 65 | $smcFunc['db_free_result']($request); |
64 | 66 | |
65 | 67 | // And now weed out the duplicates. |
@@ -81,9 +83,10 @@ discard block |
||
81 | 83 | |
82 | 84 | foreach ($prefs as $member => $pref_option) |
83 | 85 | { |
84 | - foreach ($alert_bits as $type => $bitvalue) |
|
85 | - if ($pref_option['msg_report'] & $bitvalue) |
|
86 | + foreach ($alert_bits as $type => $bitvalue) { |
|
87 | + if ($pref_option['msg_report'] & $bitvalue) |
|
86 | 88 | $notifies[$type][] = $member; |
89 | + } |
|
87 | 90 | } |
88 | 91 | |
89 | 92 | // Firstly, anyone who wants alerts. |
@@ -143,8 +146,9 @@ discard block |
||
143 | 146 | ); |
144 | 147 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
145 | 148 | { |
146 | - if (empty($row['lngfile'])) |
|
147 | - $row['lngfile'] = $language; |
|
149 | + if (empty($row['lngfile'])) { |
|
150 | + $row['lngfile'] = $language; |
|
151 | + } |
|
148 | 152 | $emails[$row['lngfile']][$row['id_member']] = $row['email_address']; |
149 | 153 | } |
150 | 154 | $smcFunc['db_free_result']($request); |
@@ -177,8 +181,9 @@ discard block |
||
177 | 181 | $emaildata = loadEmailTemplate('report_to_moderator', $replacements, empty($modSettings['userLanguage']) ? $language : $this_lang); |
178 | 182 | |
179 | 183 | // And do the actual sending... |
180 | - foreach ($recipients as $id_member => $email_address) |
|
181 | - sendmail($email_address, $emaildata['subject'], $emaildata['body'], null, 'report' . $this->_details['report_id'], $emaildata['is_html'], 2); |
|
184 | + foreach ($recipients as $id_member => $email_address) { |
|
185 | + sendmail($email_address, $emaildata['subject'], $emaildata['body'], null, 'report' . $this->_details['report_id'], $emaildata['is_html'], 2); |
|
186 | + } |
|
182 | 187 | } |
183 | 188 | } |
184 | 189 |
@@ -40,8 +40,9 @@ discard block |
||
40 | 40 | 'last_comment' => $this->_details['comment_id'], |
41 | 41 | ) |
42 | 42 | ); |
43 | - while ($row = $smcFunc['db_fetch_row']($request)) |
|
44 | - $possible_members[] = $row[0]; |
|
43 | + while ($row = $smcFunc['db_fetch_row']($request)) { |
|
44 | + $possible_members[] = $row[0]; |
|
45 | + } |
|
45 | 46 | $smcFunc['db_free_result']($request); |
46 | 47 | |
47 | 48 | // Presumably, there are some people? |
@@ -50,8 +51,9 @@ discard block |
||
50 | 51 | $possible_members = array_flip(array_flip($possible_members)); |
51 | 52 | $possible_members = array_diff($possible_members, array($this->_details['sender_id'])); |
52 | 53 | } |
53 | - if (empty($possible_members)) |
|
54 | - return true; |
|
54 | + if (empty($possible_members)) { |
|
55 | + return true; |
|
56 | + } |
|
55 | 57 | |
56 | 58 | // We need to know who can moderate this board - and therefore who can see this report. |
57 | 59 | // First up, people who have moderate_board in the board this topic was in. |
@@ -73,8 +75,9 @@ discard block |
||
73 | 75 | { |
74 | 76 | foreach ($alert_bits as $type => $bitvalue) |
75 | 77 | { |
76 | - if ($pref_option['member_report_reply'] & $bitvalue) |
|
77 | - $notifies[$type][] = $member; |
|
78 | + if ($pref_option['member_report_reply'] & $bitvalue) { |
|
79 | + $notifies[$type][] = $member; |
|
80 | + } |
|
78 | 81 | } |
79 | 82 | } |
80 | 83 | |
@@ -136,8 +139,9 @@ discard block |
||
136 | 139 | ); |
137 | 140 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
138 | 141 | { |
139 | - if (empty($row['lngfile'])) |
|
140 | - $row['lngfile'] = $language; |
|
142 | + if (empty($row['lngfile'])) { |
|
143 | + $row['lngfile'] = $language; |
|
144 | + } |
|
141 | 145 | $emails[$row['lngfile']][$row['id_member']] = $row['email_address']; |
142 | 146 | } |
143 | 147 | $smcFunc['db_free_result']($request); |
@@ -155,8 +159,9 @@ discard block |
||
155 | 159 | $emaildata = loadEmailTemplate('reply_to_user_reports', $replacements, empty($modSettings['userLanguage']) ? $language : $this_lang); |
156 | 160 | |
157 | 161 | // And do the actual sending... |
158 | - foreach ($recipients as $id_member => $email_address) |
|
159 | - sendmail($email_address, $emaildata['subject'], $emaildata['body'], null, 'urptrpy' . $this->_details['comment_id'], $emaildata['is_html'], 3); |
|
162 | + foreach ($recipients as $id_member => $email_address) { |
|
163 | + sendmail($email_address, $emaildata['subject'], $emaildata['body'], null, 'urptrpy' . $this->_details['comment_id'], $emaildata['is_html'], 3); |
|
164 | + } |
|
160 | 165 | } |
161 | 166 | } |
162 | 167 |
@@ -96,14 +96,15 @@ |
||
96 | 96 | } |
97 | 97 | |
98 | 98 | // Insert the alerts if any |
99 | - if (!empty($alert_rows)) |
|
100 | - $smcFunc['db_insert']('', |
|
99 | + if (!empty($alert_rows)) { |
|
100 | + $smcFunc['db_insert']('', |
|
101 | 101 | '{db_prefix}user_alerts', |
102 | 102 | array('alert_time' => 'int', 'id_member' => 'int', 'id_member_started' => 'int', 'member_name' => 'string', |
103 | 103 | 'content_type' => 'string', 'content_id' => 'int', 'content_action' => 'string', 'is_read' => 'int', 'extra' => 'string'), |
104 | 104 | $alert_rows, |
105 | 105 | array() |
106 | 106 | ); |
107 | + } |
|
107 | 108 | |
108 | 109 | return true; |
109 | 110 | } |
@@ -37,8 +37,9 @@ discard block |
||
37 | 37 | ) |
38 | 38 | ); |
39 | 39 | $moderators = array(); |
40 | - while ($row = $smcFunc['db_fetch_assoc']($request)) |
|
41 | - $moderators[] = $row['id_member']; |
|
40 | + while ($row = $smcFunc['db_fetch_assoc']($request)) { |
|
41 | + $moderators[] = $row['id_member']; |
|
42 | + } |
|
42 | 43 | $smcFunc['db_free_result']($request); |
43 | 44 | |
44 | 45 | require_once($sourcedir . '/Subs-Members.php'); |
@@ -59,11 +60,13 @@ discard block |
||
59 | 60 | { |
60 | 61 | if (!empty($prefs[$mod]['request_group'])) |
61 | 62 | { |
62 | - if ($prefs[$mod]['request_group'] & 0x01) |
|
63 | - $data['alert'][] = $mod; |
|
63 | + if ($prefs[$mod]['request_group'] & 0x01) { |
|
64 | + $data['alert'][] = $mod; |
|
65 | + } |
|
64 | 66 | |
65 | - if ($prefs[$mod]['request_group'] & 0x02) |
|
66 | - $data['email'][] = $mod; |
|
67 | + if ($prefs[$mod]['request_group'] & 0x02) { |
|
68 | + $data['email'][] = $mod; |
|
69 | + } |
|
67 | 70 | } |
68 | 71 | } |
69 | 72 |
@@ -89,8 +89,9 @@ discard block |
||
89 | 89 | foreach ($section['areas'] as $i => $area) |
90 | 90 | { |
91 | 91 | // Not supposed to be printed? |
92 | - if (empty($area['label'])) |
|
93 | - continue; |
|
92 | + if (empty($area['label'])) { |
|
93 | + continue; |
|
94 | + } |
|
94 | 95 | |
95 | 96 | echo ' |
96 | 97 | <li', !empty($area['subsections']) ? ' class="subsections"' : '', '>'; |
@@ -99,8 +100,9 @@ discard block |
||
99 | 100 | <a class="', $area['icon_class'], !empty($area['selected']) ? ' chosen ' : '', '" href="', (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i), $menu_context['extra_parameters'], '">', $area['icon'], $area['label'], '</a>'; |
100 | 101 | |
101 | 102 | // Is this the current area, or just some area? |
102 | - if (!empty($area['selected']) && empty($context['tabs'])) |
|
103 | - $context['tabs'] = isset($area['subsections']) ? $area['subsections'] : array(); |
|
103 | + if (!empty($area['selected']) && empty($context['tabs'])) { |
|
104 | + $context['tabs'] = isset($area['subsections']) ? $area['subsections'] : array(); |
|
105 | + } |
|
104 | 106 | |
105 | 107 | // Are there any subsections? |
106 | 108 | if (!empty($area['subsections'])) |
@@ -110,8 +112,9 @@ discard block |
||
110 | 112 | |
111 | 113 | foreach ($area['subsections'] as $sa => $sub) |
112 | 114 | { |
113 | - if (!empty($sub['disabled'])) |
|
114 | - continue; |
|
115 | + if (!empty($sub['disabled'])) { |
|
116 | + continue; |
|
117 | + } |
|
115 | 118 | |
116 | 119 | $url = isset($sub['url']) ? $sub['url'] : (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i) . ';sa=' . $sa; |
117 | 120 | |
@@ -158,8 +161,9 @@ discard block |
||
158 | 161 | <h3 class="catbg">'; |
159 | 162 | |
160 | 163 | // The function is in Admin.template.php, but since this template is used elsewhere too better check if the function is available |
161 | - if (function_exists('template_admin_quick_search')) |
|
162 | - template_admin_quick_search(); |
|
164 | + if (function_exists('template_admin_quick_search')) { |
|
165 | + template_admin_quick_search(); |
|
166 | + } |
|
163 | 167 | |
164 | 168 | // Exactly how many tabs do we have? |
165 | 169 | if (!empty($context['tabs'])) |
@@ -174,30 +178,36 @@ discard block |
||
174 | 178 | } |
175 | 179 | |
176 | 180 | // Did this not even exist - or do we not have a label? |
177 | - if (!isset($tab_context['tabs'][$id])) |
|
178 | - $tab_context['tabs'][$id] = array('label' => $tab['label']); |
|
179 | - elseif (!isset($tab_context['tabs'][$id]['label'])) |
|
180 | - $tab_context['tabs'][$id]['label'] = $tab['label']; |
|
181 | + if (!isset($tab_context['tabs'][$id])) { |
|
182 | + $tab_context['tabs'][$id] = array('label' => $tab['label']); |
|
183 | + } elseif (!isset($tab_context['tabs'][$id]['label'])) { |
|
184 | + $tab_context['tabs'][$id]['label'] = $tab['label']; |
|
185 | + } |
|
181 | 186 | |
182 | 187 | // Has a custom URL defined in the main admin structure? |
183 | - if (isset($tab['url']) && !isset($tab_context['tabs'][$id]['url'])) |
|
184 | - $tab_context['tabs'][$id]['url'] = $tab['url']; |
|
188 | + if (isset($tab['url']) && !isset($tab_context['tabs'][$id]['url'])) { |
|
189 | + $tab_context['tabs'][$id]['url'] = $tab['url']; |
|
190 | + } |
|
185 | 191 | |
186 | 192 | // Any additional paramaters for the url? |
187 | - if (isset($tab['add_params']) && !isset($tab_context['tabs'][$id]['add_params'])) |
|
188 | - $tab_context['tabs'][$id]['add_params'] = $tab['add_params']; |
|
193 | + if (isset($tab['add_params']) && !isset($tab_context['tabs'][$id]['add_params'])) { |
|
194 | + $tab_context['tabs'][$id]['add_params'] = $tab['add_params']; |
|
195 | + } |
|
189 | 196 | |
190 | 197 | // Has it been deemed selected? |
191 | - if (!empty($tab['is_selected'])) |
|
192 | - $tab_context['tabs'][$id]['is_selected'] = true; |
|
198 | + if (!empty($tab['is_selected'])) { |
|
199 | + $tab_context['tabs'][$id]['is_selected'] = true; |
|
200 | + } |
|
193 | 201 | |
194 | 202 | // Does it have its own help? |
195 | - if (!empty($tab['help'])) |
|
196 | - $tab_context['tabs'][$id]['help'] = $tab['help']; |
|
203 | + if (!empty($tab['help'])) { |
|
204 | + $tab_context['tabs'][$id]['help'] = $tab['help']; |
|
205 | + } |
|
197 | 206 | |
198 | 207 | // Is this the last one? |
199 | - if (!empty($tab['is_last']) && !isset($tab_context['override_last'])) |
|
200 | - $tab_context['tabs'][$id]['is_last'] = true; |
|
208 | + if (!empty($tab['is_last']) && !isset($tab_context['override_last'])) { |
|
209 | + $tab_context['tabs'][$id]['is_last'] = true; |
|
210 | + } |
|
201 | 211 | } |
202 | 212 | |
203 | 213 | // Find the selected tab |
@@ -214,17 +224,18 @@ discard block |
||
214 | 224 | // Show an icon and/or a help item? |
215 | 225 | if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class']) || !empty($selected_tab['icon']) || !empty($tab_context['icon']) || !empty($selected_tab['help']) || !empty($tab_context['help'])) |
216 | 226 | { |
217 | - if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class'])) |
|
218 | - echo '<span class="', !empty($selected_tab['icon_class']) ? $selected_tab['icon_class'] : $tab_context['icon_class'], ' icon"></span>'; |
|
219 | - elseif (!empty($selected_tab['icon']) || !empty($tab_context['icon'])) |
|
220 | - echo '<img src="', $settings['images_url'], '/icons/', !empty($selected_tab['icon']) ? $selected_tab['icon'] : $tab_context['icon'], '" alt="" class="icon">'; |
|
227 | + if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class'])) { |
|
228 | + echo '<span class="', !empty($selected_tab['icon_class']) ? $selected_tab['icon_class'] : $tab_context['icon_class'], ' icon"></span>'; |
|
229 | + } elseif (!empty($selected_tab['icon']) || !empty($tab_context['icon'])) { |
|
230 | + echo '<img src="', $settings['images_url'], '/icons/', !empty($selected_tab['icon']) ? $selected_tab['icon'] : $tab_context['icon'], '" alt="" class="icon">'; |
|
231 | + } |
|
221 | 232 | |
222 | - if (!empty($selected_tab['help']) || !empty($tab_context['help'])) |
|
223 | - echo '<a href="', $scripturl, '?action=helpadmin;help=', !empty($selected_tab['help']) ? $selected_tab['help'] : $tab_context['help'], '" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'], '"></span></a>'; |
|
233 | + if (!empty($selected_tab['help']) || !empty($tab_context['help'])) { |
|
234 | + echo '<a href="', $scripturl, '?action=helpadmin;help=', !empty($selected_tab['help']) ? $selected_tab['help'] : $tab_context['help'], '" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'], '"></span></a>'; |
|
235 | + } |
|
224 | 236 | |
225 | 237 | echo $tab_context['title']; |
226 | - } |
|
227 | - else |
|
238 | + } else |
|
228 | 239 | { |
229 | 240 | echo ' |
230 | 241 | ', $tab_context['title']; |
@@ -237,11 +248,12 @@ discard block |
||
237 | 248 | } |
238 | 249 | |
239 | 250 | // Shall we use the tabs? Yes, it's the only known way! |
240 | - if (!empty($selected_tab['description']) || !empty($tab_context['description'])) |
|
241 | - echo ' |
|
251 | + if (!empty($selected_tab['description']) || !empty($tab_context['description'])) { |
|
252 | + echo ' |
|
242 | 253 | <p class="information"> |
243 | 254 | ', !empty($selected_tab['description']) ? $selected_tab['description'] : $tab_context['description'], ' |
244 | 255 | </p>'; |
256 | + } |
|
245 | 257 | |
246 | 258 | // Print out all the items in this tab (if any). |
247 | 259 | if (!empty($context['tabs'])) |
@@ -253,8 +265,9 @@ discard block |
||
253 | 265 | |
254 | 266 | foreach ($tab_context['tabs'] as $sa => $tab) |
255 | 267 | { |
256 | - if (!empty($tab['disabled'])) |
|
257 | - continue; |
|
268 | + if (!empty($tab['disabled'])) { |
|
269 | + continue; |
|
270 | + } |
|
258 | 271 | |
259 | 272 | if (!empty($tab['is_selected'])) |
260 | 273 | { |
@@ -262,12 +275,12 @@ discard block |
||
262 | 275 | <li> |
263 | 276 | <a class="active" href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], isset($tab['add_params']) ? $tab['add_params'] : '', '">', $tab['label'], '</a> |
264 | 277 | </li>'; |
265 | - } |
|
266 | - else |
|
267 | - echo ' |
|
278 | + } else { |
|
279 | + echo ' |
|
268 | 280 | <li> |
269 | 281 | <a href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], isset($tab['add_params']) ? $tab['add_params'] : '', '">', $tab['label'], '</a> |
270 | 282 | </li>'; |
283 | + } |
|
271 | 284 | } |
272 | 285 | |
273 | 286 | // the end of tabs |
@@ -53,14 +53,15 @@ discard block |
||
53 | 53 | foreach ($context['smileys'] as $location => $smileyRows) |
54 | 54 | { |
55 | 55 | $countLocations--; |
56 | - if ($location == 'postform') |
|
57 | - echo ' |
|
56 | + if ($location == 'postform') { |
|
57 | + echo ' |
|
58 | 58 | dropdown: |
59 | 59 | {'; |
60 | - elseif ($location == 'popup') |
|
61 | - echo ' |
|
60 | + } elseif ($location == 'popup') { |
|
61 | + echo ' |
|
62 | 62 | popup: |
63 | 63 | {'; |
64 | + } |
|
64 | 65 | |
65 | 66 | $numRows = count($smileyRows); |
66 | 67 | // This is needed because otherwise the editor will remove all the duplicate (empty) keys and leave only 1 additional line |
@@ -72,21 +73,22 @@ discard block |
||
72 | 73 | echo ' |
73 | 74 | ', JavaScriptEscape($smiley['code']), ': ', JavaScriptEscape($settings['smileys_url'] . '/' . $smiley['filename']), empty($smiley['isLast']) ? ',' : ''; |
74 | 75 | } |
75 | - if (empty($smileyRow['isLast']) && $numRows != 1) |
|
76 | - echo ', |
|
76 | + if (empty($smileyRow['isLast']) && $numRows != 1) { |
|
77 | + echo ', |
|
77 | 78 | \'-', $emptyPlaceholder++, '\': \'\','; |
79 | + } |
|
78 | 80 | } |
79 | 81 | echo ' |
80 | 82 | }', $countLocations != 0 ? ',' : ''; |
81 | 83 | } |
82 | 84 | echo ' |
83 | 85 | }'; |
84 | - } |
|
85 | - else |
|
86 | - echo ', |
|
86 | + } else { |
|
87 | + echo ', |
|
87 | 88 | emoticons: |
88 | 89 | {}, |
89 | 90 | emoticonsEnabled:false'; |
91 | + } |
|
90 | 92 | |
91 | 93 | if ($context['show_bbc'] && $bbcContainer !== null) |
92 | 94 | { |
@@ -97,15 +99,16 @@ discard block |
||
97 | 99 | { |
98 | 100 | echo implode('|', $buttonRow); |
99 | 101 | $count_tags--; |
100 | - if (!empty($count_tags)) |
|
101 | - echo '||'; |
|
102 | + if (!empty($count_tags)) { |
|
103 | + echo '||'; |
|
104 | + } |
|
102 | 105 | } |
103 | 106 | |
104 | 107 | echo '",'; |
105 | - } |
|
106 | - else |
|
107 | - echo ', |
|
108 | + } else { |
|
109 | + echo ', |
|
108 | 110 | toolbar: "",'; |
111 | + } |
|
109 | 112 | |
110 | 113 | echo ' |
111 | 114 | }); |
@@ -146,43 +149,48 @@ discard block |
||
146 | 149 | </span>'; |
147 | 150 | |
148 | 151 | $tempTab = $context['tabindex']; |
149 | - if (!empty($context['drafts_pm_save'])) |
|
150 | - $tempTab++; |
|
151 | - elseif (!empty($context['drafts_save'])) |
|
152 | - $tempTab++; |
|
153 | - elseif ($editor_context['preview_type']) |
|
154 | - $tempTab++; |
|
155 | - elseif ($context['show_spellchecking']) |
|
156 | - $tempTab++; |
|
152 | + if (!empty($context['drafts_pm_save'])) { |
|
153 | + $tempTab++; |
|
154 | + } elseif (!empty($context['drafts_save'])) { |
|
155 | + $tempTab++; |
|
156 | + } elseif ($editor_context['preview_type']) { |
|
157 | + $tempTab++; |
|
158 | + } elseif ($context['show_spellchecking']) { |
|
159 | + $tempTab++; |
|
160 | + } |
|
157 | 161 | |
158 | 162 | $tempTab++; |
159 | 163 | $context['tabindex'] = $tempTab; |
160 | 164 | |
161 | - if (!empty($context['drafts_pm_save'])) |
|
162 | - echo ' |
|
165 | + if (!empty($context['drafts_pm_save'])) { |
|
166 | + echo ' |
|
163 | 167 | <input type="submit" name="save_draft" value="', $txt['draft_save'], '" tabindex="', --$tempTab, '" onclick="submitThisOnce(this);" accesskey="d" class="button_submit"> |
164 | 168 | <input type="hidden" id="id_pm_draft" name="id_pm_draft" value="', empty($context['id_pm_draft']) ? 0 : $context['id_pm_draft'], '">'; |
169 | + } |
|
165 | 170 | |
166 | - if (!empty($context['drafts_save'])) |
|
167 | - echo ' |
|
171 | + if (!empty($context['drafts_save'])) { |
|
172 | + echo ' |
|
168 | 173 | <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_submit"> |
169 | 174 | <input type="hidden" id="id_draft" name="id_draft" value="', empty($context['id_draft']) ? 0 : $context['id_draft'], '">'; |
175 | + } |
|
170 | 176 | |
171 | - if ($context['show_spellchecking']) |
|
172 | - echo ' |
|
177 | + if ($context['show_spellchecking']) { |
|
178 | + echo ' |
|
173 | 179 | <input type="button" value="', $txt['spell_check'], '" tabindex="', --$tempTab, '" onclick="oEditorHandle_', $editor_id, '.spellCheckStart();" class="button_submit">'; |
180 | + } |
|
174 | 181 | |
175 | - if ($editor_context['preview_type']) |
|
176 | - echo ' |
|
182 | + if ($editor_context['preview_type']) { |
|
183 | + echo ' |
|
177 | 184 | <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 event.ctrlKey || previewPost();' : 'return submitThisOnce(this);', '" accesskey="p" class="button_submit">'; |
185 | + } |
|
178 | 186 | |
179 | 187 | |
180 | 188 | echo ' |
181 | 189 | <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_submit">'; |
182 | 190 | |
183 | 191 | // Load in the PM autosaver if it's enabled |
184 | - if (!empty($context['drafts_pm_save']) && !empty($context['drafts_autosave'])) |
|
185 | - echo ' |
|
192 | + if (!empty($context['drafts_pm_save']) && !empty($context['drafts_autosave'])) { |
|
193 | + echo ' |
|
186 | 194 | <span class="righttext padding" style="display: block"> |
187 | 195 | <span id="throbber" style="display:none"><img src="' . $settings['images_url'] . '/loading_sm.gif" alt="" class="centericon"> </span> |
188 | 196 | <span id="draft_lastautosave" ></span> |
@@ -200,10 +208,11 @@ discard block |
||
200 | 208 | iFreq: ', (empty($modSettings['drafts_autosave_frequency']) ? 60000 : $modSettings['drafts_autosave_frequency'] * 1000), ' |
201 | 209 | }); |
202 | 210 | </script>'; |
211 | + } |
|
203 | 212 | |
204 | 213 | // Start an instance of the auto saver if its enabled |
205 | - if (!empty($context['drafts_save']) && !empty($context['drafts_autosave'])) |
|
206 | - echo ' |
|
214 | + if (!empty($context['drafts_save']) && !empty($context['drafts_autosave'])) { |
|
215 | + echo ' |
|
207 | 216 | <span class="righttext padding" style="display: block"> |
208 | 217 | <span id="throbber" style="display:none"><img src="' . $settings['images_url'] . '/loading_sm.gif" alt="" class="centericon"> </span> |
209 | 218 | <span id="draft_lastautosave" ></span> |
@@ -220,7 +229,8 @@ discard block |
||
220 | 229 | iFreq: ', $context['drafts_autosave_frequency'], ' |
221 | 230 | }); |
222 | 231 | </script>'; |
223 | -} |
|
232 | + } |
|
233 | + } |
|
224 | 234 | |
225 | 235 | /** |
226 | 236 | * This template displays a verification form |
@@ -237,51 +247,57 @@ discard block |
||
237 | 247 | $verify_context = &$context['controls']['verification'][$verify_id]; |
238 | 248 | |
239 | 249 | // Keep track of where we are. |
240 | - if (empty($verify_context['tracking']) || $reset) |
|
241 | - $verify_context['tracking'] = 0; |
|
250 | + if (empty($verify_context['tracking']) || $reset) { |
|
251 | + $verify_context['tracking'] = 0; |
|
252 | + } |
|
242 | 253 | |
243 | 254 | // How many items are there to display in total. |
244 | 255 | $total_items = count($verify_context['questions']) + ($verify_context['show_visual'] || $verify_context['can_recaptcha'] ? 1 : 0); |
245 | 256 | |
246 | 257 | // If we've gone too far, stop. |
247 | - if ($verify_context['tracking'] > $total_items) |
|
248 | - return false; |
|
258 | + if ($verify_context['tracking'] > $total_items) { |
|
259 | + return false; |
|
260 | + } |
|
249 | 261 | |
250 | 262 | // Loop through each item to show them. |
251 | 263 | for ($i = 0; $i < $total_items; $i++) |
252 | 264 | { |
253 | 265 | // If we're after a single item only show it if we're in the right place. |
254 | - if ($display_type == 'single' && $verify_context['tracking'] != $i) |
|
255 | - continue; |
|
266 | + if ($display_type == 'single' && $verify_context['tracking'] != $i) { |
|
267 | + continue; |
|
268 | + } |
|
256 | 269 | |
257 | - if ($display_type != 'single') |
|
258 | - echo ' |
|
270 | + if ($display_type != 'single') { |
|
271 | + echo ' |
|
259 | 272 | <div id="verification_control_', $i, '" class="verification_control">'; |
273 | + } |
|
260 | 274 | |
261 | 275 | // Display empty field, but only if we have one, and it's the first time. |
262 | - if ($verify_context['empty_field'] && empty($i)) |
|
263 | - echo ' |
|
276 | + if ($verify_context['empty_field'] && empty($i)) { |
|
277 | + echo ' |
|
264 | 278 | <div class="smalltext vv_special"> |
265 | 279 | ', $txt['visual_verification_hidden'], ': |
266 | 280 | <input type="text" name="', $_SESSION[$verify_id . '_vv']['empty_field'], '" autocomplete="off" size="30" value=""> |
267 | 281 | </div>'; |
282 | + } |
|
268 | 283 | |
269 | 284 | // Do the actual stuff |
270 | 285 | if ($i == 0 && ($verify_context['show_visual'] || $verify_context['can_recaptcha'])) |
271 | 286 | { |
272 | 287 | if ($verify_context['show_visual']) |
273 | 288 | { |
274 | - if ($context['use_graphic_library']) |
|
275 | - echo ' |
|
289 | + if ($context['use_graphic_library']) { |
|
290 | + echo ' |
|
276 | 291 | <img src="', $verify_context['image_href'], '" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '">'; |
277 | - else |
|
278 | - echo ' |
|
292 | + } else { |
|
293 | + echo ' |
|
279 | 294 | <img src="', $verify_context['image_href'], ';letter=1" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_1"> |
280 | 295 | <img src="', $verify_context['image_href'], ';letter=2" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_2"> |
281 | 296 | <img src="', $verify_context['image_href'], ';letter=3" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_3"> |
282 | 297 | <img src="', $verify_context['image_href'], ';letter=4" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_4"> |
283 | 298 | <img src="', $verify_context['image_href'], ';letter=5" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_5"> |
284 | 299 | <img src="', $verify_context['image_href'], ';letter=6" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_6">'; |
300 | + } |
|
285 | 301 | |
286 | 302 | echo ' |
287 | 303 | <div class="smalltext" style="margin: 4px 0 8px 0;"> |
@@ -297,8 +313,7 @@ discard block |
||
297 | 313 | <div class="g-recaptcha centertext" data-sitekey="' . $verify_context['recaptcha_site_key'] . '" data-theme="' . $verify_context['recaptcha_theme'] . '"></div><br> |
298 | 314 | <script type="text/javascript" src="https://www.google.com/recaptcha/api.js"></script>'; |
299 | 315 | } |
300 | - } |
|
301 | - else |
|
316 | + } else |
|
302 | 317 | { |
303 | 318 | // Where in the question array is this question? |
304 | 319 | $qIndex = $verify_context['show_visual'] ? $i - 1 : $i; |
@@ -310,21 +325,24 @@ discard block |
||
310 | 325 | </div>'; |
311 | 326 | } |
312 | 327 | |
313 | - if ($display_type != 'single') |
|
314 | - echo ' |
|
328 | + if ($display_type != 'single') { |
|
329 | + echo ' |
|
315 | 330 | </div>'; |
331 | + } |
|
316 | 332 | |
317 | 333 | // If we were displaying just one and we did it, break. |
318 | - if ($display_type == 'single' && $verify_context['tracking'] == $i) |
|
319 | - break; |
|
334 | + if ($display_type == 'single' && $verify_context['tracking'] == $i) { |
|
335 | + break; |
|
336 | + } |
|
320 | 337 | } |
321 | 338 | |
322 | 339 | // Assume we found something, always, |
323 | 340 | $verify_context['tracking']++; |
324 | 341 | |
325 | 342 | // Tell something displaying piecemeal to keep going. |
326 | - if ($display_type == 'single') |
|
327 | - return true; |
|
328 | -} |
|
343 | + if ($display_type == 'single') { |
|
344 | + return true; |
|
345 | + } |
|
346 | + } |
|
329 | 347 | |
330 | 348 | ?> |
331 | 349 | \ No newline at end of file |