@@ -41,7 +41,7 @@ |
||
| 41 | 41 | * @param \phpbb\template\template $template Template object |
| 42 | 42 | * @param \phpbb\user $user User object |
| 43 | 43 | * @param string $php_ext php file extension |
| 44 | - */ |
|
| 44 | + */ |
|
| 45 | 45 | public function __construct(\phpbb\config\config $config, \phpbb\controller\helper $controller_helper, \phpbb\symfony_request $symfony_request, \phpbb\template\template $template, \phpbb\user $user, $php_ext) |
| 46 | 46 | { |
| 47 | 47 | $this->config = $config; |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | $this->template->assign_vars(array( |
| 64 | 64 | 'BOARD_URL' => $this->board_url, |
| 65 | 65 | 'SELF_LINK' => $this->controller_helper->route($this->symfony_request->attributes->get('_route'), $this->symfony_request->attributes->get('_route_params'), true, '', UrlGeneratorInterface::ABSOLUTE_URL), |
| 66 | - 'FEED_LINK' => $this->board_url . $this->user->page['script_path'] . 'index.' . $this->php_ext, |
|
| 66 | + 'FEED_LINK' => $this->board_url.$this->user->page['script_path'].'index.'.$this->php_ext, |
|
| 67 | 67 | 'FEED_TITLE' => $this->config['sitename'], |
| 68 | 68 | 'FEED_SUBTITLE' => $this->config['site_desc'], |
| 69 | 69 | 'FEED_UPDATED' => $max_update_time, |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | $response = new Response($this->prepare_content($content)); |
| 89 | 89 | $response->headers->set('Content-Type', 'application/atom+xml'); |
| 90 | 90 | $response->setCharset('UTF-8'); |
| 91 | - $response->setLastModified(new \DateTime('@' . $max_update_time)); |
|
| 91 | + $response->setLastModified(new \DateTime('@'.$max_update_time)); |
|
| 92 | 92 | |
| 93 | 93 | if (!empty($this->user->data['is_bot'])) |
| 94 | 94 | { |
@@ -107,8 +107,8 @@ discard block |
||
| 107 | 107 | { |
| 108 | 108 | // convert relative urls to absolute urls |
| 109 | 109 | $script_path = trim($this->user->page['script_path'], '/'); |
| 110 | - $full_path = $this->board_url . '/' . $script_path; |
|
| 111 | - $content = preg_replace('/(href|src)=("|\')((?:\.*\/)+(?:' . $script_path . '\/)?)(.*?)("|\')/i', '$1=$2' . $full_path . '/$4$5', $content); |
|
| 110 | + $full_path = $this->board_url.'/'.$script_path; |
|
| 111 | + $content = preg_replace('/(href|src)=("|\')((?:\.*\/)+(?:'.$script_path.'\/)?)(.*?)("|\')/i', '$1=$2'.$full_path.'/$4$5', $content); |
|
| 112 | 112 | |
| 113 | 113 | // remove hidden field labels |
| 114 | 114 | $content = preg_replace('#<div class="field-label label-hidden">(.*?)</div>#', '', $content); |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | $content = preg_replace('/((?:\?|&)sid=[a-z0-9]+)/', '', $content); |
| 118 | 118 | |
| 119 | 119 | // Remove Comments from inline attachments [ia] |
| 120 | - $content = preg_replace('#<dd>(.*?)</dd>#','',$content); |
|
| 120 | + $content = preg_replace('#<dd>(.*?)</dd>#', '', $content); |
|
| 121 | 121 | |
| 122 | 122 | // Replace some entities with their unicode counterpart |
| 123 | 123 | $entities = array( |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | * @param \phpbb\db\driver\driver_interface $db Database connection |
| 33 | 33 | * @param \phpbb\template\template $template Template object |
| 34 | 34 | * @param \blitze\content\services\types $content_types Content types object |
| 35 | - */ |
|
| 35 | + */ |
|
| 36 | 36 | public function __construct(\phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\template\template $template, \blitze\content\services\types $content_types) |
| 37 | 37 | { |
| 38 | 38 | $this->config = $config; |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | $sql_ary = $event['sql_ary']; |
| 64 | 64 | |
| 65 | 65 | $forum_ids = array_keys($this->content_types->get_forum_types()); |
| 66 | - $sql_ary['WHERE'] .= ' AND ' . $this->db->sql_in_set('f.forum_id', array_map('intval', $forum_ids), true); |
|
| 66 | + $sql_ary['WHERE'] .= ' AND '.$this->db->sql_in_set('f.forum_id', array_map('intval', $forum_ids), true); |
|
| 67 | 67 | |
| 68 | 68 | $event['sql_ary'] = $sql_ary; |
| 69 | 69 | } |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | public function get_field_value(array $data) |
| 57 | 57 | { |
| 58 | 58 | $default = is_array($data['field_value']) ? $data['field_value'] : explode("\n", $data['field_value']); |
| 59 | - $value = $this->request->variable($data['field_name'], array(0 => '')); |
|
| 59 | + $value = $this->request->variable($data['field_name'], array(0 => '')); |
|
| 60 | 60 | return $value ?: $default; |
| 61 | 61 | } |
| 62 | 62 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | */ |
| 102 | 102 | protected function make_box($color) |
| 103 | 103 | { |
| 104 | - $style = 'display: inline-block; width: 15px; height: 15px; border: 1 solid #fff; border-radius: 4px; background-color: ' . $color; |
|
| 105 | - return ($color) ? '<div style="' . $style . '" title="' . $color . '"></div>' : ''; |
|
| 104 | + $style = 'display: inline-block; width: 15px; height: 15px; border: 1 solid #fff; border-radius: 4px; background-color: '.$color; |
|
| 105 | + return ($color) ? '<div style="'.$style.'" title="'.$color.'"></div>' : ''; |
|
| 106 | 106 | } |
| 107 | 107 | } |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | * @param \blitze\sitemaker\model\mapper_factory $sitemaker_mapper_factory Sitemaker Mapper factory object |
| 62 | 62 | * @param bool $auto_refresh Used during testing |
| 63 | 63 | * @param bool $trigger_error Used during testing |
| 64 | - */ |
|
| 64 | + */ |
|
| 65 | 65 | public function __construct(\phpbb\cache\driver\driver_interface $cache, \phpbb\language\language $language, \phpbb\log\log_interface $logger, \phpbb\request\request_interface $request, \phpbb\user $user, \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) |
| 66 | 66 | { |
| 67 | 67 | $this->cache = $cache; |
@@ -73,7 +73,7 @@ |
||
| 73 | 73 | * @param string $phpbb_admin_path Relative admin root path |
| 74 | 74 | * @param string $php_ext php file extension |
| 75 | 75 | * @param boolean $auto_refresh Used for testing |
| 76 | - */ |
|
| 76 | + */ |
|
| 77 | 77 | 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\log\log_interface $logger, \phpbb\request\request_interface $request, \phpbb\user $user, \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) |
| 78 | 78 | { |
| 79 | 79 | $this->auth = $auth; |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | * @param \blitze\content\model\entity\type $unsaved_entity |
| 123 | 123 | * @return string |
| 124 | 124 | */ |
| 125 | - protected function handle_content_type($type, \blitze\content\model\entity\type &$unsaved_entity) |
|
| 125 | + protected function handle_content_type($type, \blitze\content\model\entity\type & $unsaved_entity) |
|
| 126 | 126 | { |
| 127 | 127 | $existing_langname = ''; |
| 128 | 128 | $forum_perm_from = $this->request->variable('copy_forum_perm', 0); |
@@ -207,9 +207,9 @@ discard block |
||
| 207 | 207 | { |
| 208 | 208 | if (!$type) |
| 209 | 209 | { |
| 210 | - $u_set_permission = append_sid("{$this->phpbb_admin_path}index.$this->php_ext", 'i=permissions&mode=setting_forum_local&forum_id[]=' . $entity->get_forum_id(), true); |
|
| 210 | + $u_set_permission = append_sid("{$this->phpbb_admin_path}index.$this->php_ext", 'i=permissions&mode=setting_forum_local&forum_id[]='.$entity->get_forum_id(), true); |
|
| 211 | 211 | $lang_key = 'CONTENT_TYPE_CREATED'; |
| 212 | - $message = $this->language->lang($lang_key, '<a href="' . $u_set_permission . '">', '</a>'); |
|
| 212 | + $message = $this->language->lang($lang_key, '<a href="'.$u_set_permission.'">', '</a>'); |
|
| 213 | 213 | } |
| 214 | 214 | else |
| 215 | 215 | { |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | $additional_data[] = $entity->get_content_langname(); |
| 229 | - $this->logger->add('admin', $this->user->data['user_id'], $this->user->ip, 'ACP_LOG_' . $lang_key, time(), $additional_data); |
|
| 229 | + $this->logger->add('admin', $this->user->data['user_id'], $this->user->ip, 'ACP_LOG_'.$lang_key, time(), $additional_data); |
|
| 230 | 230 | |
| 231 | 231 | $this->trigger_error($message, $u_action); |
| 232 | 232 | } |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | if ($old_langname !== $new_langname) |
| 270 | 270 | { |
| 271 | 271 | $forum_name = $this->language->lang($new_langname); |
| 272 | - $sql = 'UPDATE ' . FORUMS_TABLE . " SET forum_name = '" . $this->db->sql_escape($forum_name) . "' WHERE forum_id = " . (int) $forum_id; |
|
| 272 | + $sql = 'UPDATE '.FORUMS_TABLE." SET forum_name = '".$this->db->sql_escape($forum_name)."' WHERE forum_id = ".(int) $forum_id; |
|
| 273 | 273 | $this->db->sql_query($sql); |
| 274 | 274 | } |
| 275 | 275 | } |
@@ -137,8 +137,7 @@ discard block |
||
| 137 | 137 | $unsaved_entity->set_content_id($entity->get_content_id()); |
| 138 | 138 | $this->handle_langname_change($forum_id, $entity->get_content_langname(), $unsaved_entity->get_content_langname()); |
| 139 | 139 | $this->copy_forum_permissions($forum_id, $forum_perm_from); |
| 140 | - } |
|
| 141 | - else |
|
| 140 | + } else |
|
| 142 | 141 | { |
| 143 | 142 | $forum_id = $this->create_content_forum($unsaved_entity->get_content_langname(), $forum_perm_from); |
| 144 | 143 | $unsaved_entity->set_forum_id($forum_id); |
@@ -210,8 +209,7 @@ discard block |
||
| 210 | 209 | $u_set_permission = append_sid("{$this->phpbb_admin_path}index.$this->php_ext", 'i=permissions&mode=setting_forum_local&forum_id[]=' . $entity->get_forum_id(), true); |
| 211 | 210 | $lang_key = 'CONTENT_TYPE_CREATED'; |
| 212 | 211 | $message = $this->language->lang($lang_key, '<a href="' . $u_set_permission . '">', '</a>'); |
| 213 | - } |
|
| 214 | - else |
|
| 212 | + } else |
|
| 215 | 213 | { |
| 216 | 214 | $this->meta_refresh(3, $u_action); |
| 217 | 215 | $lang_key = 'CONTENT_TYPE_UPDATED'; |