1 | <?php |
||
14 | class blocks extends routes |
||
15 | { |
||
16 | /** @var \phpbb\config\config */ |
||
17 | protected $config; |
||
18 | |||
19 | /** @var \phpbb\db\driver\driver_interface */ |
||
20 | protected $db; |
||
21 | |||
22 | /** @var \phpbb\template\template */ |
||
23 | protected $template; |
||
24 | |||
25 | /** @var \phpbb\user */ |
||
26 | protected $user; |
||
27 | |||
28 | /** @var \blitze\sitemaker\services\blocks\factory */ |
||
29 | protected $block_factory; |
||
30 | |||
31 | /** |
||
32 | * Constructor |
||
33 | * |
||
34 | * @param \phpbb\cache\driver\driver_interface $cache Cache driver interface |
||
35 | * @param \phpbb\config\config $config Config object |
||
36 | * @param \phpbb\db\driver\driver_interface $db Database object |
||
37 | * @param \phpbb\template\template $template Template object |
||
38 | * @param \phpbb\user $user User object |
||
39 | * @param \blitze\sitemaker\services\blocks\factory $block_factory Blocks factory object |
||
40 | * @param \blitze\sitemaker\model\mapper_factory $mapper_factory Mapper factory object |
||
41 | */ |
||
42 | public function __construct(\phpbb\cache\driver\driver_interface $cache, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\template\template $template, \phpbb\user $user, \blitze\sitemaker\services\blocks\factory $block_factory, \blitze\sitemaker\model\mapper_factory $mapper_factory) |
||
51 | |||
52 | /** |
||
53 | * Display blocks for current route |
||
54 | * |
||
55 | * @param bool $edit_mode |
||
56 | * @param array $route_info |
||
57 | * @param int $style_id |
||
58 | * @param $display_modes |
||
59 | */ |
||
60 | public function display($edit_mode, array $route_info, $style_id, array $display_modes) |
||
88 | |||
89 | /** |
||
90 | * @return array |
||
91 | */ |
||
92 | public function get_users_groups() |
||
108 | |||
109 | /** |
||
110 | * Render block |
||
111 | * |
||
112 | * @param array $display_modes |
||
113 | * @param bool $edit_mode |
||
114 | * @param array $data |
||
115 | * @param array $users_groups |
||
116 | * @param int $position_counter |
||
117 | */ |
||
118 | public function render(array $display_modes, $edit_mode, array $data, array $users_groups, &$position_counter) |
||
139 | |||
140 | /** |
||
141 | * @param array $df_settings |
||
142 | * @param array $db_settings |
||
143 | * @return array |
||
144 | */ |
||
145 | 14 | public function sync_settings(array $df_settings, array $db_settings = array()) |
|
159 | |||
160 | /** |
||
161 | * @param string $db_title |
||
162 | * @param string $df_title |
||
163 | * @return string |
||
164 | */ |
||
165 | protected function _get_block_title($db_title, $df_title) |
||
169 | |||
170 | /** |
||
171 | * @param array $block |
||
172 | * @param bool $edit_mode |
||
173 | * @return string|null |
||
174 | */ |
||
175 | protected function _get_block_content(array $block, $edit_mode) |
||
189 | |||
190 | /** |
||
191 | * Should we display this block? |
||
192 | * |
||
193 | * @param array $data |
||
194 | * @param array $display_modes |
||
195 | * @param array $users_groups |
||
196 | * @param bool $edit_mode |
||
197 | * @return bool |
||
198 | */ |
||
199 | protected function _block_is_viewable(array $data, array $display_modes, array $users_groups, $edit_mode) |
||
206 | |||
207 | /** |
||
208 | * @param mixed $allowed_groups |
||
209 | * @param array $users_groups |
||
210 | * @return bool |
||
211 | */ |
||
212 | protected function _user_is_permitted($allowed_groups, array $users_groups) |
||
216 | |||
217 | /** |
||
218 | * @param string $position |
||
219 | * @param array $ex_positions |
||
220 | * @param bool $edit_mode |
||
221 | * @return bool |
||
222 | */ |
||
223 | protected function _exclude_position($position, array $ex_positions, $edit_mode) |
||
227 | } |
||
228 |