Subversion Repositories oidplus

Rev

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

Rev 702 Rev 800
Line 122... Line 122...
122
                        $tab = 'ra';
122
                        $tab = 'ra';
123
                }
123
                }
124
                if ($id === 'oidplus:login') {
124
                if ($id === 'oidplus:login') {
125
                        $handled = true;
125
                        $handled = true;
126
                        $out['title'] = _L('Login');
126
                        $out['title'] = _L('Login');
127
                        $out['icon']  = OIDplus::webpath(__DIR__).'login_big.png';
127
                        $out['icon']  = OIDplus::webpath(__DIR__,true).'img/login_icon.png';
128
 
128
 
129
                        $out['text'] = '';
129
                        $out['text'] = '';
130
 
130
 
131
                        $out['text'] .= '<noscript>';
131
                        $out['text'] .= '<noscript>';
132
                        $out['text'] .= '<p>'._L('You need to enable JavaScript to use the login area.').'</p>';
132
                        $out['text'] .= '<p>'._L('You need to enable JavaScript to use the login area.').'</p>';
Line 268... Line 268...
268
                                }
268
                                }
269
                        }
269
                        }
270
 
270
 
271
                        $ra_roots[] = array(
271
                        $ra_roots[] = array(
272
                                'id'       => 'oidplus:logout$admin',
272
                                'id'       => 'oidplus:logout$admin',
273
                                'icon'     => OIDplus::webpath(__DIR__).'treeicon_logout.png',
273
                                'icon'     => OIDplus::webpath(__DIR__,true).'img/logout_icon16.png',
274
                                'conditionalselect' => 'OIDplusPagePublicLogin.adminLogout(); false;',
274
                                'conditionalselect' => 'OIDplusPagePublicLogin.adminLogout(); false;',
275
                                'text'     => _L('Log out')
275
                                'text'     => _L('Log out')
276
                        );
276
                        );
277
                        $loginChildren[] = array(
277
                        $loginChildren[] = array(
278
                                'id'       => 'oidplus:dummy$'.md5((string)rand()),
278
                                'id'       => 'oidplus:dummy$'.md5((string)rand()),
279
                                'text'     => _L("Logged in as <b>admin</b>"),
279
                                'text'     => _L("Logged in as <b>admin</b>"),
280
                                'icon'     => OIDplus::webpath(__DIR__).'treeicon_admin.png',
280
                                'icon'     => OIDplus::webpath(__DIR__,true).'img/admin_icon16.png',
281
                                'conditionalselect' => 'false', // dummy node that can't be selected
281
                                'conditionalselect' => 'false', // dummy node that can't be selected
282
                                'state'    => array("opened" => true),
282
                                'state'    => array("opened" => true),
283
                                'children' => $ra_roots
283
                                'children' => $ra_roots
284
                        );
284
                        );
285
                }
285
                }
Line 295... Line 295...
295
                        }
295
                        }
296
 
296
 
297
                        $ra_roots[] = array(
297
                        $ra_roots[] = array(
298
                                'id'       => 'oidplus:logout$'.$ra_email,
298
                                'id'       => 'oidplus:logout$'.$ra_email,
299
                                'conditionalselect' => 'OIDplusPagePublicLogin.raLogout('.js_escape($ra_email).'); false;',
299
                                'conditionalselect' => 'OIDplusPagePublicLogin.raLogout('.js_escape($ra_email).'); false;',
300
                                'icon'     => OIDplus::webpath(__DIR__).'treeicon_logout.png',
300
                                'icon'     => OIDplus::webpath(__DIR__,true).'img/logout_icon16.png',
301
                                'text'     => _L('Log out')
301
                                'text'     => _L('Log out')
302
                        );
302
                        );
303
                        foreach (OIDplusObject::getRaRoots($ra_email) as $loc_root) {
303
                        foreach (OIDplusObject::getRaRoots($ra_email) as $loc_root) {
304
                                $ico = $loc_root->getIcon();
304
                                $ico = $loc_root->getIcon();
305
                                $ra_roots[] = array(
305
                                $ra_roots[] = array(
306
                                        'id' => 'oidplus:raroot$'.$loc_root->nodeId(),
306
                                        'id' => 'oidplus:raroot$'.$loc_root->nodeId(),
307
                                        'text' => _L('Jump to RA root %1',$loc_root->objectTypeTitleShort().' '.$loc_root->crudShowId(OIDplusObject::parse($loc_root::root()))),
307
                                        'text' => _L('Jump to RA root %1',$loc_root->objectTypeTitleShort().' '.$loc_root->crudShowId(OIDplusObject::parse($loc_root::root()))),
308
                                        'conditionalselect' => 'openOidInPanel('.js_escape($loc_root->nodeId()).', true); false;',
308
                                        'conditionalselect' => 'openOidInPanel('.js_escape($loc_root->nodeId()).', true); false;',
309
                                        'icon' => !is_null($ico) ? $ico : OIDplus::webpath(__DIR__).'treeicon_link.png'
309
                                        'icon' => !is_null($ico) ? $ico : OIDplus::webpath(__DIR__,true).'img/link_icon16.png'
310
                                );
310
                                );
311
                        }
311
                        }
312
                        $ra_email_or_name = (new OIDplusRA($ra_email))->raName();
312
                        $ra_email_or_name = (new OIDplusRA($ra_email))->raName();
313
                        if ($ra_email_or_name == '') {
313
                        if ($ra_email_or_name == '') {
314
                                $ra_email_html = htmlentities($ra_email);
314
                                $ra_email_html = htmlentities($ra_email);
Line 319... Line 319...
319
                                $ra_email_or_name = "<b>$ra_email_or_name_html</b> ($ra_email_html)";
319
                                $ra_email_or_name = "<b>$ra_email_or_name_html</b> ($ra_email_html)";
320
                        }
320
                        }
321
                        $loginChildren[] = array(
321
                        $loginChildren[] = array(
322
                                'id'       => 'oidplus:dummy$'.md5((string)rand()),
322
                                'id'       => 'oidplus:dummy$'.md5((string)rand()),
323
                                'text'     => _L('Logged in as %1',$ra_email_or_name),
323
                                'text'     => _L('Logged in as %1',$ra_email_or_name),
324
                                'icon'     => OIDplus::webpath(__DIR__).'treeicon_ra.png',
324
                                'icon'     => OIDplus::webpath(__DIR__,true).'img/ra_icon16.png',
325
                                'conditionalselect' => 'false', // dummy node that can't be selected
325
                                'conditionalselect' => 'false', // dummy node that can't be selected
326
                                'state'    => array("opened" => true),
326
                                'state'    => array("opened" => true),
327
                                'children' => $ra_roots
327
                                'children' => $ra_roots
328
                        );
328
                        );
329
                }
329
                }
330
 
330
 
331
                $json[] = array(
331
                $json[] = array(
332
                        'id'       => 'oidplus:login',
332
                        'id'       => 'oidplus:login',
333
                        'icon'     => OIDplus::webpath(__DIR__).'treeicon_login.png',
333
                        'icon'     => OIDplus::webpath(__DIR__,true).'img/login_icon16.png',
334
                        'text'     => _L('Login'),
334
                        'text'     => _L('Login'),
335
                        'state'    => array("opened" => count($loginChildren)>0),
335
                        'state'    => array("opened" => count($loginChildren)>0),
336
                        'children' => $loginChildren
336
                        'children' => $loginChildren
337
                );
337
                );
338
 
338