diff --git a/application/views/scripts/config/authentication/create.phtml b/application/views/scripts/config/authentication/create.phtml
index 52fcbceb3..427758292 100644
--- a/application/views/scripts/config/authentication/create.phtml
+++ b/application/views/scripts/config/authentication/create.phtml
@@ -1,3 +1,6 @@
+
+ = $this->tabs->showOnlyCloseButton() ?>
+
= $this->translate('Create New Authentication Backend'); ?>
= $this->translate(
diff --git a/application/views/scripts/config/authentication/modify.phtml b/application/views/scripts/config/authentication/modify.phtml
index 19901ae5b..b01d7095a 100644
--- a/application/views/scripts/config/authentication/modify.phtml
+++ b/application/views/scripts/config/authentication/modify.phtml
@@ -1,2 +1,5 @@
+
+ = $this->tabs->showOnlyCloseButton() ?>
+
= $this->translate('Edit Backend'); ?>
= $form; ?>
\ No newline at end of file
diff --git a/application/views/scripts/config/authentication/remove.phtml b/application/views/scripts/config/authentication/remove.phtml
index e1050db0d..424aff9a0 100644
--- a/application/views/scripts/config/authentication/remove.phtml
+++ b/application/views/scripts/config/authentication/remove.phtml
@@ -1,2 +1,5 @@
+
+ = $this->tabs->showOnlyCloseButton() ?>
+
= $this->translate('Remove Backend'); ?>
= $form; ?>
\ No newline at end of file
diff --git a/application/views/scripts/config/resource/create.phtml b/application/views/scripts/config/resource/create.phtml
index 5a07d832e..0750a5aa9 100644
--- a/application/views/scripts/config/resource/create.phtml
+++ b/application/views/scripts/config/resource/create.phtml
@@ -1,3 +1,6 @@
+
+ = $this->tabs->showOnlyCloseButton() ?>
+
= $this->translate('Create A New Resource'); ?>
= $this->translate('Resources are entities that provide data to Icinga Web 2.'); ?>
= $form; ?>
\ No newline at end of file
diff --git a/application/views/scripts/config/resource/modify.phtml b/application/views/scripts/config/resource/modify.phtml
index 5fa2536bd..d355aeb4c 100644
--- a/application/views/scripts/config/resource/modify.phtml
+++ b/application/views/scripts/config/resource/modify.phtml
@@ -1,2 +1,5 @@
+
+ = $this->tabs->showOnlyCloseButton() ?>
+
= $this->translate('Edit Existing Resource'); ?>
= $form; ?>
\ No newline at end of file
diff --git a/application/views/scripts/config/resource/remove.phtml b/application/views/scripts/config/resource/remove.phtml
index a43bcd74c..14829ab40 100644
--- a/application/views/scripts/config/resource/remove.phtml
+++ b/application/views/scripts/config/resource/remove.phtml
@@ -1,2 +1,5 @@
+
+ = $this->tabs->showOnlyCloseButton() ?>
+
= $this->translate('Remove Existing Resource'); ?>
= $form; ?>
\ No newline at end of file
diff --git a/library/Icinga/Web/Widget/Tabs.php b/library/Icinga/Web/Widget/Tabs.php
index d79453a01..b2a34e0ec 100644
--- a/library/Icinga/Web/Widget/Tabs.php
+++ b/library/Icinga/Web/Widget/Tabs.php
@@ -74,6 +74,13 @@ EOT;
*/
private $dropdownTabs = array();
+ /**
+ * Whether only the close-button should by rendered for this tab
+ *
+ * @var bool
+ */
+ private $closeButtonOnly = false;
+
/**
* Whether the tabs should contain a close-button
*
@@ -275,14 +282,19 @@ EOT;
*/
public function render()
{
- if (empty($this->tabs)) {
- return '';
+ if (empty($this->tabs) || true === $this->closeButtonOnly) {
+ $tabs = '';
+ $drop = '';
+ } else {
+ $tabs = $this->renderTabs();
+ $drop = $this->renderDropdownTabs();
}
+ $close = $this->closeTab ? $this->renderCloseTab() : '';
$html = $this->baseTpl;
- $html = str_replace('{TABS}', $this->renderTabs(), $html);
- $html = str_replace('{DROPDOWN}', $this->renderDropdownTabs(), $html);
- $html = str_replace('{CLOSE}', $this->closeTab ? $this->renderCloseTab() : '', $html);
+ $html = str_replace('{TABS}', $tabs, $html);
+ $html = str_replace('{DROPDOWN}', $drop, $html);
+ $html = str_replace('{CLOSE}', $close, $html);
return $html;
}
@@ -318,6 +330,18 @@ EOT;
return $this->tabs;
}
+ /**
+ * Whether to hide all elements except of the close button
+ *
+ * @param bool $value
+ * @return Tabs fluent interface
+ */
+ public function showOnlyCloseButton($value = true)
+ {
+ $this->closeButtonOnly = $value;
+ return $this;
+ }
+
/**
* Apply a Tabextension on this tabs object
*
diff --git a/modules/monitoring/application/views/scripts/partials/command-form.phtml b/modules/monitoring/application/views/scripts/partials/command-form.phtml
index 0aae10046..0e5a4777e 100644
--- a/modules/monitoring/application/views/scripts/partials/command-form.phtml
+++ b/modules/monitoring/application/views/scripts/partials/command-form.phtml
@@ -1,3 +1,7 @@
+
+ = $this->tabs->showOnlyCloseButton() ?>
+
+
= $title ?>
diff --git a/modules/monitoring/application/views/scripts/process/disable-notifications.phtml b/modules/monitoring/application/views/scripts/process/disable-notifications.phtml
index 6b45a1f22..547b3ac37 100644
--- a/modules/monitoring/application/views/scripts/process/disable-notifications.phtml
+++ b/modules/monitoring/application/views/scripts/process/disable-notifications.phtml
@@ -1,3 +1,6 @@
+
+ = $this->tabs->showOnlyCloseButton() ?>
+
= $title ?>
notifications_enabled === false): ?>
diff --git a/modules/monitoring/application/views/scripts/show/contact.phtml b/modules/monitoring/application/views/scripts/show/contact.phtml
index a755266ea..cdb6af12c 100644
--- a/modules/monitoring/application/views/scripts/show/contact.phtml
+++ b/modules/monitoring/application/views/scripts/show/contact.phtml
@@ -1,5 +1,6 @@
getHelper('ContactFlags') ?>
+ = $this->tabs ?>
= $this->translate('Contact details') ?>
+ = $this->tabs ?>
= $intervalBox; ?>