Skip to content

Commit

Permalink
Rearrange menu entries
Browse files Browse the repository at this point in the history
refs #5543
  • Loading branch information
lippserd committed Oct 1, 2015
1 parent bdc29fe commit cb46af8
Show file tree
Hide file tree
Showing 8 changed files with 102 additions and 70 deletions.
5 changes: 1 addition & 4 deletions application/controllers/ConfigController.php
Expand Up @@ -56,7 +56,7 @@ public function createAuthenticationTabs()
$tabs = $this->getTabs();
$tabs->add('userbackend', array(
'title' => $this->translate('Configure how users authenticate with and log into Icinga Web 2'),
'label' => $this->translate('Authentication'),
'label' => $this->translate('Users'),
'url' => 'config/userbackend',
'baseTarget' => '_main'
));
Expand Down Expand Up @@ -96,7 +96,6 @@ public function generalAction()

$this->view->form = $form;
$this->createApplicationTabs()->activate('general');
$this->createAuthenticationTabs();
}

/**
Expand Down Expand Up @@ -201,7 +200,6 @@ public function userbackendAction()
$form->handleRequest();

$this->view->form = $form;
$this->createApplicationTabs();
$this->createAuthenticationTabs()->activate('userbackend');
$this->render('userbackend/reorder');
}
Expand Down Expand Up @@ -335,7 +333,6 @@ public function resourceAction()
$this->assertPermission('config/application/resources');
$this->view->resources = Config::app('resources', true);
$this->createApplicationTabs()->activate('resource');
$this->createAuthenticationTabs();
}

/**
Expand Down
24 changes: 22 additions & 2 deletions application/controllers/GroupController.php
Expand Up @@ -342,16 +342,36 @@ protected function createShowTabs($backendName, $groupName)
protected function createListTabs()
{
$tabs = $this->getTabs();
$tabs->add(
'role/list',
array(
'baseTarget' => '_main',
'label' => $this->translate('Roles'),
'title' => $this->translate(
'Configure roles to permit or restrict users and groups accessing Icinga Web 2'
),
'url' => 'role/list'

)
);
$tabs->add(
'user/list',
array(
'title' => $this->translate('List users of authentication backends'),
'label' => $this->translate('Users'),
'icon' => 'user',
'url' => 'user/list'
)
);
$tabs->add(
'group/list',
array(
'title' => $this->translate('List groups of user group backends'),
'label' => $this->translate('Usergroups'),
'label' => $this->translate('User Groups'),
'icon' => 'users',
'url' => 'group/list'
)
);

return $tabs;
}
}
14 changes: 12 additions & 2 deletions application/controllers/NavigationController.php
Expand Up @@ -125,14 +125,24 @@ public function indexAction()
$this->view->types = $this->listItemTypes();
$this->view->items = $query;

$this->getTabs()->add(
$this->getTabs()
->add(
'preferences',
array(
'title' => $this->translate('Adjust the preferences of Icinga Web 2 according to your needs'),
'label' => $this->translate('Preferences'),
'url' => 'preference'
)
)
->add(
'navigation',
array(
'active' => true,
'title' => $this->translate('List and configure your own navigation items'),
'label' => $this->translate('Navigation'),
'url' => 'navigation'
)
)->activate('navigation');
);
$this->setupSortControl(
array(
'type' => $this->translate('Type'),
Expand Down
17 changes: 10 additions & 7 deletions application/controllers/PreferenceController.php
Expand Up @@ -28,13 +28,16 @@ class PreferenceController extends BasePreferenceController
public static function createProvidedTabs()
{
return array(
'preferences' => new Tab(
array(
'title' => t('Adjust the preferences of Icinga Web 2 according to your needs'),
'label' => t('Preferences'),
'url' => Url::fromPath('preference')
)
)
'preferences' => new Tab(array(
'title' => t('Adjust the preferences of Icinga Web 2 according to your needs'),
'label' => t('Preferences'),
'url' => 'preference'
)),
'navigation' => new Tab(array(
'title' => t('List and configure your own navigation items'),
'label' => t('Navigation'),
'url' => 'navigation'
))
);
}

Expand Down
18 changes: 18 additions & 0 deletions application/controllers/RoleController.php
Expand Up @@ -158,6 +158,24 @@ protected function createListTabs()

)
);
$tabs->add(
'user/list',
array(
'title' => $this->translate('List users of authentication backends'),
'label' => $this->translate('Users'),
'icon' => 'user',
'url' => 'user/list'
)
);
$tabs->add(
'group/list',
array(
'title' => $this->translate('List groups of user group backends'),
'label' => $this->translate('User Groups'),
'icon' => 'users',
'url' => 'group/list'
)
);
return $tabs;
}
}
22 changes: 21 additions & 1 deletion application/controllers/UserController.php
Expand Up @@ -305,6 +305,18 @@ protected function createShowTabs($backendName, $userName)
protected function createListTabs()
{
$tabs = $this->getTabs();
$tabs->add(
'role/list',
array(
'baseTarget' => '_main',
'label' => $this->translate('Roles'),
'title' => $this->translate(
'Configure roles to permit or restrict users and groups accessing Icinga Web 2'
),
'url' => 'role/list'

)
);
$tabs->add(
'user/list',
array(
Expand All @@ -314,7 +326,15 @@ protected function createListTabs()
'url' => 'user/list'
)
);

$tabs->add(
'group/list',
array(
'title' => $this->translate('List groups of user group backends'),
'label' => $this->translate('User Groups'),
'icon' => 'users',
'url' => 'group/list'
)
);
return $tabs;
}
}
12 changes: 0 additions & 12 deletions application/controllers/UsergroupbackendController.php
Expand Up @@ -148,18 +148,6 @@ public function removeAction()
protected function createListTabs()
{
$tabs = $this->getTabs();
$tabs->add('general', array(
'title' => $this->translate('Adjust the general configuration of Icinga Web 2'),
'label' => $this->translate('General'),
'url' => 'config/general',
'baseTarget' => '_main'
));
$tabs->add('resource', array(
'title' => $this->translate('Configure which resources are being utilized by Icinga Web 2'),
'label' => $this->translate('Resources'),
'url' => 'config/resource',
'baseTarget' => '_main'
));
$tabs->add('userbackend', array(
'title' => $this->translate('Configure how users authenticate with and log into Icinga Web 2'),
'label' => $this->translate('Authentication'),
Expand Down
60 changes: 18 additions & 42 deletions library/Icinga/Application/Web.php
Expand Up @@ -251,43 +251,31 @@ public function getMenu()
'permission' => 'config/*',
'priority' => 800,
'children' => array(
'application' => array(
'application' => array(
'label' => t('Application'),
'url' => 'config/general',
'permission' => 'config/application/*',
'priority' => 810
),
'navigation' => array(
'label' => t('Shared Navigation'),
'url' => 'navigation/shared',
'permission' => 'config/application/navigation',
'priority' => 820,
'authentication' => array(
'label' => t('Authentication'),
'url' => 'config/userbackend',
'permission' => 'config/application/*',
'priority' => 820
),
'authentication' => array(
'label' => t('Authentication'),
'url' => 'config/userbackend',
'authorization' => array(
'label' => t('Authorization'),
'permission' => 'config/authentication/*',
'priority' => 830
'priority' => 830,
'url' => 'role/list'
),
'roles' => array(
'label' => t('Roles'),
'url' => 'role/list',
'permission' => 'config/authentication/roles/show',
'priority' => 840
),
'users' => array(
'label' => t('Users'),
'url' => 'user/list',
'permission' => 'config/authentication/users/show',
'priority' => 850
),
'groups' => array(
'label' => t('Usergroups'),
'url' => 'group/list',
'permission' => 'config/authentication/groups/show',
'priority' => 860
'navigation' => array(
'label' => t('Shared Navigation'),
'url' => 'navigation/shared',
'permission' => 'config/application/navigation',
'priority' => 840,
),
'modules' => array(
'modules' => array(
'label' => t('Modules'),
'url' => 'config/modules',
'permission' => 'config/modules',
Expand All @@ -296,22 +284,10 @@ public function getMenu()
)
),
'user' => array(
'children' => array(
'preferences' => array(
'label' => t('Preferences'),
'url' => 'preference',
'priority' => 910
),
'navigation' => array(
'label' => t('Navigation'),
'url' => 'navigation',
'priority' => 920
)
),
'cssClass' => 'user-nav-item',
'label' => $this->user->getUsername(),
'icon' => 'user',
'url' => 'account',
'icon' => 'user',
'url' => 'preference',
'priority' => 900,
'renderer' => array(
'UserNavigationItemRenderer'
Expand Down

0 comments on commit cb46af8

Please sign in to comment.