Rev 279 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 279 | Rev 281 | ||
---|---|---|---|
Line 34... | Line 34... | ||
34 | $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : ''; |
34 | $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : ''; |
35 | 35 | ||
36 | if (!OIDplus::authUtils()::isAdminLoggedIn()) { |
36 | if (!OIDplus::authUtils()::isAdminLoggedIn()) { |
37 | $out['icon'] = 'img/error_big.png'; |
37 | $out['icon'] = 'img/error_big.png'; |
38 | $out['text'] = '<p>You need to <a '.OIDplus::gui()->link('oidplus:login').'>log in</a> as administrator.</p>'; |
38 | $out['text'] = '<p>You need to <a '.OIDplus::gui()->link('oidplus:login').'>log in</a> as administrator.</p>'; |
39 | return $out; |
39 | return; |
40 | } |
40 | } |
41 | 41 | ||
42 | if (substr($parts[1],0,1) == '$') { |
42 | if (substr($parts[1],0,1) == '$') { |
43 | $classname = substr($parts[1],1); |
43 | $classname = substr($parts[1],1); |
44 | $out['title'] = htmlentities($classname); |
44 | $out['title'] = htmlentities($classname); |
Line 147... | Line 147... | ||
147 | $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : ''; |
147 | $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : ''; |
148 | $show_auth = true; |
148 | $show_auth = true; |
149 | } else { |
149 | } else { |
150 | $out['icon'] = 'img/error_big.png'; |
150 | $out['icon'] = 'img/error_big.png'; |
151 | $out['text'] = '<p>Invalid arguments.</p>'; |
151 | $out['text'] = '<p>Invalid arguments.</p>'; |
152 | return $out; |
152 | return; |
- | 153 | } |
|
- | 154 | ||
- | 155 | $pp_public = array(); |
|
- | 156 | $pp_ra = array(); |
|
- | 157 | $pp_admin = array(); |
|
- | 158 | ||
- | 159 | foreach (OIDplus::getPagePlugins() as $plugin) { |
|
- | 160 | if (is_subclass_of($plugin, OIDplusPagePluginPublic::class)) { |
|
- | 161 | $pp_public[] = $plugin; |
|
- | 162 | } |
|
- | 163 | if (is_subclass_of($plugin, OIDplusPagePluginRa::class)) { |
|
- | 164 | $pp_ra[] = $plugin; |
|
- | 165 | } |
|
- | 166 | if (is_subclass_of($plugin, OIDplusPagePluginAdmin::class)) { |
|
- | 167 | $pp_admin[] = $plugin; |
|
- | 168 | } |
|
153 | } |
169 | } |
154 | 170 | ||
155 | if ($show_pages_public) { |
171 | if ($show_pages_public) { |
156 | if (count($plugins = OIDplus::getPagePlugins('public')) > 0) { |
172 | if (count($plugins = $pp_public) > 0) { |
157 | $out['text'] .= '<h2>Public page plugins</h2>'; |
173 | $out['text'] .= '<h2>Public page plugins</h2>'; |
158 | $out['text'] .= '<div class="container box"><div id="suboid_table" class="table-responsive">'; |
174 | $out['text'] .= '<div class="container box"><div id="suboid_table" class="table-responsive">'; |
159 | $out['text'] .= '<table class="table table-bordered table-striped">'; |
175 | $out['text'] .= '<table class="table table-bordered table-striped">'; |
160 | $out['text'] .= ' <tr>'; |
176 | $out['text'] .= ' <tr>'; |
161 | $out['text'] .= ' <th width="25%">Class name</th>'; |
177 | $out['text'] .= ' <th width="25%">Class name</th>'; |
Line 179... | Line 195... | ||
179 | $out['text'] .= '</div></div>'; |
195 | $out['text'] .= '</div></div>'; |
180 | } |
196 | } |
181 | } |
197 | } |
182 | 198 | ||
183 | if ($show_pages_ra) { |
199 | if ($show_pages_ra) { |
184 | if (count($plugins = OIDplus::getPagePlugins('ra')) > 0) { |
200 | if (count($plugins = $pp_ra) > 0) { |
185 | $out['text'] .= '<h2>RA page plugins</h2>'; |
201 | $out['text'] .= '<h2>RA page plugins</h2>'; |
186 | $out['text'] .= '<div class="container box"><div id="suboid_table" class="table-responsive">'; |
202 | $out['text'] .= '<div class="container box"><div id="suboid_table" class="table-responsive">'; |
187 | $out['text'] .= '<table class="table table-bordered table-striped">'; |
203 | $out['text'] .= '<table class="table table-bordered table-striped">'; |
188 | $out['text'] .= ' <tr>'; |
204 | $out['text'] .= ' <tr>'; |
189 | $out['text'] .= ' <th width="25%">Class name</th>'; |
205 | $out['text'] .= ' <th width="25%">Class name</th>'; |
Line 207... | Line 223... | ||
207 | $out['text'] .= '</div></div>'; |
223 | $out['text'] .= '</div></div>'; |
208 | } |
224 | } |
209 | } |
225 | } |
210 | 226 | ||
211 | if ($show_pages_admin) { |
227 | if ($show_pages_admin) { |
212 | if (count($plugins = OIDplus::getPagePlugins('admin')) > 0) { |
228 | if (count($plugins = $pp_admin) > 0) { |
213 | $out['text'] .= '<h2>Admin page plugins</h2>'; |
229 | $out['text'] .= '<h2>Admin page plugins</h2>'; |
214 | $out['text'] .= '<div class="container box"><div id="suboid_table" class="table-responsive">'; |
230 | $out['text'] .= '<div class="container box"><div id="suboid_table" class="table-responsive">'; |
215 | $out['text'] .= '<table class="table table-bordered table-striped">'; |
231 | $out['text'] .= '<table class="table table-bordered table-striped">'; |
216 | $out['text'] .= ' <tr>'; |
232 | $out['text'] .= ' <tr>'; |
217 | $out['text'] .= ' <th width="25%">Class name</th>'; |
233 | $out['text'] .= ' <th width="25%">Class name</th>'; |
Line 371... | Line 387... | ||
371 | } |
387 | } |
372 | } |
388 | } |
373 | } |
389 | } |
374 | 390 | ||
375 | public function tree(&$json, $ra_email=null, $nonjs=false, $req_goto='') { |
391 | public function tree(&$json, $ra_email=null, $nonjs=false, $req_goto='') { |
- | 392 | if (!OIDplus::authUtils()::isAdminLoggedIn()) return false; |
|
- | 393 | ||
376 | if (file_exists(__DIR__.'/treeicon.png')) { |
394 | if (file_exists(__DIR__.'/treeicon.png')) { |
377 | $tree_icon = OIDplus::webpath(__DIR__).'treeicon.png'; |
395 | $tree_icon = OIDplus::webpath(__DIR__).'treeicon.png'; |
378 | } else { |
396 | } else { |
379 | $tree_icon = null; // default icon (folder) |
397 | $tree_icon = null; // default icon (folder) |
380 | } |
398 | } |
Line 389... | Line 407... | ||
389 | $tree_icon_sql_inactive = $tree_icon; // TODO |
407 | $tree_icon_sql_inactive = $tree_icon; // TODO |
390 | $tree_icon_obj_active = $tree_icon; // TODO |
408 | $tree_icon_obj_active = $tree_icon; // TODO |
391 | $tree_icon_obj_inactive = $tree_icon; // TODO |
409 | $tree_icon_obj_inactive = $tree_icon; // TODO |
392 | $tree_icon_auth = $tree_icon; // TODO |
410 | $tree_icon_auth = $tree_icon; // TODO |
393 | 411 | ||
- | 412 | $pp_public = array(); |
|
- | 413 | $pp_ra = array(); |
|
- | 414 | $pp_admin = array(); |
|
- | 415 | ||
- | 416 | foreach (OIDplus::getPagePlugins() as $plugin) { |
|
- | 417 | if (is_subclass_of($plugin, OIDplusPagePluginPublic::class)) { |
|
- | 418 | $pp_public[] = $plugin; |
|
- | 419 | } |
|
- | 420 | if (is_subclass_of($plugin, OIDplusPagePluginRa::class)) { |
|
- | 421 | $pp_ra[] = $plugin; |
|
- | 422 | } |
|
- | 423 | if (is_subclass_of($plugin, OIDplusPagePluginAdmin::class)) { |
|
- | 424 | $pp_admin[] = $plugin; |
|
- | 425 | } |
|
- | 426 | } |
|
- | 427 | ||
- | 428 | ||
394 | $public_plugins = array(); |
429 | $public_plugins = array(); |
395 | foreach (OIDplus::getPagePlugins('public') as $plugin) { |
430 | foreach ($pp_public as $plugin) { |
396 | $pluginInfo = OIDplus::getPluginInfo($plugin); |
431 | $pluginInfo = OIDplus::getPluginInfo($plugin); |
397 | $txt = (!isset($pluginInfo['name']) || empty($pluginInfo['name'])) ? get_class($plugin) : $pluginInfo['name']; |
432 | $txt = (!isset($pluginInfo['name']) || empty($pluginInfo['name'])) ? get_class($plugin) : $pluginInfo['name']; |
398 | 433 | ||
399 | $public_plugins[] = array( |
434 | $public_plugins[] = array( |
400 | 'id' => 'oidplus:system_plugins.$'.get_class($plugin), |
435 | 'id' => 'oidplus:system_plugins.$'.get_class($plugin), |
401 | 'icon' => $tree_icon_pages_public, |
436 | 'icon' => $tree_icon_pages_public, |
402 | 'text' => $txt, |
437 | 'text' => $txt, |
403 | ); |
438 | ); |
404 | } |
439 | } |
405 | $ra_plugins = array(); |
440 | $ra_plugins = array(); |
406 | foreach (OIDplus::getPagePlugins('ra') as $plugin) { |
441 | foreach ($pp_ra as $plugin) { |
407 | $pluginInfo = OIDplus::getPluginInfo($plugin); |
442 | $pluginInfo = OIDplus::getPluginInfo($plugin); |
408 | $txt = (!isset($pluginInfo['name']) || empty($pluginInfo['name'])) ? get_class($plugin) : $pluginInfo['name']; |
443 | $txt = (!isset($pluginInfo['name']) || empty($pluginInfo['name'])) ? get_class($plugin) : $pluginInfo['name']; |
409 | 444 | ||
410 | $ra_plugins[] = array( |
445 | $ra_plugins[] = array( |
411 | 'id' => 'oidplus:system_plugins.$'.get_class($plugin), |
446 | 'id' => 'oidplus:system_plugins.$'.get_class($plugin), |
412 | 'icon' => $tree_icon_pages_ra, |
447 | 'icon' => $tree_icon_pages_ra, |
413 | 'text' => $txt, |
448 | 'text' => $txt, |
414 | ); |
449 | ); |
415 | } |
450 | } |
416 | $admin_plugins = array(); |
451 | $admin_plugins = array(); |
417 | foreach (OIDplus::getPagePlugins('admin') as $plugin) { |
452 | foreach ($pp_admin as $plugin) { |
418 | $pluginInfo = OIDplus::getPluginInfo($plugin); |
453 | $pluginInfo = OIDplus::getPluginInfo($plugin); |
419 | $txt = (!isset($pluginInfo['name']) || empty($pluginInfo['name'])) ? get_class($plugin) : $pluginInfo['name']; |
454 | $txt = (!isset($pluginInfo['name']) || empty($pluginInfo['name'])) ? get_class($plugin) : $pluginInfo['name']; |
420 | 455 | ||
421 | $admin_plugins[] = array( |
456 | $admin_plugins[] = array( |
422 | 'id' => 'oidplus:system_plugins.$'.get_class($plugin), |
457 | 'id' => 'oidplus:system_plugins.$'.get_class($plugin), |