From be4292bbbbba7df81b769034bb212dcafda4ec9c Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Mon, 16 Apr 2018 20:45:29 +0200 Subject: [PATCH] help for subtitles --- lam/lib/html.inc | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/lam/lib/html.inc b/lam/lib/html.inc index 19bf38de..a52e8985 100644 --- a/lam/lib/html.inc +++ b/lam/lib/html.inc @@ -2758,6 +2758,8 @@ class htmlSubTitle extends htmlElement { private $id = null; /** show large icon */ private $largeIcon = false; + /** help ID */ + private $helpId = null; /** * Constructor. @@ -2767,7 +2769,7 @@ class htmlSubTitle extends htmlElement { * @param String $id optional ID for this element (e.g. to use for JavaScript) * @param bool $largeIcon show large (32x32px) icon instead of small one (16x16px) */ - function __construct($label, $image = null, $id = null, $largeIcon = false) { + public function __construct($label, $image = null, $id = null, $largeIcon = false) { $this->label = htmlspecialchars($label); $this->image = htmlspecialchars($image); $this->id = htmlspecialchars($id); @@ -2787,7 +2789,7 @@ class htmlSubTitle extends htmlElement { * @param string $scope Account type * @return array List of input field names and their type (name => type) */ - function generateHTML($module, $input, $values, $restricted, &$tabindex, $scope) { + public function generateHTML($module, $input, $values, $restricted, &$tabindex, $scope) { $idValue = ''; if ($this->id != null) { $idValue = ' id="' . $this->id . '"'; @@ -2799,11 +2801,26 @@ class htmlSubTitle extends htmlElement { echo '' . $this->label . ' '; } echo $this->label; + if ($this->helpId !== null) { + $spacer = new htmlSpacer('0.5rem', null); + $spacer->generateHTML($module, $input, $values, $restricted, $tabindex, $scope); + $helpLink = new htmlHelpLink($this->helpId); + $helpLink->generateHTML($module, $input, $values, $restricted, $tabindex, $scope); + } echo "\n"; echo "\n"; return array(); } + /** + * Sets an additional help id. + * + * @param string|array $helpId + */ + public function setHelpId($helpId) { + $this->helpId = $helpId; + } + } /**