1 | <?php |
||
20 | class bbcodes_display |
||
21 | { |
||
22 | /** @var driver_interface */ |
||
23 | protected $db; |
||
24 | |||
25 | /** @var manager */ |
||
26 | protected $extension_manager; |
||
27 | |||
28 | /** @var user */ |
||
29 | protected $user; |
||
30 | |||
31 | /** @var string */ |
||
32 | protected $ext_root_path; |
||
33 | |||
34 | /** @var array */ |
||
35 | protected $memberships; |
||
36 | |||
37 | /** |
||
38 | * Constructor |
||
39 | * |
||
40 | * @param driver_interface $db Database connection |
||
41 | * @param manager $extension_manager Extension manager object |
||
42 | * @param user $user User object |
||
43 | * @param string $ext_root_path Path to abbc3 extension root |
||
44 | * @access public |
||
45 | */ |
||
46 | 11 | public function __construct(driver_interface $db, manager $extension_manager, user $user, $ext_root_path) |
|
53 | |||
54 | /** |
||
55 | * Display allowed custom BBCodes with icons |
||
56 | * |
||
57 | * Uses GIF images named exactly the same as the bbcode_tag |
||
58 | * |
||
59 | * @param array $custom_tags Template data of the bbcode |
||
60 | * @param array $row The data of the bbcode |
||
61 | * @return array Update template data of the bbcode |
||
62 | * @access public |
||
63 | */ |
||
64 | 1 | public function display_custom_bbcodes($custom_tags, $row) |
|
80 | |||
81 | /** |
||
82 | * Set custom BBCodes to 'disabled' if they are not allowed to be used |
||
83 | * |
||
84 | * @param array $bbcodes Array of bbcode data for use in parsing |
||
85 | * @param array $rowset Array of bbcode data from the database |
||
86 | * @return array The bbcodes data array |
||
87 | * @access public |
||
88 | * |
||
89 | * @deprecated 3.2.0. Provides bc for phpBB 3.1.x. |
||
90 | */ |
||
91 | public function allow_custom_bbcodes($bbcodes, $rowset) |
||
103 | |||
104 | /** |
||
105 | * Determine if a user is in a group allowed to use a custom BBCode |
||
106 | * |
||
107 | * @param string $group_ids Allowed group IDs, comma separated |
||
108 | * @return bool Return true if allowed to use BBCode |
||
109 | * @access public |
||
110 | */ |
||
111 | 11 | public function user_in_bbcode_group($group_ids = '') |
|
130 | |||
131 | /** |
||
132 | * Get image paths/names from ABBC3's icons folder |
||
133 | * |
||
134 | * @return array File data from ./ext/vse/abbc3/images/icons |
||
135 | * @access protected |
||
136 | */ |
||
137 | 1 | protected function get_images() |
|
146 | |||
147 | /** |
||
148 | * Load this user's group memberships if it's not cached already |
||
149 | * |
||
150 | * @return null |
||
151 | * @access protected |
||
152 | */ |
||
153 | 7 | protected function load_memberships() |
|
172 | } |
||
173 |