@@ -168,8 +168,7 @@ discard block |
||
168 | 168 | { |
169 | 169 | $data = generate_text_for_edit($this->field_explain, $this->field_exp_uid, $this->field_exp_options); |
170 | 170 | return $data['text']; |
171 | - } |
|
172 | - else |
|
171 | + } else |
|
173 | 172 | { |
174 | 173 | $parse_flags = ($this->field_exp_bitfield ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES; |
175 | 174 | return generate_text_for_display($this->field_explain, $this->field_exp_uid, $this->field_exp_bitfield, $parse_flags); |
@@ -186,8 +185,7 @@ discard block |
||
186 | 185 | if (!is_array($props)) |
187 | 186 | { |
188 | 187 | $this->field_props = $props; |
189 | - } |
|
190 | - else if (sizeof($props)) |
|
188 | + } else if (sizeof($props)) |
|
191 | 189 | { |
192 | 190 | $this->field_props = json_encode($props); |
193 | 191 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | 'ITEMS_PER_PAGE' => 10, |
86 | 86 | 'TOPICS_PER_GROUP' => 4, |
87 | 87 | |
88 | - 'U_ACTION' => $u_action . "&do=save&type=$type", |
|
88 | + 'U_ACTION' => $u_action."&do=save&type=$type", |
|
89 | 89 | 'UA_AJAX_URL' => $this->controller_helper->route('blitze_content_field_settings', array(), false), |
90 | 90 | |
91 | 91 | 'S_TYPE_OPS' => $this->get_field_options(), |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | $options = ''; |
109 | 109 | foreach ($fields as $field => $object) |
110 | 110 | { |
111 | - $options .= '<option value="' . $field . '">' . $this->language->lang($object->get_langname()) . '</option>'; |
|
111 | + $options .= '<option value="'.$field.'">'.$this->language->lang($object->get_langname()).'</option>'; |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | return $options; |
@@ -55,7 +55,7 @@ |
||
55 | 55 | * @param \blitze\sitemaker\services\auto_lang $auto_lang Auto add lang file |
56 | 56 | * @param \blitze\content\services\form\fields_factory $fields_factory Fields factory object |
57 | 57 | * @param \blitze\content\services\views\views_factory $views_factory Views factory object |
58 | - */ |
|
58 | + */ |
|
59 | 59 | public function __construct(\phpbb\auth\auth $auth, \phpbb\controller\helper $controller_helper, \phpbb\event\dispatcher_interface $phpbb_dispatcher, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, \blitze\sitemaker\services\auto_lang $auto_lang, \blitze\content\services\form\fields_factory $fields_factory, \blitze\content\services\views\views_factory $views_factory) |
60 | 60 | { |
61 | 61 | $this->auth = $auth; |
@@ -94,7 +94,7 @@ |
||
94 | 94 | * @param int $topic_id |
95 | 95 | * @param string $mode |
96 | 96 | * @param bool $save_draft |
97 | - * @return string|false |
|
97 | + * @return string|boolean |
|
98 | 98 | */ |
99 | 99 | public function init($forum_id, $topic_id, $mode, $save_draft) |
100 | 100 | { |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | foreach ($fields_data as $field => $value) |
145 | 145 | { |
146 | 146 | $value = is_array($value) ? join("\n", $value) : $value; |
147 | - $message .= '[smcf=' . $field . ']' . $value . '[/smcf]'; |
|
147 | + $message .= '[smcf='.$field.']'.$value.'[/smcf]'; |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | return $message; |
@@ -196,13 +196,13 @@ discard block |
||
196 | 196 | $text = ''; |
197 | 197 | if ($entity = $this->types->get_type($content_type)) |
198 | 198 | { |
199 | - $fields_accessor = 'get_' . $view . '_fields'; |
|
200 | - $template_accessor = 'get_' . $view . '_tpl'; |
|
199 | + $fields_accessor = 'get_'.$view.'_fields'; |
|
200 | + $template_accessor = 'get_'.$view.'_tpl'; |
|
201 | 201 | |
202 | 202 | $this->fields->prepare_to_show($entity, array($post_data['topic_id']), $entity->$fields_accessor(), $entity->$template_accessor(), $view); |
203 | 203 | $content = $this->fields->build_content(array_change_key_case($post_data, CASE_UPPER)); |
204 | 204 | |
205 | - $text = $content['CUSTOM_DISPLAY'] ?: join('', $content['FIELDS']['all']); |
|
205 | + $text = $content['CUSTOM_DISPLAY'] ?: join('', $content['FIELDS']['all']); |
|
206 | 206 | } |
207 | 207 | return $text; |
208 | 208 | } |
@@ -397,8 +397,8 @@ discard block |
||
397 | 397 | } |
398 | 398 | else |
399 | 399 | { |
400 | - $options[ITEM_UNAPPROVED] = 'STATUS_DISAPPROVE'; |
|
401 | - $options[ITEM_APPROVED] = 'STATUS_APPROVE'; |
|
400 | + $options[ITEM_UNAPPROVED] = 'STATUS_DISAPPROVE'; |
|
401 | + $options[ITEM_APPROVED] = 'STATUS_APPROVE'; |
|
402 | 402 | } |
403 | 403 | |
404 | 404 | return $options; |
@@ -281,8 +281,7 @@ discard block |
||
281 | 281 | if (!$field_data['field_mod_only'] || $this->mode === 'mcp') |
282 | 282 | { |
283 | 283 | $this->form->add($field, $field_data['field_type'], $field_data, $topic_id); |
284 | - } |
|
285 | - else if (!empty($field_data['field_value'])) |
|
284 | + } else if (!empty($field_data['field_value'])) |
|
286 | 285 | { |
287 | 286 | $this->form->add($field, 'hidden', $field_data, $topic_id); |
288 | 287 | } |
@@ -329,8 +328,7 @@ discard block |
||
329 | 328 | { |
330 | 329 | $data['force_visibility'] = $visibility; |
331 | 330 | } |
332 | - } |
|
333 | - else if ($this->force_state()) |
|
331 | + } else if ($this->force_state()) |
|
334 | 332 | { |
335 | 333 | $data['force_visibility'] = ($mode == 'edit_first_post') ? ITEM_REAPPROVE : ITEM_UNAPPROVED; |
336 | 334 | } |
@@ -394,8 +392,7 @@ discard block |
||
394 | 392 | if ($visibility == ITEM_APPROVED) |
395 | 393 | { |
396 | 394 | $options[ITEM_REAPPROVE] = 'STATUS_REAPPROVE'; |
397 | - } |
|
398 | - else |
|
395 | + } else |
|
399 | 396 | { |
400 | 397 | $options[ITEM_UNAPPROVED] = 'STATUS_DISAPPROVE'; |
401 | 398 | $options[ITEM_APPROVED] = 'STATUS_APPROVE'; |
@@ -34,7 +34,7 @@ |
||
34 | 34 | * @param \phpbb\user $user User object |
35 | 35 | * @param string $phpbb_root_path Path to the phpbb includes directory. |
36 | 36 | * @param string $php_ext php file extension |
37 | - */ |
|
37 | + */ |
|
38 | 38 | public function __construct(\phpbb\auth\auth $auth, \phpbb\template\template $template, \phpbb\user $user, $phpbb_root_path, $php_ext) |
39 | 39 | { |
40 | 40 | $this->auth = $auth; |
@@ -124,7 +124,7 @@ |
||
124 | 124 | */ |
125 | 125 | protected function allow_topic_delete(array $topic_data) |
126 | 126 | { |
127 | - return ($this->auth->acl_get('m_delete', $topic_data['forum_id'])) || (($topic_data['topic_visibility'] != ITEM_DELETED) && $this->auth->acl_get('m_softdelete', $topic_data['forum_id'])); |
|
127 | + return ($this->auth->acl_get('m_delete', $topic_data['forum_id'])) || (($topic_data['topic_visibility'] != ITEM_DELETED) && $this->auth->acl_get('m_softdelete', $topic_data['forum_id'])); |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | /** |
@@ -22,7 +22,7 @@ |
||
22 | 22 | * |
23 | 23 | * @param \blitze\sitemaker\services\poll $poll Poll Object |
24 | 24 | * @param \blitze\sitemaker\services\template $ptemplate Sitemaker Template Object |
25 | - */ |
|
25 | + */ |
|
26 | 26 | public function __construct(\blitze\sitemaker\services\poll $poll, \blitze\sitemaker\services\template $ptemplate) |
27 | 27 | { |
28 | 28 | $this->poll = $poll; |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | ), |
69 | 69 | 'css' => array( |
70 | 70 | '@blitze_content/vendor/ion.rangeSlider/css/ion.rangeSlider.min.css', |
71 | - '@blitze_content/vendor/ion.rangeSlider/css/ion.rangeSlider.' . $data['field_props']['theme'] . '.min.css', |
|
71 | + '@blitze_content/vendor/ion.rangeSlider/css/ion.rangeSlider.'.$data['field_props']['theme'].'.min.css', |
|
72 | 72 | ) |
73 | 73 | )); |
74 | 74 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | array_walk($range, array($this, 'set_prefix'), $data['field_props']['prefix']); |
90 | 90 | } |
91 | 91 | |
92 | - return join($range, ' - ') . $data['field_props']['postfix']; |
|
92 | + return join($range, ' - ').$data['field_props']['postfix']; |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | /** |
@@ -129,6 +129,6 @@ discard block |
||
129 | 129 | */ |
130 | 130 | protected function set_prefix(&$item, $key, $prefix) |
131 | 131 | { |
132 | - $item = $prefix . $item; |
|
132 | + $item = $prefix.$item; |
|
133 | 133 | } |
134 | 134 | } |
@@ -36,7 +36,7 @@ |
||
36 | 36 | */ |
37 | 37 | public function display_field(array $data) |
38 | 38 | { |
39 | - return $data['field_value'] ? '<a href="tel:' . $data['field_value'] . '">' . preg_replace("/^1?(\d{3})(\d{3})(\d{4})$/", "$1-$2-$3", $data['field_value']) . '</a>' : ''; |
|
39 | + return $data['field_value'] ? '<a href="tel:'.$data['field_value'].'">'.preg_replace("/^1?(\d{3})(\d{3})(\d{4})$/", "$1-$2-$3", $data['field_value']).'</a>' : ''; |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
@@ -42,7 +42,7 @@ |
||
42 | 42 | * @param \phpbb\user $user User object |
43 | 43 | * @param string $root_path Path to the phpbb includes directory. |
44 | 44 | * @param string $php_ext php file extension |
45 | - */ |
|
45 | + */ |
|
46 | 46 | public function __construct(\phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, $root_path, $php_ext) |
47 | 47 | { |
48 | 48 | $this->auth = $auth; |
@@ -81,7 +81,7 @@ |
||
81 | 81 | 'L_QUICKREPLY' => $this->language->lang('NEW_COMMENT'), |
82 | 82 | 'U_QR_ACTION' => append_sid("{$this->phpbb_root_path}posting.{$this->php_ext}", "mode=reply&f={$topic_data['forum_id']}&t={$topic_data['topic_id']}"), |
83 | 83 | 'QR_HIDDEN_FIELDS' => build_hidden_fields($qr_hidden_fields), |
84 | - 'SUBJECT' => 'Re: ' . censor_text($topic_data['topic_title']), |
|
84 | + 'SUBJECT' => 'Re: '.censor_text($topic_data['topic_title']), |
|
85 | 85 | )); |
86 | 86 | } |
87 | 87 | } |
@@ -58,7 +58,7 @@ |
||
58 | 58 | * @param \blitze\content\services\topic $topic Topic object |
59 | 59 | * @param string $root_path Path to the phpbb directory. |
60 | 60 | * @param string $php_ext php file extension |
61 | - */ |
|
61 | + */ |
|
62 | 62 | public function __construct(\phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\content_visibility $content_visibility, \phpbb\db\driver\driver_interface $db, \phpbb\language\language $language, \phpbb\pagination $pagination, \phpbb\request\request_interface $request, \phpbb\template\template $template, \phpbb\template\context $template_context, \phpbb\user $user, \blitze\sitemaker\services\forum\data $forum, \blitze\content\services\topic $topic, $root_path, $php_ext) |
63 | 63 | { |
64 | 64 | parent::__construct($auth, $config, $language, $template, $user, $root_path, $php_ext); |
@@ -258,8 +258,7 @@ discard block |
||
258 | 258 | $prev_posts_count = $this->content_visibility->get_count('topic_posts', $topic_data, $topic_data['forum_id']) - 1; |
259 | 259 | } |
260 | 260 | return $prev_posts_count; |
261 | - } |
|
262 | - else |
|
261 | + } else |
|
263 | 262 | { |
264 | 263 | return $this->get_prev_posts_count($topic_data['forum_id'], $topic_data['topic_id'], $post_id, $sort_dir) - 1; |
265 | 264 | } |
@@ -290,8 +289,7 @@ discard block |
||
290 | 289 | if ($sort_dir == 'd') |
291 | 290 | { |
292 | 291 | $sql .= " AND (p.post_time > {$row['post_time']} OR (p.post_time = {$row['post_time']} AND p.post_id >= {$row['post_id']}))"; |
293 | - } |
|
294 | - else |
|
292 | + } else |
|
295 | 293 | { |
296 | 294 | $sql .= " AND (p.post_time < {$row['post_time']} OR (p.post_time = {$row['post_time']} AND p.post_id <= {$row['post_id']}))"; |
297 | 295 | } |
@@ -87,9 +87,9 @@ discard block |
||
87 | 87 | { |
88 | 88 | if ($topic_data['total_comments']) |
89 | 89 | { |
90 | - $view = $this->request->variable('view', ''); |
|
91 | - $start = $this->request->variable('start', 0); |
|
92 | - $post_id = $this->request->variable('p', 0); |
|
90 | + $view = $this->request->variable('view', ''); |
|
91 | + $start = $this->request->variable('start', 0); |
|
92 | + $post_id = $this->request->variable('p', 0); |
|
93 | 93 | |
94 | 94 | $this->find_unread($view, $topic_data); |
95 | 95 | |
@@ -104,10 +104,10 @@ discard block |
||
104 | 104 | ->build(); |
105 | 105 | $posts_data = $this->forum->get_post_data(false, array(), $this->config['posts_per_page'], $start, array( |
106 | 106 | 'WHERE' => array( |
107 | - 'p.topic_id = ' . (int) $topic_data['topic_id'], |
|
108 | - 'p.post_id <> ' . (int) $topic_data['topic_first_post_id'], |
|
107 | + 'p.topic_id = '.(int) $topic_data['topic_id'], |
|
108 | + 'p.post_id <> '.(int) $topic_data['topic_first_post_id'], |
|
109 | 109 | ), |
110 | - 'ORDER_BY' => $this->sort_by_sql[$sort_key] . ' ' . $this->sort_dir_sql[$sort_dir], |
|
110 | + 'ORDER_BY' => $this->sort_by_sql[$sort_key].' '.$this->sort_dir_sql[$sort_dir], |
|
111 | 111 | )); |
112 | 112 | |
113 | 113 | $topic_tracking_info = $this->forum->get_topic_tracking_info(); |
@@ -172,9 +172,9 @@ discard block |
||
172 | 172 | $topic_last_read = (isset($topic_tracking_info[$topic_id])) ? $topic_tracking_info[$topic_id] : 0; |
173 | 173 | |
174 | 174 | $sql = 'SELECT post_id, topic_id, forum_id |
175 | - FROM ' . POSTS_TABLE . " |
|
175 | + FROM ' . POSTS_TABLE." |
|
176 | 176 | WHERE topic_id = $topic_id |
177 | - AND " . $this->content_visibility->get_visibility_sql('post', $forum_id) . " |
|
177 | + AND ".$this->content_visibility->get_visibility_sql('post', $forum_id)." |
|
178 | 178 | AND post_time > $topic_last_read |
179 | 179 | AND forum_id = $forum_id |
180 | 180 | ORDER BY post_time ASC, post_id ASC"; |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | |
185 | 185 | if ($row) |
186 | 186 | { |
187 | - redirect(append_sid($topic_data['topic_url'], 'p=' . $row['post_id']) . '#p' . $row['post_id']); |
|
187 | + redirect(append_sid($topic_data['topic_url'], 'p='.$row['post_id']).'#p'.$row['post_id']); |
|
188 | 188 | } |
189 | 189 | } |
190 | 190 | } |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | $start = $this->pagination->validate_start($start, $this->config['posts_per_page'], $topic_data['total_comments']); |
212 | 212 | $this->pagination->generate_template_pagination($base_url, 'pagination', 'start', $topic_data['total_comments'], $this->config['posts_per_page'], $start); |
213 | 213 | |
214 | - $data =& $this->template_context->get_data_ref(); |
|
214 | + $data = & $this->template_context->get_data_ref(); |
|
215 | 215 | foreach ($data['pagination'] as &$row) |
216 | 216 | { |
217 | 217 | $row['PAGE_URL'] .= '#comments'; |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | protected function get_prev_posts_count($forum_id, $topic_id, $post_id, $sort_dir) |
274 | 274 | { |
275 | 275 | $sql = 'SELECT post_id, post_time, post_visibility |
276 | - FROM ' . POSTS_TABLE . " p |
|
276 | + FROM ' . POSTS_TABLE." p |
|
277 | 277 | WHERE p.topic_id = $topic_id |
278 | 278 | AND p.post_id = $post_id"; |
279 | 279 | $result = $this->db->sql_query($sql); |
@@ -281,9 +281,9 @@ discard block |
||
281 | 281 | $this->db->sql_freeresult($result); |
282 | 282 | |
283 | 283 | $sql = 'SELECT COUNT(p.post_id) AS prev_posts |
284 | - FROM ' . POSTS_TABLE . " p |
|
284 | + FROM ' . POSTS_TABLE." p |
|
285 | 285 | WHERE p.topic_id = $topic_id |
286 | - AND " . $this->content_visibility->get_visibility_sql('post', $forum_id, 'p.'); |
|
286 | + AND ".$this->content_visibility->get_visibility_sql('post', $forum_id, 'p.'); |
|
287 | 287 | |
288 | 288 | if ($sort_dir == 'd') |
289 | 289 | { |
@@ -310,11 +310,11 @@ discard block |
||
310 | 310 | */ |
311 | 311 | protected function set_sorting_options(&$sort_days, &$sort_key, &$sort_dir, &$u_sort_param) |
312 | 312 | { |
313 | - $default_sort_days = (!empty($this->user->data['user_post_show_days'])) ? $this->user->data['user_post_show_days'] : 0; |
|
313 | + $default_sort_days = (!empty($this->user->data['user_post_show_days'])) ? $this->user->data['user_post_show_days'] : 0; |
|
314 | 314 | $default_sort_key = (!empty($this->user->data['user_post_sortby_type'])) ? $this->user->data['user_post_sortby_type'] : 't'; |
315 | 315 | $default_sort_dir = (!empty($this->user->data['user_post_sortby_dir'])) ? $this->user->data['user_post_sortby_dir'] : 'a'; |
316 | 316 | |
317 | - $sort_days = $this->request->variable('st', $default_sort_days); |
|
317 | + $sort_days = $this->request->variable('st', $default_sort_days); |
|
318 | 318 | $sort_key = $this->request->variable('sk', $default_sort_key); |
319 | 319 | $sort_dir = $this->request->variable('sd', $default_sort_dir); |
320 | 320 | |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | */ |
377 | 377 | protected function get_post_display_lang(array $row, $topic_url) |
378 | 378 | { |
379 | - return ($row['hide_post']) ? $this->language->lang('POST_DISPLAY', '<a class="display_post" data-post-id="' . $row['post_id'] . '" href="' . append_sid($topic_url, "p={$row['post_id']}&view=show") . "#p{$row['post_id']}" . '">', '</a>') : ''; |
|
379 | + return ($row['hide_post']) ? $this->language->lang('POST_DISPLAY', '<a class="display_post" data-post-id="'.$row['post_id'].'" href="'.append_sid($topic_url, "p={$row['post_id']}&view=show")."#p{$row['post_id']}".'">', '</a>') : ''; |
|
380 | 380 | } |
381 | 381 | |
382 | 382 | /** |
@@ -386,6 +386,6 @@ discard block |
||
386 | 386 | */ |
387 | 387 | protected function set_form_action($topic_url, $start) |
388 | 388 | { |
389 | - $this->template->assign_var('S_TOPIC_ACTION', append_sid($topic_url, (($start == 0) ? '' : "start=$start")) . '#comments'); |
|
389 | + $this->template->assign_var('S_TOPIC_ACTION', append_sid($topic_url, (($start == 0) ? '' : "start=$start")).'#comments'); |
|
390 | 390 | } |
391 | 391 | } |