Rearrange menu entries

refs #5543
This commit is contained in:
Eric Lippmann 2015-10-01 09:01:03 +02:00
parent bdc29fe824
commit cb46af8e9c
8 changed files with 102 additions and 70 deletions

View File

@ -56,7 +56,7 @@ class ConfigController extends Controller
$tabs = $this->getTabs(); $tabs = $this->getTabs();
$tabs->add('userbackend', array( $tabs->add('userbackend', array(
'title' => $this->translate('Configure how users authenticate with and log into Icinga Web 2'), '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', 'url' => 'config/userbackend',
'baseTarget' => '_main' 'baseTarget' => '_main'
)); ));
@ -96,7 +96,6 @@ class ConfigController extends Controller
$this->view->form = $form; $this->view->form = $form;
$this->createApplicationTabs()->activate('general'); $this->createApplicationTabs()->activate('general');
$this->createAuthenticationTabs();
} }
/** /**
@ -201,7 +200,6 @@ class ConfigController extends Controller
$form->handleRequest(); $form->handleRequest();
$this->view->form = $form; $this->view->form = $form;
$this->createApplicationTabs();
$this->createAuthenticationTabs()->activate('userbackend'); $this->createAuthenticationTabs()->activate('userbackend');
$this->render('userbackend/reorder'); $this->render('userbackend/reorder');
} }
@ -335,7 +333,6 @@ class ConfigController extends Controller
$this->assertPermission('config/application/resources'); $this->assertPermission('config/application/resources');
$this->view->resources = Config::app('resources', true); $this->view->resources = Config::app('resources', true);
$this->createApplicationTabs()->activate('resource'); $this->createApplicationTabs()->activate('resource');
$this->createAuthenticationTabs();
} }
/** /**

View File

@ -342,16 +342,36 @@ class GroupController extends AuthBackendController
protected function createListTabs() protected function createListTabs()
{ {
$tabs = $this->getTabs(); $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( $tabs->add(
'group/list', 'group/list',
array( array(
'title' => $this->translate('List groups of user group backends'), 'title' => $this->translate('List groups of user group backends'),
'label' => $this->translate('Usergroups'), 'label' => $this->translate('User Groups'),
'icon' => 'users', 'icon' => 'users',
'url' => 'group/list' 'url' => 'group/list'
) )
); );
return $tabs; return $tabs;
} }
} }

View File

@ -125,14 +125,24 @@ class NavigationController extends Controller
$this->view->types = $this->listItemTypes(); $this->view->types = $this->listItemTypes();
$this->view->items = $query; $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', 'navigation',
array( array(
'active' => true,
'title' => $this->translate('List and configure your own navigation items'), 'title' => $this->translate('List and configure your own navigation items'),
'label' => $this->translate('Navigation'), 'label' => $this->translate('Navigation'),
'url' => 'navigation' 'url' => 'navigation'
) )
)->activate('navigation'); );
$this->setupSortControl( $this->setupSortControl(
array( array(
'type' => $this->translate('Type'), 'type' => $this->translate('Type'),

View File

@ -28,13 +28,16 @@ class PreferenceController extends BasePreferenceController
public static function createProvidedTabs() public static function createProvidedTabs()
{ {
return array( return array(
'preferences' => new Tab( 'preferences' => new Tab(array(
array( 'title' => t('Adjust the preferences of Icinga Web 2 according to your needs'),
'title' => t('Adjust the preferences of Icinga Web 2 according to your needs'), 'label' => t('Preferences'),
'label' => t('Preferences'), 'url' => 'preference'
'url' => Url::fromPath('preference') )),
) 'navigation' => new Tab(array(
) 'title' => t('List and configure your own navigation items'),
'label' => t('Navigation'),
'url' => 'navigation'
))
); );
} }

View File

@ -158,6 +158,24 @@ class RoleController extends AuthBackendController
) )
); );
$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; return $tabs;
} }
} }

View File

@ -305,6 +305,18 @@ class UserController extends AuthBackendController
protected function createListTabs() protected function createListTabs()
{ {
$tabs = $this->getTabs(); $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( $tabs->add(
'user/list', 'user/list',
array( array(
@ -314,7 +326,15 @@ class UserController extends AuthBackendController
'url' => 'user/list' '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; return $tabs;
} }
} }

View File

@ -148,18 +148,6 @@ class UsergroupbackendController extends Controller
protected function createListTabs() protected function createListTabs()
{ {
$tabs = $this->getTabs(); $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( $tabs->add('userbackend', array(
'title' => $this->translate('Configure how users authenticate with and log into Icinga Web 2'), 'title' => $this->translate('Configure how users authenticate with and log into Icinga Web 2'),
'label' => $this->translate('Authentication'), 'label' => $this->translate('Authentication'),

View File

@ -251,43 +251,31 @@ class Web extends EmbeddedWeb
'permission' => 'config/*', 'permission' => 'config/*',
'priority' => 800, 'priority' => 800,
'children' => array( 'children' => array(
'application' => array( 'application' => array(
'label' => t('Application'), 'label' => t('Application'),
'url' => 'config/general', 'url' => 'config/general',
'permission' => 'config/application/*', 'permission' => 'config/application/*',
'priority' => 810 'priority' => 810
), ),
'navigation' => array( 'authentication' => array(
'label' => t('Authentication'),
'url' => 'config/userbackend',
'permission' => 'config/application/*',
'priority' => 820
),
'authorization' => array(
'label' => t('Authorization'),
'permission' => 'config/authentication/*',
'priority' => 830,
'url' => 'role/list'
),
'navigation' => array(
'label' => t('Shared Navigation'), 'label' => t('Shared Navigation'),
'url' => 'navigation/shared', 'url' => 'navigation/shared',
'permission' => 'config/application/navigation', 'permission' => 'config/application/navigation',
'priority' => 820, 'priority' => 840,
), ),
'authentication' => array( 'modules' => array(
'label' => t('Authentication'),
'url' => 'config/userbackend',
'permission' => 'config/authentication/*',
'priority' => 830
),
'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
),
'modules' => array(
'label' => t('Modules'), 'label' => t('Modules'),
'url' => 'config/modules', 'url' => 'config/modules',
'permission' => 'config/modules', 'permission' => 'config/modules',
@ -296,22 +284,10 @@ class Web extends EmbeddedWeb
) )
), ),
'user' => array( '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', 'cssClass' => 'user-nav-item',
'label' => $this->user->getUsername(), 'label' => $this->user->getUsername(),
'icon' => 'user', 'icon' => 'user',
'url' => 'account', 'url' => 'preference',
'priority' => 900, 'priority' => 900,
'renderer' => array( 'renderer' => array(
'UserNavigationItemRenderer' 'UserNavigationItemRenderer'