[icinga-checkins] icinga.org: icingaweb2-module-director/feature/icinga1-config-12919: ActionController: provide a singleTab helper

git at icinga.org git at icinga.org
Wed Oct 19 13:17:41 CEST 2016


Module: icingaweb2-module-director
Branch: feature/icinga1-config-12919
Commit: 732ebae3392e64afee1f0ec7000016ccc63366c8
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=732ebae3392e64afee1f0ec7000016ccc63366c8

Author: Thomas Gelf <thomas at gelf.net>
Date:   Thu Oct 13 19:06:15 2016 +0000

ActionController: provide a singleTab helper

---

 library/Director/Web/Controller/ActionController.php |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/library/Director/Web/Controller/ActionController.php b/library/Director/Web/Controller/ActionController.php
index aa6c859..d1de32c 100644
--- a/library/Director/Web/Controller/ActionController.php
+++ b/library/Director/Web/Controller/ActionController.php
@@ -90,6 +90,17 @@ abstract class ActionController extends Controller
         $this->sendJson((object) array('error' => $message));
     }
 
+    protected function singleTab($label)
+    {
+        return $this->view->tabs = Widget::create('tabs')->add(
+            'tab',
+            array(
+                'label' => $label,
+                'url'   => $this->getRequest()->getUrl()
+            )
+        )->activate('tab');
+    }
+
     protected function setConfigTabs()
     {
         $this->view->tabs = Widget::create('tabs')->add(



More information about the icinga-checkins mailing list