/** * Adds breadcrumbs dynamically based on current module, submodule and action. * This might look a bit rough to the user. * Please prefer adding breadcrumbs manually via add(). */ public static function addDynamicBreadcrumbs() { $moduleName = strtolower(TargetRoute::getModuleName()); $submoduleName = strtolower(TargetRoute::getSubModuleName()); $actionName = TargetRoute::getActionNameWithoutPrefix(); if (isset($moduleName) and $moduleName !== 'controlcenter') { $url = 'index.php?mod=' . $moduleName; // Level 2 if ($submoduleName !== '') { $url .= '&sub=' . $submoduleName; $moduleName .= ' ' . $submoduleName; } self::add($moduleName, $url); // Level 3 if ($actionName !== '') { $url .= '&action=' . $actionName; self::add($actionName, $url); } } }
/** * Adds breadcrumbs dynamically based on current module, submodule and action. * This might look a bit rough to the user. * Please prefer adding breadcrumbs manually via add(). */ public static function addDynamicBreadcrumbs() { $module = strtolower(TargetRoute::getModule()); $controller = strtolower(TargetRoute::getController()); $action = TargetRoute::getActionNameWithoutPrefix(); if (isset($module) and $module !== 'controlcenter') { $url = 'index.php?mod=' . $module; // Level 2 // do not add ctrl part, if controller and module are the same if ($controller !== '' and $controller !== $module) { $url .= '&ctrl=' . $controller; $module .= ' ' . $controller; } self::add($module, $url); // Level 3 if ($action !== '') { $url .= '&action=' . $action; self::add($action, $url); } } }