diff --git a/application/forms/Navigation/NavigationConfigForm.php b/application/forms/Navigation/NavigationConfigForm.php index a4092753b..343723399 100644 --- a/application/forms/Navigation/NavigationConfigForm.php +++ b/application/forms/Navigation/NavigationConfigForm.php @@ -215,7 +215,7 @@ class NavigationConfigForm extends ConfigForm foreach ($this->getShareConfig($type) as $sectionName => $sectionConfig) { if ($sectionName !== $this->itemToLoad && $sectionConfig->owner === ($owner ?: $this->getUser()->getUsername()) - && !in_array($sectionName, $children, true) + && ! in_array($sectionName, $children, true) ) { $names[] = $sectionName; } @@ -223,7 +223,7 @@ class NavigationConfigForm extends ConfigForm foreach ($this->getUserConfig($type) as $sectionName => $sectionConfig) { if ($sectionName !== $this->itemToLoad - && !in_array($sectionName, $children, true) + && ! in_array($sectionName, $children, true) ) { $names[] = $sectionName; } @@ -363,8 +363,8 @@ class NavigationConfigForm extends ConfigForm $shared = false; if ($this->hasBeenShared($name)) { if (isset($data['parent']) && $data['parent'] - ? !$this->hasBeenShared($data['parent']) - : ((! isset($data['users']) || !$data['users']) && (! isset($data['groups']) || !$data['groups'])) + ? ! $this->hasBeenShared($data['parent']) + : ((! isset($data['users']) || ! $data['users']) && (! isset($data['groups']) || ! $data['groups'])) ) { // It is shared but shouldn't anymore $config = $this->unshare($name, isset($data['parent']) ? $data['parent'] : null); @@ -579,7 +579,7 @@ class NavigationConfigForm extends ConfigForm ) ); - if ((! $itemForm->requiresParentSelection() || !isset($formData['parent']) || !$formData['parent']) + if ((! $itemForm->requiresParentSelection() || ! isset($formData['parent']) || ! $formData['parent']) && $this->getUser()->can('application/share/navigation') ) { $checked = isset($formData['shared']) ? null : (isset($formData['users']) || isset($formData['groups'])); @@ -719,10 +719,12 @@ class NavigationConfigForm extends ConfigForm if (! empty($forbiddenUsers)) { $valid = false; $this->getElement('users')->addError( - $this->translate(sprintf( - 'You are not permitted to share this navigation item with the following users: %s', + sprintf( + $this->translate( + 'You are not permitted to share this navigation item with the following users: %s' + ), implode(', ', $forbiddenUsers) - )) + ) ); } } @@ -741,10 +743,12 @@ class NavigationConfigForm extends ConfigForm if (! empty($forbiddenGroups)) { $valid = false; $this->getElement('groups')->addError( - $this->translate(sprintf( - 'You are not permitted to share this navigation item with the following groups: %s', + sprintf( + $this->translate( + 'You are not permitted to share this navigation item with the following groups: %s' + ), implode(', ', $forbiddenGroups) - )) + ) ); } } diff --git a/library/Icinga/Web/Widget/Tabs.php b/library/Icinga/Web/Widget/Tabs.php index 979b5ef0a..ffe7934a2 100644 --- a/library/Icinga/Web/Widget/Tabs.php +++ b/library/Icinga/Web/Widget/Tabs.php @@ -332,7 +332,7 @@ EOT; $caption = t('Content'); } - $label = t(sprintf('Refresh the %s', $caption)); + $label = sprintf(t('Refresh the %s'), $caption); $title = $label; $tpl = str_replace( diff --git a/modules/monitoring/application/forms/Setup/IdoResourcePage.php b/modules/monitoring/application/forms/Setup/IdoResourcePage.php index 7ddbac24f..cc754a794 100644 --- a/modules/monitoring/application/forms/Setup/IdoResourcePage.php +++ b/modules/monitoring/application/forms/Setup/IdoResourcePage.php @@ -158,11 +158,11 @@ class IdoResourcePage extends Form $db = new DbTool($this->getValues()); $version = $db->connectToDb()->getServerVersion(); if (version_compare($version, '9.1', '<')) { - $this->error($this->translate(sprintf( - 'The server\'s version %s is too old. The minimum required version is %s.', + $this->error(sprintf( + $this->translate('The server\'s version %s is too old. The minimum required version is %s.'), $version, '9.1' - ))); + )); return false; } } diff --git a/modules/setup/application/forms/DbResourcePage.php b/modules/setup/application/forms/DbResourcePage.php index 4696e9c86..b3f178480 100644 --- a/modules/setup/application/forms/DbResourcePage.php +++ b/modules/setup/application/forms/DbResourcePage.php @@ -141,22 +141,22 @@ class DbResourcePage extends Form if ($this->getValue('db') === 'pgsql') { if ($connectionError !== null) { - $this->warning($this->translate(sprintf( - 'Unable to check the server\'s version. This is usually not a critical error as there is' - . ' probably only access to the database permitted which does not exist yet. If you are' + $this->warning(sprintf( + $this->translate('Unable to check the server\'s version. This is usually not a critical error' + . ' as there is probably only access to the database permitted which does not exist yet. If you are' . ' absolutely sure you are running PostgreSQL in a version equal to or newer than 9.1,' - . ' you can skip the validation and safely proceed to the next step. The error was: %s', + . ' you can skip the validation and safely proceed to the next step. The error was: %s'), $connectionError->getMessage() - ))); + )); $state = false; } else { $version = $db->getServerVersion(); if (version_compare($version, '9.1', '<')) { - $this->error($this->translate(sprintf( - 'The server\'s version %s is too old. The minimum required version is %s.', + $this->error(sprintf( + $this->translate('The server\'s version %s is too old. The minimum required version is %s.'), $version, '9.1' - ))); + )); $state = false; } }