src/Controller/HelpTextController.php
public function adminHelpAction(Request $request, $adminCode, $action = '')
    {
        $parameters = ['adminCode' => $adminCode, 'action' => $action];
        $defaultAdminCode = ['dashboard', 'overview'];

        if ($action == '') {
            $translationKey = $adminCode;
        } else {
            $translationKey = $adminCode.'.'.$action;
        }

        $helpTextManager = $this->get('networking_init_cms.help_text_manager');
        $helpText = $helpTextManager->getHelpTextByKeyLocale($translationKey, $request->getLocale());

        $parameters['help_text'] = $helpText;
        if (!in_array($adminCode, $defaultAdminCode)) {
            $admin = $this->container->get('sonata.admin.pool')->getAdminByAdminCode($adminCode);
            $admin->setRequest($request);
            $parameters['admin'] = $admin;
        }

        /** @var \Networking\InitCmsBundle\Admin\Pool $pool */
        $pool = $this->get('sonata.admin.pool');
        $parameters['admin_pool'] = $pool;
        $parameters['base_template'] = isset($admin) ? $this->getBaseTemplate($request, $admin) : '@NetworkingInitCms/admin_layout.html.twig';
        $dashBoardGroups = $pool->getDashboardNavigationGroups();

        $parameters['help_nav'] = $this->adminGetHelpTextNavigation(
            $dashBoardGroups,
            $request->getLocale(),
            $helpTextManager
        );

        return $this->render(
            '@NetworkingInitCms/HelpText/adminHelp.html.twig',
            $parameters
        );
    }
public function adminHelpAction(Request $request, $adminCode, $action = '')
    {
        $parameters = ['adminCode' => $adminCode, 'action' => $action];
        $defaultAdminCode = ['dashboard', 'overview'];

        if ($action == '') {
            $translationKey = $adminCode;
        } else {
            $translationKey = $adminCode.'.'.$action;
        }

        $helpTextManager = $this->get('networking_init_cms.help_text_manager');
        $helpText = $helpTextManager->getHelpTextByKeyLocale($translationKey, $request->getLocale());

        $parameters['help_text'] = $helpText;
        if (!in_array($adminCode, $defaultAdminCode)) {
            $admin = $this->container->get('sonata.admin.pool')->getAdminByAdminCode($adminCode);
            $admin->setRequest($request);
            $parameters['admin'] = $admin;
        }

        /** @var \Networking\InitCmsBundle\Admin\Pool $pool */
        $pool = $this->get('sonata.admin.pool');
        $parameters['admin_pool'] = $pool;
        $parameters['base_template'] = isset($admin) ? $this->getBaseTemplate($request, $admin) : '@NetworkingInitCms/admin_layout.html.twig';
        $dashBoardGroups = $pool->getDashboardNavigationGroups();

        $parameters['help_nav'] = $this->adminGetHelpTextNavigation(
            $dashBoardGroups,
            $request->getLocale(),
            $helpTextManager
        );

        return $this->render(
            '@NetworkingInitCms/HelpText/adminHelp.html.twig',
            $parameters
        );
    }
public function adminHelpAction ( Request $ request , $ adminCode , $ action = '' ) { $ parameters = [ 'adminCode' => $ adminCode , 'action' => $ action ] ; $ defaultAdminCode = [ 'dashboard' , 'overview' ] ; if ( $ action == '' ) { $ translationKey = $ adminCode ; } else { $ translationKey = $ adminCode . '.' . $ action ; } $ helpTextManager = $ this -> get ( 'networking_init_cms.help_text_manager' ) ; $ helpText = $ helpTextManager -> getHelpTextByKeyLocale ( $ translationKey , $ request -> getLocale ( ) ) ; $ parameters [ 'help_text' ] = $ helpText ; if ( ! in_array ( $ adminCode , $ defaultAdminCode ) ) { $ admin = $ this -> container -> get ( 'sonata.admin.pool' ) -> getAdminByAdminCode ( $ adminCode ) ; $ admin -> setRequest ( $ request ) ; $ parameters [ 'admin' ] = $ admin ; } /** @var \Networking\InitCmsBundle\Admin\Pool $pool */ $ pool = $ this -> get ( 'sonata.admin.pool' ) ; $ parameters [ 'admin_pool' ] = $ pool ; $ parameters [ 'base_template' ] = isset ( $ admin ) ? $ this -> getBaseTemplate ( $ request , $ admin ) : '@NetworkingInitCms/admin_layout.html.twig' ; $ dashBoardGroups = $ pool -> getDashboardNavigationGroups ( ) ; $ parameters [ 'help_nav' ] = $ this -> adminGetHelpTextNavigation ( $ dashBoardGroups , $ request -> getLocale ( ) , $ helpTextManager ) ; return $ this -> render ( '@NetworkingInitCms/HelpText/adminHelp.html.twig' , $ parameters ) ; }
Help text page action.

@param Request $request
@param $adminCode
@param string $action

@return \Symfony\Component\HttpFoundation\Response
Help text page action .