Set a proper title for all controller actions

refs #3851
This commit is contained in:
Johannes Meyer 2019-07-12 10:22:01 +02:00
parent 3edda43bca
commit fb48731978
10 changed files with 51 additions and 0 deletions

View File

@ -13,6 +13,7 @@ class AboutController extends Controller
{ {
$this->view->version = Version::get(); $this->view->version = Version::get();
$this->view->modules = Icinga::app()->getModuleManager()->getLoadedModules(); $this->view->modules = Icinga::app()->getModuleManager()->getLoadedModules();
$this->view->title = $this->translate('About');
$this->view->tabs = $this->getTabs()->add( $this->view->tabs = $this->getTabs()->add(
'about', 'about',
array( array(

View File

@ -68,6 +68,7 @@ class AccountController extends Controller
$form->handleRequest(); $form->handleRequest();
$this->view->form = $form; $this->view->form = $form;
$this->view->title = $this->translate('My Account');
$this->getTabs()->activate('account'); $this->getTabs()->activate('account');
} }
} }

View File

@ -12,6 +12,13 @@ use Icinga\Web\Url;
class AnnouncementsController extends Controller class AnnouncementsController extends Controller
{ {
public function init()
{
$this->view->title = $this->translate('Announcements');
parent::init();
}
/** /**
* List all announcements * List all announcements
*/ */

View File

@ -82,6 +82,7 @@ class ConfigController extends Controller
$form->handleRequest(); $form->handleRequest();
$this->view->form = $form; $this->view->form = $form;
$this->view->title = $this->translate('General');
$this->createApplicationTabs()->activate('general'); $this->createApplicationTabs()->activate('general');
} }
@ -107,6 +108,7 @@ class ConfigController extends Controller
->order('name'); ->order('name');
$this->setupLimitControl(); $this->setupLimitControl();
$this->setupPaginationControl($this->view->modules); $this->setupPaginationControl($this->view->modules);
$this->view->title = $this->translate('Modules');
} }
public function moduleAction() public function moduleAction()
@ -137,6 +139,7 @@ class ConfigController extends Controller
$this->view->module = $module; $this->view->module = $module;
$this->view->toggleForm = $toggleForm; $this->view->toggleForm = $toggleForm;
$this->view->title = $module->getName();
$this->view->tabs = $module->getConfigTabs()->activate('info'); $this->view->tabs = $module->getConfigTabs()->activate('info');
$this->view->moduleGitCommitId = Version::getGitHead($module->getBaseDir()); $this->view->moduleGitCommitId = Version::getGitHead($module->getBaseDir());
} else { } else {
@ -209,6 +212,7 @@ class ConfigController extends Controller
$this->view->form = $form; $this->view->form = $form;
$this->view->backendNames = Config::app('groups'); $this->view->backendNames = Config::app('groups');
$this->createApplicationTabs()->activate('authentication'); $this->createApplicationTabs()->activate('authentication');
$this->view->title = $this->translate('Authentication');
$this->render('userbackend/reorder'); $this->render('userbackend/reorder');
} }
@ -255,6 +259,7 @@ class ConfigController extends Controller
}); });
$form->handleRequest(); $form->handleRequest();
$this->view->title = $this->translate('Authentication');
$this->renderForm($form, $this->translate('New User Backend')); $this->renderForm($form, $this->translate('New User Backend'));
} }
@ -293,6 +298,7 @@ class ConfigController extends Controller
$this->httpNotFound(sprintf($this->translate('User backend "%s" not found'), $backendName)); $this->httpNotFound(sprintf($this->translate('User backend "%s" not found'), $backendName));
} }
$this->view->title = $this->translate('Authentication');
$this->renderForm($form, $this->translate('Update User Backend')); $this->renderForm($form, $this->translate('Update User Backend'));
} }
@ -325,6 +331,7 @@ class ConfigController extends Controller
}); });
$form->handleRequest(); $form->handleRequest();
$this->view->title = $this->translate('Authentication');
$this->renderForm($form, $this->translate('Remove User Backend')); $this->renderForm($form, $this->translate('Remove User Backend'));
} }
@ -338,6 +345,7 @@ class ConfigController extends Controller
->setKeyColumn('name') ->setKeyColumn('name')
->select() ->select()
->order('name'); ->order('name');
$this->view->title = $this->translate('Resources');
$this->createApplicationTabs()->activate('resource'); $this->createApplicationTabs()->activate('resource');
} }
@ -358,6 +366,7 @@ class ConfigController extends Controller
$form->handleRequest(); $form->handleRequest();
$this->view->form = $form; $this->view->form = $form;
$this->view->title = $this->translate('Resources');
$this->render('resource/create'); $this->render('resource/create');
} }
@ -377,6 +386,7 @@ class ConfigController extends Controller
$form->handleRequest(); $form->handleRequest();
$this->view->form = $form; $this->view->form = $form;
$this->view->title = $this->translate('Resources');
$this->render('resource/modify'); $this->render('resource/modify');
} }
@ -441,6 +451,7 @@ class ConfigController extends Controller
} }
$this->view->form = $form; $this->view->form = $form;
$this->view->title = $this->translate('Resources');
$this->render('resource/remove'); $this->render('resource/remove');
} }
} }

