1 | <?php |
||
20 | class display extends base |
||
21 | { |
||
22 | /** @var int default width of topic preview */ |
||
23 | const PREVIEW_SIZE = 360; |
||
24 | |||
25 | /** @var int default height and width of topic preview avatars */ |
||
26 | const AVATAR_SIZE = 60; |
||
27 | |||
28 | /** @var dispatcher_interface */ |
||
29 | protected $dispatcher; |
||
30 | |||
31 | /** @var language */ |
||
32 | protected $language; |
||
33 | |||
34 | /** @var template */ |
||
35 | protected $template; |
||
36 | |||
37 | /** @var string phpBB root path */ |
||
38 | protected $root_path; |
||
39 | |||
40 | /** @var trim */ |
||
41 | protected $trim; |
||
42 | |||
43 | /** |
||
44 | * Constructor |
||
45 | * |
||
46 | * @param config $config Config object |
||
47 | * @param dispatcher_interface $dispatcher Event dispatcher object |
||
48 | * @param language $language Language object |
||
49 | * @param template $template Template object |
||
50 | * @param trim $trim Trim text object |
||
51 | * @param user $user User object |
||
52 | * @param string $root_path |
||
53 | */ |
||
54 | 9 | public function __construct(config $config, dispatcher_interface $dispatcher, language $language, template $template, trim $trim, user $user, $root_path) |
|
65 | |||
66 | /** |
||
67 | * Set up some common components |
||
68 | */ |
||
69 | 9 | public function setup() |
|
85 | |||
86 | /** |
||
87 | * Inject topic preview text into the template |
||
88 | * |
||
89 | * @param array $row Row data |
||
90 | * @param array $block Template vars array |
||
91 | * |
||
92 | * @return array Template vars array |
||
93 | */ |
||
94 | 6 | public function display_topic_preview($row, $block) |
|
124 | |||
125 | /** |
||
126 | * Get topic preview text helper function |
||
127 | * This handles the trimming and censoring |
||
128 | * |
||
129 | * @param array $row User row data |
||
130 | * @param string $post The first or last post text column key |
||
131 | * |
||
132 | * @return string The trimmed and censored topic preview text |
||
133 | */ |
||
134 | 5 | protected function get_text_helper($row, $post) |
|
144 | |||
145 | /** |
||
146 | * Get user avatar helper function |
||
147 | * |
||
148 | * @param array $row User row data |
||
149 | * @param string $poster Type of poster, fp or lp |
||
150 | * |
||
151 | * @return string Avatar image |
||
152 | */ |
||
153 | 5 | protected function get_user_avatar_helper($row, $poster) |
|
175 | |||
176 | /** |
||
177 | * Get user's style topic preview theme |
||
178 | * Fall back to no theme if expected theme not found |
||
179 | * |
||
180 | * @return mixed Theme name if theme file found, false otherwise |
||
181 | */ |
||
182 | 9 | protected function get_theme() |
|
191 | } |
||
192 |