Bugfix dashboard widget headers, partly revert and explain f67e242eaa. closes https://github.com/opnsense/core/issues/4795

This commit is contained in:
Ad Schellevis 2021-03-10 14:18:45 +01:00
parent e2fbc878f0
commit 534c6d62f9
2 changed files with 8 additions and 6 deletions

View File

@ -36,8 +36,9 @@
$widgettitlelink = $widgetItem['name'] . "_title_link";?>
<tr id="add_widget_<?=$widgetItem['name']; ?>">
<?php
if (isset($widgettitle)):?>
<td style="cursor: pointer;" onclick='return addWidget("<?=$widgetItem['name']; ?>")'><?=$widgettitle; ?></td>
// XXX: ${$} is intentional here, the widgets leave global vars [widget_name]_title_link and [widget_name]_title
if (isset(${$widgettitle})):?>
<td style="cursor: pointer;" onclick='return addWidget("<?=$widgetItem['name']; ?>")'><?=$$widgettitle; ?></td>
<?php
elseif (!empty($widgetItem['display_name'])): ?>
<td style="cursor: pointer;" onclick='return addWidget("<?=$widgetItem['name']; ?>")'><?=$widgetItem['display_name']; ?></td>

View File

@ -383,12 +383,13 @@ include("fbegin.inc");?>
<ul class="list-inline __nomb">
<li><h3>
<?php
if (isset($widgettitlelink)):?>
<u><span onclick="location.href='/<?= $widgettitlelink ?>'" style="cursor:pointer">
// XXX: ${$} is intentional here, the widgets leave global vars [widget_name]_title_link and [widget_name]_title
if (isset($$widgettitlelink)):?>
<u><span onclick="location.href='/<?= ${$widgettitlelink} ?>'" style="cursor:pointer">
<?php
endif;
echo empty($widgettitle) ? $widgetItem['display_name'] : $widgettitle;
if (isset($widgettitlelink)):?>
echo empty($$widgettitle) ? $widgetItem['display_name'] : ${$widgettitle};
if (isset(${$widgettitlelink})):?>
</span></u>
<?php
endif;?>