function index(Application $app)
 {
     $params = new EventFilterParams();
     $params->set($_GET);
     $params->getEventRepositoryBuilder()->setSite($app['currentSite']);
     $params->getEventRepositoryBuilder()->setIncludeAreaInformation(true);
     $params->getEventRepositoryBuilder()->setIncludeVenueInformation(true);
     $params->getEventRepositoryBuilder()->setIncludeMediasSlugs(true);
     if ($app['currentUser']) {
         $params->getEventRepositoryBuilder()->setUserAccount($app['currentUser'], true);
     }
     $events = $params->getEventRepositoryBuilder()->fetchAll();
     return $app['twig']->render('site/eventlist/index.html.twig', array('eventListFilterParams' => $params, 'events' => $events));
 }
 function calendar($year, $month, Application $app)
 {
     $cal = new \RenderCalendar();
     $params = new EventFilterParams($cal->getEventRepositoryBuilder());
     $params->setHasDateControls(false);
     $params->setSpecifiedUserControls(true, $app['currentUser'], true);
     $params->set($_GET);
     $cal->byMonth($year, $month, true);
     list($prevYear, $prevMonth, $nextYear, $nextMonth) = $cal->getPrevNextLinksByMonth();
     return $app['twig']->render('/index/currentuser/calendar.html.twig', array('calendar' => $cal, 'eventListFilterParams' => $params, 'prevYear' => $prevYear, 'prevMonth' => $prevMonth, 'nextYear' => $nextYear, 'nextMonth' => $nextMonth, 'showCurrentUserOptions' => true));
 }