From 7fdd9bc5b2939d8b7487778474dea7ab51cd4c80 Mon Sep 17 00:00:00 2001 From: TheRON Date: Sun, 7 Jun 2026 08:26:34 -0400 Subject: [PATCH] Updated --- hubzilla/addon/vs01/vs01.php | 38 +++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/hubzilla/addon/vs01/vs01.php b/hubzilla/addon/vs01/vs01.php index 91c7fca..7776cfa 100644 --- a/hubzilla/addon/vs01/vs01.php +++ b/hubzilla/addon/vs01/vs01.php @@ -32,24 +32,34 @@ function vs01_load_pdl(&$b) { return; } - // On association channel pages: inject civicnav into right_aside. + // On association channel pages: read core mod_channel.pdl and inject + // civicnav widget as first widget in right_aside. if ($b['module'] === 'channel') { $addr = App::$profile['channel_address'] ?? ''; $slug = $addr ? explode('@', $addr)[0] : ''; - if ($slug) { - $raw = @file_get_contents('addon/vs01/config.json'); - if ($raw !== false) { - $cfg = json_decode($raw, true); - if (json_last_error() === JSON_ERROR_NONE && isset($cfg['associations'][$slug])) { - $b['layout'] = str_replace( - '[region=right_aside]', - '[region=right_aside]' . " -" . '[widget=civicnav][/widget]', - $b['layout'] ?? '' - ); - } - } + if (!$slug) return; + + $raw = @file_get_contents('addon/vs01/config.json'); + if ($raw === false) return; + $cfg = json_decode($raw, true); + if (json_last_error() !== JSON_ERROR_NONE) return; + if (!isset($cfg['associations'][$slug])) return; + + // Read core channel PDL. theme_include() checks theme overrides first, + // then falls back to view/pdl/. We mirror that lookup here. + $p = theme_include('mod_channel.pdl'); + $layout = $p ? @file_get_contents($p) : ''; + if (!$layout) { + $layout = @file_get_contents('view/pdl/mod_channel.pdl'); } + if (!$layout) return; + + // Inject civicnav as first widget in right_aside. + $b['layout'] = str_replace( + '[region=right_aside]', + '[region=right_aside]' . "\n" . '[widget=civicnav][/widget]', + $layout + ); return; }