Subversion Repositories oidplus

Rev

Rev 433 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 433 Rev 449
Line 58... Line 58...
58
                        if (get_parent_class($classname) == 'OIDplusDatabasePlugin') $back_link = 'oidplus:system_plugins.database';
58
                        if (get_parent_class($classname) == 'OIDplusDatabasePlugin') $back_link = 'oidplus:system_plugins.database';
59
                        if (get_parent_class($classname) == 'OIDplusSqlSlangPlugin') $back_link = 'oidplus:system_plugins.sql';
59
                        if (get_parent_class($classname) == 'OIDplusSqlSlangPlugin') $back_link = 'oidplus:system_plugins.sql';
60
                        if (get_parent_class($classname) == 'OIDplusAuthPlugin') $back_link = 'oidplus:system_plugins.auth';
60
                        if (get_parent_class($classname) == 'OIDplusAuthPlugin') $back_link = 'oidplus:system_plugins.auth';
61
                        if (get_parent_class($classname) == 'OIDplusLoggerPlugin') $back_link = 'oidplus:system_plugins.logger';
61
                        if (get_parent_class($classname) == 'OIDplusLoggerPlugin') $back_link = 'oidplus:system_plugins.logger';
62
                        if (get_parent_class($classname) == 'OIDplusLanguagePlugin') $back_link = 'oidplus:system_plugins.language';
62
                        if (get_parent_class($classname) == 'OIDplusLanguagePlugin') $back_link = 'oidplus:system_plugins.language';
-
 
63
                        if (get_parent_class($classname) == 'OIDplusDesignPlugin') $back_link = 'oidplus:system_plugins.design';
63
                        $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>';
64
                        $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>';
64
 
65
 
65
                        $out['text'] .= '<div><label class="padding_label">'._L('Class name').'</label><b>'.htmlentities($classname).'</b></div>'.
66
                        $out['text'] .= '<div><label class="padding_label">'._L('Class name').'</label><b>'.htmlentities($classname).'</b></div>'.
66
                                        '<div><label class="padding_label">'._L('Location').'</label><b>'.htmlentities(dirname($plugin->getPluginDirectory())).'</b></div>'.
67
                                        '<div><label class="padding_label">'._L('Location').'</label><b>'.htmlentities($plugin->getPluginDirectory()).'</b></div>'.
67
                                        '<div><label class="padding_label">'._L('Plugin type').'</label><b>'.htmlentities(get_parent_class($classname)).'</b></div>'.
68
                                        '<div><label class="padding_label">'._L('Plugin type').'</label><b>'.htmlentities(get_parent_class($classname)).'</b></div>'.
68
                                        '<div><label class="padding_label">'._L('Plugin name').'</label><b>'.htmlentities(empty($plugin->getManifest()->getName()) ? _L('n/a') : $plugin->getManifest()->getName()).'</b></div>'.
69
                                        '<div><label class="padding_label">'._L('Plugin name').'</label><b>'.htmlentities(empty($plugin->getManifest()->getName()) ? _L('n/a') : $plugin->getManifest()->getName()).'</b></div>'.
69
                                        '<div><label class="padding_label">'._L('Plugin author').'</label><b>'.htmlentities(empty($plugin->getManifest()->getAuthor()) ? _L('n/a') : $plugin->getManifest()->getAuthor()).'</b></div>'.
70
                                        '<div><label class="padding_label">'._L('Plugin author').'</label><b>'.htmlentities(empty($plugin->getManifest()->getAuthor()) ? _L('n/a') : $plugin->getManifest()->getAuthor()).'</b></div>'.
70
                                        '<div><label class="padding_label">'._L('Plugin version').'</label><b>'.htmlentities(empty($plugin->getManifest()->getVersion()) ? _L('n/a') : $plugin->getManifest()->getVersion()).'</b></div>'.
71
                                        '<div><label class="padding_label">'._L('Plugin version').'</label><b>'.htmlentities(empty($plugin->getManifest()->getVersion()) ? _L('n/a') : $plugin->getManifest()->getVersion()).'</b></div>'.
71
                                        '<div><label class="padding_label">'._L('Plugin OID').'</label><b>'.htmlentities(empty($plugin->getManifest()->getOid()) ? _L('n/a') : $plugin->getManifest()->getOid()).'</b></div>'.
72
                                        '<div><label class="padding_label">'._L('Plugin OID').'</label><b>'.htmlentities(empty($plugin->getManifest()->getOid()) ? _L('n/a') : $plugin->getManifest()->getOid()).'</b></div>'.
Line 82... Line 83...
82
                        $show_obj_active = false;
83
                        $show_obj_active = false;
83
                        $show_obj_inactive = false;
84
                        $show_obj_inactive = false;
84
                        $show_auth = false;
85
                        $show_auth = false;
85
                        $show_logger = false;
86
                        $show_logger = false;
86
                        $show_language = false;
87
                        $show_language = false;
-
 
88
                        $show_design_active = false;
