src/Controller/VideoController.php line 505

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\ClassTheatre\asides;
  4. use App\ClassTheatre\TheatreController;
  5. use App\Service\Abonnements\Abonnements;
  6. use App\Service\Functions;
  7. use Doctrine\ORM\EntityManagerInterface;
  8. use Symfony\Component\HttpFoundation\Request;
  9. use Symfony\Component\Routing\Annotation\Route;
  10. use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
  11. use Symfony\Contracts\Translation\TranslatorInterface;
  12. use TheatreCore\Entity\BookmarkExtranetuser;
  13. use TheatreCore\Entity\Commandes;
  14. use TheatreCore\Entity\Contacts;
  15. use TheatreCore\Entity\Contents;
  16. use TheatreCore\Entity\Dvds;
  17. use TheatreCore\Entity\Extranetusers;
  18. use TheatreCore\Entity\MultimediaDownload;
  19. use TheatreCore\Entity\MultimediaExtranetuser;
  20. use TheatreCore\Entity\Multimedias;
  21. use TheatreCore\Entity\UserAction;
  22. class VideoController extends TheatreController
  23. {
  24.     protected $serviceAbonnements;
  25.     protected $request;
  26.     // {{{ _construct()
  27.     /** constructeur hérité
  28.      *
  29.      */
  30.     public function __construct(EntityManagerInterface $emTranslatorInterface $translatorTokenStorageInterface $tokenStorageFunctions $funcAbonnements $abonnements)
  31.     {
  32.         // load new aside
  33.         $this->asides = new asides();
  34.         $GLOBALS['rub_courante'] = 'video';
  35.         $this->em $em;
  36.         $this->func $func;
  37.         $this->serviceAbonnements $abonnements;
  38.         // hérite du constructeur parent
  39.         parent::__construct($translator$tokenStorage);
  40.     }
  41.     public function InitController($slug null$action null)
  42.     {
  43.         $this->context['action'] = $action;
  44.         $this->RouterOptions($slug$action$GLOBALS['rub_courante']);
  45.         $this->view->controller $GLOBALS['rub_courante'];
  46.     }
  47.     /**
  48.      * @Route("/video/{slug}", name="video_slug")
  49.      */
  50.     public function action_view(Request $request$slug nullSpectacleController $spectacleController)
  51.     {
  52.         $this->request $request;
  53.         $this->InitController($slug'view');
  54.         $idmultimedia $this->id;
  55.         if (! $idmultimedia) {
  56.             return $this->redirectToRoute('erreur_type', ['type' => 'introuvable']);
  57.         }
  58.         $multimedias $this->em->getRepository(Multimedias::class);
  59.         // pas de cache
  60.         $multimedias->setParameters(array('nocache' => date('YmdHis')));
  61.         // video
  62.         $video $multimedias->getInfosMultimedia($idmultimediafalsefalse, array('tableau' => true));
  63.         // video non publiée ??
  64.         if (! $video['publish']) {
  65.             // si pas authentifie, on redirige sur la page de connexion
  66.             if (!$this->context['session'] instanceof Extranetusers) {
  67.                 return $this->redirectToRoute('app_login', ['urifrom' => '/video/' $video['url_clean']]);
  68.             }
  69.             $idextranetuser $this->getUser()->getIdextranetuser();
  70.             if ($this->isGranted('ROLE_ISROOT') === false) {
  71.                 if ($video['idextranetuser'] != $idextranetuser && !$this->em->getRepository(MultimediaExtranetuser::class)->isAuthorized($idmultimedia$idextranetuser)) {
  72.                     return $this->redirectToRoute('erreur_type', ['type' => 'non-accessible']);
  73.                 }
  74.             }
  75.             $this->view->unpublished_video true;
  76.         }
  77.         // voir si l'utilisateur est dans les utilisateurs autorisés pour un des contacts/partenaires
  78.         if ($this->isGranted('ROLE_ISROOT')) {
  79.             $this->context['view']->is_contact_user true;
  80.         } elseif (!empty($video['partenaires'])) {
  81.             foreach ($video['partenaires'] as $k => $v) {
  82.                 // controlleur pour l'edition
  83. //                $edit_utils = new Utils_edit($this->context,array(
  84. //                    'object' => 'contacts',
  85. //                    'idobject' => $v['idcontact'],
  86. //                ));
  87. //
  88. //                // les droits
  89. //                $object_rights = $edit_utils->checkObjectRights();
  90. //                if(!empty($object_rights['select'])) {
  91. //                    $this->context['view']->is_contact_user = true;
  92. //                    break;
  93. //                }
  94.             }
  95.         }
  96.         // si c'est une vidéo en accès restreint
  97.         // si pas authentifie, on redirige sur la page de connexion
  98.         if (!empty($video['status']) && $video['status'] == 4) {
  99.             if (!$this->isGranted('ROLE_ISROOT')) {
  100.                 return $this->redirectToRoute('app_login', ['urifrom' => '/video/' $video['url_clean'], 'entete_connexion' => 'video']);
  101.             } else {
  102.                 // marquer la vue dans user_action
  103.                 $this->em->getRepository(UserAction::class)->setAction('multimedias'$idmultimedia'view'$this->getUser()->getIdextranetuser());
  104.             }
  105.             // si VOD, on vérifie que la personne est encore le droit de visionner
  106.         } elseif (!empty($video['status']) && $video['status'] == 5) {
  107.             $commandes $this->em->getRepository(Commandes::class);
  108.             $this->view->vod true;
  109.             // si pas logué => message classique avec prix ect...
  110.             if (!$this->isGranted('ROLE_ISROOT')) {
  111.                 // au cas ou le prix est vide
  112.                 if (empty($video['price'])) {
  113.                     $this->view->vod false;
  114.                 }
  115.             } elseif ($commandes->isExists('multimedias'$idmultimedia$this->getUser()->getIdextranetUser())) {
  116.                 // récupèrer les infos sur la commande
  117.                 $this->view->vod_status $commandes->getInfosCommande(null, array(
  118.                     'object' => 'multimedias',
  119.                     'idobject' => $idmultimedia,
  120.                     'idextranetuser' => $this->getUser()->getIdextranetuser()
  121.                 ));
  122.             }
  123.         }
  124.         // calcul de la hauteur de la vidéo pour une argeur de 560
  125.         $width_video 560;
  126.         $height_video round(($width_video $video['flv_height']) / $video['flv_width']);
  127.         $multimedias->setDimensions(array('width' => $width_video'height' => $height_video));
  128.         // paramètre pour les stats
  129.         $multimedias->setStatsParameters();
  130.         // récupération du player
  131.         $video['player'] = $multimedias->getPlayer($video);
  132.         // trouver si il faut afficher en 16/9 ou en 4/3 (560x440)
  133.         // si policy_access == 1
  134.         if ($video['status'] == 1) {
  135.             // calculer la hauteur à partir de la largeur
  136.             $width_video_embed 480;
  137.             $height_video_embed round(($width_video_embed $video['flv_height'] / $video['flv_width']));
  138.             if (!empty($video['embed'])) {
  139.                 $video['embed'] = str_replace(480$width_video_embed$video['embed']);
  140.                 $video['embed'] = str_replace(405$height_video_embed$video['embed']);
  141.     
  142.                 // suppression paramètres stats et autres dans la version embed
  143.                 $video['embed'] = preg_replace('#(/video/swf/[a-z0-9]+)%3F[^"]*"#i''\1"'$video['embed']);
  144.             }
  145.         } else {
  146.             unset($video['embed']);
  147.         }
  148.         //$this->context['view']->new_player = true;
  149.         // chercher s'il y a des Dvds
  150.         $dvds $this->em->getRepository(Dvds::class);
  151.         $this->view->list_dvds $dvds->getListDvds(
  152.             array(
  153.                 'special' => array(
  154.                     'idmultimedias' => array($idmultimedia)
  155.                 )
  156.             )
  157.         );
  158.         // créer la vignette static sans fleche de 140x120 si elle n'existe pas
  159.         if (!empty($video['image_media']) &&
  160.             (!empty($video['audio_video']) && $video['audio_video'] == 2)) {
  161.             $static_thumbnail $multimedias->getStaticThumbnail($idmultimedia$video['code']);
  162.             $video['static_thumbnail'] = $static_thumbnail;
  163.         }
  164.         // partage
  165.         $video['share'] = true;
  166.         //nombre de multimedia à 0 par defaut
  167.         $this->context['view']->nb_multimedias 0;
  168.         // partenaires de la vidéo
  169.         if (!empty($video['partenaires'])) {
  170.             foreach ($video['partenaires'] as $k => $v) {
  171.                 // tester si il y a une image de profile
  172.                 if (count($video['partenaires']) == 1) {
  173.                     $profilepicture $this->em->getRepository(Contacts::class)->getVignetteContact($v['idcontact'], array('width' => 40'height' => 40), 'class_pp');
  174.                     if (strpos($profilepicture'normal-def') === false) {
  175.                         $this->view->profilepicture $profilepicture;
  176.                     }
  177.                 }
  178.                 //on récupère le nombre de vidéo par contact
  179.                 $this->view->contact $v;
  180.                 // trouver les videos de ce contact
  181.                 $sql_all_videos 'SELECT COUNT(DISTINCT om.idmultimedia)
  182.                 FROM object_multimedia om, multimedias m
  183.                 WHERE om.idmultimedia=m.idmultimedia
  184.                 AND m.audio_video=2
  185.                 AND m.publish=1
  186.                 AND om.idobject=' $this->view->contact['idcontact'] . '
  187.                 AND om.object=\'contacts\' ';
  188.                 $nb_multimedias $multimedias->queryOne($sql_all_videos);
  189.                 if ($nb_multimedias 1) {
  190.                     $this->context['view']->nb_multimedias += $nb_multimedias;
  191.                     $video['partenaires'][$k]['nb_multimedias'] = $nb_multimedias;
  192.                 }
  193.                 //unset($video['partenaires']);
  194.             }
  195.         }
  196.         if (empty($this->context['view']->no_partenaires_top)) {
  197.             $this->context['view']->partenaires_top true;
  198.         }
  199.         // meta keywords et description
  200.         if (empty($meta_keywords)) $meta_keywords '';
  201.         // ajout des noms des auteurs et metteurs en scène aux keywords
  202.         foreach (array('authors''directors') as $field) {
  203.             if (!empty($video[$field])) {
  204.                 // ajout des auteurs aux keywords
  205.                 foreach ($video[$field] as $k => $v) {
  206.                     $meta_keywords .= ' ' $v['lastname'];
  207.                 }
  208.             }
  209.         }
  210.         // ajout du lieu aux keywords
  211.         if (!empty($video['lieu'])) $meta_keywords .= ' ' $video['lieu'];
  212.         // ajout des titres de spectacles aux keywords
  213.         if (!empty($video['spectacles'])) {
  214.             foreach ($video['spectacles'] as $k => $v) {
  215.                 $meta_keywords .= ' ' $v['title'];
  216.             }
  217.         }
  218.         //description
  219.         $meta_description '';
  220.         $video['description'] = $this->em->getRepository(Contents::class)->wikiTransform($video['description']);
  221.         $this->func->makeMetaFromHtml($video['description'], $meta_description$meta_keywords);
  222.         function isSecure()
  223.         {
  224.             return
  225.                 (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')
  226.                 || $_SERVER['SERVER_PORT'] == 443;
  227.         }
  228.         if (isSecure()) {
  229.             $video['player'] = str_replace('http://''https://'$video['player']);
  230.         }
  231.         // couper la description
  232.         $taille_description 200;
  233.         if (mb_strlen($video['description'], 'UTF-8') > $taille_description) {
  234.             $video['description_courte'] = $multimedias->cutSentence(html_entity_decode($video['description'], ENT_QUOTES'UTF-8'), $taille_descriptiontrue);
  235.             $video['cut_description'] = true;
  236.         }
  237.         if (!empty($video['mediatype'])) {
  238.             $video['typemultimedia'] = $multimedias->getTypeMultimediaLabel($video['mediatype']);
  239.         }
  240.         $video['langue'] = $multimedias->getNameLanguage($video['language']);
  241.         if (!empty($video['audioVideo']) && $video['audioVideo'] == 1) {
  242.             $video['only_sound'] = true;
  243.         }
  244.         // l'url encodé pour le qr code
  245.         $video['url_clean_encode'] = urlencode($_ENV['URL_THTV'] . '/video/' $video['url_clean']);
  246.         // code qr démandé ?
  247.         if (isset($_GET['qrcode'])) {
  248.             $this->view->qrcode true;
  249.         }
  250.         // com démandé ?
  251.         if (isset($_GET['comment'])) {
  252.             $this->view->comment true;
  253.         }
  254.         // format json pour iphoque
  255.         if (isset($params) && array_key_exists('json'$params)) {
  256.             // vignette
  257.             $json_thumbnail $multimedias->getStaticThumbnail($idmultimedia$video['code'], 110);
  258.             $video['vignette'] = $json_thumbnail;
  259.             // string spéaré par des virgules pour authors, directors, actors, spectacles
  260.             foreach (array('authors''directors''actors''spectacles''texts') as $f) {
  261.                 $string_format null;
  262.                 $fullname = array();
  263.                 if (!empty($video[$f])) {
  264.                     if ($f != 'spectacles') {
  265.                         foreach ($video[$f] as $k => $v) {
  266.                             $fullname[] = $video[$f][$k]['firstname'] . ' ' $video[$f][$k]['lastname'];
  267.                         }
  268.                     } else {
  269.                         foreach ($video[$f] as $k => $v) {
  270.                             $fullname[] = $video[$f][$k]['title'];
  271.                         }
  272.                     }
  273.                     $string_format join(', '$fullname);
  274.                     $video[$f '_string'] = $string_format;
  275.                 }
  276.             }
  277.             $this->context['action'] = 'json';
  278.             //$this->view->video = json_encode($video);
  279.             $ajaxreponse true;
  280.             //header('Content-Type: application/xml');
  281.             $json true;
  282.         } else {
  283.             $this->view->video $video;
  284.         }
  285.         // ajout meta oembed
  286.         $this->context['view']->meta_fb[] = array(
  287.             'rel' => 'alternate',
  288.             'type' => 'application/json+oembed',
  289. //            'href' => URL_THTV.'/oembed?url='.urlencode($video['permalink']),
  290.             'title' => $video['sujet_titre'] . ' oEmbed Profile',
  291.         );
  292.         $this->context['view']->meta_fb[] = array(
  293.             'rel' => 'alternate',
  294.             'type' => 'text/xml+oembed',
  295. //            'href' => URL_THTV.'/oembed?url='.urlencode($video['permalink']).'&format=xml',
  296.             'title' => $video['sujet_titre'] . ' oEmbed Profile',
  297.         );
  298.         // version mobile
  299.         if (isset($_GET['mobile'])) {
  300.             $this->context['action'] = 'mobile_' $this->context['action'];
  301.         }
  302.         /*print_r($this->view->video);
  303.         exit;*/
  304.         // paramètres pour les coms
  305.         $params_comments = array(
  306.             'url_clean' => '/video/' $video['url_clean'],
  307.             'url_clean_rss' => '/video/' $video['url_clean'] . '?rss-commentaires',
  308.             'object' => 'multimedias',
  309.             'idobject' => $idmultimedia,
  310.             //'nb_comments' => $nb_comments,
  311.         );
  312.         // réponse rest
  313.         if (isset($params) && array_key_exists('xml'$params)) {
  314.             // authentifier le web service
  315.             $extranetusers $this->em->getRepository(Extranetusers::class);
  316.             // skin avignon
  317.             if (!empty($_GET['skin']) && $_GET['skin'] == 'avignon' && !empty($video['embed'])) {
  318.                 $this->view->video['embed'] = preg_replace('#(/video/swf/[a-z0-9]+)]*"#i''\1' urlencode('?skin=avignon') . '"'$video['embed']);
  319.                 $this->view->skin_avignon true;
  320.             }
  321.             // cle et nom de domaine source (client IP ?)
  322.             if (!empty($params['k'])) {
  323.                 if (!$extranetusers->checkAPIKey($params['k'])) {
  324.                     $this->view->api_key_error true;
  325.                 }
  326.             } else {
  327.                 $this->view->api_key_error true;
  328.             }
  329.             $this->context['action'] = 'xml';
  330.             $ajaxreponse true;
  331.             header('Content-Type: application/xml');
  332.         }
  333.         if (empty($title_page)) {
  334.             $title_page $video['sujet_titre'];
  335.         }
  336.         // vidéos en relation
  337.         if (empty($no_related_video)) {
  338.             $liste_related_videos $multimedias->getAssociateMultimedias($idmultimedia6'AND m.mp3=0');
  339.             if (!empty($liste_related_videos)) {
  340.                 // trouver les videos en fonction du type
  341.                 $sql 'SELECT * FROM ' $multimedias->__table '
  342.                 WHERE idmultimedia IN (' implode(','$liste_related_videos) . ')';
  343.                 //echo $sql;
  344.                 $multimedias->query($sql);
  345.                 $set_format = (array('width' => 130'height' => 110'direction' => 'crop''fleche' => 'moyen'));
  346.                 while ($multimedias->fetch()) {
  347.                     $idm $multimedias->idmultimedia;
  348.                     $videos[$idm] = $multimedias->getInfosMultimedia($idmfalsefalse, array('vignette' => $set_format'tableau' => true));
  349.                     $videos[$idm]['description_courte'] = $multimedias->cutSentence($videos[$idm]['description'], 100);
  350.                 }
  351.                 $this->view->videos $videos;
  352.                 $this->view->first_spectacles true;
  353.                 if (!empty($json)) {
  354.                     $video['related'] = $videos;
  355.                 }
  356.             }
  357.         }
  358.         // demande le squelette ajax
  359.         if (isset($_GET['fjs'])) {
  360.             // template
  361.             $this->context['action'] = 'simple';
  362.             // pas de com et de related
  363.             $this->view->no_apropos true;
  364.             $this->view->no_com true;
  365.             $this->view->videos null;
  366.             // pas de tidy
  367.             $ajaxreponse true;
  368.         }
  369.         if (!empty($json)) {
  370.             $this->view->video json_encode($video);
  371.         }
  372.         // autres infos
  373.         $mtinfos = array('object' => 'multimedias''idobject' => $idmultimedia'urifrom' => '/video/' $video['url_clean'], 'info_rub' => 'cette vidéo');
  374.         $this->view->mtinfos $mtinfos;
  375.         // voir si l'objet est bookmarke
  376.         if ($this->isGranted('ROLE_ISROOT')) {
  377.             $bookmark $this->em->getRepository(BookmarkExtranetuser::class);
  378.             if ($bookmark->isBookmark($idmultimedia'multimedias'$this->getUser()->getIdextranetuser())) {
  379.                 $this->view->is_bookmark true;
  380.             }
  381.         }
  382.         // meta
  383.         $this->view->meta_video true;
  384.         // action pour add/delete bookmark
  385.         if (isset($_GET['bookmark'])) {
  386.             $this->view->bookmark true;
  387.             $do_action $_GET['do_action'];
  388.             $this->view->$do_action true;
  389.             $this->view->fem 'e';
  390.         }
  391.         //setDebug($this->view->video);
  392.         if (empty($this->view->urifrom_connect)) {
  393.             $this->view->urifrom_connect '/video/' $video['url_clean'];
  394.         }
  395.         // bouton de partage
  396.         $this->view->use_addthis true;
  397.         // infos barre d'admin
  398.         $mtinfos = array(
  399.             'object' => 'multimedias',
  400.             'idobject' => $idmultimedia,
  401.             'special_pattern' => 'admin_barre'
  402.         );
  403.         $this->video $video;
  404.         if (!empty($video['spectacles']) && count($video['spectacles']) == 1) {
  405.             $spectacleController->id key($video['spectacles']);
  406.             $spectacleController->InitController();
  407.             $spectacleController->getBuildMenu(['remove' => ['videos''evenements']]);
  408. //            $spectacleController->action_videos();
  409.             $this->view->menu_spectacle $spectacleController->view->menu_spectacle;
  410.             $x $this->view->data_spectacles $spectacleController->getDataSpectacles();
  411.         }
  412.         return $this->view('video/view.html.twig');
  413.     }
  414.     /**
  415.      * @Route("/video/{slug}/download/format/{p_format}", name="video_slug_download_format")
  416.      */
  417.     public function action_download(Request $request$slug null$p_format null)
  418.     {
  419.         $this->request $request;
  420.         $this->InitController($slug'view');
  421.         $params['format'] = $this->context['params']['format'] = $p_format;
  422.         $idmultimedia $this->id;
  423.         $multimedias $this->em->getRepository(Multimedias::class);
  424.         $video $multimedias->getInfosMultimedia($idmultimediafalsefalse, array('tableau' => true));
  425.         if (!$video) {
  426.             return $this->redirectToRoute('index');
  427.         }
  428.         $formats_disponibles = array('2160HD' => 'hd2160''1080HD' => 'hd1080''720HD' => 'hd720''Mobile' => 'h264m''240p' => 'h264');
  429.         if (!empty($params['format']) && array_key_exists($params['format'], $formats_disponibles)) {
  430.             $params_format $formats_disponibles[$params['format']];
  431.         } else {
  432.             return $this->redirectToRoute('video_slug', ['slug' => $video['url_clean'], 'erreur' => 'format']);
  433.         }
  434.         // pas de caches
  435.         $multimedias->setParameters(array('nocache' => date('YmdHis')));
  436.         // retrouver l'abonnement de l'utilisateur
  437.         $this->view->abonnement $this->abonnementIsActive();
  438.         //Si l'abonneent de l'utilisateur est actif
  439.         if ($this->view->abonnement) {
  440.             $this->view->abonnement true;
  441.             $values_download = array(
  442.                 'idmultimedia' => $video['idmultimedia'],
  443.                 'idextranetuser' => $this->getUser()->getIdextranetuser(), // date d'insertion,
  444.                 'format' => $params_format
  445.             );
  446.             //On mets à jours les stats
  447.             $multimedia_download $this->em->getRepository(MultimediaDownload::class);
  448.             // preparer les champs
  449.             $multimedia_download->setUpdateFields($values_download);
  450.             $res $multimedia_download->setData(nulltrue);
  451.             //Si la vidéo est sous licence etalab
  452.             if (!empty($video['etalab']) && $video['etalab']) {
  453.                 $path_to_somefile $video['formats'][$params_format]['medialocalpath'];
  454.                 $somefile "video-" uniqid() . "-" $params_format ".mp4";
  455.                 header("X-Sendfile: $path_to_somefile");
  456.                 header("Content-Type: application/octet-stream");
  457.                 header("Content-Disposition: attachment; filename=\"$somefile\"");
  458.             } // Erreur
  459.             else {
  460.                 return $this->redirectToRoute('video_slug', ['slug' => $video['url_clean'], 'erreur' => 'etalab']);
  461.             }
  462.         } else {
  463.             return $this->redirectToRoute('video_slug', ['slug' => $video['url_clean'], 'erreur' => 'abonnement']);
  464.         }
  465.     }
  466.     public function finalizeAction()
  467.     {
  468.         if (!empty($_REQUEST['erreur'])) {
  469.             //    $this->view->erreur_etalab = true;
  470.             if ($_REQUEST['erreur'] == 'etalab') {
  471.                 $this->view->erreur['etalab'] = true;
  472.             } else if ($_REQUEST['erreur'] == 'format') {
  473.                 $this->view->erreur['format'] = true;
  474.             } else if ($_REQUEST['erreur'] == 'abonnement') {
  475.                 $this->view->erreur['abonnement'] = true;
  476.             }
  477.         }
  478.         if (!empty($_REQUEST['d'])) {
  479.             $this->view->download_ok true;
  480.         }
  481.         // retrouver l'abonnement de l'utilisateur
  482.         $this->view->abonnement $this->abonnementIsActive();
  483.         // $('url_clean'($video);
  484.         if (isset($this->video)) {
  485.             $this->request->getSession()->set('currentVideo'md5($this->video['idmultimedia']));
  486.         }
  487.         $locate = array(=> 'Video');
  488.         $title_page $this->video['sujet_titre'];
  489.         $rub_courante 'videos';
  490.         $menu = array(
  491.             array(
  492.                 'name' => 'Mes videos favorites',
  493.                 'key_sub' => 'videos',
  494.             ),
  495.             array(
  496.                 'name' => 'Mes videos modifiables',
  497.                 'key_sub' => 'mesvideos',
  498.             ),
  499.         );
  500.         $asides = new asides();
  501.         $asides->load('ajoutez_MT.inc');
  502.         $asides->load(['url_lists_alone' => array(
  503.             'exec' => ['color' => 'index'],
  504.             'php' => [
  505.                 'method' => 'asidesUrlLists',
  506.                 'urls' => $menu,
  507.                 'url' => '/montheatre/key_sub'
  508.             ],
  509.             'title' => 'Mon théâtre'
  510.         )]);
  511.         $asides->load('videos_suggestions');
  512.         $this->context['view']->aside $asides->view();
  513.         asides::setEntityManager($this->em);
  514.         //On affiche la publicité google
  515.         $asides_publicite = new asides();
  516.         asides::loadaside('Publicite')->addGoogle($asides_publicite$this->serviceAbonnements);
  517.         $this->context['view']->asides_publicite $asides_publicite->view($this->context['view']);
  518.         $asides_publicite = new asides();
  519.         asides::loadaside('Publicite')->addGoogleCorrespondantImageVideo($asides_publicite$this->serviceAbonnements);
  520.         $this->context['view']->asides_publicite_footer $asides_publicite->view($this->context['view']);
  521.     }
  522. }