From a9d767867d577bc1a61811b2bba9e11e15fe16c5 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 17 Feb 2015 14:02:35 +0100 Subject: [PATCH 01/63] WCAG/2.4.4: Add example for link contexts refs #8458 --- doc/accessibility/link-labels.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 doc/accessibility/link-labels.html diff --git a/doc/accessibility/link-labels.html b/doc/accessibility/link-labels.html new file mode 100644 index 000000000..439adb85e --- /dev/null +++ b/doc/accessibility/link-labels.html @@ -0,0 +1,15 @@ + + + + + + Accessibility: Link Labels + + + + + localhost + + \ No newline at end of file From 04d2c789830ec1d93da95e6811d25d4cdf054d10 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 23 Feb 2015 16:28:12 +0100 Subject: [PATCH 02/63] Allow to move content not wrapped by
to another container --- public/js/icinga/ui.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/js/icinga/ui.js b/public/js/icinga/ui.js index 93c539cd6..043693171 100644 --- a/public/js/icinga/ui.js +++ b/public/js/icinga/ui.js @@ -140,7 +140,7 @@ cutContainer: function ($col) { var props = { - 'elements': $('#' + $col.attr('id') + ' > div').detach(), + 'elements': $('#' + $col.attr('id') + ' > *').detach(), 'data': { 'data-icinga-url': $col.data('icingaUrl'), 'data-icinga-refresh': $col.data('icingaRefresh'), From f6ea02fec59292b5035cbd4fb70439e073aa53e6 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 23 Feb 2015 16:29:07 +0100 Subject: [PATCH 03/63] qlink: Allow passing null as default for $properties --- library/Icinga/Web/View/helpers/url.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/Icinga/Web/View/helpers/url.php b/library/Icinga/Web/View/helpers/url.php index 9fa5d4a69..d4518d2aa 100644 --- a/library/Icinga/Web/View/helpers/url.php +++ b/library/Icinga/Web/View/helpers/url.php @@ -27,8 +27,8 @@ $this->addHelperFunction('url', function ($path = null, $params = null) { return $url; }); -$this->addHelperFunction('qlink', function ($title, $url, $params = null, $properties = array(), $escape = true) use ($view) { - if (array_key_exists('title', $properties) && !array_key_exists('aria-label', $properties)) { +$this->addHelperFunction('qlink', function ($title, $url, $params = null, $properties = null, $escape = true) use ($view) { + if ($properties && array_key_exists('title', $properties) && !array_key_exists('aria-label', $properties)) { $properties['aria-label'] = $properties['title']; } From 48286e0d594acedbaaf0fbacc49a106a6c1fd84f Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 23 Feb 2015 16:42:25 +0100 Subject: [PATCH 04/63] Use View::translate() instead of mt() and t() ... --- .../views/scripts/config/application.phtml | 2 +- .../views/scripts/list/contacts.phtml | 8 ++++---- .../views/scripts/list/eventgrid.phtml | 16 ++++++++-------- .../application/views/scripts/show/contact.phtml | 8 ++++---- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/application/views/scripts/config/application.phtml b/application/views/scripts/config/application.phtml index c34aa8349..9a168a904 100644 --- a/application/views/scripts/config/application.phtml +++ b/application/views/scripts/config/application.phtml @@ -4,7 +4,7 @@

- + translate('General Configuration'); ?>

messageBox)): ?> messageBox->render() ?> diff --git a/modules/monitoring/application/views/scripts/list/contacts.phtml b/modules/monitoring/application/views/scripts/list/contacts.phtml index 4623a5027..c17d997f1 100644 --- a/modules/monitoring/application/views/scripts/list/contacts.phtml +++ b/modules/monitoring/application/views/scripts/list/contacts.phtml @@ -9,7 +9,7 @@
translate('No contacts matching the filter'); return; } foreach ($contacts as $contact): ?> @@ -26,7 +26,7 @@ ) ?>
contact_pager): ?>
- : + translate('Pager') ?>: escape($contact->contact_pager) ?>
@@ -34,13 +34,13 @@
contact_notify_service_timeperiod): ?>
- : + translate('Service notification period') ?>: escape($contact->contact_notify_service_timeperiod) ?>
contact_notify_host_timeperiod): ?>
- : + translate('Host notification period') ?>: escape($contact->contact_notify_host_timeperiod) ?>
diff --git a/modules/monitoring/application/views/scripts/list/eventgrid.phtml b/modules/monitoring/application/views/scripts/list/eventgrid.phtml index 53056daac..1af75caf9 100644 --- a/modules/monitoring/application/views/scripts/list/eventgrid.phtml +++ b/modules/monitoring/application/views/scripts/list/eventgrid.phtml @@ -18,39 +18,39 @@ use Icinga\Web\Widget\Chart\HistoryColorGrid; $settings = array( 'cnt_up' => array( - 'tooltip' => mt('monitoring', '%d ok on %s'), + 'tooltip' => $this->translate('%d hosts ok on %s'), 'color' => '#49DF96', 'opacity' => '0.55' ), 'cnt_unreachable_hard' => array( - 'tooltip' => mt('monitoring', '%d unreachable on %s'), + 'tooltip' => $this->translate('%d hosts unreachable on %s'), 'color' => '#77AAFF', 'opacity' => '0.55' ), 'cnt_critical_hard' => array( - 'tooltip' => mt('monitoring', '%d critical on %s'), + 'tooltip' => $this->translate('%d services critical on %s'), 'color' => '#ff5566', 'opacity' => '0.9' ), 'cnt_warning_hard' => array( - 'tooltip' => mt('monitoring', '%d warning on %s'), + 'tooltip' => $this->translate('%d services warning on %s'), 'color' => '#ffaa44', 'opacity' => '1.0' ), 'cnt_down_hard' => array( - 'tooltip' => mt('monitoring', '%d down on %s'), + 'tooltip' => $this->translate('%d hosts down on %s'), 'color' => '#ff5566', 'opacity' => '0.9' ), 'cnt_unknown_hard' => array( - 'tooltip' => mt('monitoring', '%d unknown on %s'), + 'tooltip' => $this->translate('%d services unknown on %s'), 'color' => '#cc77ff', 'opacity' => '0.7' ), 'cnt_ok' => array( - 'tooltip' => mt('monitoring', '%d ok on %s'), + 'tooltip' => $this->translate('%d services ok on %s'), 'color' => '#49DF96', 'opacity' => '0.55' ) @@ -66,7 +66,7 @@ if ($to - $from > 315360000) { $data = array(); if (count($summary) === 0) { - echo mt('monitoring', 'No state changes in the selected time period.'); + echo $this->translate('No state changes in the selected time period.'); } foreach ($summary as $entry) { $day = $entry->day; diff --git a/modules/monitoring/application/views/scripts/show/contact.phtml b/modules/monitoring/application/views/scripts/show/contact.phtml index 92b84dc73..0ccd0f5ec 100644 --- a/modules/monitoring/application/views/scripts/show/contact.phtml +++ b/modules/monitoring/application/views/scripts/show/contact.phtml @@ -19,23 +19,23 @@ contact_email): ?> - %1$s', $this->escape($contact->contact_email)) ?> + translate('Email') ?> contact_pager): ?> - + translate('Pager') ?> escape($contact->contact_pager) ?> - + translate('Hosts') ?> escape($contactHelper->contactFlags($contact, 'host')) ?>
escape($contact->contact_notify_host_timeperiod) ?> - + translate('Services') ?> escape($contactHelper->contactFlags($contact, 'service')) ?>
escape($contact->contact_notify_service_timeperiod) ?> From 9fb3dcabea57bffe5cb6a9d76f7e5b4777c55d2d Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 23 Feb 2015 16:48:02 +0100 Subject: [PATCH 05/63] Introduce Icinga\Web\Widget\Tab::$label as alternative for $title --- library/Icinga/Web/Widget/Tab.php | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Web/Widget/Tab.php b/library/Icinga/Web/Widget/Tab.php index 143c3e552..94e2bc678 100644 --- a/library/Icinga/Web/Widget/Tab.php +++ b/library/Icinga/Web/Widget/Tab.php @@ -42,6 +42,8 @@ class Tab extends AbstractWidget */ private $title = ''; + private $label = ''; + /** * The Url this tab points to * @@ -116,6 +118,11 @@ class Tab extends AbstractWidget return $this->name; } + public function setLabel($label) + { + $this->label = $label; + } + /** * @param mixed $title */ @@ -210,9 +217,22 @@ class Tab extends AbstractWidget if ($this->active) { $classes[] = 'active'; } - $caption = $view->escape($this->title); + + $caption = $view->escape($this->label); $tagParams = $this->tagParams; + if ($this->title) { + if ($tagParams !== null) { + $tagParams['title'] = $this->title; + $tagParams['aria-label'] = $this->title; + } else { + $tagParams = array( + 'title' => $this->title, + 'aria-label' => $this->title + ); + } + } + if ($this->icon !== null) { if (strpos($this->icon, '.') === false) { $caption = $view->icon($this->icon) . $caption; @@ -220,13 +240,16 @@ class Tab extends AbstractWidget $caption = $view->img($this->icon, null, array('class' => 'icon')) . $caption; } } + if ($this->url !== null) { $this->url->overwriteParams($this->urlParams); + if ($tagParams !== null) { $params = $view->propertiesToString($tagParams); } else { $params = ''; } + $tab = sprintf( '%s', $this->url, @@ -236,6 +259,7 @@ class Tab extends AbstractWidget } else { $tab = $caption; } + $class = empty($classes) ? '' : sprintf(' class="%s"', implode(' ', $classes)); return '
  • ' . $tab . "
  • \n"; } From 64a4dc67bc758359855750335676a4005c2bb762 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 23 Feb 2015 16:50:31 +0100 Subject: [PATCH 06/63] Add proper titles to all config tabs refs #8458 --- application/controllers/ConfigController.php | 14 ++++++++++---- application/controllers/PreferenceController.php | 5 +++-- application/controllers/RolesController.php | 14 ++++++++++---- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/application/controllers/ConfigController.php b/application/controllers/ConfigController.php index bc82b6015..6c3d2d04b 100644 --- a/application/controllers/ConfigController.php +++ b/application/controllers/ConfigController.php @@ -39,28 +39,34 @@ class ConfigController extends ActionController $allowedActions = array(); if ($auth->hasPermission('system/config/application')) { $tabs->add('application', array( - 'title' => $this->translate('Application'), + 'title' => $this->translate('Adjust the general configuration of Icinga Web 2'), + 'label' => $this->translate('Application'), 'url' => 'config/application' )); $allowedActions[] = 'application'; } if ($auth->hasPermission('system/config/authentication')) { $tabs->add('authentication', array( - 'title' => $this->translate('Authentication'), + 'title' => $this->translate('Configure how users authenticate with and log into Icinga Web 2'), + 'label' => $this->translate('Authentication'), 'url' => 'config/authentication' )); $allowedActions[] = 'authentication'; } if ($auth->hasPermission('system/config/resources')) { $tabs->add('resource', array( - 'title' => $this->translate('Resources'), + 'title' => $this->translate('Configure which resources are being utilized by Icinga Web 2'), + 'label' => $this->translate('Resources'), 'url' => 'config/resource' )); $allowedActions[] = 'resource'; } if ($auth->hasPermission('system/config/roles')) { $tabs->add('roles', array( - 'title' => $this->translate('Roles'), + 'title' => $this->translate( + 'Configure roles to permit or restrict users and groups accessing Icinga Web 2' + ), + 'label' => $this->translate('Roles'), 'url' => 'roles' )); $allowedActions[] = 'roles'; diff --git a/application/controllers/PreferenceController.php b/application/controllers/PreferenceController.php index e1fd00f46..ac67f495b 100644 --- a/application/controllers/PreferenceController.php +++ b/application/controllers/PreferenceController.php @@ -25,8 +25,9 @@ class PreferenceController extends BasePreferenceController return array( 'preferences' => new Tab( array( - 'title' => t('Preferences'), - 'url' => Url::fromPath('/preference') + 'title' => t('Adjust the preferences of Icinga Web 2 according to your needs'), + 'label' => t('Preferences'), + 'url' => Url::fromPath('/preference') ) ) ); diff --git a/application/controllers/RolesController.php b/application/controllers/RolesController.php index 7b66b1fa8..25b3651d9 100644 --- a/application/controllers/RolesController.php +++ b/application/controllers/RolesController.php @@ -25,24 +25,30 @@ class RolesController extends ActionController $auth = $this->Auth(); if ($auth->hasPermission('system/config/application')) { $tabs->add('application', array( - 'title' => $this->translate('Application'), + 'title' => $this->translate('Adjust the general configuration of Icinga Web 2'), + 'label' => $this->translate('Application'), 'url' => 'config' )); } if ($auth->hasPermission('system/config/authentication')) { $tabs->add('authentication', array( - 'title' => $this->translate('Authentication'), + 'title' => $this->translate('Configure how users authenticate with and log into Icinga Web 2'), + 'label' => $this->translate('Authentication'), 'url' => 'config/authentication' )); } if ($auth->hasPermission('system/config/resources')) { $tabs->add('resource', array( - 'title' => $this->translate('Resources'), + 'title' => $this->translate('Configure which resources are being utilized by Icinga Web 2'), + 'label' => $this->translate('Resources'), 'url' => 'config/resource' )); } $tabs->add('roles', array( - 'title' => $this->translate('Roles'), + 'title' => $this->translate( + 'Configure roles to permit or restrict users and groups accessing Icinga Web 2' + ), + 'label' => $this->translate('Roles'), 'url' => 'roles' )); } From f6cbc17ff7c35d7ffb5f36ed709717830c6e207d Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 23 Feb 2015 16:56:49 +0100 Subject: [PATCH 07/63] Add proper titles to all host/service tabs refs #8458 --- .../controllers/ShowController.php | 33 ++++++++++++++++--- .../Controller/MonitoredObjectController.php | 33 ++++++++++++++++--- 2 files changed, 56 insertions(+), 10 deletions(-) diff --git a/modules/monitoring/application/controllers/ShowController.php b/modules/monitoring/application/controllers/ShowController.php index 033b11b1d..4550b20ae 100644 --- a/modules/monitoring/application/controllers/ShowController.php +++ b/modules/monitoring/application/controllers/ShowController.php @@ -189,10 +189,12 @@ class Monitoring_ShowController extends Controller return; } if ($object->getType() === $object::TYPE_HOST) { + $isService = false; $params = array( 'host' => $object->getName() ); } else { + $isService = true; $params = array( 'host' => $object->getHost()->getName(), 'service' => $object->getName() @@ -202,17 +204,26 @@ class Monitoring_ShowController extends Controller $tabs->add( 'host', array( - 'title' => $this->translate('Host'), + 'title' => sprintf( + $this->translate('Show detailed information for host %s'), + $isService ? $object->getHost()->getName() : $object->getName() + ), + 'label' => $this->translate('Host'), 'icon' => 'host', 'url' => 'monitoring/show/host', 'urlParams' => $params, ) ); - if (isset($params['service'])) { + if ($isService) { $tabs->add( 'service', array( - 'title' => $this->translate('Service'), + 'title' => sprintf( + $this->translate('Show detailed information for service %s on host %s'), + $object->getName(), + $object->getHost()->getName() + ), + 'label' => $this->translate('Service'), 'icon' => 'service', 'url' => 'monitoring/show/service', 'urlParams' => $params, @@ -222,7 +233,11 @@ class Monitoring_ShowController extends Controller $tabs->add( 'services', array( - 'title' => $this->translate('Services'), + 'title' => sprintf( + $this->translate('List all services on host %s'), + $isService ? $object->getHost()->getName() : $object->getName() + ), + 'label' => $this->translate('Services'), 'icon' => 'services', 'url' => 'monitoring/show/services', 'urlParams' => $params, @@ -232,7 +247,15 @@ class Monitoring_ShowController extends Controller $tabs->add( 'history', array( - 'title' => $this->translate('History'), + 'title' => $isService + ? sprintf( + $this->translate('Show all event records of service %s on host %s'), + $object->getName(), + $object->getHost()->getName() + ) + : sprintf($this->translate('Show all event records of host %s'), $object->getName()) + , + 'label' => $this->translate('History'), 'icon' => 'rewind', 'url' => 'monitoring/show/history', 'urlParams' => $params, diff --git a/modules/monitoring/library/Monitoring/Web/Controller/MonitoredObjectController.php b/modules/monitoring/library/Monitoring/Web/Controller/MonitoredObjectController.php index 566c569a3..f553c12f3 100644 --- a/modules/monitoring/library/Monitoring/Web/Controller/MonitoredObjectController.php +++ b/modules/monitoring/library/Monitoring/Web/Controller/MonitoredObjectController.php @@ -164,10 +164,12 @@ abstract class MonitoredObjectController extends Controller $tabs = $this->getTabs(); $object = $this->object; if ($object->getType() === $object::TYPE_HOST) { + $isService = false; $params = array( 'host' => $object->getName() ); } else { + $isService = true; $params = array( 'host' => $object->getHost()->getName(), 'service' => $object->getName() @@ -176,17 +178,26 @@ abstract class MonitoredObjectController extends Controller $tabs->add( 'host', array( - 'title' => $this->translate('Host'), + 'title' => sprintf( + $this->translate('Show detailed information for host %s'), + $isService ? $object->getHost()->getName() : $object->getName() + ), + 'label' => $this->translate('Host'), 'icon' => 'host', 'url' => 'monitoring/host/show', 'urlParams' => $params ) ); - if (isset($params['service'])) { + if ($isService) { $tabs->add( 'service', array( - 'title' => $this->translate('Service'), + 'title' => sprintf( + $this->translate('Show detailed information for service %s on host %s'), + $object->getName(), + $object->getHost()->getName() + ), + 'label' => $this->translate('Service'), 'icon' => 'service', 'url' => 'monitoring/service/show', 'urlParams' => $params @@ -196,7 +207,11 @@ abstract class MonitoredObjectController extends Controller $tabs->add( 'services', array( - 'title' => $this->translate('Services'), + 'title' => sprintf( + $this->translate('List all services on host %s'), + $isService ? $object->getHost()->getName() : $object->getName() + ), + 'label' => $this->translate('Services'), 'icon' => 'services', 'url' => 'monitoring/show/services', 'urlParams' => $params @@ -206,7 +221,15 @@ abstract class MonitoredObjectController extends Controller $tabs->add( 'history', array( - 'title' => $this->translate('History'), + 'title' => $isService + ? sprintf( + $this->translate('Show all event records of service %s on host %s'), + $object->getName(), + $object->getHost()->getName() + ) + : sprintf($this->translate('Show all event records of host %s'), $object->getName()) + , + 'label' => $this->translate('History'), 'icon' => 'rewind', 'url' => 'monitoring/show/history', 'urlParams' => $params From ebf8d183a7f44948bccf7774649486ae87480c5e Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 23 Feb 2015 16:57:06 +0100 Subject: [PATCH 08/63] Add proper title to the alert summary's tab refs #8458 --- .../controllers/AlertsummaryController.php | 45 ++++++------------- 1 file changed, 14 insertions(+), 31 deletions(-) diff --git a/modules/monitoring/application/controllers/AlertsummaryController.php b/modules/monitoring/application/controllers/AlertsummaryController.php index 1b3db8093..3490da9b4 100644 --- a/modules/monitoring/application/controllers/AlertsummaryController.php +++ b/modules/monitoring/application/controllers/AlertsummaryController.php @@ -10,11 +10,6 @@ use Icinga\Web\Url; class Monitoring_AlertsummaryController extends Controller { - /** - * @var string - */ - protected $url; - /** * @var array */ @@ -30,40 +25,28 @@ class Monitoring_AlertsummaryController extends Controller */ public function init() { - $tabs = $this->getTabs(); - if (in_array($this->_request->getActionName(), array('alertsummary'))) { - $tabs->extend(new OutputFormat())->extend(new DashboardAction()); - } - - $this->url = Url::fromRequest(); - $this->notificationData = $this->createNotificationData(); $this->problemData = $this->createProblemData(); } /** - * @param string $action - * @param bool $title - */ - protected function addTitleTab($action, $title = false) - { - $title = $title ?: ucfirst($action); - $this->getTabs()->add( - $action, - array( - 'title' => $title, - 'url' => $this->url - ) - )->activate($action); - $this->view->title = $title; - } - - /** - * Creat full report + * Create full report */ public function indexAction() { - $this->addTitleTab('alertsummary', $this->translate('Alert Summary')); + $this->getTabs()->add( + 'alertsummary', + array( + 'title' => $this->translate( + 'Show recent alerts and visualize notifications and problems' + . ' based on their amount and chronological distribution' + ), + 'label' => $this->translate('Alert Summary'), + 'url' => Url::fromRequest() + ) + )->activate('alertsummary'); + $this->view->title = $this->translate('Alert Summary'); + $this->view->intervalBox = $this->createIntervalBox(); $this->view->recentAlerts = $this->createRecentAlerts(); $this->view->interval = $this->getInterval(); From 77b60588bc12f66b24df1e550946a474cc134d69 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 23 Feb 2015 16:57:32 +0100 Subject: [PATCH 09/63] Add proper titles to the multi selection controller tabs refs #8458 --- .../application/controllers/HostsController.php | 8 ++++++-- .../application/controllers/ServicesController.php | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/modules/monitoring/application/controllers/HostsController.php b/modules/monitoring/application/controllers/HostsController.php index c2661d01f..de1f063ac 100644 --- a/modules/monitoring/application/controllers/HostsController.php +++ b/modules/monitoring/application/controllers/HostsController.php @@ -72,8 +72,12 @@ class Monitoring_HostsController extends Controller $this->getTabs()->add( 'show', array( - 'title' => mt('monitoring', 'Hosts'), - 'url' => Url::fromRequest() + 'title' => sprintf( + $this->translate('Show summarized information for %u hosts'), + count($this->hostList) + ), + 'label' => $this->translate('Hosts'), + 'url' => Url::fromRequest() ) )->activate('show'); $this->setAutorefreshInterval(15); diff --git a/modules/monitoring/application/controllers/ServicesController.php b/modules/monitoring/application/controllers/ServicesController.php index 7d052e067..a74b61074 100644 --- a/modules/monitoring/application/controllers/ServicesController.php +++ b/modules/monitoring/application/controllers/ServicesController.php @@ -93,8 +93,12 @@ class Monitoring_ServicesController extends Controller $this->getTabs()->add( 'show', array( - 'title' => mt('monitoring', 'Services'), - 'url' => Url::fromRequest() + 'title' => sprintf( + $this->translate('Show summarized information for %u services'), + count($this->serviceList) + ), + 'label' => $this->translate('Services'), + 'url' => Url::fromRequest() ) )->activate('show'); $this->setAutorefreshInterval(15); From 7aacfcf907aaa4e7b411ef1e3f26cd2b72388a9e Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 23 Feb 2015 16:58:48 +0100 Subject: [PATCH 10/63] Add proper title to the tactical overview's tab refs #8458 --- .../application/controllers/TacticalController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/monitoring/application/controllers/TacticalController.php b/modules/monitoring/application/controllers/TacticalController.php index 8a3da2b9c..33681528c 100644 --- a/modules/monitoring/application/controllers/TacticalController.php +++ b/modules/monitoring/application/controllers/TacticalController.php @@ -11,7 +11,11 @@ class Monitoring_TacticalController extends MonitoringController $this->getTabs()->add( 'tactical_overview', array( - 'title' => $this->translate('Tactical Overview'), + 'title' => $this->translate( + 'Show an overview of all hosts and services, their current' + . ' states and monitoring feature utilisation' + ), + 'label' => $this->translate('Tactical Overview'), 'url' => Url::fromRequest() ) )->activate('tactical_overview'); From 1ef03a76f751019d06f740501247cacde09ac380 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 23 Feb 2015 16:59:13 +0100 Subject: [PATCH 11/63] Add proper title to the monitoring health's tab refs #8458 --- .../application/controllers/ProcessController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/monitoring/application/controllers/ProcessController.php b/modules/monitoring/application/controllers/ProcessController.php index 875f4094c..b20bd7576 100644 --- a/modules/monitoring/application/controllers/ProcessController.php +++ b/modules/monitoring/application/controllers/ProcessController.php @@ -22,7 +22,11 @@ class Monitoring_ProcessController extends Controller ->add( 'info', array( - 'title' => $this->translate('Monitoring Health'), + 'title' => $this->translate( + 'Show information about the current monitoring instance\'s process' + . ' and it\'s performance as well as available features' + ), + 'label' => $this->translate('Monitoring Health'), 'url' =>'monitoring/process/info' ) ); From f48dbf16405e330560bb878b813060af12c0ad0c Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 23 Feb 2015 16:59:47 +0100 Subject: [PATCH 12/63] Add proper title to the timeline's tab refs #8458 --- .../controllers/TimelineController.php | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/modules/monitoring/application/controllers/TimelineController.php b/modules/monitoring/application/controllers/TimelineController.php index a13973e1d..dcd7a10aa 100644 --- a/modules/monitoring/application/controllers/TimelineController.php +++ b/modules/monitoring/application/controllers/TimelineController.php @@ -13,19 +13,17 @@ use Icinga\Module\Monitoring\Web\Widget\SelectBox; class Monitoring_TimelineController extends Controller { - protected function addTitleTab($action, $title = false) - { - $title = $title ? : ucfirst($action); - $this->getTabs()->add($action, array( - 'title' => $title, - 'url' => Url::fromRequest() - ))->activate($action); - $this->view->title = $title; - } - public function indexAction() { - $this->addTitleTab('index', t('Timeline')); + $this->getTabs()->add( + 'timeline', + array( + 'title' => $this->translate('Show the number of historical event records grouped by time and type'), + 'label' => $this->translate('Timeline'), + 'url' => Url::fromRequest() + ) + )->activate('timeline'); + $this->view->title = $this->translate('Timeline'); // TODO: filter for hard_states (precedence adjustments necessary!) $this->setupIntervalBox(); From 6eb638f6b32ee37adde3ffb5e4164e44d701ccb8 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 23 Feb 2015 17:00:30 +0100 Subject: [PATCH 13/63] Add proper titles to the list view's tabs refs #8458 --- application/controllers/ListController.php | 2 +- .../controllers/ListController.php | 57 +++++++++++-------- 2 files changed, 34 insertions(+), 25 deletions(-) diff --git a/application/controllers/ListController.php b/application/controllers/ListController.php index 4736720ce..d55381987 100644 --- a/application/controllers/ListController.php +++ b/application/controllers/ListController.php @@ -23,7 +23,7 @@ class ListController extends Controller protected function addTitleTab($action) { $this->getTabs()->add($action, array( - 'title' => ucfirst($action), + 'label' => ucfirst($action), 'url' => Url::fromPath( 'list/' . str_replace(' ', '', $action) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index d7fbe177f..e43d64f1d 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -6,7 +6,6 @@ use Icinga\Module\Monitoring\Backend; use Icinga\Module\Monitoring\Forms\Command\Object\DeleteCommentCommandForm; use Icinga\Module\Monitoring\Forms\Command\Object\DeleteDowntimeCommandForm; use Icinga\Web\Url; -use Icinga\Web\Hook; use Icinga\Web\Widget\Tabextension\DashboardAction; use Icinga\Web\Widget\Tabextension\OutputFormat; use Icinga\Web\Widget\Tabs; @@ -17,11 +16,7 @@ use Icinga\Module\Monitoring\Forms\StatehistoryForm; class Monitoring_ListController extends Controller { - protected $url; - /** - * Retrieve backend and hooks for this controller - * * @see ActionController::init */ public function init() @@ -32,7 +27,6 @@ class Monitoring_ListController extends Controller $this->view->compact = true; $this->view->inline = true; } - $this->url = Url::fromRequest(); } /** @@ -56,7 +50,7 @@ class Monitoring_ListController extends Controller protected function hasBetterUrl() { $request = $this->getRequest(); - $url = clone($this->url); + $url = Url::fromRequest(); if ($this->getRequest()->isPost()) { if ($request->getPost('sort')) { @@ -100,7 +94,7 @@ class Monitoring_ListController extends Controller $stateChangeColumn = 'host_last_state_change'; } - $this->addTitleTab('hosts', $this->translate('Hosts')); + $this->addTitleTab('hosts', $this->translate('Hosts'), $this->translate('List hosts')); $this->setAutorefreshInterval(10); $query = $this->backend->select()->from('hostStatus', array_merge(array( 'host_icon_image', @@ -174,7 +168,7 @@ class Monitoring_ListController extends Controller $stateChangeColumn = 'service_last_state_change'; } - $this->addTitleTab('services', $this->translate('Services')); + $this->addTitleTab('services', $this->translate('Services'), $this->translate('List services')); $this->view->showHost = true; if ($host = $this->_getParam('host')) { if (strpos($host, '*') === false) { @@ -272,7 +266,7 @@ class Monitoring_ListController extends Controller if ($url = $this->hasBetterUrl()) { return $this->redirectNow($url); } - $this->addTitleTab('downtimes', $this->translate('Downtimes')); + $this->addTitleTab('downtimes', $this->translate('Downtimes'), $this->translate('List downtimes')); $this->setAutorefreshInterval(12); $query = $this->backend->select()->from('downtime', array( 'id' => 'downtime_internal_id', @@ -326,7 +320,11 @@ class Monitoring_ListController extends Controller if ($url = $this->hasBetterUrl()) { return $this->redirectNow($url); } - $this->addTitleTab('notifications', $this->translate('Notifications')); + $this->addTitleTab( + 'notifications', + $this->translate('Notifications'), + $this->translate('List notifications') + ); $this->setAutorefreshInterval(15); $query = $this->backend->select()->from('notification', array( 'host', @@ -350,7 +348,7 @@ class Monitoring_ListController extends Controller if ($url = $this->hasBetterUrl()) { return $this->redirectNow($url); } - $this->addTitleTab('contacts', $this->translate('Contacts')); + $this->addTitleTab('contacts', $this->translate('Contacts'), $this->translate('List contacts')); $query = $this->backend->select()->from('contact', array( 'contact_name', 'contact_id', @@ -389,7 +387,7 @@ class Monitoring_ListController extends Controller if ($url = $this->hasBetterUrl()) { return $this->redirectNow($url); } - $this->addTitleTab('eventgrid', $this->translate('Event Grid')); + $this->addTitleTab('eventgrid', $this->translate('Event Grid'), $this->translate('Show the Event Grid')); $form = new StatehistoryForm(); $form->setEnctype(Zend_Form::ENCTYPE_URLENCODED); @@ -430,7 +428,11 @@ class Monitoring_ListController extends Controller if ($url = $this->hasBetterUrl()) { return $this->redirectNow($url); } - $this->addTitleTab('contactgroups', $this->translate('Contact Groups')); + $this->addTitleTab( + 'contactgroups', + $this->translate('Contact Groups'), + $this->translate('List contact groups') + ); $query = $this->backend->select()->from('contactgroup', array( 'contactgroup_name', 'contactgroup_alias', @@ -462,7 +464,7 @@ class Monitoring_ListController extends Controller if ($url = $this->hasBetterUrl()) { return $this->redirectNow($url); } - $this->addTitleTab('comments', $this->translate('Comments')); + $this->addTitleTab('comments', $this->translate('Comments'), $this->translate('List comments')); $this->setAutorefreshInterval(12); $query = $this->backend->select()->from('comment', array( 'id' => 'comment_internal_id', @@ -501,7 +503,11 @@ class Monitoring_ListController extends Controller if ($url = $this->hasBetterUrl()) { return $this->redirectNow($url); } - $this->addTitleTab('servicegroups', $this->translate('Service Groups')); + $this->addTitleTab( + 'servicegroups', + $this->translate('Service Groups'), + $this->translate('List service groups') + ); $this->setAutorefreshInterval(12); $query = $this->backend->select()->from('groupsummary', array( 'servicegroup', @@ -551,7 +557,7 @@ class Monitoring_ListController extends Controller if ($url = $this->hasBetterUrl()) { return $this->redirectNow($url); } - $this->addTitleTab('hostgroups', $this->translate('Host Groups')); + $this->addTitleTab('hostgroups', $this->translate('Host Groups'), $this->translate('List host groups')); $this->setAutorefreshInterval(12); $query = $this->backend->select()->from('groupsummary', array( 'hostgroup', @@ -601,7 +607,11 @@ class Monitoring_ListController extends Controller if ($url = $this->hasBetterUrl()) { return $this->redirectNow($url); } - $this->addTitleTab('eventhistory', $this->translate('Event Overview')); + $this->addTitleTab( + 'eventhistory', + $this->translate('Event Overview'), + $this->translate('List event records') + ); $query = $this->backend->select()->from('eventHistory', array( 'host_name', @@ -632,7 +642,7 @@ class Monitoring_ListController extends Controller if ($url = $this->hasBetterUrl()) { return $this->redirectNow($url); } - $this->addTitleTab('servicegrid', $this->translate('Service Grid')); + $this->addTitleTab('servicegrid', $this->translate('Service Grid'), $this->translate('Show the Service Grid')); $this->setAutorefreshInterval(15); $query = $this->backend->select()->from('serviceStatus', array( 'host_name', @@ -698,13 +708,12 @@ class Monitoring_ListController extends Controller $this->view->sortControl->applyRequest($this->getRequest()); } - protected function addTitleTab($action, $title = false) + protected function addTitleTab($action, $title, $tip) { - $title = $title ?: ucfirst($action); $this->getTabs()->add($action, array( - 'title' => $title, - // 'url' => Url::fromPath('monitoring/list/' . $action) - 'url' => $this->url + 'title' => $tip, + 'label' => $title, + 'url' => Url::fromRequest() ))->activate($action); $this->view->title = $title; } From a5514392db55339559d39fb7c4a77cffcb89f09a Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 23 Feb 2015 17:03:11 +0100 Subject: [PATCH 14/63] Adjust dashboard, output-format and module tabs --- library/Icinga/Application/Modules/Module.php | 2 +- .../Icinga/Web/Widget/Tabextension/DashboardAction.php | 2 +- .../Icinga/Web/Widget/Tabextension/DashboardSettings.php | 8 ++++---- library/Icinga/Web/Widget/Tabextension/OutputFormat.php | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/library/Icinga/Application/Modules/Module.php b/library/Icinga/Application/Modules/Module.php index 602811b56..b59154020 100644 --- a/library/Icinga/Application/Modules/Module.php +++ b/library/Icinga/Application/Modules/Module.php @@ -641,7 +641,7 @@ class Module $tabs->add('info', array( 'url' => 'config/module', 'urlParams' => array('name' => $this->getName()), - 'title' => 'Module: ' . $this->getName() + 'label' => 'Module: ' . $this->getName() )); foreach ($this->configTabs as $name => $config) { $tabs->add($name, $config); diff --git a/library/Icinga/Web/Widget/Tabextension/DashboardAction.php b/library/Icinga/Web/Widget/Tabextension/DashboardAction.php index 0745a0759..ca9bc99be 100644 --- a/library/Icinga/Web/Widget/Tabextension/DashboardAction.php +++ b/library/Icinga/Web/Widget/Tabextension/DashboardAction.php @@ -24,7 +24,7 @@ class DashboardAction implements Tabextension 'dashboard', array( 'icon' => 'dashboard', - 'title' => 'Add To Dashboard', + 'label' => 'Add To Dashboard', 'url' => Url::fromPath('dashboard/new-dashlet'), 'urlParams' => array( 'url' => rawurlencode(Url::fromRequest()->getRelativeUrl()) diff --git a/library/Icinga/Web/Widget/Tabextension/DashboardSettings.php b/library/Icinga/Web/Widget/Tabextension/DashboardSettings.php index 6d079981c..f05786a0c 100644 --- a/library/Icinga/Web/Widget/Tabextension/DashboardSettings.php +++ b/library/Icinga/Web/Widget/Tabextension/DashboardSettings.php @@ -22,7 +22,7 @@ class DashboardSettings implements Tabextension 'dashboard_add', array( 'icon' => 'img/icons/dashboard.png', - 'title' => t('Add To Dashboard'), + 'label' => t('Add To Dashboard'), 'url' => Url::fromPath('dashboard/new-dashlet') ) ); @@ -30,9 +30,9 @@ class DashboardSettings implements Tabextension $tabs->addAsDropdown( 'dashboard_settings', array( - 'icon' => 'img/icons/dashboard.png', - 'title' => t('Settings'), - 'url' => Url::fromPath('dashboard/settings') + 'icon' => 'img/icons/dashboard.png', + 'label' => t('Settings'), + 'url' => Url::fromPath('dashboard/settings') ) ); } diff --git a/library/Icinga/Web/Widget/Tabextension/OutputFormat.php b/library/Icinga/Web/Widget/Tabextension/OutputFormat.php index 212ddb518..0ef7eea69 100644 --- a/library/Icinga/Web/Widget/Tabextension/OutputFormat.php +++ b/library/Icinga/Web/Widget/Tabextension/OutputFormat.php @@ -85,7 +85,7 @@ class OutputFormat implements Tabextension if (Platform::extensionLoaded('gd')) { $supportedTypes[self::TYPE_PDF] = array( 'name' => 'pdf', - 'title' => 'PDF', + 'label' => 'PDF', 'icon' => 'file-pdf', 'urlParams' => array('format' => 'pdf'), ); @@ -93,7 +93,7 @@ class OutputFormat implements Tabextension $supportedTypes[self::TYPE_CSV] = array( 'name' => 'csv', - 'title' => 'CSV', + 'label' => 'CSV', 'icon' => 'file-excel', 'urlParams' => array('format' => 'csv') ); @@ -101,7 +101,7 @@ class OutputFormat implements Tabextension if (Platform::extensionLoaded('json')) { $supportedTypes[self::TYPE_JSON] = array( 'name' => 'json', - 'title' => 'JSON', + 'label' => 'JSON', 'icon' => 'img/icons/json.png', 'urlParams' => array('format' => 'json') ); From c6b61617eec4702b1bebf96dfa8095082e278255 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 23 Feb 2015 17:04:40 +0100 Subject: [PATCH 15/63] Add proper titles to the monitoring module's config tabs refs #8458 --- modules/monitoring/configuration.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/monitoring/configuration.php b/modules/monitoring/configuration.php index 0087af190..fa7732e10 100644 --- a/modules/monitoring/configuration.php +++ b/modules/monitoring/configuration.php @@ -67,11 +67,13 @@ $this->provideRestriction( ); $this->provideConfigTab('backends', array( - 'title' => 'Backends', + 'title' => $this->translate('Configure how to retrieve monitoring information'), + 'label' => $this->translate('Backends'), 'url' => 'config' )); $this->provideConfigTab('security', array( - 'title' => 'Security', + 'title' => $this->translate('Configure how to protect your monitoring environment against prying eyes'), + 'label' => $this->translate('Security'), 'url' => 'config/security' )); $this->provideSetupWizard('Icinga\Module\Monitoring\MonitoringWizard'); From 66305bd79a188cec81375db50d7d84920d10e787 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 23 Feb 2015 17:05:02 +0100 Subject: [PATCH 16/63] Add proper titles to dashboards and dashlets refs #8458 --- library/Icinga/Web/Widget/Dashboard.php | 6 ++++- .../Icinga/Web/Widget/Dashboard/Dashlet.php | 27 ++++--------------- 2 files changed, 10 insertions(+), 23 deletions(-) diff --git a/library/Icinga/Web/Widget/Dashboard.php b/library/Icinga/Web/Widget/Dashboard.php index 8354f6fbb..00d39cd71 100644 --- a/library/Icinga/Web/Widget/Dashboard.php +++ b/library/Icinga/Web/Widget/Dashboard.php @@ -211,7 +211,11 @@ class Dashboard extends AbstractWidget $this->tabs->add( $key, array( - 'title' => $pane->getTitle(), + 'title' => sprintf( + t('Show %s', 'dashboard.pane.tooltip'), + $pane->getTitle() + ), + 'label' => $pane->getTitle(), 'url' => clone($url), 'urlParams' => array($this->tabParam => $key) ) diff --git a/library/Icinga/Web/Widget/Dashboard/Dashlet.php b/library/Icinga/Web/Widget/Dashboard/Dashlet.php index ae7bb5558..cbb4bec33 100644 --- a/library/Icinga/Web/Widget/Dashboard/Dashlet.php +++ b/library/Icinga/Web/Widget/Dashboard/Dashlet.php @@ -52,7 +52,7 @@ class Dashlet extends UserWidget private $template =<<<'EOD'
    -

    {TITLE}

    +

    {TITLE}

    @@ -183,38 +183,21 @@ EOD; '{URL}', '{IFRAME_URL}', '{FULL_URL}', - '{TITLE}', - '{REMOVE}' + '{TOOLTIP}', + '{TITLE}' ); $replaceTokens = array( $url, $iframeUrl, $url->getUrlWithout(array('view', 'limit')), - $view->escape($this->getTitle()), - $this->getRemoveLink() + sprintf($view->translate('Show %s', 'dashboard.dashlet.tooltip'), $view->escape($this->getTitle())), + $view->escape($this->getTitle()) ); return str_replace($searchTokens, $replaceTokens, $this->template); } - /** - * Render the form for removing a dashboard elemetn - * - * @return string The html representation of the form - */ - protected function getRemoveLink() - { - return sprintf( - '%s', - Url::fromPath('dashboard/remove-dashlet', array( - 'dashlet' => $this->getTitle(), - 'pane' => $this->pane->getTitle() - )), - t('Remove') - ); - } - /** * Create a @see Dashlet instance from the given Zend config, using the provided title * From b2f817925b760b8d9ae9033c11fb7c5165b810d8 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 23 Feb 2015 17:05:39 +0100 Subject: [PATCH 17/63] Add proper titles to the FilterEditor refs #8458 --- library/Icinga/Web/Widget/FilterEditor.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/library/Icinga/Web/Widget/FilterEditor.php b/library/Icinga/Web/Widget/FilterEditor.php index 999a825ac..16136a62a 100644 --- a/library/Icinga/Web/Widget/FilterEditor.php +++ b/library/Icinga/Web/Widget/FilterEditor.php @@ -310,7 +310,7 @@ class FilterEditor extends AbstractWidget $this->preservedUrl()->with('removeFilter', $filter->getId()), null, array( - 'title' => t('Click to remove this part of your filter'), + 'title' => t('Remove this part of your filter'), 'class' => 'icon-cancel' ) ); @@ -323,7 +323,7 @@ class FilterEditor extends AbstractWidget $this->preservedUrl()->with('addFilter', $filter->getId()), null, array( - 'title' => t('Click to add another filter'), + 'title' => t('Add another filter'), 'class' => 'icon-plus' ) ); @@ -666,6 +666,8 @@ class FilterEditor extends AbstractWidget return $html . '' From fb7640db0a7b6fcb5cc60f9e3f2c567c4da9eca9 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 23 Feb 2015 17:06:01 +0100 Subject: [PATCH 18/63] Add proper titles to the Limiter control refs #8458 --- library/Icinga/Web/Widget/Limiter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/Icinga/Web/Widget/Limiter.php b/library/Icinga/Web/Widget/Limiter.php index 1dc306982..9febf6f63 100644 --- a/library/Icinga/Web/Widget/Limiter.php +++ b/library/Icinga/Web/Widget/Limiter.php @@ -80,7 +80,7 @@ class Limiter extends AbstractWidget $this->url->setParam('limit', $limit), null, array( - 'title' => sprintf(t('Show %s rows on one page'), $caption) + 'title' => sprintf($view->translate('Limit each page to a maximum of %u rows'), $caption) ) ); } From bd9d06574d83f7a519b43681237b42b6eaddd725 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 23 Feb 2015 17:07:21 +0100 Subject: [PATCH 19/63] Ensure that the link() view helper adds proper titles refs #8458 --- .../monitoring/application/views/helpers/Link.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/monitoring/application/views/helpers/Link.php b/modules/monitoring/application/views/helpers/Link.php index 96972bd55..8faf6e5fb 100644 --- a/modules/monitoring/application/views/helpers/Link.php +++ b/modules/monitoring/application/views/helpers/Link.php @@ -32,7 +32,9 @@ class Zend_View_Helper_Link extends Zend_View_Helper_Abstract { return $this->view->qlink( $linkText, - $this->view->href('monitoring/host/show', array('host' => $host)) + 'monitoring/host/show', + array('host' => $host), + array('title' => sprintf($this->view->translate('Show detailed information for host %s'), $host)) ); } @@ -52,7 +54,13 @@ class Zend_View_Helper_Link extends Zend_View_Helper_Abstract $this->view->translate('%s on %s', 'Service running on host'), $this->view->qlink( $serviceLinkText, - $this->view->href('monitoring/service/show', array('host' => $host, 'service' => $service)) + 'monitoring/service/show', + array('host' => $host, 'service' => $service), + array('title' => sprintf( + $this->view->translate('Show detailed information for service %s on host %s'), + $service, + $host + )) ), $this->host($host, $hostLinkText) ); From 5fd447394c2d7000dc3511ca8a6ed94660cb3e2f Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 23 Feb 2015 17:09:37 +0100 Subject: [PATCH 20/63] Add proper title to the BackendConfigForms's jump link... ...and move it to the right of the respective form control refs #8458 --- .../forms/Config/BackendConfigForm.php | 53 ++++++++++--------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/modules/monitoring/application/forms/Config/BackendConfigForm.php b/modules/monitoring/application/forms/Config/BackendConfigForm.php index e0f8e3e0d..3014974a3 100644 --- a/modules/monitoring/application/forms/Config/BackendConfigForm.php +++ b/modules/monitoring/application/forms/Config/BackendConfigForm.php @@ -221,7 +221,9 @@ class BackendConfigForm extends ConfigForm ) ); - $resourceElement = $this->createElement( + $decorators = static::$defaultElementDecorators; + array_pop($decorators); // Removes the HtmlTag decorator + $this->addElement( 'select', 'resource', array( @@ -229,32 +231,35 @@ class BackendConfigForm extends ConfigForm 'label' => $this->translate('Resource'), 'description' => $this->translate('The resource to use'), 'multiOptions' => $this->resources[$resourceType], + 'value' => current($this->resources[$resourceType]), + 'decorators' => $decorators, 'autosubmit' => true ) ); - - if (empty($formData)) { - $options = $resourceElement->options; - $resourceName = array_shift($options); - } else { - $resourceName = (isset($formData['resource'])) ? $formData['resource'] : $this->getValue('resource'); - } - - $this->addElement($resourceElement); - - if ($resourceElement) { - $this->addElement( - 'note', - 'resource_note', - array( - 'value' => sprintf( - '%s', - $this->getView()->url('config/editresource', array('resource' => $resourceName)), - $this->translate('Show resource configuration') - ), - 'escape' => false + $resourceName = isset($formData['resource']) ? $formData['resource'] : $this->getValue('resource'); + $this->addElement( + 'note', + 'resource_note', + array( + 'escape' => false, + 'decorators' => $decorators, + 'value' => sprintf( + '%3$s', + $this->getView()->url('config/editresource', array('resource' => $resourceName)), + sprintf($this->translate('Show the configuration of the %s resource'), $resourceName), + $this->translate('Show resource configuration') ) - ); - } + ) + ); + $this->addDisplayGroup( + array('resource', 'resource_note'), + 'resource-group', + array( + 'decorators' => array( + 'FormElements', + array('HtmlTag', array('tag' => 'div', 'class' => 'element')) + ) + ) + ); } } From 77fa2f7c2b5634c0e72ea89b847448a1294d6014 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 23 Feb 2015 17:10:52 +0100 Subject: [PATCH 21/63] Add aria-label to the monitoring health's link to disable notifications refs #8458 --- .../Command/Instance/ToggleInstanceFeaturesCommandForm.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/application/forms/Command/Instance/ToggleInstanceFeaturesCommandForm.php b/modules/monitoring/application/forms/Command/Instance/ToggleInstanceFeaturesCommandForm.php index 5c685dc85..692ed6094 100644 --- a/modules/monitoring/application/forms/Command/Instance/ToggleInstanceFeaturesCommandForm.php +++ b/modules/monitoring/application/forms/Command/Instance/ToggleInstanceFeaturesCommandForm.php @@ -60,7 +60,7 @@ class ToggleInstanceFeaturesCommandForm extends CommandForm if ((bool) $this->status->notifications_enabled) { if ($this->hasPermission('monitoring/command/feature/instance')) { $notificationDescription = sprintf( - '%s', + '%3$s', $this->translate('Disable notifications for a specific time on a program-wide basis'), $this->getView()->href('monitoring/process/disable-notifications'), $this->translate('Disable temporarily') From 676f10bb87d2b1f1c1088332e0dcecd707e986fb Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 23 Feb 2015 17:11:23 +0100 Subject: [PATCH 22/63] Fix week-label of the timeline --- .../monitoring/application/controllers/TimelineController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/application/controllers/TimelineController.php b/modules/monitoring/application/controllers/TimelineController.php index dcd7a10aa..f1ef32592 100644 --- a/modules/monitoring/application/controllers/TimelineController.php +++ b/modules/monitoring/application/controllers/TimelineController.php @@ -141,7 +141,7 @@ class Monitoring_TimelineController extends Controller case '1d': return $this->getDateFormat(); case '1w': - return '\W\e\ek #W\\of Y'; + return '\W\e\ek W\\of Y'; case '1m': return 'F Y'; case '1y': From a1e7cd8906d4186132d68a238cb734a009731ce7 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 23 Feb 2015 17:12:34 +0100 Subject: [PATCH 23/63] Add proper titles to the documentation tocs and search results refs #8458 --- .../Doc/Renderer/DocSearchRenderer.php | 27 ++++++++++++++++--- .../library/Doc/Renderer/DocTocRenderer.php | 22 ++++++++++++--- 2 files changed, 41 insertions(+), 8 deletions(-) diff --git a/modules/doc/library/Doc/Renderer/DocSearchRenderer.php b/modules/doc/library/Doc/Renderer/DocSearchRenderer.php index aa5a9f892..31445dfc8 100644 --- a/modules/doc/library/Doc/Renderer/DocSearchRenderer.php +++ b/modules/doc/library/Doc/Renderer/DocSearchRenderer.php @@ -107,11 +107,30 @@ class DocSearchRenderer extends DocRenderer ); /** @type \Icinga\Web\Url $url */ $url->setAnchor($this->encodeAnchor($section->getId())); - $this->content[] = sprintf( - '
  • %s', - $section->getNoFollow() ? 'rel="nofollow" ' : '', + $urlAttributes = array( + 'data-base-target' => '_next', + 'title' => sprintf( + $this->getView()->translate( + 'Show all matches of "%s" in %sthe chapter "%s"', + 'search.render.section.link' + ), + $this->getInnerIterator()->getSearch()->getInput(), + $section->getId() !== $section->getChapter()->getId() ? sprintf( + $this->getView()->translate('the section "%s" of ', 'search.render.section.link'), + $section->getTitle() + ) : '', + $section->getChapter()->getTitle() + ) + ); + if ($section->getNoFollow()) { + $urlAttributes['rel'] = 'nofollow'; + } + $this->content[] = '
  • ' . $this->getView()->qlink( + $title, $url->getAbsoluteUrl(), - $title + null, + $urlAttributes, + false ); if (! empty($contentMatches)) { $this->content = array_merge($this->content, $contentMatches); diff --git a/modules/doc/library/Doc/Renderer/DocTocRenderer.php b/modules/doc/library/Doc/Renderer/DocTocRenderer.php index ed65a1e0b..a216a190b 100644 --- a/modules/doc/library/Doc/Renderer/DocTocRenderer.php +++ b/modules/doc/library/Doc/Renderer/DocTocRenderer.php @@ -87,11 +87,25 @@ class DocTocRenderer extends DocRenderer $url = $view->url($path); /** @type \Icinga\Web\Url $url */ $url->setAnchor($this->encodeAnchor($section->getId())); - $this->content[] = sprintf( - '
  • %s', - $section->getNoFollow() ? 'rel="nofollow" ' : '', + $urlAttributes = array( + 'data-base-target' => '_next', + 'title' => sprintf( + $this->getView()->translate('Show the %schapter "%s"', 'toc.render.section.link'), + $section->getId() !== $section->getChapter()->getId() ? sprintf( + $this->getView()->translate('section "%s" of the ', 'toc.render.section.link'), + $section->getTitle() + ) : '', + $section->getChapter()->getTitle() + ) + ); + if ($section->getNoFollow()) { + $urlAttributes['rel'] = 'nofollow'; + } + $this->content[] = '
  • ' . $this->getView()->qlink( + $section->getTitle(), $url->getAbsoluteUrl(), - $view->escape($section->getTitle()) + null, + $urlAttributes ); if (! $section->hasChildren()) { $this->content[] = '
  • '; From 49e7964355da07f84877ab63458972c7723686f1 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 23 Feb 2015 17:13:55 +0100 Subject: [PATCH 24/63] Use an already existing variable instead of calling a function twice.. --- modules/doc/application/controllers/ModuleController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/doc/application/controllers/ModuleController.php b/modules/doc/application/controllers/ModuleController.php index 3b8e5e201..22c5e569c 100644 --- a/modules/doc/application/controllers/ModuleController.php +++ b/modules/doc/application/controllers/ModuleController.php @@ -49,7 +49,7 @@ class Doc_ModuleController extends DocController { $moduleManager = Icinga::app()->getModuleManager(); $modules = array(); - foreach (Icinga::app()->getModuleManager()->listEnabledModules() as $module) { + foreach ($moduleManager->listEnabledModules() as $module) { $path = $this->getPath($module, $moduleManager->getModuleDir($module, '/doc'), true); if ($path !== null) { $modules[] = $module; From b626a96e162308e367040aa137b7126450ec19d3 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 23 Feb 2015 17:14:40 +0100 Subject: [PATCH 25/63] Add aria-label to each box of the event grid refs #8458 --- .../Web/Widget/Chart/HistoryColorGrid.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/library/Icinga/Web/Widget/Chart/HistoryColorGrid.php b/library/Icinga/Web/Widget/Chart/HistoryColorGrid.php index 4e07d06b3..96b012db5 100644 --- a/library/Icinga/Web/Widget/Chart/HistoryColorGrid.php +++ b/library/Icinga/Web/Widget/Chart/HistoryColorGrid.php @@ -122,17 +122,18 @@ class HistoryColorGrid extends AbstractWidget { { if (array_key_exists($day, $this->data) && $this->data[$day]['value'] > 0) { $entry = $this->data[$day]; - return' '; - } else { - return ''; + } else { + return ''; } } From de744fdc83f435e6f72d26ece2af4b1747ebe7b2 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 23 Feb 2015 17:17:48 +0100 Subject: [PATCH 26/63] Add proper title to each module documentation link refs #8458 --- .../controllers/ModuleController.php | 2 +- .../views/scripts/module/index.phtml | 24 +++++++++++-------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/modules/doc/application/controllers/ModuleController.php b/modules/doc/application/controllers/ModuleController.php index 22c5e569c..eb9f4dcf1 100644 --- a/modules/doc/application/controllers/ModuleController.php +++ b/modules/doc/application/controllers/ModuleController.php @@ -52,7 +52,7 @@ class Doc_ModuleController extends DocController foreach ($moduleManager->listEnabledModules() as $module) { $path = $this->getPath($module, $moduleManager->getModuleDir($module, '/doc'), true); if ($path !== null) { - $modules[] = $module; + $modules[] = $moduleManager->getModule($module); } } $this->view->modules = $modules; diff --git a/modules/doc/application/views/scripts/module/index.phtml b/modules/doc/application/views/scripts/module/index.phtml index 0d8350f48..e0c57ae79 100644 --- a/modules/doc/application/views/scripts/module/index.phtml +++ b/modules/doc/application/views/scripts/module/index.phtml @@ -1,15 +1,19 @@
    - showOnlyCloseButton() ?> -

    translate('Module documentations') ?>

    + showOnlyCloseButton(); ?> +

    translate('Module documentations'); ?>

      - -
    • - - - -
    • - + +
    • qlink( + $module->getTitle(), + 'doc/module/toc', + array('moduleName' => $module->getName()), + array('title' => sprintf( + $this->translate('Show the documentation\'s table of contents for the %s'), + $module->getTitle() + )) + ); ?>
    • +
    -
    +
    \ No newline at end of file From fb28da8f239deabbb9404e969f23545b907d8bf4 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 23 Feb 2015 17:18:32 +0100 Subject: [PATCH 27/63] Add proper titles to the documentation module's overview refs #8458 --- .../views/scripts/index/index.phtml | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/modules/doc/application/views/scripts/index/index.phtml b/modules/doc/application/views/scripts/index/index.phtml index 1e8139f10..65fa0b9d2 100644 --- a/modules/doc/application/views/scripts/index/index.phtml +++ b/modules/doc/application/views/scripts/index/index.phtml @@ -1,9 +1,19 @@
    - showOnlyCloseButton() ?> -

    translate('Available documentations') ?>

    + showOnlyCloseButton(); ?> +

    translate('Available documentations'); ?>

      -
    • Icinga Web 2
    • -
    • translate('Module documentations') ?>
    • +
    • qlink( + 'Icinga Web 2', + 'doc/icingaweb/toc', + null, + array('title' => $this->translate('Show the documentation\'s table of contents for Icinga Web 2')) + ); ?>
    • +
    • qlink( + $this->translate('Module documentations'), + 'doc/module/', + null, + array('title' => $this->translate('List all modifications for which documentation is available')) + ); ?>
    -
    +
    \ No newline at end of file From 3605880fd1ba3dbd99ee6cb0ad728688caf596c1 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 23 Feb 2015 17:19:06 +0100 Subject: [PATCH 28/63] Add proper titles to the module overview refs #8458 --- application/views/scripts/config/modules.phtml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/application/views/scripts/config/modules.phtml b/application/views/scripts/config/modules.phtml index 01fc1c48d..2c79fcee0 100644 --- a/application/views/scripts/config/modules.phtml +++ b/application/views/scripts/config/modules.phtml @@ -11,22 +11,18 @@ enabled && $module->loaded) { - $icon = $this->icon('thumbs-up'); - $title = sprintf($this->translate('Module %s is enabled'), $module->name); + echo $this->icon('thumbs-up', sprintf($this->translate('Module %s is enabled'), $module->name)); } elseif (! $module->enabled) { - $icon = $this->icon('thumbs-down'); - $title = sprintf($this->translate('Module %s is disabled'), $module->name); + echo $this->icon('thumbs-down', sprintf($this->translate('Module %s is disabled'), $module->name)); } else { // ! $module->loaded - $icon = $this->icon('thumbs-down'); - $title = sprintf($this->translate('Module %s has failed to load'), $module->name); + echo $this->icon('thumbs-down', sprintf($this->translate('Module %s has failed to load'), $module->name)); } echo $this->qlink( - $icon . $this->escape($module->name), + $module->name, 'config/module/', array('name' => $module->name), - array('title' => $title), - false + array('title' => sprintf($this->translate('Show the overview of the %s module'), $module->name)) ); ?> From baf47fef7f7acb869e2e2169726ce76cf14e5411 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 23 Feb 2015 17:19:37 +0100 Subject: [PATCH 29/63] Add proper titles for the links to dis-/enable modules refs #8458 --- application/views/scripts/config/module.phtml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/application/views/scripts/config/module.phtml b/application/views/scripts/config/module.phtml index cd6ad5af8..617740c5a 100644 --- a/application/views/scripts/config/module.phtml +++ b/application/views/scripts/config/module.phtml @@ -21,14 +21,20 @@ $state = $moduleData->enabled ? ($moduleData->loaded ? 'enabled' : 'failed') : ' translate('State') ?> - qlink($this->translate('disable'), 'config/moduledisable', array( - 'name' => $module->getName() - )) ?> + qlink( + $this->translate('disable'), + 'config/moduledisable', + array('name' => $module->getName()), + array('title' => sprintf($this->translate('Disable the %s module'), $module->getName())) + ); ?> - qlink($this->translate('enable'), 'config/moduleenable', array( - 'name' => $module->getName() - )) ?> + qlink( + $this->translate('enable'), + 'config/moduleenable', + array('name' => $module->getName()), + array('title' => sprintf($this->translate('Enable the %s module'), $module->getName())) + ); ?> From 508322cfdc790bfdab185a1fe1715673a7687f68 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 23 Feb 2015 17:20:26 +0100 Subject: [PATCH 30/63] Add proper titles to the dashboard configuration's links refs #8458 --- .../views/scripts/dashboard/settings.phtml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/application/views/scripts/dashboard/settings.phtml b/application/views/scripts/dashboard/settings.phtml index 2ac9a1dfa..10ad613de 100644 --- a/application/views/scripts/dashboard/settings.phtml +++ b/application/views/scripts/dashboard/settings.phtml @@ -44,12 +44,20 @@ getDisabled() === true) continue; ?> - - getTitle(); ?> - + qlink( + $dashlet->getTitle(), + 'dashboard/update-dashlet', + array('pane' => $pane->getName(), 'dashlet' => $dashlet->getTitle()), + array('title' => sprintf($this->translate('Edit dashlet %s'), $dashlet->getTitle())) + ); ?> - getUrl(); ?> + qlink( + $dashlet->getUrl(), + $dashlet->getUrl(), + null, + array('title' => sprintf($this->translate('Show dashlet %s'), $dashlet->getTitle())) + ); ?> qlink( From 261abbd65e4c974a3f7e122baab570c961df4984 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 23 Feb 2015 17:20:48 +0100 Subject: [PATCH 31/63] Add proper titles to the role configuration refs #8458 --- application/views/scripts/roles/index.phtml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/application/views/scripts/roles/index.phtml b/application/views/scripts/roles/index.phtml index ea70bbe3f..0dcd75691 100644 --- a/application/views/scripts/roles/index.phtml +++ b/application/views/scripts/roles/index.phtml @@ -21,10 +21,12 @@ $role): /** @var object $role */ ?> - escape($name) ?> - + qlink( + $name, + 'roles/update', + array('role' => $name), + array('title' => sprintf($this->translate('Edit role %s'), $name)) + ); ?> escape($role->permissions, 0, 50) ?> @@ -65,7 +67,7 @@ - translate('New Role') ?> + translate('Create a New Role') ?>
    From a966f543f6fe755197ea3fa45c266b4e2494e844 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 23 Feb 2015 17:21:12 +0100 Subject: [PATCH 32/63] Add proper titles to the joystick navigation refs #8458 --- .../views/scripts/joystickPagination.phtml | 118 ++++++++++++------ 1 file changed, 77 insertions(+), 41 deletions(-) diff --git a/application/views/scripts/joystickPagination.phtml b/application/views/scripts/joystickPagination.phtml index a89d2601d..ef0acdb60 100644 --- a/application/views/scripts/joystickPagination.phtml +++ b/application/views/scripts/joystickPagination.phtml @@ -6,7 +6,7 @@ if ($xAxisPaginator->count() <= 1 && $yAxisPaginator->count() <= 1) { return; // Display this pagination only if there are multiple pages } -$fromTo = t('%s: %d to %d of %d (on the %s-axis)'); +$showText = $this->translate('%s: Show %s %u to %u out of %u', 'pagination.joystick'); $xAxisPages = $xAxisPaginator->getPages('all'); $yAxisPages = $yAxisPaginator->getPages('all'); @@ -28,16 +28,25 @@ $nextXAxisPage = $currentXAxisPage < $totalXAxisPages ? $currentXAxisPage + 1 :   - icon('up-open'); ?> + qlink( + $this->icon('up-open'), + Url::fromRequest(), + array( + 'page' => $currentXAxisPage . ',' . $prevYAxisPage + ), + array( + 'data-base-target' => '_self', + 'title' => sprintf( + $showText, + $this->translate('Y-Axis', 'pagination.joystick'), + $this->translate('hosts', 'pagination.joystick'), + ($prevYAxisPage - 1) * $yAxisPages->itemCountPerPage + 1, + $prevYAxisPage * $yAxisPages->itemCountPerPage, + $yAxisPages->totalItemCount + ) + ), + false + ); ?> icon('up-open'); ?> @@ -47,16 +56,25 @@ $nextXAxisPage = $currentXAxisPage < $totalXAxisPages ? $currentXAxisPage + 1 : - icon('left-open'); ?> + qlink( + $this->icon('left-open'), + Url::fromRequest(), + array( + 'page' => $prevXAxisPage . ',' . $currentYAxisPage + ), + array( + 'data-base-target' => '_self', + 'title' => sprintf( + $showText, + $this->translate('X-Axis', 'pagination.joystick'), + $this->translate('services', 'pagination.joystick'), + ($prevXAxisPage - 1) * $xAxisPages->itemCountPerPage + 1, + $prevXAxisPage * $xAxisPages->itemCountPerPage, + $xAxisPages->totalItemCount + ) + ), + false + ); ?> icon('left-open'); ?> @@ -64,16 +82,25 @@ $nextXAxisPage = $currentXAxisPage < $totalXAxisPages ? $currentXAxisPage + 1 :   - icon('right-open'); ?> + qlink( + $this->icon('right-open'), + Url::fromRequest(), + array( + 'page' => $nextXAxisPage . ',' . $currentYAxisPage + ), + array( + 'data-base-target' => '_self', + 'title' => sprintf( + $showText, + $this->translate('X-Axis', 'pagination.joystick'), + $this->translate('services', 'pagination.joystick'), + $currentXAxisPage * $xAxisPages->itemCountPerPage + 1, + $nextXAxisPage === $xAxisPages->last ? $xAxisPages->totalItemCount : $nextXAxisPage * $xAxisPages->itemCountPerPage, + $xAxisPages->totalItemCount + ) + ), + false + ); ?> icon('right-open'); ?> @@ -83,16 +110,25 @@ $nextXAxisPage = $currentXAxisPage < $totalXAxisPages ? $currentXAxisPage + 1 :   - icon('down-open'); ?> + qlink( + $this->icon('down-open'), + Url::fromRequest(), + array( + 'page' => $currentXAxisPage . ',' . $nextYAxisPage + ), + array( + 'data-base-target' => '_self', + 'title' => sprintf( + $showText, + $this->translate('Y-Axis', 'pagination.joystick'), + $this->translate('hosts', 'pagination.joystick'), + $currentYAxisPage * $yAxisPages->itemCountPerPage + 1, + $nextYAxisPage === $yAxisPages->last ? $yAxisPages->totalItemCount : $nextYAxisPage * $yAxisPages->itemCountPerPage, + $yAxisPages->totalItemCount + ) + ), + false + ); ?> icon('down-open'); ?> From 371f8951889467e8bbb40b10ff7d5b4ff5774ea2 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 23 Feb 2015 17:21:31 +0100 Subject: [PATCH 33/63] Add proper titles to the mixed pagination refs #8458 --- application/views/scripts/mixedPagination.phtml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/views/scripts/mixedPagination.phtml b/application/views/scripts/mixedPagination.phtml index bac2b202b..4704d8f51 100644 --- a/application/views/scripts/mixedPagination.phtml +++ b/application/views/scripts/mixedPagination.phtml @@ -13,7 +13,7 @@ if ($this->pageCount <= 1) return;