@@ -44,7 +44,7 @@ |
||
44 | 44 | * @param \phpbb\controller\helper $helper Helper object |
45 | 45 | * @param \phpbb\user $user User object |
46 | 46 | * @param \blitze\content\services\types $content_types Content types object |
47 | - */ |
|
47 | + */ |
|
48 | 48 | public function __construct(\phpbb\auth\auth $auth, \phpbb\content_visibility $content_visibility, \phpbb\db\driver\driver_interface $db, \phpbb\controller\helper $helper, \phpbb\user $user, \blitze\content\services\types $content_types, $phpbb_root_path, $php_ext) |
49 | 49 | { |
50 | 50 | $this->auth = $auth; |
@@ -94,8 +94,8 @@ |
||
94 | 94 | 'FROM' => array( |
95 | 95 | TOPICS_TABLE => 't', |
96 | 96 | ), |
97 | - 'WHERE' => 't.forum_id = ' . (int) $settings['forum_id'] . ' |
|
98 | - AND t.topic_time <= ' . time() . ' |
|
97 | + 'WHERE' => 't.forum_id = '.(int) $settings['forum_id'].' |
|
98 | + AND t.topic_time <= ' . time().' |
|
99 | 99 | AND ' . $this->content_visibility->get_global_visibility_sql('topic', array_keys($this->auth->acl_getf('!f_read', true)), 't.'), |
100 | 100 | 'GROUP_BY' => 'year, month', |
101 | 101 | 'ORDER_BY' => 'year DESC', |
@@ -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 |
@@ -36,8 +36,8 @@ |
||
36 | 36 | */ |
37 | 37 | public function create($type) |
38 | 38 | { |
39 | - $mapper_class = 'blitze\\content\\model\\mapper\\' . $type; |
|
40 | - $collection = 'blitze\\content\\model\\collections\\' . $type; |
|
39 | + $mapper_class = 'blitze\\content\\model\\mapper\\'.$type; |
|
40 | + $collection = 'blitze\\content\\model\\collections\\'.$type; |
|
41 | 41 | |
42 | 42 | return new $mapper_class($this->db, new $collection, $this, $this->mapper_tables[$type]); |
43 | 43 | } |
@@ -92,7 +92,7 @@ |
||
92 | 92 | */ |
93 | 93 | public function add($name, $type, array $field_data, $forum_id = 0, $topic_id = 0) |
94 | 94 | { |
95 | - $field_data += array('field_id' => 'field-' . $name); |
|
95 | + $field_data += array('field_id' => 'field-'.$name); |
|
96 | 96 | $field_data += $this->get_default_field_data(); |
97 | 97 | |
98 | 98 | if ($this->fields_factory->exists($type)) |
@@ -197,8 +197,7 @@ discard block |
||
197 | 197 | if ($previewing || empty($row['field_props']['is_db_field'])) |
198 | 198 | { |
199 | 199 | $fields_data[$field] = $value; |
200 | - } |
|
201 | - else |
|
200 | + } else |
|
202 | 201 | { |
203 | 202 | $this->db_fields[$field] = $value; |
204 | 203 | } |
@@ -238,14 +237,12 @@ discard block |
||
238 | 237 | if (!empty($field_value)) |
239 | 238 | { |
240 | 239 | $this->errors[] = $obj->validate_field($row); |
241 | - } |
|
242 | - else if ($row['field_required']) |
|
240 | + } else if ($row['field_required']) |
|
243 | 241 | { |
244 | 242 | if (!$row['field_mod_only'] || $cp_class === 'mcp') |
245 | 243 | { |
246 | 244 | $this->errors[] = $this->language->lang_array('FIELD_REQUIRED', array($row['field_label'])); |
247 | - } |
|
248 | - else |
|
245 | + } else |
|
249 | 246 | { |
250 | 247 | $req_mod_input = true; |
251 | 248 | } |
@@ -34,7 +34,7 @@ |
||
34 | 34 | */ |
35 | 35 | public function create($mode, $action) |
36 | 36 | { |
37 | - $service_name = 'blitze.content.actions.' . $mode . '.' . $action; |
|
37 | + $service_name = 'blitze.content.actions.'.$mode.'.'.$action; |
|
38 | 38 | if (!$this->phpbb_container->has($service_name)) |
39 | 39 | { |
40 | 40 | throw new \blitze\sitemaker\exception\out_of_bounds(array($action, 'INVALID_REQUEST')); |
@@ -65,14 +65,14 @@ |
||
65 | 65 | $entity->set_allow_comments(false); |
66 | 66 | |
67 | 67 | $overwrite = array( |
68 | - 'TOPIC_URL' => $u_action . '&do=view&type=' . $type . '&t=' . $topic_id, |
|
68 | + 'TOPIC_URL' => $u_action.'&do=view&type='.$type.'&t='.$topic_id, |
|
69 | 69 | 'U_INFO' => '', |
70 | 70 | ); |
71 | 71 | |
72 | 72 | if ($mode === 'mcp') |
73 | 73 | { |
74 | 74 | $redirect_url = urlencode(str_replace('&', '&', $u_action)); |
75 | - $overwrite['U_DELETE'] = append_sid("{$this->phpbb_root_path}mcp.$this->php_ext", 'quickmod=1&action=delete_topic&t=' . $topic_id . '&redirect=' . $redirect_url); |
|
75 | + $overwrite['U_DELETE'] = append_sid("{$this->phpbb_root_path}mcp.$this->php_ext", 'quickmod=1&action=delete_topic&t='.$topic_id.'&redirect='.$redirect_url); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | $update_count = array(); |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | { |
89 | 89 | $copy_params = $this->params; |
90 | 90 | unset($copy_params['type']); |
91 | - $view_url = $u_action . http_build_query($copy_params); |
|
91 | + $view_url = $u_action.http_build_query($copy_params); |
|
92 | 92 | |
93 | 93 | $this->template->assign_block_vars('content', array( |
94 | 94 | 'TITLE' => $this->language->lang('TOPIC_ALL'), |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | 'TITLE' => $entity->get_content_langname(), |
105 | 105 | 'COLOUR' => $entity->get_content_colour(), |
106 | 106 | 'S_SELECTED' => ($type === $content_name) ? true : false, |
107 | - 'U_VIEW' => $view_url . '&type=' . $content_name |
|
107 | + 'U_VIEW' => $view_url.'&type='.$content_name |
|
108 | 108 | )); |
109 | 109 | } |
110 | 110 | } |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | { |
135 | 135 | $copy_params = $this->params; |
136 | 136 | unset($copy_params['status']); |
137 | - $view_url = $u_action . http_build_query($copy_params); |
|
137 | + $view_url = $u_action.http_build_query($copy_params); |
|
138 | 138 | |
139 | 139 | $this->template->assign_block_vars('status', array( |
140 | 140 | 'TITLE' => $this->language->lang('TOPIC_ALL'), |
@@ -146,9 +146,9 @@ discard block |
||
146 | 146 | foreach ($topic_status_ary as $status) |
147 | 147 | { |
148 | 148 | $this->template->assign_block_vars('status', array( |
149 | - 'TITLE' => $this->language->lang('TOPIC_' . strtoupper($status)), |
|
149 | + 'TITLE' => $this->language->lang('TOPIC_'.strtoupper($status)), |
|
150 | 150 | 'S_SELECTED' => ($status === $topic_status) ? true : false, |
151 | - 'U_VIEW' => $view_url . '&status=' . $status |
|
151 | + 'U_VIEW' => $view_url.'&status='.$status |
|
152 | 152 | )); |
153 | 153 | } |
154 | 154 | } |
@@ -163,18 +163,18 @@ discard block |
||
163 | 163 | switch ($topic_status) |
164 | 164 | { |
165 | 165 | case 'scheduled': |
166 | - $sql_where_array[] = 't.topic_time > ' . time(); |
|
166 | + $sql_where_array[] = 't.topic_time > '.time(); |
|
167 | 167 | break; |
168 | 168 | case 'unapproved': |
169 | 169 | case 'published': |
170 | 170 | case 'deleted': |
171 | - $sql_where_array[] = 't.topic_visibility = ' . array_search($topic_status, $this->filter_topic_status_ary); |
|
171 | + $sql_where_array[] = 't.topic_visibility = '.array_search($topic_status, $this->filter_topic_status_ary); |
|
172 | 172 | break; |
173 | 173 | case 'recommended': |
174 | 174 | case 'featured': |
175 | 175 | case 'must_read': |
176 | - $sql_where_array[] = 't.topic_type = ' . array_search($topic_status, $this->filter_topic_types_ary); |
|
177 | - $sql_where_array[] = 't.topic_visibility = ' . ITEM_APPROVED; |
|
176 | + $sql_where_array[] = 't.topic_type = '.array_search($topic_status, $this->filter_topic_types_ary); |
|
177 | + $sql_where_array[] = 't.topic_visibility = '.ITEM_APPROVED; |
|
178 | 178 | break; |
179 | 179 | } |
180 | 180 | } |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | if ($keyword = $this->request->variable('keyword', '', true)) |
189 | 189 | { |
190 | 190 | $this->params['keyword'] = $keyword; |
191 | - $sql_where_array[] = 't.topic_title ' . $this->db->sql_like_expression($this->db->get_any_char() . $keyword . $this->db->get_any_char()); |
|
191 | + $sql_where_array[] = 't.topic_title '.$this->db->sql_like_expression($this->db->get_any_char().$keyword.$this->db->get_any_char()); |
|
192 | 192 | } |
193 | 193 | } |
194 | 194 | } |
@@ -47,7 +47,7 @@ |
||
47 | 47 | * @param \blitze\sitemaker\model\mapper_factory $sitemaker_mapper_factory Sitemaker Mapper factory object |
48 | 48 | * @param bool $auto_refresh Used during testing |
49 | 49 | * @param bool $trigger_error Used during testing |
50 | - */ |
|
50 | + */ |
|
51 | 51 | public function __construct(\phpbb\cache\driver\driver_interface $cache, \phpbb\language\language $language, \phpbb\request\request_interface $request, \blitze\content\services\types $content_types, \blitze\sitemaker\services\forum\manager $forum_manager, \blitze\content\model\mapper_factory $content_mapper_factory, \blitze\sitemaker\model\mapper_factory $sitemaker_mapper_factory, $auto_refresh = true, $trigger_error = true) |
52 | 52 | { |
53 | 53 | $this->cache = $cache; |