1 | <?php |
||
12 | class archive extends \blitze\sitemaker\services\blocks\driver\block |
||
13 | { |
||
14 | /** @var \phpbb\db\driver\driver_interface */ |
||
15 | protected $db; |
||
16 | |||
17 | /* @var \phpbb\controller\helper */ |
||
18 | protected $helper; |
||
19 | |||
20 | /* @var \blitze\content\services\types */ |
||
21 | protected $content_types; |
||
22 | |||
23 | /** @var \blitze\sitemaker\services\forum\data */ |
||
24 | protected $forum; |
||
25 | |||
26 | /** @var integer */ |
||
27 | protected $cache_time; |
||
28 | |||
29 | /** |
||
30 | * Constructor |
||
31 | * |
||
32 | * @param \phpbb\db\driver\driver_interface $db Database object |
||
33 | * @param \phpbb\controller\helper $helper Helper object |
||
34 | * @param \blitze\content\services\types $content_types Content types object |
||
35 | * @param \blitze\sitemaker\services\forum\data $forum Forum Data object |
||
36 | * @param integer $cache_time Cache results for 3 hours by default |
||
37 | */ |
||
38 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\controller\helper $helper, \blitze\content\services\types $content_types, \blitze\sitemaker\services\forum\data $forum, $cache_time) |
||
46 | |||
47 | /** |
||
48 | * {@inheritdoc} |
||
49 | */ |
||
50 | public function get_config(array $settings) |
||
63 | |||
64 | /** |
||
65 | * {@inheritdoc} |
||
66 | */ |
||
67 | public function display(array $bdata, $edit_mode = false) |
||
95 | |||
96 | /** |
||
97 | * @param array $settings |
||
98 | * @return array |
||
99 | */ |
||
100 | protected function get_info(array $settings) |
||
101 | { |
||
102 | if ($settings['forum_id']) |
||
103 | { |
||
104 | return array( |
||
105 | 'forum_ids' => (array) $settings['forum_id'], |
||
106 | 'route_name' => 'blitze_content_type_filter', |
||
107 | 'route_params' => array('type' => $this->content_types->get_forum_type($settings['forum_id'])), |
||
108 | ); |
||
109 | } |
||
110 | else |
||
111 | { |
||
112 | return array( |
||
113 | 'forum_ids' => array_keys($this->content_types->get_forum_types()), |
||
114 | 'route_name' => 'blitze_content_filter', |
||
115 | 'route_params' => array(), |
||
116 | ); |
||
117 | } |
||
118 | } |
||
119 | |||
120 | /** |
||
121 | * @param array $forum_ids |
||
122 | * @return array |
||
123 | */ |
||
124 | protected function get_sql_array(array $forum_ids) |
||
138 | |||
139 | /** |
||
140 | * @return string[] |
||
141 | */ |
||
142 | protected function get_content_type_options() |
||
155 | } |
||
156 |