Ejemplo n.º 1
0
 protected function initFormCafe($parent, $a_create = true)
 {
     global $lng, $tpl;
     $lng->loadLanguageModule('dateplaner');
     $lng->loadLanguageModule('crs');
     $tpl->addJavaScript('./Services/Form/js/date_duration.js');
     include_once './Services/Form/classes/class.ilDateDurationInputGUI.php';
     $dur = new ilDateDurationInputGUI($lng->txt('cal_fullday'), 'cafe_time');
     if (!$a_create) {
         $dur->setDisabled(true);
     }
     $dur->setStartText($lng->txt('event_start_date'));
     $dur->setEndText($lng->txt('event_end_date'));
     $dur->setShowTime(false);
     $start = new ilDate(time(), IL_CAL_UNIX);
     $end = clone $start;
     $end->increment(IL_CAL_MONTH, 1);
     $dur->setStart($start);
     $dur->setEnd($end);
     if ($parent instanceof ilPropertyFormGUI) {
         $parent->addItem($dur);
     } else {
         $parent->addSubItem($dur);
     }
 }