|
8 | 8 | * License: GNU/GPLv2 |
9 | 9 | * @see LICENSE.txt |
10 | 10 | * |
11 | | - * This file: Front-end handler (last modified: 2022.03.13). |
| 11 | + * This file: Front-end handler (last modified: 2022.03.17). |
12 | 12 | */ |
13 | 13 |
|
14 | 14 | namespace phpMussel\FrontEnd; |
@@ -1420,13 +1420,35 @@ public function view(string $Page = ''): void |
1420 | 1420 | $ThisDir['FieldOut'] .= '</small>'; |
1421 | 1421 | } |
1422 | 1422 |
|
| 1423 | + /** Provide hints, useful for users to better understand the directive at hand. */ |
| 1424 | + if (!empty($DirValue['hints'])) { |
| 1425 | + $ThisDir['Hints'] = $this->Loader->L10N->Data[$DirValue['hints']] ?? $DirValue['hints']; |
| 1426 | + if (!is_array($ThisDir['Hints'])) { |
| 1427 | + $ThisDir['Hints'] = [$ThisDir['Hints']]; |
| 1428 | + } |
| 1429 | + foreach ($ThisDir['Hints'] as $ThisDir['HintKey'] => $ThisDir['HintValue']) { |
| 1430 | + if (is_int($ThisDir['HintKey'])) { |
| 1431 | + $ThisDir['FieldOut'] .= sprintf("\n<br /><br />%s", $ThisDir['HintValue']); |
| 1432 | + continue; |
| 1433 | + } |
| 1434 | + $ThisDir['FieldOut'] .= sprintf( |
| 1435 | + "\n<br /><br /><span class=\"s\">%s</span> %s", |
| 1436 | + $ThisDir['HintKey'], |
| 1437 | + $ThisDir['HintValue'] |
| 1438 | + ); |
| 1439 | + } |
| 1440 | + } |
| 1441 | + |
| 1442 | + /** Provide additional information, useful for users to better understand the directive at hand. */ |
1423 | 1443 | if (!empty($DirValue['See also']) && is_array($DirValue['See also'])) { |
1424 | 1444 | $ThisDir['FieldOut'] .= sprintf("\n<br /><br />%s<ul>\n", $this->Loader->L10N->getString('label_see_also')); |
1425 | 1445 | foreach ($DirValue['See also'] as $RefKey => $RefLink) { |
1426 | 1446 | $ThisDir['FieldOut'] .= sprintf('<li><a dir="ltr" href="%s">%s</a></li>', $RefLink, $RefKey); |
1427 | 1447 | } |
1428 | 1448 | $ThisDir['FieldOut'] .= "\n</ul>"; |
1429 | 1449 | } |
| 1450 | + |
| 1451 | + /** Finalise configuration row. */ |
1430 | 1452 | $FE['ConfigFields'] .= $this->Loader->parse( |
1431 | 1453 | $this->Loader->L10N->Data, |
1432 | 1454 | $this->Loader->parse($ThisDir, $ConfigurationRow) |
|
0 commit comments