View File

@ -21,6 +21,13 @@ use Icinga\Web\Widget;
class GroupController extends AuthBackendController class GroupController extends AuthBackendController
{ {
public function init()
{
$this->view->title = $this->translate('User Groups');
parent::init();
}
/** /**
* List all user groups of a single backend * List all user groups of a single backend
*/ */

View File

@ -54,5 +54,6 @@ class ListController extends Controller
$this->setupLimitControl(); $this->setupLimitControl();
$this->setupPaginationControl($this->view->logData); $this->setupPaginationControl($this->view->logData);
$this->view->title = $this->translate('Application Log');
} }
} }

View File

@ -127,6 +127,7 @@ class NavigationController extends Controller
$this->view->types = $this->listItemTypes(); $this->view->types = $this->listItemTypes();
$this->view->items = $query; $this->view->items = $query;
$this->view->title = $this->translate('Navigation');
$this->getTabs() $this->getTabs()
->add( ->add(
'account', 'account',
@ -187,6 +188,7 @@ class NavigationController extends Controller
$this->view->types = $this->listItemTypes(); $this->view->types = $this->listItemTypes();
$this->view->items = $query; $this->view->items = $query;
$this->view->title = $this->translate('Shared Navigation');
$this->getTabs()->add( $this->getTabs()->add(
'navigation/shared', 'navigation/shared',
array( array(
@ -242,6 +244,7 @@ class NavigationController extends Controller
}); });
$form->handleRequest(); $form->handleRequest();
$this->view->title = $this->translate('Navigation');
$this->renderForm($form, $this->translate('New Navigation Item')); $this->renderForm($form, $this->translate('New Navigation Item'));
} }
@ -297,6 +300,7 @@ class NavigationController extends Controller
$this->httpNotFound(sprintf($this->translate('Navigation item "%s" not found'), $itemName)); $this->httpNotFound(sprintf($this->translate('Navigation item "%s" not found'), $itemName));
} }
$this->view->title = $this->translate('Navigation');
$this->renderForm($form, $this->translate('Update Navigation Item')); $this->renderForm($form, $this->translate('Update Navigation Item'));
} }
@ -340,6 +344,7 @@ class NavigationController extends Controller
}); });
$form->handleRequest(); $form->handleRequest();
$this->view->title = $this->translate('Navigation');
$this->renderForm($form, $this->translate('Remove Navigation Item')); $this->renderForm($form, $this->translate('Remove Navigation Item'));
} }
@ -428,5 +433,6 @@ class NavigationController extends Controller
} }
$this->view->navigation = $navigation; $this->view->navigation = $navigation;
$this->view->title = $navigation->getLabel();
} }
} }

View File

@ -18,6 +18,13 @@ use Icinga\Web\Notification;
*/ */
class RoleController extends AuthBackendController class RoleController extends AuthBackendController
{ {
public function init()
{
$this->view->title = $this->translate('Roles');
parent::init();
}
/** /**
* List roles * List roles
* *

View File

@ -20,6 +20,13 @@ use Icinga\Web\Widget;
class UserController extends AuthBackendController class UserController extends AuthBackendController
{ {
public function init()
{
$this->view->title = $this->translate('Users');
parent::init();
}
/** /**
* List all users of a single backend * List all users of a single backend
*/ */

View File

@ -58,6 +58,7 @@ class UsergroupbackendController extends Controller
}); });
$form->handleRequest(); $form->handleRequest();
$this->view->title = $this->translate('Authentication');
$this->renderForm($form, $this->translate('New User Group Backend')); $this->renderForm($form, $this->translate('New User Group Backend'));
} }
@ -94,6 +95,7 @@ class UsergroupbackendController extends Controller
$this->httpNotFound(sprintf($this->translate('User group backend "%s" not found'), $backendName)); $this->httpNotFound(sprintf($this->translate('User group backend "%s" not found'), $backendName));
} }
$this->view->title = $this->translate('Authentication');
$this->renderForm($form, $this->translate('Update User Group Backend')); $this->renderForm($form, $this->translate('Update User Group Backend'));
} }
@ -125,6 +127,7 @@ class UsergroupbackendController extends Controller
}); });
$form->handleRequest(); $form->handleRequest();
$this->view->title = $this->translate('Authentication');
$this->renderForm($form, $this->translate('Remove User Group Backend')); $this->renderForm($form, $this->translate('Remove User Group Backend'));
} }
} }