Subversion Repositories oidplus

Rev

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

Rev 321 Rev 360
Line 51... Line 51...
51
        }
51
        }
52
 
52
 
53
        public function gui($id, &$out, &$handled) {
53
        public function gui($id, &$out, &$handled) {
54
                if ($id === 'oidplus:list_ra') {
54
                if ($id === 'oidplus:list_ra') {
55
                        $handled = true;
55
                        $handled = true;
56
                        $out['title'] = 'RA Listing';
56
                        $out['title'] = _L('RA Listing');
57
                        $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : '';
57
                        $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : '';
58
 
58
 
59
                        if (!OIDplus::authUtils()::isAdminLoggedIn()) {
59
                        if (!OIDplus::authUtils()::isAdminLoggedIn()) {
60
                                $out['icon'] = 'img/error_big.png';
60
                                $out['icon'] = 'img/error_big.png';
61
                                $out['text'] = '<p>You need to <a '.OIDplus::gui()->link('oidplus:login').'>log in</a> as administrator.</p>';
61
                                $out['text'] = '<p>'._L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login')).'</p>';
62
                                return;
62
                                return;
63
                        }
63
                        }
64
 
64
 
65
                        $out['text'] = '';
65
                        $out['text'] = '';
66
 
66
 
67
                        $tmp = $this->get_ralist();
67
                        $tmp = $this->get_ralist();
68
 
68
 
69
                        if (count($tmp) == 0) {
69
                        if (count($tmp) == 0) {
70
                                $out['text'] .= '<p>Currently there are no Registration Authorities.</p>';
70
                                $out['text'] .= '<p>'._L('Currently there are no Registration Authorities.').'</p>';
71
                        }
71
                        }
72
 
72
 
73
                        foreach ($tmp as $ra_email => $registered) {
73
                        foreach ($tmp as $ra_email => $registered) {
74
                                if (empty($ra_email)) {
74
                                if (empty($ra_email)) {
75
                                        $out['text'] .= '<p><b><a '.OIDplus::gui()->link('oidplus:rainfo$').'>(Objects with undefined RA)</a></b></p>';
75
                                        $out['text'] .= '<p><b><a '.OIDplus::gui()->link('oidplus:rainfo$').'>'._L('(Objects with undefined RA)').'</a></b></p>';
76
                                } else {
76
                                } else {
77
                                        if ($registered == 0) {
77
                                        if ($registered == 0) {
78
                                                $out['text'] .= '<p><b><a '.OIDplus::gui()->link('oidplus:rainfo$'.str_replace('@','&',$ra_email)).'>'.htmlentities($ra_email).'</a></b> (has objects, is not registered)</p>';
78
                                                $out['text'] .= '<p><b><a '.OIDplus::gui()->link('oidplus:rainfo$'.str_replace('@','&',$ra_email)).'>'.htmlentities($ra_email).'</a></b> '._L('(has objects, is not registered)').'</p>';
79
                                        }
79
                                        }
80
                                        if ($registered == 1) {
80
                                        if ($registered == 1) {
81
                                                $out['text'] .= '<p><b><a '.OIDplus::gui()->link('oidplus:rainfo$'.str_replace('@','&',$ra_email)).'>'.htmlentities($ra_email).'</a></b> (registered, <font color="red">has no objects</font>)</p>';
81
                                                $out['text'] .= '<p><b><a '.OIDplus::gui()->link('oidplus:rainfo$'.str_replace('@','&',$ra_email)).'>'.htmlentities($ra_email).'</a></b> '._L('(registered, <font color="red">has no objects</font>)').'</p>';
82
                                        }
82
                                        }
83
                                        if ($registered == 2) {
83
                                        if ($registered == 2) {
84
                                                $out['text'] .= '<p><b><a '.OIDplus::gui()->link('oidplus:rainfo$'.str_replace('@','&',$ra_email)).'>'.htmlentities($ra_email).'</a></b></p>';
84
                                                $out['text'] .= '<p><b><a '.OIDplus::gui()->link('oidplus:rainfo$'.str_replace('@','&',$ra_email)).'>'.htmlentities($ra_email).'</a></b></p>';
85
                                        }
85
                                        }
86
                                }
86
                                }
Line 102... Line 102...
102
                foreach ($tmp as $ra_email => $registered) {
102
                foreach ($tmp as $ra_email => $registered) {
103
                        if (empty($ra_email)) {
103
                        if (empty($ra_email)) {
104
                                $children[] = array(
104
                                $children[] = array(
105
                                        'id' => 'oidplus:rainfo$',
105
                                        'id' => 'oidplus:rainfo$',
106
                                        'icon' => $tree_icon,
106
                                        'icon' => $tree_icon,
107
                                        'text' => '(Objects with undefined RA)'
107
                                        'text' => _L('(Objects with undefined RA)')
108
                                );
108
                                );
109
                        } else {
109
                        } else {
110
                                if ($registered == 0) {
110
                                if ($registered == 0) {
111
                                        $children[] = array(
111
                                        $children[] = array(
112
                                                'id' => 'oidplus:rainfo$'.str_replace('@', '&', $ra_email),
112
                                                'id' => 'oidplus:rainfo$'.str_replace('@', '&', $ra_email),
113
                                                'icon' => $tree_icon,
113
                                                'icon' => $tree_icon,
114
                                                'text' => $ra_email.' <i>(has objects, is not registered)</i>'
114
                                                'text' => $ra_email.' <i>'._L('(has objects, is not registered)').'</i>'
115
                                        );
115
                                        );
116
                                }
116
                                }
117
                                if ($registered == 1) {
117
                                if ($registered == 1) {
118
                                        $children[] = array(
118
                                        $children[] = array(
119
                                                'id' => 'oidplus:rainfo$'.$ra_email,
119
                                                'id' => 'oidplus:rainfo$'.$ra_email,
120
                                                'icon' => $tree_icon,
120
                                                'icon' => $tree_icon,
121
                                                'text' => $ra_email.' <i><font color="red">(has no objects)</font></i>'
121
                                                'text' => $ra_email.' <i><font color="red">'._L('(has no objects)').'</font></i>'
122
                                        );
122
                                        );
123
                                }
123
                                }
124
                                if ($registered == 2) {
124
                                if ($registered == 2) {
125
                                        $children[] = array(
125
                                        $children[] = array(
126
                                                'id' => 'oidplus:rainfo$'.$ra_email,
126
                                                'id' => 'oidplus:rainfo$'.$ra_email,
Line 132... Line 132...
132
                }
132
                }
133
 
133
 
134
                $json[] = array(
134
                $json[] = array(
135
                        'id' => 'oidplus:list_ra',
135
                        'id' => 'oidplus:list_ra',
136
                        'icon' => $tree_icon,
136
                        'icon' => $tree_icon,
137
                        'text' => 'List RAs',
137
                        'text' => _L('List RAs'),
138
                        'children' => $children
138
                        'children' => $children
139
                );
139
                );
140
 
140
 
141
                return true;
141
                return true;
142
        }
142
        }