1 | <?php |
||
32 | class PostingHelper extends AppHelper |
||
33 | { |
||
34 | public $helpers = ['Form', 'Html', 'TimeH']; |
||
35 | |||
36 | /** |
||
37 | * @var array perf-cheat for renderers |
||
38 | */ |
||
39 | protected $_renderers = []; |
||
40 | |||
41 | /** |
||
42 | * @var SaitoEventManager |
||
43 | */ |
||
44 | protected $_SEM; |
||
45 | |||
46 | /** |
||
47 | * get paginated index |
||
48 | * |
||
49 | * @param int $tid tid |
||
50 | * @param null|string $lastAction last action |
||
51 | * @return string |
||
52 | */ |
||
53 | public function getPaginatedIndexPageId(int $tid, ?string $lastAction = null): string |
||
66 | |||
67 | /** |
||
68 | * Get fast link for posting. |
||
69 | * |
||
70 | * @param BasicPostingInterface $posting posting |
||
71 | * @param array $options options |
||
72 | * @return string HTML |
||
73 | */ |
||
74 | public function getFastLink(BasicPostingInterface $posting, array $options = []) |
||
84 | |||
85 | /** |
||
86 | * Render view counter |
||
87 | * |
||
88 | * @param BasicPostingInterface $posting posting |
||
89 | * |
||
90 | * @return string |
||
91 | */ |
||
92 | public function views(BasicPostingInterface $posting) |
||
96 | |||
97 | /** |
||
98 | * renders a posting tree as thread |
||
99 | * |
||
100 | * @param PostingInterface $tree passed as reference to share CU-decorator "up" |
||
101 | * @param array $options options |
||
102 | * - 'renderer' [thread]|mix |
||
103 | * @return string |
||
104 | * @internal param CurrentUser $CurrentUser current user |
||
105 | */ |
||
106 | public function renderThread(PostingInterface $tree, array $options = []) |
||
142 | |||
143 | /** |
||
144 | * Get badges |
||
145 | * |
||
146 | * @param PostingInterface $entry posting |
||
147 | * @return string |
||
148 | */ |
||
149 | public function getBadges(PostingInterface $entry) |
||
172 | |||
173 | /** |
||
174 | * Get solved badge |
||
175 | * |
||
176 | * @return string |
||
177 | */ |
||
178 | public function solvedBadge() |
||
183 | |||
184 | /** |
||
185 | * This function may be called serveral hundred times on the front page. |
||
186 | * Don't make ist slow, benchmark! |
||
187 | * |
||
188 | * @param BasicPostingInterface $posting posting |
||
189 | * @return string |
||
190 | */ |
||
191 | public function getSubject(BasicPostingInterface $posting) |
||
195 | |||
196 | /** |
||
197 | * Gets SaitoEventManager |
||
198 | * |
||
199 | * @return SaitoEventManager |
||
200 | */ |
||
201 | private function getSaitoEventManager(): SaitoEventManager |
||
209 | } |
||
210 |