This commit is contained in:
2026-06-07 12:37:32 -04:00
parent e457889812
commit 9ec04c9879

View File

@@ -81,11 +81,6 @@ class CivicNav {
private function resolve_slug() { private function resolve_slug() {
$module = \App::$module ?? ''; $module = \App::$module ?? '';
// On addon module pages (vs01, dsc01, scn01): slug is argv(1).
if (in_array($module, ['vs01', 'dsc01', 'scn01'], true)) {
return \argv(1) ?? '';
}
// On the channel page: slug is the local part of channel_address. // On the channel page: slug is the local part of channel_address.
if ($module === 'channel') { if ($module === 'channel') {
$addr = \App::$profile['channel_address'] ?? ''; $addr = \App::$profile['channel_address'] ?? '';
@@ -93,6 +88,16 @@ class CivicNav {
// channel_address may be bare (kingsrow-wdca) or full (kingsrow-wdca@node). // channel_address may be bare (kingsrow-wdca) or full (kingsrow-wdca@node).
return explode('@', $addr)[0]; return explode('@', $addr)[0];
} }
return '';
}
// On any registered addon module page: slug is argv(1).
// Module list is driven by the civicnav registry — no hardcoded names.
$addons = $this->load_registry();
foreach ($addons as $addon) {
if (($addon['module'] ?? '') === $module) {
return \argv(1) ?? '';
}
} }
return ''; return '';