/** * Method to refresh Group Calendar */ private function refreshCalendar() { //get the passed in event id $calendarId = Request::getVar('calendar_id', ''); // get the calendar $calendar = \Components\Events\Models\Calendar::getInstance($calendarId); // refresh Calendar (force refresh even if we dont need to yet) if (!$calendar->refresh(true)) { $this->setError(Lang::txt('Unable to sync the group calendar "%s". Please verify the calendar subscription URL is valid.', $calendar->getError())); return $this->calendars(); } //inform and redirect App::redirect(Route::url('index.php?option=' . $this->option . '&cn=' . $this->group->get('cn') . '&active=calendar&action=calendars'), Lang::txt('You have successfully refreshed the calendar.'), 'passed'); }
/** * Returns calendar for event * * @return object */ public function calendar() { return Calendar::getInstance($this->get('calendar_id')); }