1 | <?php |
||
23 | class bbcodes_display |
||
24 | { |
||
25 | /** @var auth */ |
||
26 | protected $auth; |
||
27 | |||
28 | /** @var config */ |
||
29 | protected $config; |
||
30 | |||
31 | /** @var driver_interface */ |
||
32 | protected $db; |
||
33 | |||
34 | /** @var manager */ |
||
35 | protected $extension_manager; |
||
36 | |||
37 | /** @var user */ |
||
38 | protected $user; |
||
39 | |||
40 | /** @var string */ |
||
41 | protected $root_path; |
||
42 | |||
43 | /** @var array */ |
||
44 | protected $memberships; |
||
45 | |||
46 | /** |
||
47 | 13 | * Constructor |
|
48 | * |
||
49 | 13 | * @param auth $auth Auth object |
|
50 | 13 | * @param config $config Config object |
|
51 | 13 | * @param driver_interface $db Database connection |
|
52 | 13 | * @param manager $extension_manager Extension manager object |
|
53 | 13 | * @param user $user User object |
|
54 | * @param string $root_path Path to phpBB root |
||
55 | * @access public |
||
56 | */ |
||
57 | public function __construct(auth $auth, config $config, driver_interface $db, manager $extension_manager, user $user, $root_path) |
||
66 | |||
67 | 1 | /** |
|
68 | * Display allowed custom BBCodes with icons |
||
69 | 1 | * |
|
70 | 1 | * Uses GIF images named exactly the same as the bbcode_tag |
|
71 | 1 | * |
|
72 | 1 | * @param array $custom_tags Template data of the bbcode |
|
73 | * @param array $row The data of the bbcode |
||
74 | 1 | * @return array Update template data of the bbcode |
|
75 | 1 | * @access public |
|
76 | */ |
||
77 | 1 | public function display_custom_bbcodes($custom_tags, $row) |
|
88 | |||
89 | /** |
||
90 | 3 | * Disable BBCodes not allowed by a user's group(s). |
|
91 | * |
||
92 | 3 | * @param parser $service Object from the text_formatter.parser service |
|
93 | 3 | * @return void |
|
94 | * @access public |
||
95 | 3 | */ |
|
96 | 3 | public function allow_custom_bbcodes(parser $service) |
|
108 | |||
109 | /** |
||
110 | 13 | * Determine if a user is in a group allowed to use a custom BBCode |
|
111 | * |
||
112 | * @param string|array $group_ids Allowed group IDs, comma separated string or array |
||
113 | 13 | * @return bool Return true if allowed to use BBCode |
|
114 | * @access public |
||
115 | 9 | */ |
|
116 | 9 | public function user_in_bbcode_group($group_ids = '') |
|
135 | |||
136 | 1 | /** |
|
137 | * Get paths/names to ABBC3's BBCode icons. |
||
138 | 1 | * Search in ABBC3's icons dir and also the core's images dir. |
|
139 | * |
||
140 | * @return array Array of icon paths: ['foo' => './ext/vse/abbc3/images/icons/foo.png'] |
||
141 | 1 | * @access public |
|
142 | 1 | */ |
|
143 | 1 | public function get_icons() |
|
167 | 9 | ||
168 | 9 | /** |
|
169 | 9 | * Load this user's group memberships if it's not cached already |
|
170 | * |
||
171 | * @access protected |
||
172 | */ |
||
173 | protected function load_memberships() |
||
192 | |||
193 | /** |
||
194 | * Set BBCode statuses for posting IMG, URL, FLASH and QUOTE in a forum. |
||
195 | * |
||
196 | * @param int $forum_id The forum identifier |
||
197 | * @return array An array containing booleans for each BBCode status |
||
198 | */ |
||
199 | public function bbcode_statuses($forum_id) |
||
222 | } |
||
223 |