1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <?php
- if (!defined('STATUSNET')) {
-
-
- exit(1);
- }
- class PrimaryNav extends Menu
- {
- function show()
- {
- $user = common_current_user();
- $this->action->elementStart('ul', array('class' => 'nav'));
- if (Event::handle('StartPrimaryNav', array($this->action))) {
- if (!empty($user)) {
- $this->action->menuItem(common_local_url('profilesettings'),
-
- _m('MENU','Settings'),
-
- _('Change your personal settings.'),
- false,
- 'nav_account');
- if ($user->hasRight(Right::CONFIGURESITE)) {
- $this->action->menuItem(common_local_url('siteadminpanel'),
-
- _m('MENU','Admin'),
-
- _('Site configuration.'),
- false,
- 'nav_admin');
- }
- $this->action->menuItem(common_local_url('logout'),
-
- _m('MENU','Logout'),
-
- _('Logout from the site.'),
- false,
- 'nav_logout');
- } else {
- $this->action->menuItem(common_local_url('login'),
-
- _m('MENU','Login'),
-
- _('Login to the site.'),
- false,
- 'nav_login');
- }
- Event::handle('EndPrimaryNav', array($this->action));
- }
- $this->action->elementEnd('ul');
- }
- }
|