@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | $this->display_mode = $view_mode; |
| 98 | 98 | $this->content_type = $entity->get_content_name(); |
| 99 | - $this->tpl_name = ($custom_tpl) ? $this->content_type . '_' . $view_mode : ''; |
|
| 99 | + $this->tpl_name = ($custom_tpl) ? $this->content_type.'_'.$view_mode : ''; |
|
| 100 | 100 | $this->view_mode = (in_array($view_mode, array('summary', 'detail'))) ? $view_mode : 'summary'; |
| 101 | 101 | $this->form_fields = array_intersect_key($this->fields_factory->get_all(), array_flip($view_mode_fields)); |
| 102 | 102 | $this->db_fields = $db_fields; |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | */ |
| 118 | 118 | public function show($type, array $topic_data, array $post_data, array $users_cache, array &$attachments, array &$update_count, array $topic_tracking_info, array $topic_data_overwrite = array(), $mode = '') |
| 119 | 119 | { |
| 120 | - $callable = 'get_' . $this->view_mode . '_template_data'; |
|
| 120 | + $callable = 'get_'.$this->view_mode.'_template_data'; |
|
| 121 | 121 | $tpl_data = array_merge(array( |
| 122 | 122 | 'TOPIC_COMMENTS' => $this->comments->count($topic_data), |
| 123 | 123 | 'S_USER_LOGGED_IN' => $this->user->data['is_registered'], |
@@ -185,21 +185,21 @@ discard block |
||
| 185 | 185 | $field_data['field_props'] = array_replace_recursive($this->form_fields[$field_type]->get_default_props(), $field_data['field_props']); |
| 186 | 186 | $field_data['field_value'] = &$field_values[$field_name]; |
| 187 | 187 | |
| 188 | - $field_contents = $this->form_fields[$field_type]->display_field($field_data, $this->display_mode, $tpl_data, $this->content_type); |
|
| 188 | + $field_contents = $this->form_fields[$field_type]->display_field($field_data, $this->display_mode, $tpl_data, $this->content_type); |
|
| 189 | 189 | |
| 190 | 190 | // this essentially hides other fields if the field returns an array |
| 191 | 191 | if (is_array($field_contents)) |
| 192 | 192 | { |
| 193 | 193 | $display_data['all'] = $field_contents; |
| 194 | - $display_data[$field_data['field_' . $this->view_mode . '_show']] = $field_contents; |
|
| 194 | + $display_data[$field_data['field_'.$this->view_mode.'_show']] = $field_contents; |
|
| 195 | 195 | break; |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | if (!empty($field_contents)) |
| 199 | 199 | { |
| 200 | - $field = '<div class="field-label ' . $this->label[$field_data['field_' . $this->view_mode . '_ldisp']] . '">' . $field_data['field_label'] . $this->language->lang('COLON') . ' </div>' . $field_contents; |
|
| 200 | + $field = '<div class="field-label '.$this->label[$field_data['field_'.$this->view_mode.'_ldisp']].'">'.$field_data['field_label'].$this->language->lang('COLON').' </div>'.$field_contents; |
|
| 201 | 201 | $display_data['all'][$field_name] = $field; |
| 202 | - $display_data[$field_data['field_' . $this->view_mode . '_show']][$field_name] = $field; |
|
| 202 | + $display_data[$field_data['field_'.$this->view_mode.'_show']][$field_name] = $field; |
|
| 203 | 203 | } |
| 204 | 204 | } |
| 205 | 205 | |
@@ -142,8 +142,7 @@ |
||
| 142 | 142 | $this->template->assign_vars(array_change_key_case(array_merge($tpl_data, $fields_data['all']), CASE_UPPER)); |
| 143 | 143 | $this->template->set_filenames(array('content' => $this->tpl_name)); |
| 144 | 144 | $tpl_data['CUSTOM_DISPLAY'] = $this->template->assign_display('content'); |
| 145 | - } |
|
| 146 | - else |
|
| 145 | + } else |
|
| 147 | 146 | { |
| 148 | 147 | $tpl_data['FIELDS'] = $fields_data; |
| 149 | 148 | } |
@@ -99,9 +99,9 @@ discard block |
||
| 99 | 99 | { |
| 100 | 100 | $toc_pattern = '(<h4>(.*?)</h4>)?'; |
| 101 | 101 | $pages_pattern = '<p><!-- pagebreak --></p>'; |
| 102 | - $split_pattern = $pages_pattern . (($view_mode !== 'detail') ? $toc_pattern : ''); |
|
| 102 | + $split_pattern = $pages_pattern.(($view_mode !== 'detail') ? $toc_pattern : ''); |
|
| 103 | 103 | |
| 104 | - $pages = array_filter(preg_split('#' . $split_pattern . '#s', $data['field_value'])); |
|
| 104 | + $pages = array_filter(preg_split('#'.$split_pattern.'#s', $data['field_value'])); |
|
| 105 | 105 | |
| 106 | 106 | if ($view_mode !== 'detail') |
| 107 | 107 | { |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | // get page titles to generate TOC |
| 112 | - preg_match_all('#' . $pages_pattern . $toc_pattern . '#s', $data['field_value'], $matches); |
|
| 112 | + preg_match_all('#'.$pages_pattern.$toc_pattern.'#s', $data['field_value'], $matches); |
|
| 113 | 113 | |
| 114 | 114 | return $this->get_detail_value($pages, $matches[2], $data); |
| 115 | 115 | } |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | $asset_path = $this->util->get_web_path(); |
| 125 | 125 | $this->util->add_assets(array( |
| 126 | 126 | 'js' => array( |
| 127 | - $asset_path . 'assets/javascript/editor.js', |
|
| 127 | + $asset_path.'assets/javascript/editor.js', |
|
| 128 | 128 | '@blitze_content/assets/form/textarea.min.js' |
| 129 | 129 | ) |
| 130 | 130 | )); |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | $this->template->assign_block_vars('toc', array( |
| 233 | 233 | 'TITLE' => ($title) ? $title : $this->language->lang('CONTENT_TOC_UNTITLED'), |
| 234 | 234 | 'S_PAGE' => ($page === $start), |
| 235 | - 'U_VIEW' => append_sid($topic_url, ($page) ? 'page=' . $page : false), |
|
| 235 | + 'U_VIEW' => append_sid($topic_url, ($page) ? 'page='.$page : false), |
|
| 236 | 236 | )); |
| 237 | 237 | } |
| 238 | 238 | } |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | // Assigning custom bbcodes |
| 283 | 283 | if (!function_exists('display_custom_bbcodes')) |
| 284 | 284 | { |
| 285 | - include($this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext); |
|
| 285 | + include($this->phpbb_root_path.'includes/functions_display.'.$this->php_ext); |
|
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | display_custom_bbcodes(); |
@@ -34,7 +34,7 @@ discard block |
||
| 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\config\db $config, \phpbb\user $user, $phpbb_root_path, $php_ext) |
| 39 | 39 | { |
| 40 | 40 | $this->auth = $auth; |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | { |
| 117 | 117 | return append_sid("{$this->phpbb_root_path}mcp.$this->php_ext", 'i=queue&mode=approve_details&f=' . $post_data['forum_id'] . '&p=' . $post_data['post_id'], true, $this->user->session_id); |
| 118 | 118 | } |
| 119 | - */ |
|
| 119 | + */ |
|
| 120 | 120 | |
| 121 | 121 | /** |
| 122 | 122 | * @param array $post_data |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | public function get_edit_url(array $post_data, array $topic_data, $cp_mode = '') |
| 54 | 54 | { |
| 55 | 55 | $cp_param = $this->get_cp_param($post_data, $topic_data, $cp_mode); |
| 56 | - return ($this->edit_allowed($post_data, $topic_data)) ? append_sid("{$this->phpbb_root_path}posting.$this->php_ext", "mode=edit&f={$topic_data['forum_id']}&p={$post_data['post_id']}" . $cp_param) : ''; |
|
| 56 | + return ($this->edit_allowed($post_data, $topic_data)) ? append_sid("{$this->phpbb_root_path}posting.$this->php_ext", "mode=edit&f={$topic_data['forum_id']}&p={$post_data['post_id']}".$cp_param) : ''; |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | public function get_delete_url(array $post_data, array $topic_data, $cp_mode = '') |
| 66 | 66 | { |
| 67 | 67 | $cp_param = $this->get_cp_param($post_data, $topic_data, $cp_mode); |
| 68 | - return ($this->delete_allowed($post_data, $topic_data)) ? append_sid("{$this->phpbb_root_path}posting.$this->php_ext", 'mode=' . (($this->softdelete_allowed($post_data)) ? 'soft_delete' : 'delete') . "&f={$post_data['forum_id']}&p={$post_data['post_id']}" . $cp_param) : ''; |
|
| 68 | + return ($this->delete_allowed($post_data, $topic_data)) ? append_sid("{$this->phpbb_root_path}posting.$this->php_ext", 'mode='.(($this->softdelete_allowed($post_data)) ? 'soft_delete' : 'delete')."&f={$post_data['forum_id']}&p={$post_data['post_id']}".$cp_param) : ''; |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /** |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | */ |
| 94 | 94 | public function get_print_topic_url(array $topic_data) |
| 95 | 95 | { |
| 96 | - return ($this->auth->acl_get('f_print', $topic_data['forum_id'])) ? $topic_data['topic_url'] . '?view=print' : ''; |
|
| 96 | + return ($this->auth->acl_get('f_print', $topic_data['forum_id'])) ? $topic_data['topic_url'].'?view=print' : ''; |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | /** |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | public function get_email_topic_url(array $topic_data) |
| 104 | 104 | { |
| 105 | - return ($this->auth->acl_get('f_email', $topic_data['forum_id']) && $this->config['email_enable']) ? append_sid("{$this->phpbb_root_path}memberlist.{$this->php_ext}", 'mode=email&t=' . $topic_data['topic_id']) : ''; |
|
| 105 | + return ($this->auth->acl_get('f_email', $topic_data['forum_id']) && $this->config['email_enable']) ? append_sid("{$this->phpbb_root_path}memberlist.{$this->php_ext}", 'mode=email&t='.$topic_data['topic_id']) : ''; |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | /** |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | */ |
| 113 | 113 | public function get_search_users_posts_url($forum_id, $username) |
| 114 | 114 | { |
| 115 | - return append_sid("{$this->phpbb_root_path}search.{$this->php_ext}", "author={$username}&" . urlencode('fid[]') . "=$forum_id&sc=0&sf=titleonly&sr=topics"); |
|
| 115 | + return append_sid("{$this->phpbb_root_path}search.{$this->php_ext}", "author={$username}&".urlencode('fid[]')."=$forum_id&sc=0&sf=titleonly&sr=topics"); |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | /** |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | public function get_info_url(array $post_data) |
| 123 | 123 | { |
| 124 | 124 | $forum_id = $post_data['forum_id']; |
| 125 | - return ($this->auth->acl_get('m_info', $forum_id)) ? append_sid("{$this->phpbb_root_path}mcp.$this->php_ext", "i=main&mode=post_details&f=$forum_id&p=" . $post_data['post_id'], true, $this->user->session_id) : ''; |
|
| 125 | + return ($this->auth->acl_get('m_info', $forum_id)) ? append_sid("{$this->phpbb_root_path}mcp.$this->php_ext", "i=main&mode=post_details&f=$forum_id&p=".$post_data['post_id'], true, $this->user->session_id) : ''; |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | /** |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | */ |
| 133 | 133 | public function get_approve_url(array $post_data, $viewtopic_url) |
| 134 | 134 | { |
| 135 | - return append_sid("{$this->phpbb_root_path}mcp.$this->php_ext", "i=queue&p={$post_data['post_id']}&f={$post_data['forum_id']}&redirect=" . urlencode(str_replace('&', '&', $viewtopic_url . '&p=' . $post_data['post_id'] . '#p' . $post_data['post_id']))); |
|
| 135 | + return append_sid("{$this->phpbb_root_path}mcp.$this->php_ext", "i=queue&p={$post_data['post_id']}&f={$post_data['forum_id']}&redirect=".urlencode(str_replace('&', '&', $viewtopic_url.'&p='.$post_data['post_id'].'#p'.$post_data['post_id']))); |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | /** |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | */ |
| 162 | 162 | public function get_mcp_report_url(array $post_data) |
| 163 | 163 | { |
| 164 | - return ($this->auth->acl_get('m_report', $post_data['forum_id'])) ? append_sid("{$this->phpbb_root_path}mcp.$this->php_ext", 'i=reports&mode=report_details&f=' . $post_data['forum_id'] . '&p=' . $post_data['post_id'], true, $this->user->session_id) : ''; |
|
| 164 | + return ($this->auth->acl_get('m_report', $post_data['forum_id'])) ? append_sid("{$this->phpbb_root_path}mcp.$this->php_ext", 'i=reports&mode=report_details&f='.$post_data['forum_id'].'&p='.$post_data['post_id'], true, $this->user->session_id) : ''; |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | /** |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | */ |
| 172 | 172 | public function get_mcp_restore_url(array $post_data, array $topic_data) |
| 173 | 173 | { |
| 174 | - return ($this->auth->acl_get('m_approve', $post_data['forum_id'])) ? append_sid("{$this->phpbb_root_path}mcp.$this->php_ext", 'i=queue&mode=' . (($topic_data['topic_visibility'] != ITEM_DELETED) ? 'deleted_posts' : 'deleted_topics') . '&f=' . $post_data['forum_id'] . '&p=' . $post_data['post_id'], true, $this->user->session_id) : ''; |
|
| 174 | + return ($this->auth->acl_get('m_approve', $post_data['forum_id'])) ? append_sid("{$this->phpbb_root_path}mcp.$this->php_ext", 'i=queue&mode='.(($topic_data['topic_visibility'] != ITEM_DELETED) ? 'deleted_posts' : 'deleted_topics').'&f='.$post_data['forum_id'].'&p='.$post_data['post_id'], true, $this->user->session_id) : ''; |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | /** |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | */ |
| 181 | 181 | public function get_notes_url(array $post_data) |
| 182 | 182 | { |
| 183 | - return ($this->auth->acl_getf_global('m_')) ? append_sid("{$this->phpbb_root_path}mcp.$this->php_ext", 'i=notes&mode=user_notes&u=' . $post_data['poster_id'], true, $this->user->session_id) : ''; |
|
| 183 | + return ($this->auth->acl_getf_global('m_')) ? append_sid("{$this->phpbb_root_path}mcp.$this->php_ext", 'i=notes&mode=user_notes&u='.$post_data['poster_id'], true, $this->user->session_id) : ''; |
|
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | /** |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | */ |
| 190 | 190 | public function get_warning_url(array $post_data) |
| 191 | 191 | { |
| 192 | - return ($this->auth->acl_get('m_warn') && !$this->user_is_poster($post_data['poster_id']) && $post_data['poster_id'] != ANONYMOUS) ? append_sid("{$this->phpbb_root_path}mcp.$this->php_ext", 'i=warn&mode=warn_post&f=' . $post_data['forum_id'] . '&p=' . $post_data['post_id'], true, $this->user->session_id) : ''; |
|
| 192 | + return ($this->auth->acl_get('m_warn') && !$this->user_is_poster($post_data['poster_id']) && $post_data['poster_id'] != ANONYMOUS) ? append_sid("{$this->phpbb_root_path}mcp.$this->php_ext", 'i=warn&mode=warn_post&f='.$post_data['forum_id'].'&p='.$post_data['post_id'], true, $this->user->session_id) : ''; |
|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | /** |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | $cp_param = ''; |
| 243 | 243 | if ($topic_data['topic_first_post_id'] == $post_data['post_id']) |
| 244 | 244 | { |
| 245 | - $cp_param = '&cp=' . ((!$cp_mode) ? (($this->user_is_poster($post_data['poster_id'])) ? 'ucp' : 'mcp') : $cp_mode); |
|
| 245 | + $cp_param = '&cp='.((!$cp_mode) ? (($this->user_is_poster($post_data['poster_id'])) ? 'ucp' : 'mcp') : $cp_mode); |
|
| 246 | 246 | } |
| 247 | 247 | return $cp_param; |
| 248 | 248 | } |
@@ -222,8 +222,7 @@ |
||
| 222 | 222 | if ($topic_id) |
| 223 | 223 | { |
| 224 | 224 | $u_mcp = append_sid("{$this->phpbb_root_path}mcp.{$this->php_ext}", "i=mcp_main&mode=topic_view&f=$forum_id&t=$topic_id", true, $this->user->session_id); |
| 225 | - } |
|
| 226 | - else |
|
| 225 | + } else |
|
| 227 | 226 | { |
| 228 | 227 | $u_mcp = append_sid("{$this->phpbb_root_path}mcp.$this->php_ext", 'i=-blitze-content-mcp-content_module&mode=content', true, $this->user->session_id); |
| 229 | 228 | } |