123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- <?php
- if (!defined('STATUSNET')) {
-
-
- exit(1);
- }
- class AdminPanelNav extends Menu
- {
-
- function show()
- {
- $action_name = $this->action->trimmed('action');
- $user = common_current_user();
- $nickname = $user->nickname;
- $name = $user->getProfile()->getBestName();
- $stub = new HomeStubNav($this->action);
- $this->submenu(_m('MENU','Home'), $stub);
- $this->action->elementStart('ul');
- $this->action->elementStart('li');
-
- $this->action->element('h3', null, _m('HEADER','Admin'));
- $this->action->elementStart('ul', array('class' => 'nav'));
- if (Event::handle('StartAdminPanelNav', array($this))) {
- if (AdminPanelAction::canAdmin('site')) {
-
- $menu_title = _('Basic site configuration');
-
- $this->out->menuItem(common_local_url('siteadminpanel'), _m('MENU', 'Site'),
- $menu_title, $action_name == 'siteadminpanel', 'nav_site_admin_panel');
- }
- if (AdminPanelAction::canAdmin('user')) {
-
- $menu_title = _('User configuration');
-
- $this->out->menuItem(common_local_url('useradminpanel'), _m('MENU','User'),
- $menu_title, $action_name == 'useradminpanel', 'nav_user_admin_panel');
- }
- if (AdminPanelAction::canAdmin('access')) {
-
- $menu_title = _('Access configuration');
-
- $this->out->menuItem(common_local_url('accessadminpanel'), _m('MENU','Access'),
- $menu_title, $action_name == 'accessadminpanel', 'nav_access_admin_panel');
- }
- if (AdminPanelAction::canAdmin('paths')) {
-
- $menu_title = _('Paths configuration');
-
- $this->out->menuItem(common_local_url('pathsadminpanel'), _m('MENU','Paths'),
- $menu_title, $action_name == 'pathsadminpanel', 'nav_paths_admin_panel');
- }
- if (AdminPanelAction::canAdmin('sessions')) {
-
- $menu_title = _('Sessions configuration');
-
- $this->out->menuItem(common_local_url('sessionsadminpanel'), _m('MENU','Sessions'),
- $menu_title, $action_name == 'sessionsadminpanel', 'nav_sessions_admin_panel');
- }
- if (AdminPanelAction::canAdmin('sitenotice')) {
-
- $menu_title = _('Edit site notice');
-
- $this->out->menuItem(common_local_url('sitenoticeadminpanel'), _m('MENU','Site notice'),
- $menu_title, $action_name == 'sitenoticeadminpanel', 'nav_sitenotice_admin_panel');
- }
- if (AdminPanelAction::canAdmin('license')) {
-
- $menu_title = _('Set site license');
-
- $this->out->menuItem(common_local_url('licenseadminpanel'), _m('MENU','License'),
- $menu_title, $action_name == 'licenseadminpanel', 'nav_license_admin_panel');
- }
- if (AdminPanelAction::canAdmin('plugins')) {
-
- $menu_title = _('Plugins configuration');
-
- $this->out->menuItem(common_local_url('pluginsadminpanel'), _m('MENU','Plugins'),
- $menu_title, $action_name == 'pluginsadminpanel', 'nav_plugin_admin_panel');
- }
- Event::handle('EndAdminPanelNav', array($this));
- }
- $this->action->elementEnd('ul');
- $this->action->elementEnd('li');
- $this->action->elementEnd('ul');
- }
- }
|