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->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'
));
@ -96,7 +96,6 @@ class ConfigController extends Controller
$this->view->form = $form;
$this->createApplicationTabs()->activate('general');
$this->createAuthenticationTabs();
}
/**
@ -201,7 +200,6 @@ class ConfigController extends Controller
$form->handleRequest();
$this->view->form = $form;
$this->createApplicationTabs();
$this->createAuthenticationTabs()->activate('userbackend');
$this->render('userbackend/reorder');
}
@ -335,7 +333,6 @@ class ConfigController extends Controller
$this->assertPermission('config/application/resources');
$this->view->resources = Config::app('resources', true);
$this->createApplicationTabs()->activate('resource');
$this->createAuthenticationTabs();
}
/**

View File

@ -342,16 +342,36 @@ class GroupController extends AuthBackendController
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;
}
}

View File

@ -125,14 +125,24 @@ class NavigationController extends Controller
$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'),

View File

@ -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'
))
);
}

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;
}
}

View File

@ -305,6 +305,18 @@ class UserController extends AuthBackendController
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(
@ -314,7 +326,15 @@ class UserController extends AuthBackendController
'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;
}
}

View File

@ -148,18 +148,6 @@ class UsergroupbackendController extends Controller
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'),

View File

@ -251,43 +251,31 @@ class Web extends EmbeddedWeb
'permission' => 'config/*',
'priority' => 800,
'children' => array(
'application' => array(
'application' => array(
'label' => t('Application'),
'url' => 'config/general',
'permission' => 'config/application/*',
'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'),
'url' => 'navigation/shared',
'permission' => 'config/application/navigation',
'priority' => 820,
'priority' => 840,
),
'authentication' => 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(
'modules' => array(
'label' => t('Modules'),
'url' => 'config/modules',
'permission' => 'config/modules',
@ -296,22 +284,10 @@ class Web extends EmbeddedWeb
)
),
'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'