-
 
89
                        $show_design_inactive = false;
87
 
90
 
88
                        if ($parts[1] == '') {
91
                        if ($parts[1] == '') {
89
                                $out['title'] = _L('Installed plugins');
92
                                $out['title'] = _L('Installed plugins');
90
                                $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : '';
93
                                $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : '';
91
                                $show_pages_public = true;
94
                                $show_pages_public = true;
Line 98... Line 101...
98
                                $show_obj_active = true;
101
                                $show_obj_active = true;
99
                                $show_obj_inactive = true;
102
                                $show_obj_inactive = true;
100
                                $show_auth = true;
103
                                $show_auth = true;
101
                                $show_logger = true;
104
                                $show_logger = true;
102
                                $show_language = true;
105
                                $show_language = true;
-
 
106
                                $show_design_active = true;
-
 
107
                                $show_design_inactive = true;
103
                        } else if ($parts[1] == 'pages') {
108
                        } else if ($parts[1] == 'pages') {
104
                                $out['title'] = _L('Page plugins');
109
                                $out['title'] = _L('Page plugins');
105
                                $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : '';
110
                                $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : '';
106
                                $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>';
111
                                $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>';
107
                                $show_pages_public = true;
112
                                $show_pages_public = true;
Line 183... Line 188...
183
                        } else if ($parts[1] == 'language') {
188
                        } else if ($parts[1] == 'language') {
184
                                $out['title'] = _L('Languages');
189
                                $out['title'] = _L('Languages');
185
                                $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : '';
190
                                $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : '';
186
                                $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>';
191
                                $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>';
187
                                $show_language = true;
192
                                $show_language = true;
-
 
193
                        } else if ($parts[1] == 'design') {
-
 
194
                                $out['title'] = _L('Designs');
-
 
195
                                $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : '';
-
 
196
                                $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>';
-
 
197
                                $show_design_active = true;
-
 
198
                                $show_design_inactive = true;
188
                        } else {
199
                        } else {
189
                                $out['title'] = _L('Error');
200
                                $out['title'] = _L('Error');
190
                                $out['icon'] = 'img/error_big.png';
201
                                $out['icon'] = 'img/error_big.png';
191
                                $out['text'] = '<p>'._L('Invalid arguments').'</p>';
202
                                $out['text'] = '<p>'._L('Invalid arguments').'</p>';
192
                                $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>';
203
                                $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>';
Line 451... Line 462...
451
                                        }
462
                                        }
452
                                        $out['text'] .= '</table>';
463
                                        $out['text'] .= '</table>';
453
                                        $out['text'] .= '</div></div>';
464
                                        $out['text'] .= '</div></div>';
454
                                }
465
                                }
455
                        }
466
                        }
-
 
467
 
-
 
468
                        if ($show_design_active || $show_design_inactive) {
-
 
469
                                if (count($plugins = OIDplus::getDesignPlugins()) > 0) {
-
 
470
                                        $out['text'] .= '<h2>'._L('Designs').'</h2>';
-
 
471
                                        $out['text'] .= '<div class="container box"><div id="suboid_table" class="table-responsive">';
-
 
472
                                        $out['text'] .= '<table class="table table-bordered table-striped">';
-
 
473
                                        $out['text'] .= '       <tr>';
-
 
474
                                        $out['text'] .= '               <th width="25%">'._L('Class name').'</th>';
-
 
475
                                        $out['text'] .= '               <th width="25%">'._L('Plugin name').'</th>';
-
 
476
                                        $out['text'] .= '               <th width="25%">'._L('Plugin version').'</th>';
-
 
477
                                        $out['text'] .= '               <th width="25%">'._L('Plugin author').'</th>';
-
 
478
                                        $out['text'] .= '       </tr>';
-
 
479
                                        foreach ($plugins as $plugin) {
-
 
480
                                                $active = OIDplus::config()->getValue('design') === basename($plugin->getPluginDirectory());
-
 
481
                                                if ($active && !$show_design_active) continue;
-
 
482
                                                if (!$active && !$show_design_inactive) continue;
-
 
483
 
-
 
484
                                                $out['text'] .= '       <tr>';
-
 
485
                                                if ($active) {
-
 
486
                                                        $out['text'] .= '<td><a '.OIDplus::gui()->link('oidplus:system_plugins$'.get_class($plugin)).'><b>'.htmlentities(get_class($plugin)).'</b> '._L('(active)').'</a></td>';
-
 
487
                                                } else {
-
 
488
                                                        $out['text'] .= '<td><a '.OIDplus::gui()->link('oidplus:system_plugins$'.get_class($plugin)).'>'.htmlentities(get_class($plugin)).'</a></td>';
-
 
489
                                                }
-
 
490
                                                $out['text'] .= '<td>' . htmlentities(empty($plugin->getManifest()->getName()) ? _L('n/a') : $plugin->getManifest()->getName()) . '</td>';
-
 
491
                                                $out['text'] .= '<td>' . htmlentities(empty($plugin->getManifest()->getVersion()) ? _L('n/a') : $plugin->getManifest()->getVersion()) . '</td>';
-
 
492
                                                $out['text'] .= '<td>' . htmlentities(empty($plugin->getManifest()->getAuthor()) ? _L('n/a') : $plugin->getManifest()->getAuthor()) . '</td>';
-
 
493
                                                $out['text'] .= '       </tr>';
-
 
494
                                        }
-
 
495
                                        $out['text'] .= '</table>';
-
 
496
                                        $out['text'] .= '</div></div>';
-
 
497
                                }
-
 
498
                        }
