From 2a0e093a8f81f7e9ff1ce427ac8bb1900d372d6b Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Thu, 13 Jan 2022 19:46:46 +0100 Subject: [PATCH] restyling --- lam/graphics/required.png | Bin 3002 -> 0 bytes lam/lib/html.inc | 63 +++++++++++++++++++++++++------------- lam/style/500_layout.css | 6 ++++ 3 files changed, 48 insertions(+), 21 deletions(-) delete mode 100644 lam/graphics/required.png diff --git a/lam/graphics/required.png b/lam/graphics/required.png deleted file mode 100644 index 2718ce4c3ad8490e36cbc75130c1c5d9c3335900..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3002 zcmV;r3q|yaP)Oz@Z0f2-7z;ux~O9+4z06=<WDR*FRcSTFz- zW=q650N5=6FiBTtNC2?60Km==3$g$R3;-}uh=nNt1bYBr$Ri_o0EC$U6h`t_Jn<{8 z5a%iY0C<_QJh>z}MS)ugEpZ1|S1ukX&Pf+56gFW3VVXcL!g-k)GJ!M?;PcD?0HBc- z5#WRK{dmp}uFlRjj{U%*%WZ25jX z{P*?XzTzZ-GF^d31o+^>%=Ap99M6&ogks$0k4OBs3;+Bb(;~!4V!2o<6ys46agIcq zjPo+3B8fthDa9qy|77CdEc*jK-!%ZRYCZvbku9iQV*~a}ClFY4z~c7+0P?$U!PF=S z1Au6Q;m>#f??3%Vpd|o+W=WE9003S@Bra6Svp>fO002awfhw>;8}z{#EWidF!3EsG z3;bXU&9EIRU@z1_9W=mEXoiz;4lcq~xDGvV5BgyU zp1~-*fe8db$Osc*A=-!mVv1NJjtCc-h4>-CNCXm#Bp}I%6j35eku^v$Qi@a{RY)E3 zJ#qp$hg?Rwkvqr$GJ^buyhkyVfwECO)C{#lxu`c9ghrwZ&}4KmnvWKso6vH!8a<3Q zq36)6Xb;+tK10Vaz~~qUGsJ8#F2=(`u{bOVlVi)VBCHIn#u~6ztOL7=^<&SmcLWlF zMZgI*1b0FpVIDz9SWH+>*hr`#93(Um+6gxa1B6k+CnA%mOSC4s5&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n{*%*B$Ge=nny$HAYq{=vy|sI0 z_vss+H_qMky?OB#|JK!>IX&II^LlUh#rO5!7TtbwC;iULyV-Xq?ybB}ykGP{?LpZ? z-G|jbTmIbG@7#ZCz;~eY(cDM(28Dyq{*m>M4?_iynUBkc4TkHUI6gT!;y-fz>HMcd z&t%Ugo)`Y2{>!cx7B7DI)$7;J(U{Spm-3gBzioV_{p!H$8L!*M!p0uH$#^p{Ui4P` z?ZJ24cOCDe-w#jZd?0@)|7iKK^;6KN`;!@ylm7$*nDhK&GcDTy000JJOGiWi{{a60 z|De66lK=n!32;bRa{vGf6951U69E94oEQKA00(qQO+^RW1OgKcG-2Mq)&Kwi>`6pH zR5;6HV4xM4pv$H>!;D*pWR2bG3}y@r3=DT0O^!WiGdst?z`!s?m%)N4%}pu{>OUqr z{=ZRXb?yI&b^rfg-uM4@v)7|v?Kb~=br}q>>0w6Z?0?7bR`27JKXyJo;S3D#85myQ zWe^fm;NLiVaZU1hhSk^%U_lpn{QS>3hVM5SK3)C6@axl01`#nnhA$k~W5cWc+ z27}$t87}`H<|zF9f5_wi|81`S?`O*Y{om*Kzh4=<7cjtDcm5a#1_p+kmHKyXl*'; +} + +/** + * Returns the marker for required values. + * + * @return htmlSpan HTML code for required marker + */ +function htmlGetRequiredMarkerElement(): htmlSpan { + $span = new htmlSpan(new htmlOutputText('*'), array('lam-required')); + $span->setTitle(_('required')); + return $span; +} + /** * Represents a HTML element. * This is used to build HTML code by using objects. @@ -948,9 +968,7 @@ class htmlTableExtendedInputField extends htmlInputField { echo '
'; echo $this->label; if ($this->required) { - $graphicsPath = "../../graphics"; - if (is_dir("../graphics")) $graphicsPath = "../graphics"; - echo 'required'; + echo htmlGetRequiredMarker(); } echo '
'; echo "\n\n\n"; @@ -2045,9 +2063,7 @@ class htmlOutputText extends htmlElement { echo $this->string; } if ($this->markAsRequired) { - $graphicsPath = "../../graphics"; - if (is_dir("../graphics")) $graphicsPath = "../graphics"; - echo 'required'; + echo htmlGetRequiredMarker(); } if ($this->isPreformatted) { echo ""; @@ -2763,9 +2779,7 @@ class htmlTableExtendedInputTextarea extends htmlInputTextarea { echo '
'; echo $this->label; if ($this->required) { - $graphicsPath = "../../graphics"; - if (is_dir("../graphics")) $graphicsPath = "../graphics"; - echo 'required'; + echo htmlGetRequiredMarker(); } echo '
'; echo "\n\n\n"; @@ -3705,6 +3719,8 @@ class htmlSpan extends htmlElement { private $content = null; /** onclick handler */ private $onclick = null; + /** title */ + private $title = null; /** * Constructor. @@ -3739,7 +3755,11 @@ class htmlSpan extends htmlElement { if (!empty($this->onclick)) { $onclickHandler = ' onclick="' . $this->onclick . '"'; } - echo ''; + $titleCode = ''; + if ($this->title !== null) { + $titleCode = ' title="' . $this->title . '"'; + } + echo ''; if ($this->content != null) { $return = $this->content->generateHTML($module, $input, $values, $restricted, $tabindex, $scope); } @@ -3756,6 +3776,15 @@ class htmlSpan extends htmlElement { $this->onclick = $event; } + /** + * Sets the title. + * + * @param string|null $title title + */ + public function setTitle(?string $title): void { + $this->title = htmlspecialchars($title); + } + } /** @@ -4465,11 +4494,7 @@ class htmlResponsiveInputField extends htmlInputField { $labelGroup = new htmlGroup(); $labelGroup->addElement(new htmlOutputText($this->label)); if ($this->required) { - $graphicsPath = "../../graphics"; - if (is_dir("../graphics")) { - $graphicsPath = "../graphics"; - } - $labelGroup->addElement(new htmlImage($graphicsPath . '/required.png', 16, 16, _('required'), _('required'))); + $labelGroup->addElement(htmlGetRequiredMarkerElement()); } if (!empty($this->helpID)) { $helpLinkLabel = new htmlHelpLink($this->helpID, $this->helpModule); @@ -4561,9 +4586,7 @@ class htmlResponsiveInputFileUpload extends htmlInputFileUpload { $labelGroup = new htmlGroup(); $labelGroup->addElement(new htmlOutputText($this->label)); if ($this->required) { - $graphicsPath = "../../graphics"; - if (is_dir("../graphics")) $graphicsPath = "../graphics"; - $labelGroup->addElement(new htmlImage($graphicsPath . '/required.png', 16, 16, _('required'), _('required'))); + $labelGroup->addElement(htmlGetRequiredMarkerElement()); } if (!empty($this->helpID)) { $helpLinkLabel = new htmlHelpLink($this->helpID, $this->helpModule); @@ -4648,9 +4671,7 @@ class htmlResponsiveInputTextarea extends htmlInputTextarea { $labelGroup = new htmlGroup(); $labelGroup->addElement(new htmlOutputText($this->label)); if ($this->required) { - $graphicsPath = "../../graphics"; - if (is_dir("../graphics")) $graphicsPath = "../graphics"; - $labelGroup->addElement(new htmlImage($graphicsPath . '/required.png', 16, 16, _('required'), _('required'))); + $labelGroup->addElement(htmlGetRequiredMarkerElement()); } if (!empty($this->helpID)) { $helpLinkLabel = new htmlHelpLink($this->helpID, $this->helpModule); diff --git a/lam/style/500_layout.css b/lam/style/500_layout.css index dff971c80..269a62817 100644 --- a/lam/style/500_layout.css +++ b/lam/style/500_layout.css @@ -341,6 +341,12 @@ table.accountlist > tbody > tr:hover { vertical-align: unset; } +span.lam-required { + font-weight: bold; + color: #ff9933; + margin-left: 0.2rem; +} + /* table preferences */ table.accountlist thead {