1 | <?php |
||
18 | class Main |
||
19 | { |
||
20 | |||
21 | /** |
||
22 | * An array of HTML Purifier instances keyed by filter configuration hash |
||
23 | * @var array |
||
24 | */ |
||
25 | protected $htmlpurifiers = array(); |
||
26 | |||
27 | /** |
||
28 | * Config class instance |
||
29 | * @var \gplcart\core\Config $config |
||
30 | */ |
||
31 | protected $config; |
||
32 | |||
33 | /** |
||
34 | * Library class instance |
||
35 | * @var \gplcart\core\Library $library |
||
36 | */ |
||
37 | protected $library; |
||
38 | |||
39 | /** |
||
40 | * @param Config $config |
||
41 | * @param Library $library |
||
42 | */ |
||
43 | public function __construct(Config $config, Library $library) |
||
48 | |||
49 | /** |
||
50 | * Implements hook "library.list" |
||
51 | * @param array $libraries |
||
52 | */ |
||
53 | public function hookLibraryList(array &$libraries) |
||
72 | |||
73 | /** |
||
74 | * Implements hook "route.list" |
||
75 | * @param array $routes |
||
76 | */ |
||
77 | public function hookRouteList(array &$routes) |
||
93 | |||
94 | /** |
||
95 | * Implements hook "user.role.permissions" |
||
96 | * @param array $permissions |
||
97 | */ |
||
98 | public function hookUserRolePermissions(array &$permissions) |
||
103 | |||
104 | /** |
||
105 | * Implements hook "filter" |
||
106 | * @param string $text |
||
107 | * @param array $filter |
||
108 | * @param null|string $filtered |
||
109 | */ |
||
110 | public function hookFilter($text, $filter, &$filtered) |
||
116 | |||
117 | /** |
||
118 | * Implements hook "filter.handlers" |
||
119 | * @param mixed $filters |
||
120 | */ |
||
121 | public function hookFilterHandlers(array &$filters) |
||
125 | |||
126 | /** |
||
127 | * Implements hook "module.enable.after" |
||
128 | */ |
||
129 | public function hookModuleEnableAfter() |
||
133 | |||
134 | /** |
||
135 | * Implements hook "module.disable.after" |
||
136 | */ |
||
137 | public function hookModuleDisableAfter() |
||
141 | |||
142 | /** |
||
143 | * Implements hook "module.install.after" |
||
144 | */ |
||
145 | public function hookModuleInstallAfter() |
||
149 | |||
150 | /** |
||
151 | * Implements hook "module.uninstall.after" |
||
152 | */ |
||
153 | public function hookModuleUninstallAfter() |
||
163 | |||
164 | /** |
||
165 | * Filter a string |
||
166 | * @param string $text |
||
167 | * @param array $filter |
||
168 | * @return string |
||
169 | */ |
||
170 | public function filter($text, $filter) |
||
174 | |||
175 | /** |
||
176 | * Returns HTML Purifier class instance depending on the filter configuration |
||
177 | * @param array $filter |
||
178 | * @return \HTMLPurifier |
||
179 | */ |
||
180 | public function getHtmlpurifierInstance(array $filter) |
||
199 | |||
200 | /** |
||
201 | * Returns an array of filter handlers |
||
202 | * @return array |
||
203 | */ |
||
204 | protected function getFilterHandlers() |
||
210 | |||
211 | } |
||
212 |