src/CoreBundle/Contao/Hooks/RegisterBackendNavigation.php
private function addMenu(&$modules, $section, $name, $module, Request $request)
    {
        if (!isset($modules[$section])) {
            $modules[$section] = $this->buildBackendMenuSection($section, $request);
        }

        $active = $this->isActive($module['route'], $module['param'], $request);
        $class  = 'navigation ' . $name;
        if (isset($module['class'])) {
            $class .= ' ' . $module['class'];
        }
        if ($active) {
            $class .= ' active';
        }
        if ($request->query->has('ref')) {
            $module['param']['ref'] = $request->query->get('ref');
        }

        $modules[$section]['modules'][$name] = [
            'label'    => $module['label'],
            'title'    => $module['title'],
            'class'    => $class,
            'isActive' => $active,
            'href'     => $this->urlGenerator->generate($module['route'], $module['param']),
        ];
    }
private function addMenu(&$modules, $section, $name, $module, Request $request)
    {
        if (!isset($modules[$section])) {
            $modules[$section] = $this->buildBackendMenuSection($section, $request);
        }

        $active = $this->isActive($module['route'], $module['param'], $request);
        $class  = 'navigation ' . $name;
        if (isset($module['class'])) {
            $class .= ' ' . $module['class'];
        }
        if ($active) {
            $class .= ' active';
        }
        if ($request->query->has('ref')) {
            $module['param']['ref'] = $request->query->get('ref');
        }

        $modules[$section]['modules'][$name] = [
            'label'    => $module['label'],
            'title'    => $module['title'],
            'class'    => $class,
            'isActive' => $active,
            'href'     => $this->urlGenerator->generate($module['route'], $module['param']),
        ];
    }
Add a module to the modules list.

@param array   $modules The modules list.
@param string  $section The section to add to.
@param string  $name    The name of the module.
@param array   $module  The module.
@param Request $request The current request.

@return void