summaryrefslogtreecommitdiff
path: root/includes/view/UserHintsRenderer.php
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2017-11-28 15:43:51 +0100
committerGitHub <noreply@github.com>2017-11-28 15:43:51 +0100
commit599f2fd264bfc7b1b6826fe206442806e317340f (patch)
tree50cf84d7d07d11bd65b45c2c17f37632f6cd8eff /includes/view/UserHintsRenderer.php
parenta5fc5bd0979e8de1fce8a8addd351a6e7bd6aeb8 (diff)
parenteda7f7788ea8012bd8be46405c56a666c11f3fa5 (diff)
Merge pull request #365 from engelsystem/feature-igel-rewrite
Feature igel rewrite
Diffstat (limited to 'includes/view/UserHintsRenderer.php')
-rw-r--r--includes/view/UserHintsRenderer.php105
1 files changed, 56 insertions, 49 deletions
diff --git a/includes/view/UserHintsRenderer.php b/includes/view/UserHintsRenderer.php
index cf4b1414..aac8ecfd 100644
--- a/includes/view/UserHintsRenderer.php
+++ b/includes/view/UserHintsRenderer.php
@@ -2,58 +2,65 @@
namespace Engelsystem;
-class UserHintsRenderer {
+class UserHintsRenderer
+{
+ /** @var string[] */
+ private $hints = [];
- private $hints = [];
+ private $important = false;
- private $important = false;
+ /**
+ * Render the added hints to a popover for the toolbar.
+ *
+ * @return string
+ */
+ public function render()
+ {
+ if (count($this->hints) > 0) {
+ $hint_class = $this->important ? 'danger' : 'info';
+ $glyphicon = $this->important ? 'warning-sign' : 'info-sign';
- /**
- * Render the added hints to a popover for the toolbar.
- */
- public function render() {
- if (count($this->hints) > 0) {
- $hint_class = $this->important ? 'danger' : 'info';
- $glyphicon = $this->important ? 'warning-sign' : 'info-sign';
-
- return toolbar_popover($glyphicon . ' text-' . $hint_class, '', $this->hints, 'bg-' . $hint_class);
+ return toolbar_popover($glyphicon . ' text-' . $hint_class, '', $this->hints, 'bg-' . $hint_class);
+ }
+
+ return '';
}
-
- return '';
- }
-
- /**
- * Add a hint to the list, if its not null and a not empty string.
- *
- * @param string $hint
- * The hint
- * @param boolean $important
- * Is the hint important?
- */
- public function addHint($hint, $important = false) {
- if ($hint != null && $hint != '') {
- if ($important) {
- $this->important = true;
- $this->hints[] = error($hint, true);
- } else {
- $this->hints[] = info($hint, true);
- }
+
+ /**
+ * Add a hint to the list, if its not null and a not empty string.
+ *
+ * @param string $hint The hint
+ * @param boolean $important Is the hint important?
+ */
+ public function addHint($hint, $important = false)
+ {
+ if ($hint != null && $hint != '') {
+ if ($important) {
+ $this->important = true;
+ $this->hints[] = error($hint, true);
+ } else {
+ $this->hints[] = info($hint, true);
+ }
+ }
}
- }
-
- /**
- * Get all hints.
- */
- public function getHints() {
- return $this->hints;
- }
-
- /**
- * Are there important hints? This leads to a more intensive icon.
- */
- public function isImportant() {
- return $this->important;
- }
-}
-?> \ No newline at end of file
+ /**
+ * Get all hints.
+ *
+ * @return string[]
+ */
+ public function getHints()
+ {
+ return $this->hints;
+ }
+
+ /**
+ * Are there important hints? This leads to a more intensive icon.
+ *
+ * @return bool
+ */
+ public function isImportant()
+ {
+ return $this->important;
+ }
+}