summaryrefslogtreecommitdiffstats
path: root/library/Director/Web/Widget/NotInBranchedHint.php
diff options
context:
space:
mode:
Diffstat (limited to 'library/Director/Web/Widget/NotInBranchedHint.php')
-rw-r--r--library/Director/Web/Widget/NotInBranchedHint.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/library/Director/Web/Widget/NotInBranchedHint.php b/library/Director/Web/Widget/NotInBranchedHint.php
new file mode 100644
index 0000000..222934b
--- /dev/null
+++ b/library/Director/Web/Widget/NotInBranchedHint.php
@@ -0,0 +1,23 @@
+<?php
+
+namespace Icinga\Module\Director\Web\Widget;
+
+use gipfl\Translation\TranslationHelper;
+use gipfl\Web\Widget\Hint;
+use Icinga\Authentication\Auth;
+use Icinga\Module\Director\Db\Branch\Branch;
+use ipl\Html\Html;
+
+class NotInBranchedHint extends Hint
+{
+ use TranslationHelper;
+
+ public function __construct($forbiddenAction, Branch $branch, Auth $auth)
+ {
+ parent::__construct(Html::sprintf(
+ $this->translate('%s is not available while being in a Configuration Branch: %s'),
+ $forbiddenAction,
+ Branch::requireHook()->linkToBranch($branch, $auth, $branch->getName())
+ ), 'info');
+ }
+}