@@ -84,8 +84,7 @@ |
||
84 | 84 | if ($trigger_error) |
85 | 85 | { |
86 | 86 | throw new \blitze\sitemaker\exception\out_of_bounds($type); |
87 | - } |
|
88 | - else |
|
87 | + } else |
|
89 | 88 | { |
90 | 89 | return false; |
91 | 90 | } |
@@ -134,12 +134,10 @@ |
||
134 | 134 | if ($this->is_too_short($data, $length)) |
135 | 135 | { |
136 | 136 | return $this->language->lang('FIELD_TOO_SHORT', $data['field_label'], $data['field_minlength']); |
137 | - } |
|
138 | - else if ($this->is_too_long($data, $length)) |
|
137 | + } else if ($this->is_too_long($data, $length)) |
|
139 | 138 | { |
140 | 139 | return $this->language->lang('FIELD_TOO_LONG', $data['field_label'], $data['field_maxlength']); |
141 | - } |
|
142 | - else |
|
140 | + } else |
|
143 | 141 | { |
144 | 142 | return $this->language->lang('FIELD_INVALID', $data['field_label']); |
145 | 143 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $this->ptemplate->assign_vars($data); |
70 | 70 | |
71 | 71 | $field = $this->get_name(); |
72 | - return $this->ptemplate->render_view('blitze/content', "fields/$field.html", $field . '_field'); |
|
72 | + return $this->ptemplate->render_view('blitze/content', "fields/$field.html", $field.'_field'); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | */ |
86 | 86 | public function get_langname() |
87 | 87 | { |
88 | - return strtoupper('FORM_FIELD_' . $this->get_name()); |
|
88 | + return strtoupper('FORM_FIELD_'.$this->get_name()); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | /** |
@@ -127,8 +127,7 @@ |
||
127 | 127 | { |
128 | 128 | $data = $this->blocks_data[$id]; |
129 | 129 | $column_name = 'block_tpl'; |
130 | - } |
|
131 | - else |
|
130 | + } else |
|
132 | 131 | { |
133 | 132 | $data = $this->content_types[$id]; |
134 | 133 | $column_name = $view . '_tpl'; |
@@ -131,7 +131,7 @@ |
||
131 | 131 | else |
132 | 132 | { |
133 | 133 | $data = $this->content_types[$id]; |
134 | - $column_name = $view . '_tpl'; |
|
134 | + $column_name = $view.'_tpl'; |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | $return = array( |
@@ -70,8 +70,7 @@ discard block |
||
70 | 70 | { |
71 | 71 | $forum_ids = $this->get_selected_forum_ids($topic_ids); |
72 | 72 | $this->{$action}($topic_ids, $forum_ids); |
73 | - } |
|
74 | - else |
|
73 | + } else |
|
75 | 74 | { |
76 | 75 | $message = $this->language->lang('INVALID_REQUEST', $action); |
77 | 76 | trigger_error($message . '<br /><br />' . $this->language->lang('RETURN_PAGE', '<a href="' . $u_action . '">', '</a>')); |
@@ -113,8 +112,7 @@ discard block |
||
113 | 112 | { |
114 | 113 | $this->approve($topic_ids, $forum_ids, false); |
115 | 114 | \mcp_queue::disapprove_posts($post_id_list, '-blitze-content-mcp-content_module', 'content'); |
116 | - } |
|
117 | - else |
|
115 | + } else |
|
118 | 116 | { |
119 | 117 | trigger_error('NO_POST_SELECTED'); |
120 | 118 | } |
@@ -73,8 +73,8 @@ discard block |
||
73 | 73 | } |
74 | 74 | else |
75 | 75 | { |
76 | - $message = $this->language->lang('INVALID_REQUEST', $action); |
|
77 | - trigger_error($message . '<br /><br />' . $this->language->lang('RETURN_PAGE', '<a href="' . $u_action . '">', '</a>')); |
|
76 | + $message = $this->language->lang('INVALID_REQUEST', $action); |
|
77 | + trigger_error($message.'<br /><br />'.$this->language->lang('RETURN_PAGE', '<a href="'.$u_action.'">', '</a>')); |
|
78 | 78 | } |
79 | 79 | } |
80 | 80 | |
@@ -86,8 +86,8 @@ discard block |
||
86 | 86 | */ |
87 | 87 | protected function approve(array $topic_ids, array $forum_ids, $execute = true) |
88 | 88 | { |
89 | - include($this->phpbb_root_path . 'includes/mcp/mcp_queue.' . $this->php_ext); |
|
90 | - include($this->phpbb_root_path . 'includes/functions_messenger.' . $this->php_ext); |
|
89 | + include($this->phpbb_root_path.'includes/mcp/mcp_queue.'.$this->php_ext); |
|
90 | + include($this->phpbb_root_path.'includes/functions_messenger.'.$this->php_ext); |
|
91 | 91 | |
92 | 92 | if (!(sizeof(array_intersect_key($forum_ids, $this->auth->acl_getf('m_approve', true))))) |
93 | 93 | { |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | */ |
150 | 150 | protected function resync(array $topic_ids) |
151 | 151 | { |
152 | - include($this->phpbb_root_path . 'includes/mcp/mcp_forum.' . $this->php_ext); |
|
152 | + include($this->phpbb_root_path.'includes/mcp/mcp_forum.'.$this->php_ext); |
|
153 | 153 | |
154 | 154 | mcp_resync_topics($topic_ids); |
155 | 155 | } |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | } |
230 | 230 | |
231 | 231 | $sql = 'SELECT forum_id |
232 | - FROM ' . TOPICS_TABLE . ' |
|
232 | + FROM ' . TOPICS_TABLE.' |
|
233 | 233 | WHERE ' . $this->db->sql_in_set('topic_id', $topic_ids); |
234 | 234 | $result = $this->db->sql_query($sql); |
235 | 235 | |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | } |
258 | 258 | |
259 | 259 | $sql = 'SELECT post_id |
260 | - FROM ' . POSTS_TABLE . ' |
|
260 | + FROM ' . POSTS_TABLE.' |
|
261 | 261 | WHERE ' . $this->db->sql_in_set('topic_id', $topic_ids); |
262 | 262 | $result = $this->db->sql_query($sql); |
263 | 263 |
@@ -272,16 +272,13 @@ |
||
272 | 272 | if ($topic_deleted) |
273 | 273 | { |
274 | 274 | $topic_status = 'deleted'; |
275 | - } |
|
276 | - else if ($topic_unapproved) |
|
275 | + } else if ($topic_unapproved) |
|
277 | 276 | { |
278 | 277 | $topic_status = 'unapproved'; |
279 | - } |
|
280 | - else if ($row['topic_time'] > time()) |
|
278 | + } else if ($row['topic_time'] > time()) |
|
281 | 279 | { |
282 | 280 | $topic_status = 'scheduled'; |
283 | - } |
|
284 | - else |
|
281 | + } else |
|
285 | 282 | { |
286 | 283 | $topic_status = $this->filter_topic_types_ary[$row['topic_type']]; |
287 | 284 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | */ |
91 | 91 | public function execute($u_action, $mode = '') |
92 | 92 | { |
93 | - include($this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext); |
|
93 | + include($this->phpbb_root_path.'includes/functions_display.'.$this->php_ext); |
|
94 | 94 | |
95 | 95 | $this->language->add_lang('viewforum'); |
96 | 96 | $this->language->add_lang('manager', 'blitze/content'); |
@@ -106,8 +106,8 @@ discard block |
||
106 | 106 | $filter_topic_status = $this->apply_status_filter($sql_where_array); |
107 | 107 | $filter_content_type = $this->apply_content_type_filter(); |
108 | 108 | |
109 | - $callable = 'init_' . $mode . '_mode'; |
|
110 | - $this->base_url = $u_action . (sizeof($this->params) ? '&' : ''); |
|
109 | + $callable = 'init_'.$mode.'_mode'; |
|
110 | + $this->base_url = $u_action.(sizeof($this->params) ? '&' : ''); |
|
111 | 111 | $this->$callable($content_types, $sql_where_array); |
112 | 112 | |
113 | 113 | $this->forum->query(true, false) |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $topic_tracking_info = $this->forum->get_topic_tracking_info(); |
139 | 139 | |
140 | 140 | $topics_data = array_values($topics_data); |
141 | - $base_url = $u_action . http_build_query($this->params); |
|
141 | + $base_url = $u_action.http_build_query($this->params); |
|
142 | 142 | |
143 | 143 | for ($i = 0, $size = sizeof($topics_data); $i < $size; $i++) |
144 | 144 | { |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | { |
173 | 173 | return array( |
174 | 174 | 'ATTACH_ICON_IMG' => $this->get_attachment_icon($row), |
175 | - 'U_REVIEW_TOPIC' => $u_action . "&do=view&type=$content_type&t=" . $row['topic_id'], |
|
175 | + 'U_REVIEW_TOPIC' => $u_action."&do=view&type=$content_type&t=".$row['topic_id'], |
|
176 | 176 | 'U_DELETE' => $this->get_delete_url($mode, $u_action, $row, $post_row), |
177 | 177 | ); |
178 | 178 | } |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | 'S_CAN_MAKE_NORMAL' => ($s_can_make_sticky || $s_can_make_announce), |
199 | 199 | 'S_CAN_MAKE_STICKY' => $s_can_make_sticky, |
200 | 200 | 'S_CAN_MAKE_ANNOUNCE' => $s_can_make_announce, |
201 | - 'U_MCP_ACTION' => $this->base_url . '&do=moderate&redirect=' . $this->get_redirect_url($this->base_url), |
|
201 | + 'U_MCP_ACTION' => $this->base_url.'&do=moderate&redirect='.$this->get_redirect_url($this->base_url), |
|
202 | 202 | )); |
203 | 203 | } |
204 | 204 | |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | */ |
209 | 209 | protected function init_ucp_mode(array $content_types, array &$sql_where_array) |
210 | 210 | { |
211 | - $sql_where_array[] = 't.topic_poster = ' . (int) $this->user->data['user_id']; |
|
211 | + $sql_where_array[] = 't.topic_poster = '.(int) $this->user->data['user_id']; |
|
212 | 212 | |
213 | 213 | // list all content types that the user can post in |
214 | 214 | $postable_forums = array_intersect_key($this->content_forums, $this->auth->acl_getf('f_post', true)); |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | $this->template->assign_block_vars('postable', array( |
221 | 221 | 'TYPE' => $entity->get_content_langname(), |
222 | 222 | 'COLOUR' => $entity->get_content_colour(), |
223 | - 'U_POST' => append_sid("{$this->phpbb_root_path}posting." . $this->php_ext, 'mode=post&f=' . $entity->get_forum_id()), |
|
223 | + 'U_POST' => append_sid("{$this->phpbb_root_path}posting.".$this->php_ext, 'mode=post&f='.$entity->get_forum_id()), |
|
224 | 224 | )); |
225 | 225 | } |
226 | 226 | } |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | 'CONTENT_TYPE' => $entity->get_content_langname(), |
239 | 239 | 'CONTENT_TYPE_COLOR' => $entity->get_content_colour(), |
240 | 240 | 'S_COMMENTS' => $entity->get_allow_comments(), |
241 | - 'U_CONTENT_TYPE' => $base_url . "&type=$type", |
|
241 | + 'U_CONTENT_TYPE' => $base_url."&type=$type", |
|
242 | 242 | ); |
243 | 243 | } |
244 | 244 | |
@@ -288,8 +288,8 @@ discard block |
||
288 | 288 | } |
289 | 289 | |
290 | 290 | return array( |
291 | - 'TOPIC_STATUS' => $this->language->lang('TOPIC_' . strtoupper($topic_status)), |
|
292 | - 'U_TOPIC_STATUS' => $base_url . "&status=$topic_status", |
|
291 | + 'TOPIC_STATUS' => $this->language->lang('TOPIC_'.strtoupper($topic_status)), |
|
292 | + 'U_TOPIC_STATUS' => $base_url."&status=$topic_status", |
|
293 | 293 | ); |
294 | 294 | } |
295 | 295 | |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | if ($mode === 'mcp') |
317 | 317 | { |
318 | 318 | $u_mcp_queue = $this->get_mcp_queue_url($topic_unapproved, $posts_unapproved, $topic_id); |
319 | - $u_mcp_queue = (!$u_mcp_queue && $topic_deleted) ? append_sid("{$this->phpbb_root_path}mcp.$this->php_ext", 'i=queue&mode=deleted_topics&t=' . $topic_id, true, $this->user->session_id) : $u_mcp_queue; |
|
319 | + $u_mcp_queue = (!$u_mcp_queue && $topic_deleted) ? append_sid("{$this->phpbb_root_path}mcp.$this->php_ext", 'i=queue&mode=deleted_topics&t='.$topic_id, true, $this->user->session_id) : $u_mcp_queue; |
|
320 | 320 | } |
321 | 321 | |
322 | 322 | return array( |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | */ |
333 | 333 | protected function get_mcp_queue_url($topic_unapproved, $posts_unapproved, $topic_id) |
334 | 334 | { |
335 | - return ($topic_unapproved || $posts_unapproved) ? append_sid("{$this->phpbb_root_path}mcp.$this->php_ext", 'i=queue&mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&t=$topic_id", true, $this->user->session_id) : ''; |
|
335 | + return ($topic_unapproved || $posts_unapproved) ? append_sid("{$this->phpbb_root_path}mcp.$this->php_ext", 'i=queue&mode='.(($topic_unapproved) ? 'approve_details' : 'unapproved_posts')."&t=$topic_id", true, $this->user->session_id) : ''; |
|
336 | 336 | } |
337 | 337 | |
338 | 338 | /** |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | if ($mode === 'mcp') |
350 | 350 | { |
351 | 351 | $redirect_url = $this->get_redirect_url($u_action); |
352 | - $u_delete = append_sid("{$this->phpbb_root_path}mcp.$this->php_ext", 'quickmod=1&action=delete_topic&t=' . $row['topic_id'] . '&redirect=' . $redirect_url, true, $this->user->session_id); |
|
352 | + $u_delete = append_sid("{$this->phpbb_root_path}mcp.$this->php_ext", 'quickmod=1&action=delete_topic&t='.$row['topic_id'].'&redirect='.$redirect_url, true, $this->user->session_id); |
|
353 | 353 | } |
354 | 354 | } |
355 | 355 | |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | */ |
363 | 363 | protected function get_redirect_url($base_url) |
364 | 364 | { |
365 | - $base_url .= (sizeof($this->params)) ? '&' . http_build_query($this->params) : ''; |
|
365 | + $base_url .= (sizeof($this->params)) ? '&'.http_build_query($this->params) : ''; |
|
366 | 366 | return urlencode(str_replace('&', '&', $base_url)); |
367 | 367 | } |
368 | 368 |
@@ -22,7 +22,7 @@ |
||
22 | 22 | * |
23 | 23 | * @param \phpbb\language\language $language Language object |
24 | 24 | * @param \blitze\content\services\action_handler $action_handler Handles actions |
25 | - */ |
|
25 | + */ |
|
26 | 26 | public function __construct(\phpbb\language\language $language, \blitze\content\services\action_handler $action_handler) |
27 | 27 | { |
28 | 28 | $this->language = $language; |
@@ -42,8 +42,7 @@ |
||
42 | 42 | { |
43 | 43 | $command = $this->action_handler->create('topic', $action); |
44 | 44 | $command->execute($base_url, 'ucp'); |
45 | - } |
|
46 | - catch (\blitze\sitemaker\exception\base $e) |
|
45 | + } catch (\blitze\sitemaker\exception\base $e) |
|
47 | 46 | { |
48 | 47 | $message = $e->get_message($this->language); |
49 | 48 | trigger_error($message . '<br /><br />' . $this->language->lang('RETURN_PAGE', '<a href="' . $base_url . '">', '</a>')); |
@@ -46,7 +46,7 @@ |
||
46 | 46 | catch (\blitze\sitemaker\exception\base $e) |
47 | 47 | { |
48 | 48 | $message = $e->get_message($this->language); |
49 | - trigger_error($message . '<br /><br />' . $this->language->lang('RETURN_PAGE', '<a href="' . $base_url . '">', '</a>')); |
|
49 | + trigger_error($message.'<br /><br />'.$this->language->lang('RETURN_PAGE', '<a href="'.$base_url.'">', '</a>')); |
|
50 | 50 | } |
51 | 51 | } |
52 | 52 | } |
@@ -42,8 +42,7 @@ |
||
42 | 42 | { |
43 | 43 | $command = $this->action_handler->create('topic', $action); |
44 | 44 | $command->execute($base_url, 'mcp'); |
45 | - } |
|
46 | - catch (\blitze\sitemaker\exception\base $e) |
|
45 | + } catch (\blitze\sitemaker\exception\base $e) |
|
47 | 46 | { |
48 | 47 | $message = $e->get_message($this->language); |
49 | 48 | trigger_error($message . '<br /><br />' . $this->language->lang('RETURN_PAGE', '<a href="' . $base_url . '">', '</a>')); |
@@ -22,7 +22,7 @@ |
||
22 | 22 | * |
23 | 23 | * @param \phpbb\language\language $language Language object |
24 | 24 | * @param \blitze\content\services\action_handler $action_handler Handles actions |
25 | - */ |
|
25 | + */ |
|
26 | 26 | public function __construct(\phpbb\language\language $language, \blitze\content\services\action_handler $action_handler) |
27 | 27 | { |
28 | 28 | $this->language = $language; |
@@ -46,7 +46,7 @@ |
||
46 | 46 | catch (\blitze\sitemaker\exception\base $e) |
47 | 47 | { |
48 | 48 | $message = $e->get_message($this->language); |
49 | - trigger_error($message . '<br /><br />' . $this->language->lang('RETURN_PAGE', '<a href="' . $base_url . '">', '</a>')); |
|
49 | + trigger_error($message.'<br /><br />'.$this->language->lang('RETURN_PAGE', '<a href="'.$base_url.'">', '</a>')); |
|
50 | 50 | } |
51 | 51 | } |
52 | 52 | } |
@@ -22,7 +22,7 @@ |
||
22 | 22 | * |
23 | 23 | * @param \phpbb\language\language $language Language object |
24 | 24 | * @param \blitze\content\services\action_handler $action_handler Handles actions |
25 | - */ |
|
25 | + */ |
|
26 | 26 | public function __construct(\phpbb\language\language $language, \blitze\content\services\action_handler $action_handler) |
27 | 27 | { |
28 | 28 | $this->language = $language; |
@@ -47,7 +47,7 @@ |
||
47 | 47 | catch (\blitze\sitemaker\exception\base $e) |
48 | 48 | { |
49 | 49 | $message = $e->get_message($this->language); |
50 | - trigger_error($this->language->lang($message) . adm_back_link($base_url), E_USER_WARNING); |
|
50 | + trigger_error($this->language->lang($message).adm_back_link($base_url), E_USER_WARNING); |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | } |
@@ -43,8 +43,7 @@ |
||
43 | 43 | { |
44 | 44 | $command = $this->action_handler->create('type', $action); |
45 | 45 | $command->execute($base_url, $type); |
46 | - } |
|
47 | - catch (\blitze\sitemaker\exception\base $e) |
|
46 | + } catch (\blitze\sitemaker\exception\base $e) |
|
48 | 47 | { |
49 | 48 | $message = $e->get_message($this->language); |
50 | 49 | trigger_error($this->language->lang($message) . adm_back_link($base_url), E_USER_WARNING); |
@@ -25,8 +25,8 @@ discard block |
||
25 | 25 | */ |
26 | 26 | protected function _find_sql(array $sql_where) |
27 | 27 | { |
28 | - return 'SELECT * FROM ' . $this->entity_table . |
|
29 | - ((sizeof($sql_where)) ? ' WHERE ' . join(' AND ', $sql_where) : '') . ' |
|
28 | + return 'SELECT * FROM '.$this->entity_table. |
|
29 | + ((sizeof($sql_where)) ? ' WHERE '.join(' AND ', $sql_where) : '').' |
|
30 | 30 | ORDER BY field_order ASC'; |
31 | 31 | } |
32 | 32 | |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public function get_max_field_id() |
37 | 37 | { |
38 | - $result = $this->db->sql_query('SELECT MAX(' . $this->entity_pkey . ') AS max_id FROM ' . $this->entity_table); |
|
38 | + $result = $this->db->sql_query('SELECT MAX('.$this->entity_pkey.') AS max_id FROM '.$this->entity_table); |
|
39 | 39 | $max_id = $this->db->sql_fetchfield('max_id'); |
40 | 40 | $this->db->sql_freeresult($result); |
41 | 41 |