@@ -77,8 +77,7 @@ |
||
77 | 77 | $return_data = $command->execute($style_id); |
78 | 78 | |
79 | 79 | $this->action_handler->clear_cache(); |
80 | - } |
|
81 | - catch (\blitze\sitemaker\exception\base $e) |
|
80 | + } catch (\blitze\sitemaker\exception\base $e) |
|
82 | 81 | { |
83 | 82 | $json_data['message'] = $e->get_message($this->user); |
84 | 83 | } |
@@ -58,12 +58,10 @@ |
||
58 | 58 | $return_data = $command->execute(); |
59 | 59 | |
60 | 60 | $this->action_handler->clear_cache(); |
61 | - } |
|
62 | - catch (\blitze\sitemaker\exception\base $e) |
|
61 | + } catch (\blitze\sitemaker\exception\base $e) |
|
63 | 62 | { |
64 | 63 | $return_data['message'] = $e->get_message($this->user); |
65 | - } |
|
66 | - catch (\Exception $e) |
|
64 | + } catch (\Exception $e) |
|
67 | 65 | { |
68 | 66 | $return_data['message'] = $this->user->lang($e->getMessage()); |
69 | 67 | } |
@@ -79,8 +79,7 @@ |
||
79 | 79 | 'title' => 'LOGIN', |
80 | 80 | 'content' => $this->ptemplate->render_view('blitze/sitemaker', 'blocks/login.html', 'login_block') |
81 | 81 | ); |
82 | - } |
|
83 | - else if ($settings['show_member_menu']) |
|
82 | + } else if ($settings['show_member_menu']) |
|
84 | 83 | { |
85 | 84 | $block = $this->phpbb_container->get('blitze.sitemaker.block.member_menu'); |
86 | 85 | $block->set_template($this->ptemplate); |
@@ -71,9 +71,9 @@ |
||
71 | 71 | $this->ptemplate->assign_vars(array( |
72 | 72 | 'S_SHOW_HIDE_ME' => ($settings['show_hide_me']) ? true : false, |
73 | 73 | 'S_AUTOLOGIN_ENABLED' => ($settings['allow_autologin']) ? true : false, |
74 | - 'S_LOGIN_ACTION' => append_sid("{$this->phpbb_root_path}ucp." . $this->php_ext, 'mode=login'), |
|
75 | - 'U_REGISTER' => append_sid("{$this->phpbb_root_path}ucp." . $this->php_ext, 'mode=register'), |
|
76 | - 'U_SEND_PASSWORD' => append_sid("{$this->phpbb_root_path}ucp." . $this->php_ext, 'mode=sendpassword'), |
|
74 | + 'S_LOGIN_ACTION' => append_sid("{$this->phpbb_root_path}ucp.".$this->php_ext, 'mode=login'), |
|
75 | + 'U_REGISTER' => append_sid("{$this->phpbb_root_path}ucp.".$this->php_ext, 'mode=register'), |
|
76 | + 'U_SEND_PASSWORD' => append_sid("{$this->phpbb_root_path}ucp.".$this->php_ext, 'mode=sendpassword'), |
|
77 | 77 | 'U_REDIRECT' => reapply_sid(ltrim(rtrim(build_url(array('edit_mode')), '?'), './../')) |
78 | 78 | )); |
79 | 79 |
@@ -237,8 +237,7 @@ |
||
237 | 237 | { |
238 | 238 | $padding .= $pad_with; |
239 | 239 | $padding_store[$row['parent_id']] = $padding; |
240 | - } |
|
241 | - else if ($row['left_id'] > $right + 1) |
|
240 | + } else if ($row['left_id'] > $right + 1) |
|
242 | 241 | { |
243 | 242 | $padding = (isset($padding_store[$row['parent_id']])) ? $padding_store[$row['parent_id']] : ''; |
244 | 243 | } |
@@ -33,13 +33,13 @@ |
||
33 | 33 | protected $data = array(); |
34 | 34 | |
35 | 35 | /** |
36 | - * Construct |
|
37 | - * |
|
38 | - * @param \phpbb\db\driver\driver_interface $db Database connection |
|
39 | - * @param string $items_table Table name |
|
40 | - * @param string $pk Primary key |
|
41 | - * @param string $sql_where Column restriction |
|
42 | - */ |
|
36 | + * Construct |
|
37 | + * |
|
38 | + * @param \phpbb\db\driver\driver_interface $db Database connection |
|
39 | + * @param string $items_table Table name |
|
40 | + * @param string $pk Primary key |
|
41 | + * @param string $sql_where Column restriction |
|
42 | + */ |
|
43 | 43 | public function __construct(\phpbb\db\driver\driver_interface $db, $items_table, $pk, $sql_where = '') |
44 | 44 | { |
45 | 45 | $this->db = $db; |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | { |
79 | 79 | $sql = "SELECT * |
80 | 80 | FROM $this->items_table |
81 | - WHERE $this->pk = " . (int) $node_id ; |
|
81 | + WHERE $this->pk = ".(int) $node_id; |
|
82 | 82 | $result = $this->db->sql_query($sql); |
83 | 83 | $row = $this->db->sql_fetchrow($result); |
84 | 84 | $this->db->sql_freeresult($result); |
@@ -107,8 +107,8 @@ discard block |
||
107 | 107 | $this->items_table => ' t' |
108 | 108 | ), |
109 | 109 | 'WHERE' => array( |
110 | - 't.depth ' . (($level) ? " BETWEEN $start AND " . ($start + $level) : ' >= ' . $start), |
|
111 | - (($this->sql_where) ? 't.' . $this->sql_where : ''), |
|
110 | + 't.depth '.(($level) ? " BETWEEN $start AND ".($start + $level) : ' >= '.$start), |
|
111 | + (($this->sql_where) ? 't.'.$this->sql_where : ''), |
|
112 | 112 | ), |
113 | 113 | 'ORDER_BY' => 't.left_id ASC', |
114 | 114 | ), |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | * @param \phpbb\template\twig\twig $template |
148 | 148 | * @param string $handle |
149 | 149 | */ |
150 | - public function display_list(array $data, \phpbb\template\twig\twig &$template, $handle = 'tree') |
|
150 | + public function display_list(array $data, \phpbb\template\twig\twig & $template, $handle = 'tree') |
|
151 | 151 | { |
152 | 152 | $prev_depth = 0; |
153 | 153 | $parental_depth = array(0 => -1); |
@@ -156,10 +156,10 @@ discard block |
||
156 | 156 | for ($i = 0, $size = sizeof($data); $i < $size; $i++) |
157 | 157 | { |
158 | 158 | $row = $data[$i]; |
159 | - $this_depth = $parental_depth[$row['parent_id']] + 1; |
|
160 | - $repeat = abs($prev_depth - $this_depth); |
|
159 | + $this_depth = $parental_depth[$row['parent_id']] + 1; |
|
160 | + $repeat = abs($prev_depth - $this_depth); |
|
161 | 161 | |
162 | - $tpl_data = array( |
|
162 | + $tpl_data = array( |
|
163 | 163 | 'PREV_DEPTH' => $prev_depth, |
164 | 164 | 'THIS_DEPTH' => $this_depth, |
165 | 165 | 'NUM_KIDS' => $this->count_descendants($row), |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | |
170 | 170 | for ($j = 0; $j < $repeat; $j++) |
171 | 171 | { |
172 | - $template->assign_block_vars($handle . '.close', array()); |
|
172 | + $template->assign_block_vars($handle.'.close', array()); |
|
173 | 173 | } |
174 | 174 | |
175 | 175 | $prev_depth = $this_depth; |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | |
179 | 179 | for ($i = 0; $i < $prev_depth; $i++) |
180 | 180 | { |
181 | - $template->assign_block_vars('close_' . $handle, array()); |
|
181 | + $template->assign_block_vars('close_'.$handle, array()); |
|
182 | 182 | } |
183 | 183 | } |
184 | 184 | |
@@ -217,10 +217,10 @@ discard block |
||
217 | 217 | } |
218 | 218 | |
219 | 219 | $right = $row['right_id']; |
220 | - $title = $padding . '├─ ' . $row[$title_column]; |
|
220 | + $title = $padding.'├─ '.$row[$title_column]; |
|
221 | 221 | $selected = (in_array($row[$this->pk], $selected_ids)) ? ' selected="selected' : ''; |
222 | 222 | |
223 | - $return_options .= '<option value="' . $row[$this->pk] . '"' . $selected . '>' . $title . '</option>'; |
|
223 | + $return_options .= '<option value="'.$row[$this->pk].'"'.$selected.'>'.$title.'</option>'; |
|
224 | 224 | $return_data[$row[$this->pk]] = $title; |
225 | 225 | } |
226 | 226 |
@@ -13,8 +13,8 @@ |
||
13 | 13 | { |
14 | 14 | public function execute($style_id) |
15 | 15 | { |
16 | - $name = $this->request->variable('block', ''); |
|
17 | - $route = $this->request->variable('route', ''); |
|
16 | + $name = $this->request->variable('block', ''); |
|
17 | + $route = $this->request->variable('route', ''); |
|
18 | 18 | |
19 | 19 | if (($block_instance = $this->block_factory->get_block($name)) === null) |
20 | 20 | { |
@@ -50,8 +50,7 @@ discard block |
||
50 | 50 | if (!empty($collection)) |
51 | 51 | { |
52 | 52 | return $collection->get_entities(); |
53 | - } |
|
54 | - else |
|
53 | + } else |
|
55 | 54 | { |
56 | 55 | return array(); |
57 | 56 | } |
@@ -88,8 +87,7 @@ discard block |
||
88 | 87 | if (!$has_blocks && !$hiding_blocks && !sizeof($ex_positions)) |
89 | 88 | { |
90 | 89 | $this->route_mapper->delete($route); |
91 | - } |
|
92 | - else |
|
90 | + } else |
|
93 | 91 | { |
94 | 92 | $route->set_has_blocks($has_blocks); |
95 | 93 | $this->route_mapper->save($route); |
@@ -135,8 +135,7 @@ discard block |
||
135 | 135 | if ($this->request->is_set('style')) |
136 | 136 | { |
137 | 137 | return $this->request->variable('style', 0); |
138 | - } |
|
139 | - else |
|
138 | + } else |
|
140 | 139 | { |
141 | 140 | return (!$this->config['override_user_style']) ? $this->user->data['user_style'] : $this->config['default_style']; |
142 | 141 | } |
@@ -172,8 +171,7 @@ discard block |
||
172 | 171 | self::SHOW_BLOCK_LANDING => true, |
173 | 172 | self::SHOW_BLOCK_SUBPAGE => false, |
174 | 173 | ); |
175 | - } |
|
176 | - else |
|
174 | + } else |
|
177 | 175 | { |
178 | 176 | $modes = array( |
179 | 177 | self::SHOW_BLOCK_BOTH => true, |
@@ -200,8 +198,7 @@ discard block |
||
200 | 198 | } |
201 | 199 | |
202 | 200 | $u_edit_mode = append_sid(generate_board_url() . '/' . ltrim(rtrim(build_url(array('edit_mode', 'style')), '?'), './../'), 'edit_mode=' . (($edit_mode) ? 0 : 1)); |
203 | - } |
|
204 | - else |
|
201 | + } else |
|
205 | 202 | { |
206 | 203 | $edit_mode = false; |
207 | 204 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | |
69 | 69 | $edit_mode = $this->toggle_edit_mode(); |
70 | 70 | $style_id = $this->get_style_id(); |
71 | - $current_route = ltrim($this->user->page['page_dir'] . '/' . $this->user->page['page_name'], './'); |
|
71 | + $current_route = ltrim($this->user->page['page_dir'].'/'.$this->user->page['page_name'], './'); |
|
72 | 72 | $route_info = $blocks->get_route_info($current_route, $this->user->page['page_dir'], $style_id, $edit_mode); |
73 | 73 | |
74 | 74 | $display_modes = $this->get_display_modes($route_info['is_sub_route']); |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | */ |
115 | 115 | protected function toggle_edit_mode() |
116 | 116 | { |
117 | - $edit_mode = $this->request->variable($this->config['cookie_name'] . '_sm_edit_mode', false, false, \phpbb\request\request_interface::COOKIE); |
|
117 | + $edit_mode = $this->request->variable($this->config['cookie_name'].'_sm_edit_mode', false, false, \phpbb\request\request_interface::COOKIE); |
|
118 | 118 | |
119 | 119 | if ($this->request->is_set('edit_mode')) |
120 | 120 | { |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | ); |
171 | 171 | } |
172 | 172 | |
173 | - $u_edit_mode = append_sid(generate_board_url() . '/' . ltrim(rtrim(build_url(array('edit_mode', 'sid', 'style')), '?'), './../'), 'edit_mode=' . (int) !$edit_mode); |
|
173 | + $u_edit_mode = append_sid(generate_board_url().'/'.ltrim(rtrim(build_url(array('edit_mode', 'sid', 'style')), '?'), './../'), 'edit_mode='.(int) !$edit_mode); |
|
174 | 174 | } |
175 | 175 | else |
176 | 176 | { |
@@ -29,7 +29,7 @@ |
||
29 | 29 | $headers = $headers[0]; |
30 | 30 | } |
31 | 31 | |
32 | - preg_match('/HTTP\/.* ([0-9]+) .*/', $headers , $status); |
|
32 | + preg_match('/HTTP\/.* ([0-9]+) .*/', $headers, $status); |
|
33 | 33 | |
34 | 34 | return ($status[1] == 200) ? true : false; |
35 | 35 | } |
@@ -41,8 +41,7 @@ |
||
41 | 41 | if (is_array($message)) |
42 | 42 | { |
43 | 43 | $this->message = (string) $message[0]; |
44 | - } |
|
45 | - else |
|
44 | + } else |
|
46 | 45 | { |
47 | 46 | $this->message = $message; |
48 | 47 | } |
@@ -164,8 +164,7 @@ |
||
164 | 164 | if (!is_array($settings)) |
165 | 165 | { |
166 | 166 | $this->settings = $settings; |
167 | - } |
|
168 | - else if (sizeof($settings)) |
|
167 | + } else if (sizeof($settings)) |
|
169 | 168 | { |
170 | 169 | $this->settings = serialize($settings); |
171 | 170 | $this->hash = md5($this->settings); |
@@ -141,7 +141,7 @@ |
||
141 | 141 | */ |
142 | 142 | public function set_class($class) |
143 | 143 | { |
144 | - $this->class = ($class) ? ' ' . $class : ''; |
|
144 | + $this->class = ($class) ? ' '.$class : ''; |
|
145 | 145 | return $this; |
146 | 146 | } |
147 | 147 |