/** * Prepare calendar appointments * * @access public * @param string mode UPDATE|CREATE|DELETE * @return */ public function prepareCalendarAppointments($a_mode = 'create') { include_once './Services/Calendar/classes/class.ilCalendarAppointmentTemplate.php'; switch ($a_mode) { case 'create': case 'update': $app = new ilCalendarAppointmentTemplate(self::CAL_REG_START); $app->setTranslationType(IL_CAL_TRANSLATION_NONE); $app->setTitle($this->getTitle() ? $this->getTitle() : $this->lng->txt('obj_sess')); $app->setDescription($this->getLongDescription()); $sess_app = $this->getFirstAppointment(); $app->setFullday($sess_app->isFullday()); $app->setStart($sess_app->getStart()); $app->setEnd($sess_app->getEnd()); $apps[] = $app; return $apps; case 'delete': // Nothing to do: The category and all assigned appointments will be deleted. return array(); } }