@@ -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)) |
@@ -195,8 +195,7 @@ discard block |
||
| 195 | 195 | if ($previewing || empty($row['field_props']['is_db_field'])) |
| 196 | 196 | { |
| 197 | 197 | $fields_data[$field] = $value; |
| 198 | - } |
|
| 199 | - else |
|
| 198 | + } else |
|
| 200 | 199 | { |
| 201 | 200 | $this->db_fields[$field] = $value; |
| 202 | 201 | } |
@@ -236,14 +235,12 @@ discard block |
||
| 236 | 235 | if (!empty($field_value)) |
| 237 | 236 | { |
| 238 | 237 | $this->errors[] = $obj->validate_field($row); |
| 239 | - } |
|
| 240 | - else if ($row['field_required']) |
|
| 238 | + } else if ($row['field_required']) |
|
| 241 | 239 | { |
| 242 | 240 | if (!$row['field_mod_only'] || $cp_class === 'mcp') |
| 243 | 241 | { |
| 244 | 242 | $this->errors[] = $this->language->lang_array('CONTENT_FIELD_REQUIRED', array($row['field_label'])); |
| 245 | - } |
|
| 246 | - else |
|
| 243 | + } else |
|
| 247 | 244 | { |
| 248 | 245 | $req_mod_input = true; |
| 249 | 246 | } |
@@ -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 | } |
@@ -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 | } |
@@ -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 | { |
@@ -232,8 +232,7 @@ discard block |
||
| 232 | 232 | { |
| 233 | 233 | $data = generate_text_for_edit($this->content_desc, $this->content_desc_uid, $this->content_desc_options); |
| 234 | 234 | return $data['text']; |
| 235 | - } |
|
| 236 | - else |
|
| 235 | + } else |
|
| 237 | 236 | { |
| 238 | 237 | $parse_flags = ($this->content_desc_bitfield ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES; |
| 239 | 238 | return generate_text_for_display($this->content_desc, $this->content_desc_uid, $this->content_desc_bitfield, $parse_flags); |
@@ -251,8 +250,7 @@ discard block |
||
| 251 | 250 | if (!is_array($settings)) |
| 252 | 251 | { |
| 253 | 252 | $this->content_view_settings = $settings; |
| 254 | - } |
|
| 255 | - else if (sizeof($settings)) |
|
| 253 | + } else if (sizeof($settings)) |
|
| 256 | 254 | { |
| 257 | 255 | $this->content_view_settings = json_encode($settings); |
| 258 | 256 | } |
@@ -309,10 +309,10 @@ |
||
| 309 | 309 | $detail_fields = $this->get_template_fields($detail_fields, $this->detail_tpl, $fields); |
| 310 | 310 | |
| 311 | 311 | $this->summary_fields = array_intersect_key($field_types, array_flip($summary_fields)); |
| 312 | - $this->detail_fields = array_intersect_key($field_types, array_flip($detail_fields)); |
|
| 312 | + $this->detail_fields = array_intersect_key($field_types, array_flip($detail_fields)); |
|
| 313 | 313 | |
| 314 | 314 | $this->content_fields = $content_fields; |
| 315 | - $this->field_types = $field_types; |
|
| 315 | + $this->field_types = $field_types; |
|
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | /** |
@@ -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 | } |