Updated
This commit is contained in:
@@ -81,11 +81,6 @@ class CivicNav {
|
||||
private function resolve_slug() {
|
||||
$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.
|
||||
if ($module === 'channel') {
|
||||
$addr = \App::$profile['channel_address'] ?? '';
|
||||
@@ -93,6 +88,16 @@ class CivicNav {
|
||||
// channel_address may be bare (kingsrow-wdca) or full (kingsrow-wdca@node).
|
||||
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 '';
|
||||
|
||||
Reference in New Issue
Block a user