1 | <?php |
||
12 | class routes |
||
13 | { |
||
14 | /** @var \phpbb\cache\driver\driver_interface */ |
||
15 | protected $cache; |
||
16 | |||
17 | /** @var \phpbb\config\config */ |
||
18 | protected $config; |
||
19 | |||
20 | /** @var \blitze\sitemaker\services\blocks\factory */ |
||
21 | protected $block_factory; |
||
22 | |||
23 | /** @var \blitze\sitemaker\model\mapper_factory */ |
||
24 | protected $mapper_factory; |
||
25 | |||
26 | /** @var string */ |
||
27 | protected $php_ext; |
||
28 | |||
29 | /** @var bool */ |
||
30 | protected $is_sub_route = false; |
||
31 | |||
32 | /** |
||
33 | * Constructor |
||
34 | * |
||
35 | * @param \phpbb\cache\driver\driver_interface $cache Cache driver interface |
||
36 | * @param \phpbb\config\config $config Config object |
||
37 | * @param \blitze\sitemaker\services\blocks\factory $block_factory Blocks factory object |
||
38 | * @param \blitze\sitemaker\model\mapper_factory $mapper_factory Mapper factory object |
||
39 | * @param string $php_ext phpEx |
||
40 | */ |
||
41 | 36 | public function __construct(\phpbb\cache\driver\driver_interface $cache, \phpbb\config\config $config, \blitze\sitemaker\services\blocks\factory $block_factory, \blitze\sitemaker\model\mapper_factory $mapper_factory, $php_ext) |
|
49 | |||
50 | /** |
||
51 | * @param string $current_route |
||
52 | * @param string $page_dir |
||
53 | * @param int $style_id |
||
54 | * @param bool|false $edit_mode |
||
55 | * @return array |
||
56 | */ |
||
57 | 22 | public function get_route_info($current_route, $page_dir, $style_id, $edit_mode = false) |
|
76 | |||
77 | /** |
||
78 | * @param array $route_info |
||
79 | * @param int $style_id |
||
80 | * @param bool $edit_mode |
||
81 | * @return array |
||
82 | */ |
||
83 | 22 | public function get_blocks_for_route(array $route_info, $style_id, $edit_mode) |
|
90 | |||
91 | /** |
||
92 | * @param array $df_settings |
||
93 | * @param array $db_settings |
||
94 | * @return array |
||
95 | */ |
||
96 | 37 | public function sync_settings(array $df_settings, array $db_settings = array()) |
|
110 | |||
111 | /** |
||
112 | * Clear blocks cache |
||
113 | */ |
||
114 | public function clear_cache() |
||
119 | |||
120 | /** |
||
121 | * @param array $routes |
||
122 | * @param array $route_info |
||
123 | * @param string $current_route |
||
124 | * @param string $page_dir |
||
125 | * @param int $style_id |
||
126 | * @return array |
||
127 | */ |
||
128 | 15 | protected function inherit_route_info(array $routes, array $route_info, $current_route, $page_dir, $style_id) |
|
144 | |||
145 | /** |
||
146 | * @param string $current_route |
||
147 | * @param int $style_id |
||
148 | * @return array |
||
149 | */ |
||
150 | 22 | protected function get_default_route_info($current_route, $style_id) |
|
162 | |||
163 | /** |
||
164 | * @param array $routes |
||
165 | * @param string $current_route |
||
166 | * @param string $page_dir |
||
167 | * @return array |
||
168 | */ |
||
169 | 9 | protected function get_parent_route(array $routes, $current_route, $page_dir) |
|
188 | |||
189 | /** |
||
190 | * @param array $routes_data |
||
191 | * @param string $current_route |
||
192 | * @return string |
||
193 | */ |
||
194 | 5 | protected function get_virtual_parent(array $routes_data, $current_route) |
|
210 | |||
211 | /** |
||
212 | * @param array $routes |
||
213 | * @param string $route |
||
214 | * @return int |
||
215 | */ |
||
216 | 4 | protected function get_parent_route_info(array $routes, $route) |
|
227 | |||
228 | /** |
||
229 | * We get blocks to display by route id, so we update the route id here, |
||
230 | * to show blocks from default route if current route or it's parent has no blocks |
||
231 | * |
||
232 | * @param array $routes |
||
233 | * @param array $route_info |
||
234 | * @return array |
||
235 | */ |
||
236 | 15 | protected function set_display_route_id(array $routes, array $route_info) |
|
246 | |||
247 | /** |
||
248 | * @param array $condition |
||
249 | * @return array |
||
250 | */ |
||
251 | 22 | protected function get_all_blocks(array $condition) |
|
276 | |||
277 | /** |
||
278 | * @return array|mixed |
||
279 | */ |
||
280 | 22 | protected function get_all_routes() |
|
300 | |||
301 | /** |
||
302 | * @param int $style_id |
||
303 | * @return array |
||
304 | */ |
||
305 | 22 | protected function get_routes_for_style($style_id) |
|
310 | |||
311 | /** |
||
312 | * @param bool $edit_mode |
||
313 | * @return array |
||
314 | */ |
||
315 | 22 | protected function get_cached_blocks($edit_mode) |
|
326 | |||
327 | /** |
||
328 | * @param array $blocks |
||
329 | * @param bool $edit_mode |
||
330 | */ |
||
331 | 22 | protected function cache_block(array $blocks, $edit_mode) |
|
338 | } |
||
339 |