456
                }
499
                }
457
        }
500
        }
458
 
501
 
459
        public function tree(&$json, $ra_email=null, $nonjs=false, $req_goto='') {
502
        public function tree(&$json, $ra_email=null, $nonjs=false, $req_goto='') {
460
                if (!OIDplus::authUtils()::isAdminLoggedIn()) return false;
503
                if (!OIDplus::authUtils()::isAdminLoggedIn()) return false;
Line 476... Line 519...
476
                $tree_icon_obj_active = $tree_icon; // TODO
519
                $tree_icon_obj_active = $tree_icon; // TODO
477
                $tree_icon_obj_inactive = $tree_icon; // TODO
520
                $tree_icon_obj_inactive = $tree_icon; // TODO
478
                $tree_icon_auth = $tree_icon; // TODO
521
                $tree_icon_auth = $tree_icon; // TODO
479
                $tree_icon_logger = $tree_icon; // TODO
522
                $tree_icon_logger = $tree_icon; // TODO
480
                $tree_icon_language = $tree_icon; // TODO
523
                $tree_icon_language = $tree_icon; // TODO
-
 
524
                $tree_icon_design_active = $tree_icon; // TODO
-
 
525
                $tree_icon_design_inactive = $tree_icon; // TODO
481
 
526
 
482
                $pp_public = array();
527
                $pp_public = array();
483
                $pp_ra = array();
528
                $pp_ra = array();
484
                $pp_admin = array();
529
                $pp_admin = array();
485
 
530
 
Line 612... Line 657...
612
                                'id' => 'oidplus:system_plugins$'.get_class($plugin),
657
                                'id' => 'oidplus:system_plugins$'.get_class($plugin),
613
                                'icon' => $tree_icon_language,
658
                                'icon' => $tree_icon_language,
614
                                'text' => $txt,
659
                                'text' => $txt,
615
                        );
660
                        );
616
                }
661
                }
-
 
662
                $design_plugins = array();
-
 
663
                foreach (OIDplus::getDesignPlugins() as $plugin) {
-
 
664
                        $txt = (empty($plugin->getManifest()->getName())) ? get_class($plugin) : $plugin->getManifest()->getName();
-
 
665
 
-
 
666
                        $active = OIDplus::config()->getValue('design') === basename($plugin->getPluginDirectory());
-
 
667
                        if ($active) {
-
 
668
                                $design_plugins[] = array(
-
 
669
                                        'id' => 'oidplus:system_plugins$'.get_class($plugin),
-
 
670
                                        'icon' => $tree_icon_design_active,
-
 
671
                                        'text' => $txt,
-
 
672
                                );
-
 
673
                        } else {
-
 
674
                                $design_plugins[] = array(
-
 
675
                                        'id' => 'oidplus:system_plugins$'.get_class($plugin),
-
 
676
                                        'icon' => $tree_icon_design_inactive,
-
 
677
                                        'text' => '<font color="gray">'.$txt.'</font>',
-
 
678
                                );
-
 
679
                        }
-
 
680
                }
617
                $json[] = array(
681
                $json[] = array(
618
                        'id' => 'oidplus:system_plugins',
682
                        'id' => 'oidplus:system_plugins',
619
                        'icon' => $tree_icon,
683
                        'icon' => $tree_icon,
620
                        'text' => _L('Plugins'),
684
                        'text' => _L('Plugins'),
621
                        'children' => array(
685
                        'children' => array(
Line 677... Line 741...
677
                                array(
741
                                array(
678
                                        'id' => 'oidplus:system_plugins.language',
742
                                        'id' => 'oidplus:system_plugins.language',
679
                                        'icon' => $tree_icon,
743
                                        'icon' => $tree_icon,
680
                                        'text' => _L('Languages'),
744
                                        'text' => _L('Languages'),
681
                                        'children' => $language_plugins
745
                                        'children' => $language_plugins
-
 
746
                                ),
-
 
747
                                array(
-
 
748
                                        'id' => 'oidplus:system_plugins.design',
-
 
749
                                        'icon' => $tree_icon,
-
 
750
                                        'text' => _L('Designs'),
-
 
751
                                        'children' => $design_plugins
682
                                )
752
                                )
683
                        )
753
                        )
684
                );
754
                );
685
 
755
 
686
                return true;
756
                return true;