diff --git a/css/common.css b/css/common.css index ba07e3f..bf7da83 100644 --- a/css/common.css +++ b/css/common.css @@ -214,6 +214,28 @@ color: black !important; } +/* Enabled/Disabled status pills on the Panel Library page */ +.intropage_status_pill { + display: inline-block; + min-width: 72px; + padding: 2px 10px; + border-radius: 10px; + font-size: 0.85em; + font-weight: bold; + line-height: 1.5; + text-align: center; +} + +.intropage_status_pill.enabled { + background: rgba(148,179,107,1); + color: #000; +} + +.intropage_status_pill.disabled { + background: #cc0000; + color: #fff; +} + #intropage_main .fa, #overlay .fa { padding-right: 3px; diff --git a/includes/functions.php b/includes/functions.php index 9947dd2..0e3bca0 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -2503,10 +2503,26 @@ function intropage_addpanel_select(int $dashboard_id): void { ON pda.id = pd.panel_id WHERE pd.user_id IN (0, ?) AND pd.dashboard_id = ? - ) - ORDER BY pd.name', + )', [$_SESSION['sess_user_id'], $dashboard_id]); + // Prefix each option label with the panel's source ("Core - " / + // " - "), matching the Panel Library list, and HTML-escape it once + // here so every option below (including the "(no permission)" entries) + // renders the plugin-derived name safely without re-escaping per branch. + // Then order by the prefixed label, rather than with ORDER BY pd.name, so + // the menu stays grouped by source and reads as sorted even though the + // displayed label no longer matches the unprefixed database name. + foreach ($add_panels as &$panel) { + $panel['name'] = html_escape(intropage_prefix_panel_name($panel['panel_id'], (string) $panel['name'])); + } + + unset($panel); + + usort($add_panels, function ($a, $b) { + return strnatcasecmp($a['name'], $b['name']); + }); + // display always, even if it is empty print "