1 | <?php |
||
12 | class fields extends topic |
||
13 | { |
||
14 | /** @var \blitze\content\services\comments\comments_interface */ |
||
15 | protected $comments; |
||
16 | |||
17 | /** @var \blitze\content\services\form\fields_factory */ |
||
18 | protected $fields_factory; |
||
19 | |||
20 | /** @var array */ |
||
21 | protected $form_fields; |
||
22 | |||
23 | /** @var string */ |
||
24 | protected $content_type; |
||
25 | |||
26 | /** @var array */ |
||
27 | protected $content_fields; |
||
28 | |||
29 | /** @var string */ |
||
30 | protected $board_url = ''; |
||
31 | |||
32 | /** @var string */ |
||
33 | protected $tpl_name = ''; |
||
34 | |||
35 | /** @var string */ |
||
36 | protected $display_mode = ''; |
||
37 | |||
38 | /** @var string */ |
||
39 | protected $view_mode = ''; |
||
40 | |||
41 | /** @var array */ |
||
42 | protected $db_fields = array(); |
||
43 | |||
44 | /** @var array */ |
||
45 | protected $label = array('', 'label-hidden', 'label-inline', 'label-newline'); |
||
46 | |||
47 | /** |
||
48 | * Construct |
||
49 | * |
||
50 | * @param \phpbb\config\db $config Config object |
||
51 | * @param \phpbb\controller\helper $controller_helper Controller Helper object |
||
52 | * @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher object |
||
53 | * @param \phpbb\language\language $language Language object |
||
54 | * @param \phpbb\template\template $template Template object |
||
55 | * @param \phpbb\user $user User object |
||
56 | * @param \blitze\content\services\helper $helper Content helper object |
||
57 | * @param \blitze\content\services\comments\comments_interface $comments Comments object |
||
58 | * @param \blitze\content\services\form\fields_factory $fields_factory Form fields factory |
||
59 | */ |
||
60 | public function __construct(\phpbb\config\db $config, \phpbb\controller\helper $controller_helper, \phpbb\event\dispatcher_interface $phpbb_dispatcher, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, \blitze\content\services\helper $helper, \blitze\content\services\comments\comments_interface $comments, \blitze\content\services\form\fields_factory $fields_factory) |
||
67 | |||
68 | /** |
||
69 | * Set type data needed to display topics. This should only run once |
||
70 | * |
||
71 | * @param \blitze\content\model\entity\type $entity |
||
72 | * @param array $topic_ids |
||
73 | * @param array $view_mode_fields array of form array([field_name] => [field_type]) |
||
74 | * @param string $custom_tpl |
||
75 | * @param string $view_mode |
||
76 | * @param string $tpl_name |
||
77 | * @return void |
||
78 | */ |
||
79 | public function prepare_to_show(\blitze\content\model\entity\type $entity, array $topic_ids, array $view_mode_fields, $custom_tpl, $view_mode, $tpl_name = null) |
||
108 | |||
109 | /** |
||
110 | * @param string $type |
||
111 | * @param array $topic_data |
||
112 | * @param array $post_data |
||
113 | * @param array $users_cache |
||
114 | * @param array $attachments |
||
115 | * @param array $update_count |
||
116 | * @param array $topic_tracking_info |
||
117 | * @param array $topic_data_overwrite |
||
118 | * @param string $mode |
||
119 | * @return array |
||
120 | */ |
||
121 | 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 = '') |
||
136 | |||
137 | /** |
||
138 | * @param array $tpl_data |
||
139 | * @return array |
||
140 | */ |
||
141 | public function build_content(array $tpl_data) |
||
159 | |||
160 | /** |
||
161 | * @param array $view_mode_fields array of form array([field_name] => [field_type]) |
||
162 | * @param array $fields_data |
||
163 | * @return void |
||
164 | */ |
||
165 | public function set_content_fields(array $view_mode_fields, array $fields_data) |
||
175 | |||
176 | /** |
||
177 | * @param array $view_mode_fields array of form array([field_name] => [field_type]) |
||
178 | * @return void |
||
179 | */ |
||
180 | public function set_form_fields(array $view_mode_fields) |
||
184 | |||
185 | /** |
||
186 | * @param string $type |
||
187 | * @return void |
||
188 | */ |
||
189 | public function set_content_type($type) |
||
193 | |||
194 | /** |
||
195 | * @param array $tpl_data |
||
196 | * @return array |
||
197 | */ |
||
198 | protected function get_fields_data_for_display(array &$tpl_data) |
||
230 | |||
231 | /** |
||
232 | * @param int $label_type |
||
233 | * @param string $label_text |
||
234 | * @return string |
||
235 | */ |
||
236 | protected function get_field_label($label_type, $label_text) |
||
245 | |||
246 | /** |
||
247 | * @param array $tpl_data |
||
248 | * @return array |
||
249 | */ |
||
250 | protected function get_field_values(array &$tpl_data) |
||
260 | |||
261 | /** |
||
262 | * @param string $post_text |
||
263 | * @return array |
||
264 | */ |
||
265 | protected function get_fields_data_from_post($post_text) |
||
276 | |||
277 | /** |
||
278 | * @return void |
||
279 | */ |
||
280 | protected function reset() |
||
287 | } |
||
288 |