@@ -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')); |
@@ -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; |
@@ -28,7 +28,7 @@ |
||
28 | 28 | * @param \phpbb\language\language $language Language Object |
29 | 29 | * @param \phpbb\template\template $template Template object |
30 | 30 | * @param \blitze\content\services\types $content_types Content types object |
31 | - */ |
|
31 | + */ |
|
32 | 32 | public function __construct(\phpbb\language\language $language, \phpbb\template\template $template, \blitze\content\services\types $content_types) |
33 | 33 | { |
34 | 34 | $this->language = $language; |
@@ -30,7 +30,7 @@ |
||
30 | 30 | * @param \blitze\content\services\types $content_types Content types object |
31 | 31 | * @param \blitze\content\model\mapper_factory $mapper_factory Mapper factory object |
32 | 32 | * @param boolean $redirect Used for testing |
33 | - */ |
|
33 | + */ |
|
34 | 34 | public function __construct(\phpbb\cache\driver\driver_interface $cache, \blitze\content\services\types $content_types, \blitze\content\model\mapper_factory $mapper_factory, $redirect = true) |
35 | 35 | { |
36 | 36 | $this->cache = $cache; |
@@ -44,7 +44,7 @@ |
||
44 | 44 | * @param string $phpbb_root_path Path to the phpbb includes directory. |
45 | 45 | * @param string $relative_admin_path Relative admin root path |
46 | 46 | * @param string $php_ext php file extension |
47 | - */ |
|
47 | + */ |
|
48 | 48 | public function __construct(\phpbb\controller\helper $controller_helper, \phpbb\language\language $language, \phpbb\template\template $template, \blitze\content\services\types $content_types, $phpbb_root_path, $relative_admin_path, $php_ext) |
49 | 49 | { |
50 | 50 | $this->controller_helper = $controller_helper; |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $this->template = $template; |
53 | 53 | $this->content_types = $content_types; |
54 | 54 | $this->phpbb_root_path = $phpbb_root_path; |
55 | - $this->phpbb_admin_path = $this->phpbb_root_path . $relative_admin_path; |
|
55 | + $this->phpbb_admin_path = $this->phpbb_root_path.$relative_admin_path; |
|
56 | 56 | $this->php_ext = $php_ext; |
57 | 57 | } |
58 | 58 | |
@@ -76,19 +76,19 @@ discard block |
||
76 | 76 | |
77 | 77 | 'S_ENABLED' => $entity->get_content_enabled(), |
78 | 78 | |
79 | - 'U_DELETE' => $u_action . '&do=pre_delete&type=' . $type, |
|
80 | - 'U_EDIT' => $u_action . '&do=edit&type=' . $type, |
|
81 | - 'U_STATUS' => $u_action . '&do=toggle_status&type=' . $type, |
|
79 | + 'U_DELETE' => $u_action.'&do=pre_delete&type='.$type, |
|
80 | + 'U_EDIT' => $u_action.'&do=edit&type='.$type, |
|
81 | + 'U_STATUS' => $u_action.'&do=toggle_status&type='.$type, |
|
82 | 82 | 'U_VIEW' => $this->controller_helper->route('blitze_content_type', array('type' => $type)), |
83 | - 'U_POST' => append_sid("{$this->phpbb_root_path}posting." . $this->php_ext, "mode=post&f=$forum_id"), |
|
84 | - 'U_GROUP_PERMS' => append_sid("{$this->phpbb_admin_path}index." . $this->php_ext, "i=acp_permissions&mode=setting_group_global"), |
|
85 | - 'U_FORUM_PERMS' => append_sid("{$this->phpbb_admin_path}index." . $this->php_ext, "i=acp_permissions&mode=setting_forum_local&forum_id[]=$forum_id"), |
|
83 | + 'U_POST' => append_sid("{$this->phpbb_root_path}posting.".$this->php_ext, "mode=post&f=$forum_id"), |
|
84 | + 'U_GROUP_PERMS' => append_sid("{$this->phpbb_admin_path}index.".$this->php_ext, "i=acp_permissions&mode=setting_group_global"), |
|
85 | + 'U_FORUM_PERMS' => append_sid("{$this->phpbb_admin_path}index.".$this->php_ext, "i=acp_permissions&mode=setting_forum_local&forum_id[]=$forum_id"), |
|
86 | 86 | ); |
87 | 87 | } |
88 | 88 | |
89 | 89 | $this->template->assign_vars(array( |
90 | 90 | 'TYPES' => $types_list, |
91 | - 'U_ADD_TYPE' => $u_action . "&do=add", |
|
91 | + 'U_ADD_TYPE' => $u_action."&do=add", |
|
92 | 92 | )); |
93 | 93 | } |
94 | 94 | } |
@@ -62,7 +62,7 @@ |
||
62 | 62 | * @param string $phpbb_admin_path Relative admin root path |
63 | 63 | * @param string $php_ext php file extension |
64 | 64 | * @param boolean $auto_refresh Used for testing |
65 | - */ |
|
65 | + */ |
|
66 | 66 | public function __construct(\phpbb\auth\auth $auth, \phpbb\cache\driver\driver_interface $cache, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \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 $mapper_factory, $phpbb_admin_path, $php_ext, $auto_refresh = true) |
67 | 67 | { |
68 | 68 | $this->auth = $auth; |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | * @param \blitze\content\model\entity\type $unsaved_entity |
109 | 109 | * @return void |
110 | 110 | */ |
111 | - protected function handle_content_type($type, \blitze\content\model\entity\type &$unsaved_entity) |
|
111 | + protected function handle_content_type($type, \blitze\content\model\entity\type & $unsaved_entity) |
|
112 | 112 | { |
113 | 113 | $forum_perm_from = $this->request->variable('copy_forum_perm', 0); |
114 | 114 | |
@@ -187,8 +187,8 @@ discard block |
||
187 | 187 | { |
188 | 188 | if (!$type) |
189 | 189 | { |
190 | - $u_set_permission = append_sid("{$this->phpbb_admin_path}index.$this->php_ext", 'i=permissions&mode=setting_forum_local&forum_id[]=' . $forum_id, true); |
|
191 | - $message = $this->language->lang('CONTENT_TYPE_CREATED', '<a href="' . $u_set_permission . '">', '</a>'); |
|
190 | + $u_set_permission = append_sid("{$this->phpbb_admin_path}index.$this->php_ext", 'i=permissions&mode=setting_forum_local&forum_id[]='.$forum_id, true); |
|
191 | + $message = $this->language->lang('CONTENT_TYPE_CREATED', '<a href="'.$u_set_permission.'">', '</a>'); |
|
192 | 192 | } |
193 | 193 | else |
194 | 194 | { |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | if ($old_langname !== $new_langname) |
238 | 238 | { |
239 | 239 | $forum_name = $this->language->lang($new_langname); |
240 | - $sql = 'UPDATE ' . FORUMS_TABLE . " SET forum_name = '" . $this->db->sql_escape($forum_name) . "' WHERE forum_id = " . (int) $forum_id; |
|
240 | + $sql = 'UPDATE '.FORUMS_TABLE." SET forum_name = '".$this->db->sql_escape($forum_name)."' WHERE forum_id = ".(int) $forum_id; |
|
241 | 241 | $this->db->sql_query($sql); |
242 | 242 | } |
243 | 243 | } |
@@ -121,8 +121,7 @@ discard block |
||
121 | 121 | $unsaved_entity->set_content_id($entity->get_content_id()); |
122 | 122 | $this->handle_langname_change($forum_id, $entity->get_content_langname(), $unsaved_entity->get_content_langname()); |
123 | 123 | $this->copy_forum_permissions($forum_id, $forum_perm_from); |
124 | - } |
|
125 | - else |
|
124 | + } else |
|
126 | 125 | { |
127 | 126 | $forum_id = $this->create_content_forum($unsaved_entity->get_content_langname(), $forum_perm_from); |
128 | 127 | $unsaved_entity->set_forum_id($forum_id); |
@@ -189,8 +188,7 @@ discard block |
||
189 | 188 | { |
190 | 189 | $u_set_permission = append_sid("{$this->phpbb_admin_path}index.$this->php_ext", 'i=permissions&mode=setting_forum_local&forum_id[]=' . $forum_id, true); |
191 | 190 | $message = $this->language->lang('CONTENT_TYPE_CREATED', '<a href="' . $u_set_permission . '">', '</a>'); |
192 | - } |
|
193 | - else |
|
191 | + } else |
|
194 | 192 | { |
195 | 193 | $this->meta_refresh(3, $u_action); |
196 | 194 | $message = $this->language->lang('CONTENT_TYPE_UPDATED'); |
@@ -111,7 +111,7 @@ |
||
111 | 111 | */ |
112 | 112 | protected function set_prop($prop, array &$data) |
113 | 113 | { |
114 | - $field_prop = $this->request->variable('field_' . $prop, array('' => array(0 => '')), true); |
|
114 | + $field_prop = $this->request->variable('field_'.$prop, array('' => array(0 => '')), true); |
|
115 | 115 | |
116 | 116 | if (null !== ($array = array_pop($field_prop))) |
117 | 117 | { |