Rev 703 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
635 | daniel-mar | 1 | <?php |
2 | |||
3 | /* |
||
4 | * OIDplus 2.0 |
||
5 | * Copyright 2019 - 2021 Daniel Marschall, ViaThinkSoft |
||
6 | * |
||
7 | * Licensed under the Apache License, Version 2.0 (the "License"); |
||
8 | * you may not use this file except in compliance with the License. |
||
9 | * You may obtain a copy of the License at |
||
10 | * |
||
11 | * http://www.apache.org/licenses/LICENSE-2.0 |
||
12 | * |
||
13 | * Unless required by applicable law or agreed to in writing, software |
||
14 | * distributed under the License is distributed on an "AS IS" BASIS, |
||
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||
16 | * See the License for the specific language governing permissions and |
||
17 | * limitations under the License. |
||
18 | */ |
||
19 | |||
20 | if (!defined('INSIDE_OIDPLUS')) die(); |
||
21 | |||
22 | class OIDplusPageAdminPlugins extends OIDplusPagePluginAdmin { |
||
23 | |||
24 | public function init($html=true) { |
||
25 | } |
||
26 | |||
27 | public function gui($id, &$out, &$handled) { |
||
28 | $tmp = explode('$',$id); |
||
29 | $classname = isset($tmp[1]) ? $tmp[1] : null; |
||
30 | |||
31 | $parts = explode('.',$tmp[0],2); |
||
32 | if (!isset($parts[1])) $parts[1] = ''; |
||
33 | if ($parts[0] != 'oidplus:system_plugins') return; |
||
34 | $handled = true; |
||
35 | $out['title'] = _L('Installed plugins'); |
||
36 | $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : ''; |
||
37 | |||
38 | if (!OIDplus::authUtils()->isAdminLoggedIn()) { |
||
39 | $out['icon'] = 'img/error_big.png'; |
||
40 | $out['text'] = '<p>'._L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')).'</p>'; |
||
41 | return; |
||
42 | } |
||
43 | |||
44 | if (!is_null($classname)) { |
||
45 | $plugin = OIDplus::getPluginByClassName($classname); |
||
46 | if (is_null($plugin)) { |
||
47 | $out['icon'] = 'img/error_big.png'; |
||
48 | $out['text'] = '<p>'._L('Plugin %1 not found.',$classname).'</p>'; |
||
49 | return; |
||
50 | } |
||
51 | |||
52 | $out['title'] = empty($plugin->getManifest()->getName()) ? htmlentities($classname) : htmlentities($plugin->getManifest()->getName()); |
||
53 | $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : ''; |
||
54 | |||
55 | $back_link = 'oidplus:system_plugins'; |
||
56 | if (get_parent_class($classname) == 'OIDplusPagePluginPublic') $back_link = 'oidplus:system_plugins.pages.public'; |
||
57 | if (get_parent_class($classname) == 'OIDplusPagePluginRa') $back_link = 'oidplus:system_plugins.pages.ra'; |
||
58 | if (get_parent_class($classname) == 'OIDplusPagePluginAdmin') $back_link = 'oidplus:system_plugins.pages.admin'; |
||
59 | if (get_parent_class($classname) == 'OIDplusObjectTypePlugin') $back_link = 'oidplus:system_plugins.objects'; |
||
60 | if (get_parent_class($classname) == 'OIDplusDatabasePlugin') $back_link = 'oidplus:system_plugins.database'; |
||
61 | if (get_parent_class($classname) == 'OIDplusSqlSlangPlugin') $back_link = 'oidplus:system_plugins.sql'; |
||
62 | if (get_parent_class($classname) == 'OIDplusAuthPlugin') $back_link = 'oidplus:system_plugins.auth'; |
||
63 | if (get_parent_class($classname) == 'OIDplusLoggerPlugin') $back_link = 'oidplus:system_plugins.logger'; |
||
64 | if (get_parent_class($classname) == 'OIDplusLanguagePlugin') $back_link = 'oidplus:system_plugins.language'; |
||
65 | if (get_parent_class($classname) == 'OIDplusDesignPlugin') $back_link = 'oidplus:system_plugins.design'; |
||
66 | $out['text'] = '<p><a '.OIDplus::gui()->link($back_link).'><img src="img/arrow_back.png" width="16" alt="'._L('Go back').'"> '._L('Go back').'</a></p>'; |
||
67 | |||
68 | $out['text'] .= '<div><label class="padding_label">'._L('Class name').'</label><b>'.htmlentities($classname).'</b></div>'. |
||
69 | '<div><label class="padding_label">'._L('Location').'</label><b>'.htmlentities($plugin->getPluginDirectory()).'</b></div>'. |
||
70 | '<div><label class="padding_label">'._L('Plugin type').'</label><b>'.htmlentities(get_parent_class($classname)).'</b></div>'. |
||
71 | '<div><label class="padding_label">'._L('Plugin name').'</label><b>'.htmlentities(empty($plugin->getManifest()->getName()) ? _L('n/a') : $plugin->getManifest()->getName()).'</b></div>'. |
||
72 | '<div><label class="padding_label">'._L('Plugin author').'</label><b>'.htmlentities(empty($plugin->getManifest()->getAuthor()) ? _L('n/a') : $plugin->getManifest()->getAuthor()).'</b></div>'. |
||
73 | '<div><label class="padding_label">'._L('Plugin version').'</label><b>'.htmlentities(empty($plugin->getManifest()->getVersion()) ? _L('n/a') : $plugin->getManifest()->getVersion()).'</b></div>'. |
||
74 | '<div><label class="padding_label">'._L('Plugin OID').'</label><b>'.htmlentities(empty($plugin->getManifest()->getOid()) ? _L('n/a') : $plugin->getManifest()->getOid()).'</b></div>'. |
||
75 | (!empty(trim($plugin->getManifest()->getHtmlDescription())) ? '<br><p><b>'._L('Additional information').':</b></p>' : ''). |
||
76 | $plugin->getManifest()->getHtmlDescription(); |
||
77 | } else { |
||
78 | $show_pages_public = false; |
||
79 | $show_pages_ra = false; |
||
80 | $show_pages_admin = false; |
||
81 | $show_db_active = false; |
||
82 | $show_db_inactive = false; |
||
83 | $show_sql_active = false; |
||
84 | $show_sql_inactive = false; |
||
85 | $show_obj_active = false; |
||
86 | $show_obj_inactive = false; |
||
87 | $show_auth = false; |
||
88 | $show_logger = false; |
||
89 | $show_language = false; |
||
90 | $show_design_active = false; |
||
91 | $show_design_inactive = false; |
||
92 | |||
93 | if ($parts[1] == '') { |
||
94 | $out['title'] = _L('Installed plugins'); |
||
95 | $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : ''; |
||
96 | $show_pages_public = true; |
||
97 | $show_pages_ra = true; |
||
98 | $show_pages_admin = true; |
||
99 | $show_db_active = true; |
||
100 | $show_db_inactive = true; |
||
101 | $show_sql_active = true; |
||
102 | $show_sql_inactive = true; |
||
103 | $show_obj_active = true; |
||
104 | $show_obj_inactive = true; |
||
105 | $show_auth = true; |
||
106 | $show_logger = true; |
||
107 | $show_language = true; |
||
108 | $show_design_active = true; |
||
109 | $show_design_inactive = true; |
||
110 | } else if ($parts[1] == 'pages') { |
||
111 | $out['title'] = _L('Page plugins'); |
||
112 | $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : ''; |
||
113 | $out['text'] = '<p><a '.OIDplus::gui()->link('oidplus:system_plugins').'><img src="img/arrow_back.png" width="16" alt="'._L('Go back').'"> '._L('Go back').'</a></p>'; |
||
114 | $show_pages_public = true; |
||
115 | $show_pages_ra = true; |
||
116 | $show_pages_admin = true; |
||
117 | } else if ($parts[1] == 'pages.public') { |
||
118 | $out['title'] = _L('Public page plugins'); |
||
119 | $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : ''; |
||
120 | $out['text'] = '<p><a '.OIDplus::gui()->link('oidplus:system_plugins.pages').'><img src="img/arrow_back.png" width="16" alt="'._L('Go back').'"> '._L('Go back').'</a></p>'; |
||
121 | $show_pages_public = true; |
||
122 | } else if ($parts[1] == 'pages.ra') { |
||
123 | $out['title'] = _L('RA page plugins'); |
||
124 | $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : ''; |
||
125 | $out['text'] = '<p><a '.OIDplus::gui()->link('oidplus:system_plugins.pages').'><img src="img/arrow_back.png" width="16" alt="'._L('Go back').'"> '._L('Go back').'</a></p>'; |
||
126 | $show_pages_ra = true; |
||
127 | } else if ($parts[1] == 'pages.admin') { |
||
128 | $out['title'] = _L('Admin page plugins'); |
||
129 | $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : ''; |
||
130 | $out['text'] = '<p><a '.OIDplus::gui()->link('oidplus:system_plugins.pages').'><img src="img/arrow_back.png" width="16" alt="'._L('Go back').'"> '._L('Go back').'</a></p>'; |
||
131 | $show_pages_admin = true; |
||
132 | } else if ($parts[1] == 'objects') { |
||
133 | $out['title'] = _L('Object type plugins'); |
||
134 | $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : ''; |
||
135 | $out['text'] = '<p><a '.OIDplus::gui()->link('oidplus:system_plugins').'><img src="img/arrow_back.png" width="16" alt="'._L('Go back').'"> '._L('Go back').'</a></p>'; |
||
136 | $show_obj_active = true; |
||
137 | $show_obj_inactive = true; |
||
138 | } else if ($parts[1] == 'objects.enabled') { |
||
139 | $out['title'] = _L('Object type plugins (enabled)'); |
||
140 | $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : ''; |
||
141 | $out['text'] = '<p><a '.OIDplus::gui()->link('oidplus:system_plugins').'><img src="img/arrow_back.png" width="16" alt="'._L('Go back').'"> '._L('Go back').'</a></p>'; |
||
142 | $show_obj_active = true; |
||
143 | } else if ($parts[1] == 'objects.disabled') { |
||
144 | $out['title'] = _L('Object type plugins (disabled)'); |
||
145 | $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : ''; |
||
146 | $out['text'] = '<p><a '.OIDplus::gui()->link('oidplus:system_plugins').'><img src="img/arrow_back.png" width="16" alt="'._L('Go back').'"> '._L('Go back').'</a></p>'; |
||
147 | $show_obj_inactive = true; |
||
148 | } else if ($parts[1] == 'database') { |
||
149 | $out['title'] = _L('Database provider plugins'); |
||
150 | $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : ''; |
||
151 | $out['text'] = '<p><a '.OIDplus::gui()->link('oidplus:system_plugins').'><img src="img/arrow_back.png" width="16" alt="'._L('Go back').'"> '._L('Go back').'</a></p>'; |
||
152 | $show_db_active = true; |
||
153 | $show_db_inactive = true; |
||
154 | } else if ($parts[1] == 'database.enabled') { |
||
155 | $out['title'] = _L('Database provider plugins (active)'); |
||
156 | $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : ''; |
||
157 | $out['text'] = '<p><a '.OIDplus::gui()->link('oidplus:system_plugins').'><img src="img/arrow_back.png" width="16" alt="'._L('Go back').'"> '._L('Go back').'</a></p>'; |
||
158 | $show_db_active = true; |
||
159 | } else if ($parts[1] == 'database.disabled') { |
||
160 | $out['title'] = _L('Database provider plugins (inactive)'); |
||
161 | $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : ''; |
||
162 | $out['text'] = '<p><a '.OIDplus::gui()->link('oidplus:system_plugins').'><img src="img/arrow_back.png" width="16" alt="'._L('Go back').'"> '._L('Go back').'</a></p>'; |
||
163 | $show_db_inactive = true; |
||
164 | } else if ($parts[1] == 'sql') { |
||
165 | $out['title'] = _L('SQL slang plugins'); |
||
166 | $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : ''; |
||
167 | $out['text'] = '<p><a '.OIDplus::gui()->link('oidplus:system_plugins').'><img src="img/arrow_back.png" width="16" alt="'._L('Go back').'"> '._L('Go back').'</a></p>'; |
||
168 | $show_sql_active = true; |
||
169 | $show_sql_inactive = true; |
||
170 | } else if ($parts[1] == 'sql.enabled') { |
||
171 | $out['title'] = _L('SQL slang plugins (active)'); |
||
172 | $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : ''; |
||
173 | $out['text'] = '<p><a '.OIDplus::gui()->link('oidplus:system_plugins').'><img src="img/arrow_back.png" width="16" alt="'._L('Go back').'"> '._L('Go back').'</a></p>'; |
||
174 | $show_sql_active = true; |
||
175 | } else if ($parts[1] == 'sql.disabled') { |
||
176 | $out['title'] = _L('SQL slang plugins (inactive)'); |
||
177 | $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : ''; |
||
178 | $out['text'] = '<p><a '.OIDplus::gui()->link('oidplus:system_plugins').'><img src="img/arrow_back.png" width="16" alt="'._L('Go back').'"> '._L('Go back').'</a></p>'; |
||
179 | $show_sql_inactive = true; |
||
180 | } else if ($parts[1] == 'auth') { |
||
181 | $out['title'] = _L('RA authentication'); |
||
182 | $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : ''; |
||
183 | $out['text'] = '<p><a '.OIDplus::gui()->link('oidplus:system_plugins').'><img src="img/arrow_back.png" width="16" alt="'._L('Go back').'"> '._L('Go back').'</a></p>'; |
||
184 | $show_auth = true; |
||
185 | } else if ($parts[1] == 'logger') { |
||
186 | $out['title'] = _L('Logger'); |
||
187 | $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : ''; |
||
188 | $out['text'] = '<p><a '.OIDplus::gui()->link('oidplus:system_plugins').'><img src="img/arrow_back.png" width="16" alt="'._L('Go back').'"> '._L('Go back').'</a></p>'; |
||
189 | $show_logger = true; |
||
190 | } else if ($parts[1] == 'language') { |
||
191 | $out['title'] = _L('Languages'); |
||
192 | $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : ''; |
||
193 | $out['text'] = '<p><a '.OIDplus::gui()->link('oidplus:system_plugins').'><img src="img/arrow_back.png" width="16" alt="'._L('Go back').'"> '._L('Go back').'</a></p>'; |
||
194 | $show_language = true; |
||
195 | } else if ($parts[1] == 'design') { |
||
196 | $out['title'] = _L('Designs'); |
||
197 | $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : ''; |
||
198 | $out['text'] = '<p><a '.OIDplus::gui()->link('oidplus:system_plugins').'><img src="img/arrow_back.png" width="16" alt="'._L('Go back').'"> '._L('Go back').'</a></p>'; |
||
199 | $show_design_active = true; |
||
200 | $show_design_inactive = true; |
||
201 | } else { |
||
202 | $out['title'] = _L('Error'); |
||
203 | $out['icon'] = 'img/error_big.png'; |
||
204 | $out['text'] = '<p>'._L('Invalid arguments').'</p>'; |
||
205 | $out['text'] .= '<p><a '.OIDplus::gui()->link('oidplus:system_plugins').'><img src="img/arrow_back.png" width="16" alt="'._L('Go back').'"> '._L('Go back').'</a></p>'; |
||
206 | return; |
||
207 | } |
||
208 | |||
209 | $pp_public = array(); |
||
210 | $pp_ra = array(); |
||
211 | $pp_admin = array(); |
||
212 | |||
213 | foreach (OIDplus::getPagePlugins() as $plugin) { |
||
214 | if (is_subclass_of($plugin, OIDplusPagePluginPublic::class)) { |
||
215 | $pp_public[] = $plugin; |
||
216 | } |
||
217 | if (is_subclass_of($plugin, OIDplusPagePluginRa::class)) { |
||
218 | $pp_ra[] = $plugin; |
||
219 | } |
||
220 | if (is_subclass_of($plugin, OIDplusPagePluginAdmin::class)) { |
||
221 | $pp_admin[] = $plugin; |
||
222 | } |
||
223 | } |
||
224 | |||
225 | if ($show_pages_public) { |
||
226 | if (count($plugins = $pp_public) > 0) { |
||
227 | $out['text'] .= '<h2>'._L('Public page plugins').'</h2>'; |
||
228 | $out['text'] .= '<div class="container box"><div id="suboid_table" class="table-responsive">'; |
||
229 | $out['text'] .= '<table class="table table-bordered table-striped">'; |
||
230 | $out['text'] .= ' <tr>'; |
||
231 | $out['text'] .= ' <th width="25%">'._L('Class name').'</th>'; |
||
232 | $out['text'] .= ' <th width="25%">'._L('Plugin name').'</th>'; |
||
233 | $out['text'] .= ' <th width="25%">'._L('Plugin version').'</th>'; |
||
234 | $out['text'] .= ' <th width="25%">'._L('Plugin author').'</th>'; |
||
235 | $out['text'] .= ' </tr>'; |
||
236 | foreach ($plugins as $plugin) { |
||
237 | $out['text'] .= ' <tr>'; |
||
238 | $out['text'] .= '<td><a '.OIDplus::gui()->link('oidplus:system_plugins$'.get_class($plugin)).'>'.htmlentities(get_class($plugin)).'</a></td>'; |
||
239 | $out['text'] .= '<td>' . htmlentities(empty($plugin->getManifest()->getName()) ? _L('n/a') : $plugin->getManifest()->getName()) . '</td>'; |
||
240 | $out['text'] .= '<td>' . htmlentities(empty($plugin->getManifest()->getVersion()) ? _L('n/a') : $plugin->getManifest()->getVersion()) . '</td>'; |
||
241 | $out['text'] .= '<td>' . htmlentities(empty($plugin->getManifest()->getAuthor()) ? _L('n/a') : $plugin->getManifest()->getAuthor()) . '</td>'; |
||
242 | $out['text'] .= ' </tr>'; |
||
243 | } |
||
244 | $out['text'] .= '</table>'; |
||
245 | $out['text'] .= '</div></div>'; |
||
246 | } |
||
247 | } |
||
248 | |||
249 | if ($show_pages_ra) { |
||
250 | if (count($plugins = $pp_ra) > 0) { |
||
251 | $out['text'] .= '<h2>'._L('RA page plugins').'</h2>'; |
||
252 | $out['text'] .= '<div class="container box"><div id="suboid_table" class="table-responsive">'; |
||
253 | $out['text'] .= '<table class="table table-bordered table-striped">'; |
||
254 | $out['text'] .= ' <tr>'; |
||
255 | $out['text'] .= ' <th width="25%">'._L('Class name').'</th>'; |
||
256 | $out['text'] .= ' <th width="25%">'._L('Plugin name').'</th>'; |
||
257 | $out['text'] .= ' <th width="25%">'._L('Plugin version').'</th>'; |
||
258 | $out['text'] .= ' <th width="25%">'._L('Plugin author').'</th>'; |
||
259 | $out['text'] .= ' </tr>'; |
||
260 | foreach ($plugins as $plugin) { |
||
261 | $out['text'] .= ' <tr>'; |
||
262 | $out['text'] .= '<td><a '.OIDplus::gui()->link('oidplus:system_plugins$'.get_class($plugin)).'>'.htmlentities(get_class($plugin)).'</a></td>'; |
||
263 | $out['text'] .= '<td>' . htmlentities(empty($plugin->getManifest()->getName()) ? _L('n/a') : $plugin->getManifest()->getName()) . '</td>'; |
||
264 | $out['text'] .= '<td>' . htmlentities(empty($plugin->getManifest()->getVersion()) ? _L('n/a') : $plugin->getManifest()->getVersion()) . '</td>'; |
||
265 | $out['text'] .= '<td>' . htmlentities(empty($plugin->getManifest()->getAuthor()) ? _L('n/a') : $plugin->getManifest()->getAuthor()) . '</td>'; |
||
266 | $out['text'] .= ' </tr>'; |
||
267 | } |
||
268 | $out['text'] .= '</table>'; |
||
269 | $out['text'] .= '</div></div>'; |
||
270 | } |
||
271 | } |
||
272 | |||
273 | if ($show_pages_admin) { |
||
274 | if (count($plugins = $pp_admin) > 0) { |
||
275 | $out['text'] .= '<h2>'._L('Admin page plugins').'</h2>'; |
||
276 | $out['text'] .= '<div class="container box"><div id="suboid_table" class="table-responsive">'; |
||
277 | $out['text'] .= '<table class="table table-bordered table-striped">'; |
||
278 | $out['text'] .= ' <tr>'; |
||
279 | $out['text'] .= ' <th width="25%">'._L('Class name').'</th>'; |
||
280 | $out['text'] .= ' <th width="25%">'._L('Plugin name').'</th>'; |
||
281 | $out['text'] .= ' <th width="25%">'._L('Plugin version').'</th>'; |
||
282 | $out['text'] .= ' <th width="25%">'._L('Plugin author').'</th>'; |
||
283 | $out['text'] .= ' </tr>'; |
||
284 | foreach ($plugins as $plugin) { |
||
285 | $out['text'] .= ' <tr>'; |
||
286 | $out['text'] .= '<td><a '.OIDplus::gui()->link('oidplus:system_plugins$'.get_class($plugin)).'>'.htmlentities(get_class($plugin)).'</a></td>'; |
||
287 | $out['text'] .= '<td>' . htmlentities(empty($plugin->getManifest()->getName()) ? _L('n/a') : $plugin->getManifest()->getName()) . '</td>'; |
||
288 | $out['text'] .= '<td>' . htmlentities(empty($plugin->getManifest()->getVersion()) ? _L('n/a') : $plugin->getManifest()->getVersion()) . '</td>'; |
||
289 | $out['text'] .= '<td>' . htmlentities(empty($plugin->getManifest()->getAuthor()) ? _L('n/a') : $plugin->getManifest()->getAuthor()) . '</td>'; |
||
290 | $out['text'] .= ' </tr>'; |
||
291 | } |
||
292 | $out['text'] .= '</table>'; |
||
293 | $out['text'] .= '</div></div>'; |
||
294 | } |
||
295 | } |
||
296 | |||
297 | if ($show_obj_active || $show_obj_inactive) { |
||
298 | $enabled = $show_obj_active ? OIDplus::getObjectTypePluginsEnabled() : array(); |
||
299 | $disabled = $show_obj_inactive ? OIDplus::getObjectTypePluginsDisabled() : array(); |
||
300 | if (count($plugins = array_merge($enabled, $disabled)) > 0) { |
||
301 | $out['text'] .= '<h2>'._L('Object types').'</h2>'; |
||
302 | $out['text'] .= '<div class="container box"><div id="suboid_table" class="table-responsive">'; |
||
303 | $out['text'] .= '<table class="table table-bordered table-striped">'; |
||
304 | $out['text'] .= ' <tr>'; |
||
305 | $out['text'] .= ' <th width="25%">'._L('Class name').'</th>'; |
||
306 | $out['text'] .= ' <th width="25%">'._L('Plugin name').'</th>'; |
||
307 | $out['text'] .= ' <th width="25%">'._L('Plugin version').'</th>'; |
||
308 | $out['text'] .= ' <th width="25%">'._L('Plugin author').'</th>'; |
||
309 | $out['text'] .= ' </tr>'; |
||
310 | foreach ($plugins as $plugin) { |
||
311 | $out['text'] .= ' <tr>'; |
||
312 | if (in_array($plugin, $enabled)) { |
||
313 | $out['text'] .= '<td><a '.OIDplus::gui()->link('oidplus:system_plugins$'.get_class($plugin)).'>'.htmlentities(get_class($plugin)).'</a></td>'; |
||
314 | } else { |
||
315 | $out['text'] .= '<td><a '.OIDplus::gui()->link('oidplus:system_plugins$'.get_class($plugin)).'><font color="gray">'.htmlentities(get_class($plugin)).' '._L('(disabled)').'</font></a></td>'; |
||
316 | } |
||
317 | $out['text'] .= '<td>' . htmlentities(empty($plugin->getManifest()->getName()) ? _L('n/a') : $plugin->getManifest()->getName()) . '</td>'; |
||
318 | $out['text'] .= '<td>' . htmlentities(empty($plugin->getManifest()->getVersion()) ? _L('n/a') : $plugin->getManifest()->getVersion()) . '</td>'; |
||
319 | $out['text'] .= '<td>' . htmlentities(empty($plugin->getManifest()->getAuthor()) ? _L('n/a') : $plugin->getManifest()->getAuthor()) . '</td>'; |
||
320 | $out['text'] .= ' </tr>'; |
||
321 | } |
||
322 | $out['text'] .= '</table>'; |
||
323 | $out['text'] .= '</div></div>'; |
||
324 | } |
||
325 | } |
||
326 | |||
327 | if ($show_db_active || $show_db_inactive) { |
||
328 | if (count($plugins = OIDplus::getDatabasePlugins()) > 0) { |
||
329 | $out['text'] .= '<h2>'._L('Database providers').'</h2>'; |
||
330 | $out['text'] .= '<div class="container box"><div id="suboid_table" class="table-responsive">'; |
||
331 | $out['text'] .= '<table class="table table-bordered table-striped">'; |
||
332 | $out['text'] .= ' <tr>'; |
||
333 | $out['text'] .= ' <th width="25%">'._L('Class name').'</th>'; |
||
334 | $out['text'] .= ' <th width="25%">'._L('Plugin name').'</th>'; |
||
335 | $out['text'] .= ' <th width="25%">'._L('Plugin version').'</th>'; |
||
336 | $out['text'] .= ' <th width="25%">'._L('Plugin author').'</th>'; |
||
337 | $out['text'] .= ' </tr>'; |
||
338 | foreach ($plugins as $plugin) { |
||
339 | $active = $plugin::id() == OIDplus::baseConfig()->getValue('DATABASE_PLUGIN'); |
||
340 | if ($active && !$show_db_active) continue; |
||
341 | if (!$active && !$show_db_inactive) continue; |
||
342 | |||
343 | $out['text'] .= ' <tr>'; |
||
344 | if ($active) { |
||
345 | $out['text'] .= '<td><a '.OIDplus::gui()->link('oidplus:system_plugins$'.get_class($plugin)).'><b>'.htmlentities(get_class($plugin)).'</b> '._L('(active)').'</a></td>'; |
||
346 | } else { |
||
347 | $out['text'] .= '<td><a '.OIDplus::gui()->link('oidplus:system_plugins$'.get_class($plugin)).'>'.htmlentities(get_class($plugin)).'</a></td>'; |
||
348 | } |
||
349 | $out['text'] .= '<td>' . htmlentities(empty($plugin->getManifest()->getName()) ? _L('n/a') : $plugin->getManifest()->getName()) . '</td>'; |
||
350 | $out['text'] .= '<td>' . htmlentities(empty($plugin->getManifest()->getVersion()) ? _L('n/a') : $plugin->getManifest()->getVersion()) . '</td>'; |
||
351 | $out['text'] .= '<td>' . htmlentities(empty($plugin->getManifest()->getAuthor()) ? _L('n/a') : $plugin->getManifest()->getAuthor()) . '</td>'; |
||
352 | $out['text'] .= ' </tr>'; |
||
353 | } |
||
354 | $out['text'] .= '</table>'; |
||
355 | $out['text'] .= '</div></div>'; |
||
356 | } |
||
357 | } |
||
358 | |||
359 | if ($show_sql_active || $show_sql_inactive) { |
||
360 | if (count($plugins = OIDplus::getSqlSlangPlugins()) > 0) { |
||
361 | $out['text'] .= '<h2>'._L('SQL slang plugins').'</h2>'; |
||
362 | $out['text'] .= '<div class="container box"><div id="suboid_table" class="table-responsive">'; |
||
363 | $out['text'] .= '<table class="table table-bordered table-striped">'; |
||
364 | $out['text'] .= ' <tr>'; |
||
365 | $out['text'] .= ' <th width="25%">'._L('Class name').'</th>'; |
||
366 | $out['text'] .= ' <th width="25%">'._L('Plugin name').'</th>'; |
||
367 | $out['text'] .= ' <th width="25%">'._L('Plugin version').'</th>'; |
||
368 | $out['text'] .= ' <th width="25%">'._L('Plugin author').'</th>'; |
||
369 | $out['text'] .= ' </tr>'; |
||
370 | foreach ($plugins as $plugin) { |
||
371 | $active = $plugin::id() == OIDplus::db()->getSlang()->id(); |
||
372 | if ($active && !$show_sql_active) continue; |
||
373 | if (!$active && !$show_sql_inactive) continue; |
||
374 | |||
375 | $out['text'] .= ' <tr>'; |
||
376 | if ($active) { |
||
377 | $out['text'] .= '<td><a '.OIDplus::gui()->link('oidplus:system_plugins$'.get_class($plugin)).'><b>'.htmlentities(get_class($plugin)).'</b> '._L('(active)').'</a></td>'; |
||
378 | } else { |
||
379 | $out['text'] .= '<td><a '.OIDplus::gui()->link('oidplus:system_plugins$'.get_class($plugin)).'>'.htmlentities(get_class($plugin)).'</a></td>'; |
||
380 | } |
||
381 | $out['text'] .= '<td>' . htmlentities(empty($plugin->getManifest()->getName()) ? _L('n/a') : $plugin->getManifest()->getName()) . '</td>'; |
||
382 | $out['text'] .= '<td>' . htmlentities(empty($plugin->getManifest()->getVersion()) ? _L('n/a') : $plugin->getManifest()->getVersion()) . '</td>'; |
||
383 | $out['text'] .= '<td>' . htmlentities(empty($plugin->getManifest()->getAuthor()) ? _L('n/a') : $plugin->getManifest()->getAuthor()) . '</td>'; |
||
384 | $out['text'] .= ' </tr>'; |
||
385 | } |
||
386 | $out['text'] .= '</table>'; |
||
387 | $out['text'] .= '</div></div>'; |
||
388 | } |
||
389 | } |
||
390 | |||
391 | if ($show_auth) { |
||
392 | if (count($plugins = OIDplus::getAuthPlugins()) > 0) { |
||
393 | $out['text'] .= '<h2>'._L('RA authentication providers').'</h2>'; |
||
394 | $out['text'] .= '<div class="container box"><div id="suboid_table" class="table-responsive">'; |
||
395 | $out['text'] .= '<table class="table table-bordered table-striped">'; |
||
396 | $out['text'] .= ' <tr>'; |
||
397 | $out['text'] .= ' <th width="25%">'._L('Class name').'</th>'; |
||
398 | $out['text'] .= ' <th width="25%">'._L('Plugin name').'</th>'; |
||
399 | $out['text'] .= ' <th width="25%">'._L('Plugin version').'</th>'; |
||
400 | $out['text'] .= ' <th width="25%">'._L('Plugin author').'</th>'; |
||
401 | $out['text'] .= ' </tr>'; |
||
402 | foreach ($plugins as $plugin) { |
||
403 | $out['text'] .= ' <tr>'; |
||
404 | $out['text'] .= '<td><a '.OIDplus::gui()->link('oidplus:system_plugins$'.get_class($plugin)).'>'.htmlentities(get_class($plugin)).'</a></td>'; |
||
405 | $out['text'] .= '<td>' . htmlentities(empty($plugin->getManifest()->getName()) ? _L('n/a') : $plugin->getManifest()->getName()) . '</td>'; |
||
406 | $out['text'] .= '<td>' . htmlentities(empty($plugin->getManifest()->getVersion()) ? _L('n/a') : $plugin->getManifest()->getVersion()) . '</td>'; |
||
407 | $out['text'] .= '<td>' . htmlentities(empty($plugin->getManifest()->getAuthor()) ? _L('n/a') : $plugin->getManifest()->getAuthor()) . '</td>'; |
||
408 | $out['text'] .= ' </tr>'; |
||
409 | } |
||
410 | $out['text'] .= '</table>'; |
||
411 | $out['text'] .= '</div></div>'; |
||
412 | } |
||
413 | } |
||
414 | |||
415 | if ($show_logger) { |
||
416 | if (count($plugins = OIDplus::getLoggerPlugins()) > 0) { |
||
417 | $out['text'] .= '<h2>'._L('Logger plugins').'</h2>'; |
||
418 | $out['text'] .= '<div class="container box"><div id="suboid_table" class="table-responsive">'; |
||
419 | $out['text'] .= '<table class="table table-bordered table-striped">'; |
||
420 | $out['text'] .= ' <tr>'; |
||
421 | $out['text'] .= ' <th width="25%">'._L('Class name').'</th>'; |
||
422 | $out['text'] .= ' <th width="25%">'._L('Plugin name').'</th>'; |
||
423 | $out['text'] .= ' <th width="25%">'._L('Plugin version').'</th>'; |
||
424 | $out['text'] .= ' <th width="25%">'._L('Plugin author').'</th>'; |
||
425 | $out['text'] .= ' </tr>'; |
||
426 | foreach ($plugins as $plugin) { |
||
427 | $reason = ''; |
||
428 | $active = $plugin->available($reason); |
||
429 | |||
430 | $out['text'] .= ' <tr>'; |
||
431 | if ($active) { |
||
432 | $out['text'] .= '<td><a '.OIDplus::gui()->link('oidplus:system_plugins$'.get_class($plugin)).'>'.htmlentities(get_class($plugin)).'</a></td>'; |
||
433 | } else { |
||
434 | $out['text'] .= '<td><a '.OIDplus::gui()->link('oidplus:system_plugins$'.get_class($plugin)).'><font color="gray">'.htmlentities(get_class($plugin)).'</font></a> <font color="gray">('._L('not available: %1',htmlentities($reason)).')</font></td>'; |
||
435 | } |
||
436 | $out['text'] .= '<td>' . htmlentities(empty($plugin->getManifest()->getName()) ? _L('n/a') : $plugin->getManifest()->getName()) . '</td>'; |
||
437 | $out['text'] .= '<td>' . htmlentities(empty($plugin->getManifest()->getVersion()) ? _L('n/a') : $plugin->getManifest()->getVersion()) . '</td>'; |
||
438 | $out['text'] .= '<td>' . htmlentities(empty($plugin->getManifest()->getAuthor()) ? _L('n/a') : $plugin->getManifest()->getAuthor()) . '</td>'; |
||
439 | $out['text'] .= ' </tr>'; |
||
440 | } |
||
441 | $out['text'] .= '</table>'; |
||
442 | $out['text'] .= '</div></div>'; |
||
443 | } |
||
444 | } |
||
445 | |||
446 | if ($show_language) { |
||
447 | if (count($plugins = OIDplus::getLanguagePlugins()) > 0) { |
||
448 | $out['text'] .= '<h2>'._L('Languages').'</h2>'; |
||
449 | $out['text'] .= '<div class="container box"><div id="suboid_table" class="table-responsive">'; |
||
450 | $out['text'] .= '<table class="table table-bordered table-striped">'; |
||
451 | $out['text'] .= ' <tr>'; |
||
452 | $out['text'] .= ' <th width="25%">'._L('Class name').'</th>'; |
||
453 | $out['text'] .= ' <th width="25%">'._L('Plugin name').'</th>'; |
||
454 | $out['text'] .= ' <th width="25%">'._L('Plugin version').'</th>'; |
||
455 | $out['text'] .= ' <th width="25%">'._L('Plugin author').'</th>'; |
||
456 | $out['text'] .= ' </tr>'; |
||
457 | foreach ($plugins as $plugin) { |
||
458 | $out['text'] .= ' <tr>'; |
||
459 | $out['text'] .= '<td><a '.OIDplus::gui()->link('oidplus:system_plugins$'.get_class($plugin)).'>'.htmlentities(get_class($plugin)).'</a></td>'; |
||
460 | $out['text'] .= '<td>' . htmlentities(empty($plugin->getManifest()->getName()) ? _L('n/a') : $plugin->getManifest()->getName()) . '</td>'; |
||
461 | $out['text'] .= '<td>' . htmlentities(empty($plugin->getManifest()->getVersion()) ? _L('n/a') : $plugin->getManifest()->getVersion()) . '</td>'; |
||
462 | $out['text'] .= '<td>' . htmlentities(empty($plugin->getManifest()->getAuthor()) ? _L('n/a') : $plugin->getManifest()->getAuthor()) . '</td>'; |
||
463 | $out['text'] .= ' </tr>'; |
||
464 | } |
||
465 | $out['text'] .= '</table>'; |
||
466 | $out['text'] .= '</div></div>'; |
||
467 | } |
||
468 | } |
||
469 | |||
470 | if ($show_design_active || $show_design_inactive) { |
||
471 | if (count($plugins = OIDplus::getDesignPlugins()) > 0) { |
||
472 | $out['text'] .= '<h2>'._L('Designs').'</h2>'; |
||
473 | $out['text'] .= '<div class="container box"><div id="suboid_table" class="table-responsive">'; |
||
474 | $out['text'] .= '<table class="table table-bordered table-striped">'; |
||
475 | $out['text'] .= ' <tr>'; |
||
476 | $out['text'] .= ' <th width="25%">'._L('Class name').'</th>'; |
||
477 | $out['text'] .= ' <th width="25%">'._L('Plugin name').'</th>'; |
||
478 | $out['text'] .= ' <th width="25%">'._L('Plugin version').'</th>'; |
||
479 | $out['text'] .= ' <th width="25%">'._L('Plugin author').'</th>'; |
||
480 | $out['text'] .= ' </tr>'; |
||
481 | foreach ($plugins as $plugin) { |
||
482 | $active = OIDplus::config()->getValue('design') === basename($plugin->getPluginDirectory()); |
||
483 | if ($active && !$show_design_active) continue; |
||
484 | if (!$active && !$show_design_inactive) continue; |
||
485 | |||
486 | $out['text'] .= ' <tr>'; |
||
487 | if ($active) { |
||
488 | $out['text'] .= '<td><a '.OIDplus::gui()->link('oidplus:system_plugins$'.get_class($plugin)).'><b>'.htmlentities(get_class($plugin)).'</b> '._L('(active)').'</a></td>'; |
||
489 | } else { |
||
490 | $out['text'] .= '<td><a '.OIDplus::gui()->link('oidplus:system_plugins$'.get_class($plugin)).'>'.htmlentities(get_class($plugin)).'</a></td>'; |
||
491 | } |
||
492 | $out['text'] .= '<td>' . htmlentities(empty($plugin->getManifest()->getName()) ? _L('n/a') : $plugin->getManifest()->getName()) . '</td>'; |
||
493 | $out['text'] .= '<td>' . htmlentities(empty($plugin->getManifest()->getVersion()) ? _L('n/a') : $plugin->getManifest()->getVersion()) . '</td>'; |
||
494 | $out['text'] .= '<td>' . htmlentities(empty($plugin->getManifest()->getAuthor()) ? _L('n/a') : $plugin->getManifest()->getAuthor()) . '</td>'; |
||
495 | $out['text'] .= ' </tr>'; |
||
496 | } |
||
497 | $out['text'] .= '</table>'; |
||
498 | $out['text'] .= '</div></div>'; |
||
499 | } |
||
500 | } |
||
501 | } |
||
502 | } |
||
503 | |||
504 | public function tree(&$json, $ra_email=null, $nonjs=false, $req_goto='') { |
||
505 | if (!OIDplus::authUtils()->isAdminLoggedIn()) return false; |
||
506 | |||
507 | if (file_exists(__DIR__.'/treeicon.png')) { |
||
508 | $tree_icon = OIDplus::webpath(__DIR__).'treeicon.png'; |
||
509 | } else { |
||
510 | $tree_icon = null; // default icon (folder) |
||
511 | } |
||
512 | |||
513 | $tree_icon_pages = $tree_icon; // TODO |
||
514 | $tree_icon_pages_public = $tree_icon; // TODO |
||
515 | $tree_icon_pages_ra = $tree_icon; // TODO |
||
516 | $tree_icon_pages_admin = $tree_icon; // TODO |
||
517 | $tree_icon_db_active = $tree_icon; // TODO |
||
518 | $tree_icon_db_inactive = $tree_icon; // TODO |
||
519 | $tree_icon_sql_active = $tree_icon; // TODO |
||
520 | $tree_icon_sql_inactive = $tree_icon; // TODO |
||
521 | $tree_icon_obj_active = $tree_icon; // TODO |
||
522 | $tree_icon_obj_inactive = $tree_icon; // TODO |
||
523 | $tree_icon_auth = $tree_icon; // TODO |
||
524 | $tree_icon_logger = $tree_icon; // TODO |
||
525 | $tree_icon_language = $tree_icon; // TODO |
||
526 | $tree_icon_design_active = $tree_icon; // TODO |
||
527 | $tree_icon_design_inactive = $tree_icon; // TODO |
||
528 | |||
529 | $pp_public = array(); |
||
530 | $pp_ra = array(); |
||
531 | $pp_admin = array(); |
||
532 | |||
533 | foreach (OIDplus::getPagePlugins() as $plugin) { |
||
534 | if (is_subclass_of($plugin, OIDplusPagePluginPublic::class)) { |
||
535 | $pp_public[] = $plugin; |
||
536 | } |
||
537 | if (is_subclass_of($plugin, OIDplusPagePluginRa::class)) { |
||
538 | $pp_ra[] = $plugin; |
||
539 | } |
||
540 | if (is_subclass_of($plugin, OIDplusPagePluginAdmin::class)) { |
||
541 | $pp_admin[] = $plugin; |
||
542 | } |
||
543 | } |
||
544 | |||
545 | |||
546 | $public_plugins = array(); |
||
547 | foreach ($pp_public as $plugin) { |
||
548 | $txt = (empty($plugin->getManifest()->getName())) ? get_class($plugin) : $plugin->getManifest()->getName(); |
||
549 | |||
550 | $public_plugins[] = array( |
||
551 | 'id' => 'oidplus:system_plugins$'.get_class($plugin), |
||
552 | 'icon' => $tree_icon_pages_public, |
||
553 | 'text' => $txt, |
||
554 | ); |
||
555 | } |
||
556 | $ra_plugins = array(); |
||
557 | foreach ($pp_ra as $plugin) { |
||
558 | $txt = (empty($plugin->getManifest()->getName())) ? get_class($plugin) : $plugin->getManifest()->getName(); |
||
559 | |||
560 | $ra_plugins[] = array( |
||
561 | 'id' => 'oidplus:system_plugins$'.get_class($plugin), |
||
562 | 'icon' => $tree_icon_pages_ra, |
||
563 | 'text' => $txt, |
||
564 | ); |
||
565 | } |
||
566 | $admin_plugins = array(); |
||
567 | foreach ($pp_admin as $plugin) { |
||
568 | $txt = (empty($plugin->getManifest()->getName())) ? get_class($plugin) : $plugin->getManifest()->getName(); |
||
569 | |||
570 | $admin_plugins[] = array( |
||
571 | 'id' => 'oidplus:system_plugins$'.get_class($plugin), |
||
572 | 'icon' => $tree_icon_pages_admin, |
||
573 | 'text' => $txt, |
||
574 | ); |
||
575 | } |
||
576 | $db_plugins = array(); |
||
577 | foreach (OIDplus::getDatabasePlugins() as $plugin) { |
||
578 | $txt = (empty($plugin->getManifest()->getName())) ? get_class($plugin) : $plugin->getManifest()->getName(); |
||
579 | |||
580 | if ($plugin::id() == OIDplus::baseConfig()->getValue('DATABASE_PLUGIN')) { |
||
581 | $db_plugins[] = array( |
||
582 | 'id' => 'oidplus:system_plugins$'.get_class($plugin), |
||
583 | 'icon' => $tree_icon_db_active, |
||
584 | 'text' => $txt, |
||
585 | ); |
||
586 | } else { |
||
587 | $db_plugins[] = array( |
||
588 | 'id' => 'oidplus:system_plugins$'.get_class($plugin), |
||
589 | 'icon' => $tree_icon_db_inactive, |
||
590 | 'text' => '<font color="gray">'.$txt.'</font>', |
||
591 | ); |
||
592 | } |
||
593 | } |
||
594 | $sql_plugins = array(); |
||
595 | foreach (OIDplus::getSqlSlangPlugins() as $plugin) { |
||
596 | $txt = (empty($plugin->getManifest()->getName())) ? get_class($plugin) : $plugin->getManifest()->getName(); |
||
597 | |||
598 | if ($plugin::id() == OIDplus::db()->getSlang()->id()) { |
||
599 | $sql_plugins[] = array( |
||
600 | 'id' => 'oidplus:system_plugins$'.get_class($plugin), |
||
601 | 'icon' => $tree_icon_db_active, |
||
602 | 'text' => $txt, |
||
603 | ); |
||
604 | } else { |
||
605 | $sql_plugins[] = array( |
||
606 | 'id' => 'oidplus:system_plugins$'.get_class($plugin), |
||
607 | 'icon' => $tree_icon_db_inactive, |
||
608 | 'text' => '<font color="gray">'.$txt.'</font>', |
||
609 | ); |
||
610 | } |
||
611 | } |
||
612 | $obj_plugins = array(); |
||
613 | $enabled = OIDplus::getObjectTypePluginsEnabled(); |
||
614 | $disabled = OIDplus::getObjectTypePluginsDisabled(); |
||
615 | foreach (array_merge($enabled, $disabled) as $plugin) { |
||
616 | $txt = (empty($plugin->getManifest()->getName())) ? get_class($plugin) : $plugin->getManifest()->getName(); |
||
617 | if (in_array($plugin, $enabled)) { |
||
618 | $obj_plugins[] = array( |
||
619 | 'id' => 'oidplus:system_plugins$'.get_class($plugin), |
||
620 | 'icon' => $tree_icon_obj_active, |
||
621 | 'text' => $txt, |
||
622 | ); |
||
623 | } else { |
||
624 | $obj_plugins[] = array( |
||
625 | 'id' => 'oidplus:system_plugins$'.get_class($plugin), |
||
626 | 'icon' => $tree_icon_obj_inactive, |
||
627 | 'text' => '<font color="gray">'.$txt.'</font>', |
||
628 | ); |
||
629 | } |
||
630 | } |
||
631 | $auth_plugins = array(); |
||
632 | foreach (OIDplus::getAuthPlugins() as $plugin) { |
||
633 | $txt = (empty($plugin->getManifest()->getName())) ? get_class($plugin) : $plugin->getManifest()->getName(); |
||
634 | |||
635 | $auth_plugins[] = array( |
||
636 | 'id' => 'oidplus:system_plugins$'.get_class($plugin), |
||
637 | 'icon' => $tree_icon_auth, |
||
638 | 'text' => $txt, |
||
639 | ); |
||
640 | } |
||
641 | $logger_plugins = array(); |
||
642 | foreach (OIDplus::getLoggerPlugins() as $plugin) { |
||
643 | $txt = (empty($plugin->getManifest()->getName())) ? get_class($plugin) : $plugin->getManifest()->getName(); |
||
644 | |||
645 | $reason = ''; |
||
646 | if (!$plugin->available($reason)) $txt = '<font color="gray">'.$txt.'</font>'; |
||
647 | |||
648 | $logger_plugins[] = array( |
||
649 | 'id' => 'oidplus:system_plugins$'.get_class($plugin), |
||
650 | 'icon' => $tree_icon_logger, |
||
651 | 'text' => $txt, |
||
652 | ); |
||
653 | } |
||
654 | $language_plugins = array(); |
||
655 | foreach (OIDplus::getLanguagePlugins() as $plugin) { |
||
656 | $txt = (empty($plugin->getManifest()->getName())) ? get_class($plugin) : $plugin->getManifest()->getName(); |
||
657 | |||
658 | $language_plugins[] = array( |
||
659 | 'id' => 'oidplus:system_plugins$'.get_class($plugin), |
||
660 | 'icon' => $tree_icon_language, |
||
661 | 'text' => $txt, |
||
662 | ); |
||
663 | } |
||
664 | $design_plugins = array(); |
||
665 | foreach (OIDplus::getDesignPlugins() as $plugin) { |
||
666 | $txt = (empty($plugin->getManifest()->getName())) ? get_class($plugin) : $plugin->getManifest()->getName(); |
||
667 | |||
668 | $active = OIDplus::config()->getValue('design') === basename($plugin->getPluginDirectory()); |
||
669 | if ($active) { |
||
670 | $design_plugins[] = array( |
||
671 | 'id' => 'oidplus:system_plugins$'.get_class($plugin), |
||
672 | 'icon' => $tree_icon_design_active, |
||
673 | 'text' => $txt, |
||
674 | ); |
||
675 | } else { |
||
676 | $design_plugins[] = array( |
||
677 | 'id' => 'oidplus:system_plugins$'.get_class($plugin), |
||
678 | 'icon' => $tree_icon_design_inactive, |
||
679 | 'text' => '<font color="gray">'.$txt.'</font>', |
||
680 | ); |
||
681 | } |
||
682 | } |
||
683 | $json[] = array( |
||
684 | 'id' => 'oidplus:system_plugins', |
||
685 | 'icon' => $tree_icon, |
||
686 | 'text' => _L('Plugins'), |
||
687 | 'children' => array( |
||
688 | array( |
||
689 | 'id' => 'oidplus:system_plugins.pages', |
||
690 | 'icon' => $tree_icon, |
||
691 | 'text' => _L('Page plugins'), |
||
692 | 'children' => array( |
||
693 | array( |
||
694 | 'id' => 'oidplus:system_plugins.pages.public', |
||
695 | 'icon' => $tree_icon, |
||
696 | 'text' => _L('Public'), |
||
697 | 'children' => $public_plugins |
||
698 | ), |
||
699 | array( |
||
700 | 'id' => 'oidplus:system_plugins.pages.ra', |
||
701 | 'icon' => $tree_icon, |
||
702 | 'text' => _L('RA'), |
||
703 | 'children' => $ra_plugins |
||
704 | ), |
||
705 | array( |
||
706 | 'id' => 'oidplus:system_plugins.pages.admin', |
||
707 | 'icon' => $tree_icon, |
||
708 | 'text' => _L('Admin'), |
||
709 | 'children' => $admin_plugins |
||
710 | ) |
||
711 | ) |
||
712 | ), |
||
713 | array( |
||
714 | 'id' => 'oidplus:system_plugins.objects', |
||
715 | 'icon' => $tree_icon, |
||
716 | 'text' => _L('Object types'), |
||
717 | 'children' => $obj_plugins |
||
718 | ), |
||
719 | array( |
||
720 | 'id' => 'oidplus:system_plugins.database', |
||
721 | 'icon' => $tree_icon, |
||
722 | 'text' => _L('Database providers'), |
||
723 | 'children' => $db_plugins |
||
724 | ), |
||
725 | array( |
||
726 | 'id' => 'oidplus:system_plugins.sql', |
||
727 | 'icon' => $tree_icon, |
||
728 | 'text' => _L('SQL slangs'), |
||
729 | 'children' => $sql_plugins |
||
730 | ), |
||
731 | array( |
||
732 | 'id' => 'oidplus:system_plugins.auth', |
||
733 | 'icon' => $tree_icon, |
||
734 | 'text' => _L('RA authentication'), |
||
735 | 'children' => $auth_plugins |
||
736 | ), |
||
737 | array( |
||
738 | 'id' => 'oidplus:system_plugins.logger', |
||
739 | 'icon' => $tree_icon, |
||
740 | 'text' => _L('Logger'), |
||
741 | 'children' => $logger_plugins |
||
742 | ), |
||
743 | array( |
||
744 | 'id' => 'oidplus:system_plugins.language', |
||
745 | 'icon' => $tree_icon, |
||
746 | 'text' => _L('Languages'), |
||
747 | 'children' => $language_plugins |
||
748 | ), |
||
749 | array( |
||
750 | 'id' => 'oidplus:system_plugins.design', |
||
751 | 'icon' => $tree_icon, |
||
752 | 'text' => _L('Designs'), |
||
753 | 'children' => $design_plugins |
||
754 | ) |
||
755 | ) |
||
756 | ); |
||
757 | |||
758 | return true; |
||
759 | } |
||
760 | |||
761 | public function tree_search($request) { |
||
762 | // Not required, because all sub-nodes are loaded at the same time; no lazy-loading |
||
763 | return false; |
||
764 | } |
||
765 | } |