protected function compile()
 {
     $this->loadLanguageFile('tl_calendar_events');
     $objEvents = \HeimrichHannot\CalendarPlus\CalendarPlusEventsModel::findAll(array('order' => 'startDate DESC'));
     // HOOK: modify event objects for the chooser
     if (isset($GLOBALS['TL_HOOKS']['getEventObjectsForChooser']) && is_array($GLOBALS['TL_HOOKS']['getEventObjectsForChooser'])) {
         foreach ($GLOBALS['TL_HOOKS']['getEventObjectsForChooser'] as $callback) {
             $this->import($callback[0]);
             $this->{$callback}[0]->{$callback}[1]($objEvents);
         }
     }
     $items = array();
     if ($objEvents !== null) {
         while ($objEvents->next()) {
             $items[$objEvents->id] = array('title' => $objEvents->shortTitle ? $objEvents->shortTitle : $objEvents->title, 'date' => date('d.m.Y', $objEvents->startDate));
         }
     }
     // HOOK: modify event items for the chooser
     if (isset($GLOBALS['TL_HOOKS']['getEventItemsForChooser']) && is_array($GLOBALS['TL_HOOKS']['getEventItemsForChooser'])) {
         foreach ($GLOBALS['TL_HOOKS']['getEventItemsForChooser'] as $callback) {
             $this->import($callback[0]);
             $this->{$callback}[0]->{$callback}[1]($objEvents, $items);
         }
     }
     $this->Template->items = $items;
     if ($this->jumpTo) {
         $this->Template->action = $this->generateFrontendUrl($this->jumpTo);
     } else {
         $this->Template->action = '';
     }
 }