restyling

This commit is contained in:
Roland Gruber 2022-01-13 19:46:46 +01:00
parent 40059575a9
commit 2a0e093a8f
3 changed files with 48 additions and 21 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

View file

@ -27,6 +27,26 @@
* @author Roland Gruber * @author Roland Gruber
*/ */
/**
* Returns the marker for required values.
*
* @return string HTML code for required marker
*/
function htmlGetRequiredMarker(): string {
return '<span class="lam-required" title="' . _('required') . '">*</span>';
}
/**
* 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. * Represents a HTML element.
* This is used to build HTML code by using objects. * This is used to build HTML code by using objects.
@ -948,9 +968,7 @@ class htmlTableExtendedInputField extends htmlInputField {
echo '<div class="nowrap">'; echo '<div class="nowrap">';
echo $this->label; echo $this->label;
if ($this->required) { if ($this->required) {
$graphicsPath = "../../graphics"; echo htmlGetRequiredMarker();
if (is_dir("../graphics")) $graphicsPath = "../graphics";
echo '<img src="' . $graphicsPath . '/required.png" alt="required" width=16 height=16 title="' . _('required') . '">';
} }
echo '</div>'; echo '</div>';
echo "\n</td>\n<td>\n"; echo "\n</td>\n<td>\n";
@ -2045,9 +2063,7 @@ class htmlOutputText extends htmlElement {
echo $this->string; echo $this->string;
} }
if ($this->markAsRequired) { if ($this->markAsRequired) {
$graphicsPath = "../../graphics"; echo htmlGetRequiredMarker();
if (is_dir("../graphics")) $graphicsPath = "../graphics";
echo '<img src="' . $graphicsPath . '/required.png" alt="required" width=16 height=16 title="' . _('required') . '">';
} }
if ($this->isPreformatted) { if ($this->isPreformatted) {
echo "</pre>"; echo "</pre>";
@ -2763,9 +2779,7 @@ class htmlTableExtendedInputTextarea extends htmlInputTextarea {
echo '<div class="nowrap">'; echo '<div class="nowrap">';
echo $this->label; echo $this->label;
if ($this->required) { if ($this->required) {
$graphicsPath = "../../graphics"; echo htmlGetRequiredMarker();
if (is_dir("../graphics")) $graphicsPath = "../graphics";
echo '<img src="' . $graphicsPath . '/required.png" alt="required" width=16 height=16 title="' . _('required') . '">';
} }
echo '</div>'; echo '</div>';
echo "\n</td>\n<td>\n"; echo "\n</td>\n<td>\n";
@ -3705,6 +3719,8 @@ class htmlSpan extends htmlElement {
private $content = null; private $content = null;
/** onclick handler */ /** onclick handler */
private $onclick = null; private $onclick = null;
/** title */
private $title = null;
/** /**
* Constructor. * Constructor.
@ -3739,7 +3755,11 @@ class htmlSpan extends htmlElement {
if (!empty($this->onclick)) { if (!empty($this->onclick)) {
$onclickHandler = ' onclick="' . $this->onclick . '"'; $onclickHandler = ' onclick="' . $this->onclick . '"';
} }
echo '<span' . $classesValue . $onclickHandler . '>'; $titleCode = '';
if ($this->title !== null) {
$titleCode = ' title="' . $this->title . '"';
}
echo '<span' . $classesValue . $titleCode . $onclickHandler . '>';
if ($this->content != null) { if ($this->content != null) {
$return = $this->content->generateHTML($module, $input, $values, $restricted, $tabindex, $scope); $return = $this->content->generateHTML($module, $input, $values, $restricted, $tabindex, $scope);
} }
@ -3756,6 +3776,15 @@ class htmlSpan extends htmlElement {
$this->onclick = $event; $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 = new htmlGroup();
$labelGroup->addElement(new htmlOutputText($this->label)); $labelGroup->addElement(new htmlOutputText($this->label));
if ($this->required) { if ($this->required) {
$graphicsPath = "../../graphics"; $labelGroup->addElement(htmlGetRequiredMarkerElement());
if (is_dir("../graphics")) {
$graphicsPath = "../graphics";
}
$labelGroup->addElement(new htmlImage($graphicsPath . '/required.png', 16, 16, _('required'), _('required')));
} }
if (!empty($this->helpID)) { if (!empty($this->helpID)) {
$helpLinkLabel = new htmlHelpLink($this->helpID, $this->helpModule); $helpLinkLabel = new htmlHelpLink($this->helpID, $this->helpModule);
@ -4561,9 +4586,7 @@ class htmlResponsiveInputFileUpload extends htmlInputFileUpload {
$labelGroup = new htmlGroup(); $labelGroup = new htmlGroup();
$labelGroup->addElement(new htmlOutputText($this->label)); $labelGroup->addElement(new htmlOutputText($this->label));
if ($this->required) { if ($this->required) {
$graphicsPath = "../../graphics"; $labelGroup->addElement(htmlGetRequiredMarkerElement());
if (is_dir("../graphics")) $graphicsPath = "../graphics";
$labelGroup->addElement(new htmlImage($graphicsPath . '/required.png', 16, 16, _('required'), _('required')));
} }
if (!empty($this->helpID)) { if (!empty($this->helpID)) {
$helpLinkLabel = new htmlHelpLink($this->helpID, $this->helpModule); $helpLinkLabel = new htmlHelpLink($this->helpID, $this->helpModule);
@ -4648,9 +4671,7 @@ class htmlResponsiveInputTextarea extends htmlInputTextarea {
$labelGroup = new htmlGroup(); $labelGroup = new htmlGroup();
$labelGroup->addElement(new htmlOutputText($this->label)); $labelGroup->addElement(new htmlOutputText($this->label));
if ($this->required) { if ($this->required) {
$graphicsPath = "../../graphics"; $labelGroup->addElement(htmlGetRequiredMarkerElement());
if (is_dir("../graphics")) $graphicsPath = "../graphics";
$labelGroup->addElement(new htmlImage($graphicsPath . '/required.png', 16, 16, _('required'), _('required')));
} }
if (!empty($this->helpID)) { if (!empty($this->helpID)) {
$helpLinkLabel = new htmlHelpLink($this->helpID, $this->helpModule); $helpLinkLabel = new htmlHelpLink($this->helpID, $this->helpModule);

View file

@ -341,6 +341,12 @@ table.accountlist > tbody > tr:hover {
vertical-align: unset; vertical-align: unset;
} }
span.lam-required {
font-weight: bold;
color: #ff9933;
margin-left: 0.2rem;
}
/* table preferences */ /* table preferences */
table.accountlist thead { table.accountlist thead {