src/Gh/FrontBundle/Controller/GuiController.php line 51

Open in your IDE?
  1. <?php
  2. namespace Gh\FrontBundle\Controller;
  3. use Gh\FrontBundle\Classes\Sidebar\SidebarClass,
  4.     Gh\FrontBundle\Classes\MenuActiveClass,
  5.     Gh\DatabaseBundle\Entity\GhMessages,
  6.     Symfony\Bundle\FrameworkBundle\Controller\Controller,
  7.     Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  8. /**
  9.  * In this controller, methods are created for the header and the footer.
  10.  * 
  11.  * @author jmboyer
  12.  */
  13. class GuiController extends Controller
  14. {
  15.     /**
  16.      * @param boolean $ad If true, the megaban is displayed.
  17.      * @param $targetPath string|null (for headerEmbeddedAction)
  18.      * @Template()
  19.      */
  20.     public function headerAction($ad$targetPath null) {
  21.         $search '';
  22.         
  23.         if (array_key_exists('queljeu'$_GET)) {
  24.             $search $_GET['queljeu'];
  25.         }
  26.         
  27.         $em $this->getDoctrine()->getManager();
  28.         
  29.         // Retrieve moment message (header and sidebar)
  30.         $momentMessage $em->getRepository('GhDatabaseBundle:GhMessages')->getMessage(GhMessages::MESSAGE_TYPE_HEADERtrue);
  31.         
  32.         // Retrieve message to be displayed in the nav
  33.         $navMessage $em->getRepository('GhDatabaseBundle:GhMessageNav')->getMessage();
  34.         
  35.         return array(
  36.             'search' => $search,
  37.             'ad' => $ad,
  38.             'targetPath' => $targetPath,
  39.             'momentMessage' => $momentMessage,
  40.             'navMessage' => $navMessage
  41.         );
  42.     }
  43.     
  44.     /**
  45.      * @param boolean $ad If true, the div are managed with megaban enabled.
  46.      * @Template()
  47.      */
  48.     public function footerAction($ad) {
  49.         return array(
  50.             'ad' => $ad
  51.             'isHomepage' => (MenuActiveClass::getInstance()->getMenuActive() == 'homepage')
  52.         );
  53.     }
  54.     
  55.     /**
  56.      * @Template()
  57.      */
  58.     public function sidebarAction() {
  59.         return array('sidebarList' => SidebarClass::getInstance()->getList());
  60.     }
  61. }