/**
  * Init property form
  *
  * @return ilPropertyFormGUI $form
  */
 protected function initFormSettings()
 {
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setTitle($this->lng->txt('tracking_settings'));
     $form->setFormAction($this->ctrl->getFormAction($this));
     // Mode
     $mod = new ilRadioGroupInputGUI($this->lng->txt('trac_mode'), 'modus');
     $mod->setRequired(true);
     $mod->setValue($this->obj_lp->getCurrentMode());
     $form->addItem($mod);
     foreach ($this->obj_lp->getValidModes() as $mode_key) {
         $opt = new ilRadioOption($this->obj_lp->getModeText($mode_key), $mode_key, $this->obj_lp->getModeInfoText($mode_key));
         $opt->setValue($mode_key);
         $mod->addOption($opt);
         // :TODO: Subitem for visits ?!
         if ($mode_key == ilLPObjSettings::LP_MODE_VISITS) {
             $vis = new ilNumberInputGUI($this->lng->txt('trac_visits'), 'visits');
             $vis->setSize(3);
             $vis->setMaxLength(4);
             $vis->setInfo(sprintf($this->lng->txt('trac_visits_info'), ilObjUserTracking::_getValidTimeSpan()));
             $vis->setRequired(true);
             $vis->setValue($this->obj_settings->getVisits());
             $opt->addSubItem($vis);
         }
     }
     $form->addCommandButton('saveSettings', $this->lng->txt('save'));
     return $form;
 }
 public function build()
 {
     $this->setFormAction($this->ctrl->getFormAction($this->questionSetConfigGUI));
     $this->setTitle($this->lng->txt('tst_rnd_quest_set_cfg_general_form'));
     $this->setId('tstRndQuestSetCfgGeneralForm');
     $this->addCommandButton(ilTestRandomQuestionSetConfigGUI::CMD_SAVE_GENERAL_CONFIG_FORM, $this->lng->txt('save'));
     // Require Pools with Homogeneous Scored Questions
     $requirePoolsQuestionsHomoScored = new ilCheckboxInputGUI($this->lng->txt('tst_inp_all_quest_points_equal_per_pool'), 'quest_points_equal_per_pool');
     $requirePoolsQuestionsHomoScored->setInfo($this->lng->txt('tst_inp_all_quest_points_equal_per_pool_desc'));
     $requirePoolsQuestionsHomoScored->setChecked($this->questionSetConfig->arePoolsWithHomogeneousScoredQuestionsRequired());
     $this->addItem($requirePoolsQuestionsHomoScored);
     // question amount config mode (per test / per pool)
     $questionAmountConfigMode = new ilRadioGroupInputGUI($this->lng->txt('tst_inp_quest_amount_cfg_mode'), 'quest_amount_cfg_mode');
     $questionAmountConfigMode->setValue($this->fetchValidQuestionAmountConfigModeWithFallbackModePerTest($this->questionSetConfig));
     $questionAmountConfigModePerTest = new ilRadioOption($this->lng->txt('tst_inp_quest_amount_cfg_mode_test'), ilTestRandomQuestionSetConfig::QUESTION_AMOUNT_CONFIG_MODE_PER_TEST);
     $questionAmountConfigMode->addOption($questionAmountConfigModePerTest);
     $questionAmountConfigModePerPool = new ilRadioOption($this->lng->txt('tst_inp_quest_amount_cfg_mode_pool'), ilTestRandomQuestionSetConfig::QUESTION_AMOUNT_CONFIG_MODE_PER_POOL);
     $questionAmountConfigMode->addOption($questionAmountConfigModePerPool);
     $questionAmountConfigMode->setRequired(true);
     $this->addItem($questionAmountConfigMode);
     // question amount per test
     $questionAmountPerTest = new ilNumberInputGUI($this->lng->txt('tst_inp_quest_amount_per_test'), 'quest_amount_per_test');
     $questionAmountPerTest->setRequired(true);
     $questionAmountPerTest->setMinValue(0);
     $questionAmountPerTest->allowDecimals(false);
     $questionAmountPerTest->setMinvalueShouldBeGreater(true);
     $questionAmountPerTest->setSize(4);
     $questionAmountPerTest->setValue($this->questionSetConfig->getQuestionAmountPerTest());
     $questionAmountConfigModePerTest->addSubItem($questionAmountPerTest);
     if ($this->testOBJ->participantDataExist()) {
         $requirePoolsQuestionsHomoScored->setDisabled(true);
         $questionAmountConfigMode->setDisabled(true);
         $questionAmountPerTest->setDisabled(true);
     }
 }
 function initEditForm($a_job_id)
 {
     global $ilCtrl, $lng;
     $job = ilCronManager::getJobInstanceById($a_job_id);
     if (!$job) {
         $ilCtrl->redirect($this, "render");
     }
     $ilCtrl->setParameter($this, "jid", $a_job_id);
     $data = array_pop(ilCronManager::getCronJobData($job->getId()));
     include_once "Services/Cron/classes/class.ilCronJob.php";
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($ilCtrl->getFormAction($this, "update"));
     $form->setTitle($lng->txt("cron_action_edit") . ': "' . $job->getTitle() . '"');
     if ($job->hasFlexibleSchedule()) {
         $type = new ilRadioGroupInputGUI($lng->txt("cron_schedule_type"), "type");
         $type->setRequired(true);
         $type->setValue($data["schedule_type"]);
         $type->addOption(new ilRadioOption($lng->txt("cron_schedule_daily"), ilCronJob::SCHEDULE_TYPE_DAILY));
         $type->addOption(new ilRadioOption($lng->txt("cron_schedule_weekly"), ilCronJob::SCHEDULE_TYPE_WEEKLY));
         $type->addOption(new ilRadioOption($lng->txt("cron_schedule_monthly"), ilCronJob::SCHEDULE_TYPE_MONTHLY));
         $type->addOption(new ilRadioOption($lng->txt("cron_schedule_quarterly"), ilCronJob::SCHEDULE_TYPE_QUARTERLY));
         $type->addOption(new ilRadioOption($lng->txt("cron_schedule_yearly"), ilCronJob::SCHEDULE_TYPE_YEARLY));
         $min = new ilRadioOption(sprintf($lng->txt("cron_schedule_in_minutes"), "x"), ilCronJob::SCHEDULE_TYPE_IN_MINUTES);
         $mini = new ilNumberInputGUI($lng->txt("cron_schedule_value"), "smini");
         $mini->setRequired(true);
         $mini->setSize(5);
         if ($data["schedule_type"] == ilCronJob::SCHEDULE_TYPE_IN_MINUTES) {
             $mini->setValue($data["schedule_value"]);
         }
         $min->addSubItem($mini);
         $type->addOption($min);
         $hr = new ilRadioOption(sprintf($lng->txt("cron_schedule_in_hours"), "x"), ilCronJob::SCHEDULE_TYPE_IN_HOURS);
         $hri = new ilNumberInputGUI($lng->txt("cron_schedule_value"), "shri");
         $hri->setRequired(true);
         $hri->setSize(5);
         if ($data["schedule_type"] == ilCronJob::SCHEDULE_TYPE_IN_HOURS) {
             $hri->setValue($data["schedule_value"]);
         }
         $hr->addSubItem($hri);
         $type->addOption($hr);
         $dy = new ilRadioOption(sprintf($lng->txt("cron_schedule_in_days"), "x"), ilCronJob::SCHEDULE_TYPE_IN_DAYS);
         $dyi = new ilNumberInputGUI($lng->txt("cron_schedule_value"), "sdyi");
         $dyi->setRequired(true);
         $dyi->setSize(5);
         if ($data["schedule_type"] == ilCronJob::SCHEDULE_TYPE_IN_DAYS) {
             $dyi->setValue($data["schedule_value"]);
         }
         $dy->addSubItem($dyi);
         $type->addOption($dy);
         $form->addItem($type);
     }
     if ($job->hasCustomSettings()) {
         $job->addCustomSettingsToForm($form);
     }
     $form->addCommandButton("update", $lng->txt("save"));
     $form->addCommandButton("render", $lng->txt("cancel"));
     return $form;
 }
 public function build(ilTestRandomQuestionSetSourcePoolDefinition $sourcePool, $availableTaxonomyIds)
 {
     $this->setFormAction($this->ctrl->getFormAction($this->questionSetConfigGUI));
     $this->setTitle($this->lng->txt('tst_rnd_quest_set_cfg_pool_form'));
     $this->setId('tstRndQuestSetCfgPoolForm');
     $this->addCommandButton($this->getSaveCommand(), $this->lng->txt('save'));
     $this->addCommandButton(ilTestRandomQuestionSetConfigGUI::CMD_SHOW_SRC_POOL_DEF_LIST, $this->lng->txt('cancel'));
     $hiddenDefId = new ilHiddenInputGUI('src_pool_def_id');
     $hiddenDefId->setValue($sourcePool->getId());
     $this->addItem($hiddenDefId);
     $hiddenPoolId = new ilHiddenInputGUI('quest_pool_id');
     $hiddenPoolId->setValue($sourcePool->getPoolId());
     $this->addItem($hiddenPoolId);
     $nonEditablePoolLabel = new ilNonEditableValueGUI($this->lng->txt('tst_inp_source_pool_label'), 'quest_pool_label');
     $nonEditablePoolLabel->setValue($sourcePool->getPoolInfoLabel($this->lng));
     $this->addItem($nonEditablePoolLabel);
     if (count($availableTaxonomyIds)) {
         $taxRadio = new ilRadioGroupInputGUI($this->lng->txt('tst_inp_source_pool_filter_tax'), 'filter_tax');
         $taxRadio->setRequired(true);
         $taxRadio->addOption(new ilRadioOption($this->lng->txt('tst_inp_source_pool_no_tax_filter'), 0));
         $taxRadio->setValue(0);
         require_once 'Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php';
         foreach ($availableTaxonomyIds as $taxId) {
             $taxonomy = new ilObjTaxonomy($taxId);
             $label = sprintf($this->lng->txt('tst_inp_source_pool_filter_tax_x'), $taxonomy->getTitle());
             $taxRadioOption = new ilRadioOption($label, $taxId);
             $taxRadio->addOption($taxRadioOption);
             $taxSelect = new ilTaxSelectInputGUI($taxId, "filter_tax_{$taxId}", false);
             $taxSelect->setRequired(true);
             $taxRadioOption->addSubItem($taxSelect);
             if ($taxId == $sourcePool->getOriginalFilterTaxId()) {
                 $taxRadio->setValue($sourcePool->getOriginalFilterTaxId());
                 $taxSelect->setValue($sourcePool->getOriginalFilterTaxNodeId());
             }
         }
         $this->addItem($taxRadio);
     } else {
         $hiddenNoTax = new ilHiddenInputGUI('filter_tax');
         $hiddenNoTax->setValue(0);
         $this->addItem($hiddenNoTax);
         $nonEditableNoTax = new ilNonEditableValueGUI($this->lng->txt('tst_inp_source_pool_filter_tax'), 'no_tax_label');
         $nonEditableNoTax->setValue($this->lng->txt('tst_inp_no_available_tax_hint'));
         $this->addItem($nonEditableNoTax);
     }
     if ($this->questionSetConfig->isQuestionAmountConfigurationModePerPool()) {
         $questionAmountPerSourcePool = new ilNumberInputGUI($this->lng->txt('tst_inp_quest_amount_per_source_pool'), 'question_amount_per_pool');
         $questionAmountPerSourcePool->setRequired(true);
         $questionAmountPerSourcePool->allowDecimals(false);
         $questionAmountPerSourcePool->setMinValue(0);
         $questionAmountPerSourcePool->setMinvalueShouldBeGreater(true);
         $questionAmountPerSourcePool->setSize(4);
         if ($sourcePool->getQuestionAmount()) {
             $questionAmountPerSourcePool->setValue($sourcePool->getQuestionAmount());
         }
         $this->addItem($questionAmountPerSourcePool);
     }
 }
 protected function addCustomEditForm(ilPropertyFormGUI $a_form)
 {
     $radio_grp = new ilRadioGroupInputGUI($this->lng->txt('ecs_availability'), 'activation_type');
     $radio_grp->setValue($this->object->getAvailabilityType());
     $radio_grp->setDisabled(true);
     $radio_opt = new ilRadioOption($this->lng->txt('offline'), ilObjRemoteLearningModule::ACTIVATION_OFFLINE);
     $radio_grp->addOption($radio_opt);
     $radio_opt = new ilRadioOption($this->lng->txt('online'), ilObjRemoteLearningModule::ACTIVATION_ONLINE);
     $radio_grp->addOption($radio_opt);
     $a_form->addItem($radio_grp);
 }
 /**
  * Init property form
  *
  * @return ilPropertyFormGUI $form
  */
 protected function initFormSettings()
 {
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setTitle($this->lng->txt('tracking_settings'));
     $form->setFormAction($this->ctrl->getFormAction($this));
     // Mode
     $mod = new ilRadioGroupInputGUI($this->lng->txt('trac_mode'), 'modus');
     $mod->setRequired(true);
     $mod->setValue($this->obj_settings->getMode());
     $form->addItem($mod);
     foreach ($this->obj_settings->getValidModes() as $mode_key => $mode_name) {
         $opt = new ilRadioOption($mode_name, $mode_key, ilLPObjSettings::_mode2InfoText($mode_key));
         $opt->setValue($mode_key);
         $mod->addOption($opt);
         // Subitem for vistits
         if ($mode_key == LP_MODE_VISITS) {
             $vis = new ilNumberInputGUI($this->lng->txt('trac_visits'), 'visits');
             $vis->setSize(3);
             $vis->setMaxLength(4);
             $vis->setInfo(sprintf($this->lng->txt('trac_visits_info'), ilObjUserTracking::_getValidTimeSpan()));
             $vis->setRequired(true);
             $vis->setValue($this->obj_settings->getVisits());
             $opt->addSubItem($vis);
         }
     }
     /*
     // Info Active
     $act = new ilCustomInputGUI($this->lng->txt('trac_activated'), '');
     $img = new ilTemplate('tpl.obj_settings_img_row.html',true,true,'Services/Tracking');
     $img->setVariable("IMG_SRC",
     	$activated = ilObjUserTracking::_enabledLearningProgress()
     		? ilUtil::getImagePath('icon_ok.png')
     		: ilUtil::getImagePath('icon_not_ok.png')
     );
     $act->setHTML($img->get());
     $form->addItem($act);
     
      		// Info Anonymized
      		$ano = new ilCustomInputGUI($this->lng->txt('trac_anonymized'), '');
     $img = new ilTemplate('tpl.obj_settings_img_row.html',true,true,'Services/Tracking');
     $img->setVariable("IMG_SRC",
     	$anonymized = !ilObjUserTracking::_enabledUserRelatedData()
     		? ilUtil::getImagePath('icon_ok.png')
     		: ilUtil::getImagePath('icon_not_ok.png')
     );
     $ano->setHTML($img->get());
     $form->addItem($ano);
     */
     $form->addCommandButton('saveSettings', $this->lng->txt('save'));
     return $form;
 }
 /**
  * @param ilRadioOption $option
  */
 public function initPluginCreationFormSection(ilRadioOption $option)
 {
     //		$option->setInfo($this->txt('create_info1') . '</br>' . $this->txt('create_info2') . $this->getAdminConfigObject()->getAppName()
     //			. $this->txt('create_info3'));
     $sub_selection = new ilRadioGroupInputGUI($this->txt(self::F_BASE_FOLDER), self::F_BASE_FOLDER);
     $sub_selection->setRequired(true);
     $option_default = new ilRadioOption($this->txt(self::F_DEFAULT_BASE_FOLDER), self::F_DEFAULT_BASE_FOLDER);
     $option_custom = new ilRadioOption($this->txt('custom_base_folder'), self::F_CUSTOM_FOLDER_SELECTION);
     $custom_base_folder_input = new ilTextInputGUI($this->txt(self::F_CUSTOM_BASE_FOLDER_INPUT), self::F_CUSTOM_BASE_FOLDER_INPUT);
     $custom_base_folder_input->setRequired(true);
     $custom_base_folder_input->setInfo($this->txt('custom_base_folder_input_info'));
     $option_custom->addSubItem($custom_base_folder_input);
     $sub_selection->addOption($option_default);
     $sub_selection->addOption($option_custom);
     $sub_selection->setValue(self::F_DEFAULT_BASE_FOLDER);
     $option->addSubItem($sub_selection);
 }
 /**
  * Edit resources form.
  */
 public function edit($a_insert = false)
 {
     global $ilCtrl, $tpl, $lng, $objDefinition;
     $this->displayValidationError();
     // edit form
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($ilCtrl->getFormAction($this));
     if ($a_insert) {
         $form->setTitle($this->lng->txt("cont_insert_login_page"));
     } else {
         $form->setTitle($this->lng->txt("cont_update_login_page"));
     }
     // type selection
     $type_prop = new ilRadioGroupInputGUI($this->lng->txt("cont_type"), "type");
     foreach (ilPCLoginPageElement::getAllTypes() as $index => $lang_key) {
         $types[$index] = $this->lng->txt('cont_lpe_' . $lang_key);
         $option = new ilRadioOption($this->lng->txt('cont_lpe_' . $lang_key), $index);
         $type_prop->addOption($option);
     }
     $selected = $a_insert ? "" : $this->content_obj->getLoginPageElementType();
     $type_prop->setValue($selected);
     $form->addItem($type_prop);
     // horizonal align
     $align_prop = new ilSelectInputGUI($this->lng->txt("cont_align"), "horizontal_align");
     $options = array("Left" => $lng->txt("cont_left"), "Center" => $lng->txt("cont_center"), "Right" => $lng->txt("cont_right"));
     #			"LeftFloat" => $lng->txt("cont_left_float"),
     #			"RightFloat" => $lng->txt("cont_right_float"));
     $align_prop->setOptions($options);
     $align_prop->setValue($this->content_obj->getAlignment());
     $form->addItem($align_prop);
     // save/cancel buttons
     if ($a_insert) {
         $form->addCommandButton("create_login_page_element", $lng->txt("save"));
         $form->addCommandButton("cancelCreate", $lng->txt("cancel"));
     } else {
         $form->addCommandButton("update_login_page_element", $lng->txt("save"));
         $form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
     }
     $html = $form->getHTML();
     $tpl->setContent($html);
     return $ret;
 }
 /**
  * @param ilRadioOption $option
  * @throws ilCloudPluginConfigException
  */
 public function initPluginCreationFormSection(ilRadioOption $option)
 {
     $option->setInfo($this->txt("create_info1") . "</br>" . $this->txt("create_info2") . $this->getAdminConfigObject()->getAppName() . $this->txt("create_info3"));
     $sub_selection = new ilRadioGroupInputGUI($this->txt(self::F_BASE_FOLDER), "dropbox_base_folder");
     $sub_selection->setRequired(true);
     $option_default = new ilRadioOption($this->txt("default_base_folder"), self::F_DROPBOX_DEFAULT_BASE_FOLDER);
     $option_custom = new ilRadioOption($this->txt("custom_base_folder"), self::F_DROPBOX_CUSTOM_FOLDER_SELECTION);
     $custom_base_folder_input = new ilTextInputGUI($this->txt("custom_base_folder_input"), self::F_DROPBOX_CUSTOM_BASE_FOLDER_INPUT);
     $custom_base_folder_input->setRequired(true);
     $custom_base_folder_input->setInfo($this->txt("custom_base_folder_input_info"));
     $option_custom->addSubItem($custom_base_folder_input);
     $sub_selection->addOption($option_default);
     $sub_selection->addOption($option_custom);
     $sub_selection->setValue(self::F_DROPBOX_DEFAULT_BASE_FOLDER);
     $option->addSubItem($sub_selection);
     $sub_selection2 = new ilCheckboxInputGUI($this->txt(self::F_ONLINE), self::F_ONLINE);
     if ($this->getAdminConfigObject()->getValue('config_default_online')) {
         $sub_selection2->setChecked(true);
     }
     $option->addSubItem($sub_selection2);
 }
 protected function addCustomEditForm(ilPropertyFormGUI $a_form)
 {
     $radio_grp = new ilRadioGroupInputGUI($this->lng->txt('grp_visibility'), 'activation_type');
     $radio_grp->setValue($this->object->getAvailabilityType());
     $radio_grp->setDisabled(true);
     $radio_opt = new ilRadioOption($this->lng->txt('grp_visibility_unvisible'), ilObjRemoteTest::ACTIVATION_OFFLINE);
     $radio_grp->addOption($radio_opt);
     $radio_opt = new ilRadioOption($this->lng->txt('grp_visibility_limitless'), ilObjRemoteTest::ACTIVATION_UNLIMITED);
     $radio_grp->addOption($radio_opt);
     // :TODO: not supported in ECS yet
     $radio_opt = new ilRadioOption($this->lng->txt('grp_visibility_until'), ilObjRemoteTest::ACTIVATION_LIMITED);
     $start = new ilDateTimeInputGUI($this->lng->txt('grp_start'), 'start');
     $start->setDate(new ilDateTime(time(), IL_CAL_UNIX));
     $start->setDisabled(true);
     $start->setShowTime(true);
     $radio_opt->addSubItem($start);
     $end = new ilDateTimeInputGUI($this->lng->txt('grp_end'), 'end');
     $end->setDate(new ilDateTime(time(), IL_CAL_UNIX));
     $end->setDisabled(true);
     $end->setShowTime(true);
     $radio_opt->addSubItem($end);
     $radio_grp->addOption($radio_opt);
     $a_form->addItem($radio_grp);
 }
 /**
  * Init settings property form
  *
  * @access protected
  */
 protected function initFormSettings()
 {
     if (is_object($this->form)) {
         return true;
     }
     include_once 'Services/Calendar/classes/class.ilCalendarUtil.php';
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($this->ctrl->getFormAction($this));
     $this->form->setTitle($this->lng->txt('cal_global_settings'));
     $this->form->addCommandButton('save', $this->lng->txt('save'));
     #$this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
     $check = new ilCheckboxInputGUI($this->lng->txt('enable_calendar'), 'enable');
     $check->setValue(1);
     $check->setChecked($this->settings->isEnabled() ? true : false);
     $this->form->addItem($check);
     $server_tz = new ilNonEditableValueGUI($this->lng->txt('cal_server_tz'));
     $server_tz->setValue(ilTimeZone::_getDefaultTimeZone());
     $this->form->addItem($server_tz);
     $select = new ilSelectInputGUI($this->lng->txt('cal_def_timezone'), 'default_timezone');
     $select->setOptions(ilCalendarUtil::_getShortTimeZoneList());
     $select->setInfo($this->lng->txt('cal_def_timezone_info'));
     $select->setValue($this->settings->getDefaultTimeZone());
     $this->form->addItem($select);
     $year = date("Y");
     $select = new ilSelectInputGUI($this->lng->txt('cal_def_date_format'), 'default_date_format');
     $select->setOptions(array(ilCalendarSettings::DATE_FORMAT_DMY => '31.10.' . $year, ilCalendarSettings::DATE_FORMAT_YMD => $year . "-10-31", ilCalendarSettings::DATE_FORMAT_MDY => "10/31/" . $year));
     $select->setInfo($this->lng->txt('cal_def_date_format_info'));
     $select->setValue($this->settings->getDefaultDateFormat());
     $this->form->addItem($select);
     $select = new ilSelectInputGUI($this->lng->txt('cal_def_time_format'), 'default_time_format');
     $select->setOptions(array(ilCalendarSettings::TIME_FORMAT_24 => '13:00', ilCalendarSettings::TIME_FORMAT_12 => '1:00pm'));
     $select->setInfo($this->lng->txt('cal_def_time_format_info'));
     $select->setValue($this->settings->getDefaultTimeFormat());
     $this->form->addItem($select);
     // Weekstart
     $radio = new ilRadioGroupInputGUI($this->lng->txt('cal_def_week_start'), 'default_week_start');
     $radio->setValue($this->settings->getDefaultWeekStart());
     $option = new ilRadioOption($this->lng->txt('l_su'), 0);
     $radio->addOption($option);
     $option = new ilRadioOption($this->lng->txt('l_mo'), 1);
     $radio->addOption($option);
     $this->form->addItem($radio);
     // Day start
     $day_start = new ilSelectInputGUI($this->lng->txt('cal_day_start'), 'dst');
     $day_start->setOptions(ilCalendarUtil::getHourSelection($this->settings->getDefaultTimeFormat()));
     $day_start->setValue($this->settings->getDefaultDayStart());
     $this->form->addItem($day_start);
     $day_end = new ilSelectInputGUI($this->lng->txt('cal_day_end'), 'den');
     $day_end->setOptions(ilCalendarUtil::getHourSelection($this->settings->getDefaultTimeFormat()));
     $day_end->setValue($this->settings->getDefaultDayEnd());
     $this->form->addItem($day_end);
     $sync = new ilCheckboxInputGUI($this->lng->txt('cal_webcal_sync'), 'webcal');
     $sync->setValue(1);
     $sync->setChecked($this->settings->isWebCalSyncEnabled());
     $sync->setInfo($this->lng->txt('cal_webcal_sync_info'));
     $sync_min = new ilNumberInputGUI('', 'webcal_hours');
     $sync_min->setSize(2);
     $sync_min->setMaxLength(3);
     $sync_min->setValue($this->settings->getWebCalSyncHours());
     $sync_min->setSuffix($this->lng->txt('hours'));
     $sync->addSubItem($sync_min);
     $this->form->addItem($sync);
     // enable milestone planning in groups
     $mil = new ilFormSectionHeaderGUI();
     $mil->setTitle($this->lng->txt('cal_milestone_settings'));
     $this->form->addItem($mil);
     $checkm = new ilCheckboxInputGUI($this->lng->txt('cal_enable_group_milestones'), 'enable_grp_milestones');
     $checkm->setValue(1);
     $checkm->setChecked($this->settings->getEnableGroupMilestones() ? true : false);
     $checkm->setInfo($this->lng->txt('cal_enable_group_milestones_desc'));
     $this->form->addItem($checkm);
     // Consultation hours
     $con = new ilFormSectionHeaderGUI();
     $con->setTitle($this->lng->txt('cal_ch_form_header'));
     $this->form->addItem($con);
     $ch = new ilCheckboxInputGUI($this->lng->txt('cal_ch_form'), 'ch');
     $ch->setInfo($this->lng->txt('cal_ch_form_info'));
     $ch->setValue(1);
     $ch->setChecked($this->settings->areConsultationHoursEnabled());
     $this->form->addItem($ch);
     // repository visibility default
     $rep = new ilFormSectionHeaderGUI();
     $rep->setTitle($GLOBALS['lng']->txt('cal_setting_global_vis_repos'));
     $this->form->addItem($rep);
     $crs = new ilCheckboxInputGUI($GLOBALS['lng']->txt('cal_setting_global_crs_vis'), 'visible_crs');
     $crs->setInfo($GLOBALS['lng']->txt('cal_setting_global_crs_vis_info'));
     $crs->setValue(1);
     $crs->setInfo($GLOBALS['lng']->txt('cal_setting_global_crs_vis_info'));
     $crs->setChecked($this->settings->isCourseCalendarEnabled());
     $this->form->addItem($crs);
     $grp = new ilCheckboxInputGUI($GLOBALS['lng']->txt('cal_setting_global_grp_vis'), 'visible_grp');
     $grp->setInfo($GLOBALS['lng']->txt('cal_setting_global_grp_vis_info'));
     $grp->setValue(1);
     $grp->setInfo($GLOBALS['lng']->txt('cal_setting_global_grp_vis_info'));
     $grp->setChecked($this->settings->isGroupCalendarEnabled());
     $this->form->addItem($grp);
     // Notifications
     $not = new ilFormSectionHeaderGUI();
     $not->setTitle($this->lng->txt('notifications'));
     $this->form->addItem($not);
     $cgn = new ilCheckboxInputGUI($this->lng->txt('cal_notification'), 'cn');
     $cgn->setOptionTitle($this->lng->txt('cal_notification_crsgrp'));
     $cgn->setValue(1);
     $cgn->setChecked($this->settings->isNotificationEnabled());
     $cgn->setInfo($this->lng->txt('cal_adm_notification_info'));
     $this->form->addItem($cgn);
     $cnu = new ilCheckboxInputGUI('', 'cnu');
     $cnu->setOptionTitle($this->lng->txt('cal_notification_users'));
     $cnu->setValue(1);
     $cnu->setChecked($this->settings->isUserNotificationEnabled());
     $cnu->setInfo($this->lng->txt('cal_adm_notification_user_info'));
     $this->form->addItem($cnu);
     // Registration
     $book = new ilFormSectionHeaderGUI();
     $book->setTitle($this->lng->txt('cal_registrations'));
     $this->form->addItem($book);
     $cgn = new ilCheckboxInputGUI($this->lng->txt('cal_cg_registrations'), 'cgr');
     $cgn->setValue(1);
     $cgn->setChecked($this->settings->isCGRegistrationEnabled());
     $cgn->setInfo($this->lng->txt('cal_cg_registration_info'));
     $this->form->addItem($cgn);
     // Synchronisation cache
     $sec = new ilFormSectionHeaderGUI();
     $sec->setTitle($this->lng->txt('cal_cache_settings'));
     $this->form->addItem($sec);
     $cache = new ilRadioGroupInputGUI($this->lng->txt('cal_sync_cache'), 'sync_cache');
     $cache->setValue((int) $this->settings->isSynchronisationCacheEnabled());
     $cache->setInfo($this->lng->txt('cal_sync_cache_info'));
     $cache->setRequired(true);
     $sync_cache = new ilRadioOption($this->lng->txt('cal_sync_disabled'), 0);
     $cache->addOption($sync_cache);
     $sync_cache = new ilRadioOption($this->lng->txt('cal_sync_enabled'), 1);
     $cache->addOption($sync_cache);
     $cache_t = new ilNumberInputGUI('', 'sync_cache_time');
     $cache_t->setValue($this->settings->getSynchronisationCacheMinutes());
     $cache_t->setMinValue(0);
     $cache_t->setSize(3);
     $cache_t->setMaxLength(3);
     $cache_t->setSuffix($this->lng->txt('form_minutes'));
     $sync_cache->addSubItem($cache_t);
     $this->form->addItem($cache);
     // Calendar cache
     $cache = new ilRadioGroupInputGUI($this->lng->txt('cal_cache'), 'cache');
     $cache->setValue((int) $this->settings->isCacheUsed());
     $cache->setInfo($this->lng->txt('cal_cache_info'));
     $cache->setRequired(true);
     $sync_cache = new ilRadioOption($this->lng->txt('cal_cache_disabled'), 0);
     $cache->addOption($sync_cache);
     $sync_cache = new ilRadioOption($this->lng->txt('cal_cache_enabled'), 1);
     $cache->addOption($sync_cache);
     $cache_t = new ilNumberInputGUI('', 'cache_time');
     $cache_t->setValue($this->settings->getCacheMinutes());
     $cache_t->setMinValue(0);
     $cache_t->setSize(3);
     $cache_t->setMaxLength(3);
     $cache_t->setSuffix($this->lng->txt('form_minutes'));
     $sync_cache->addSubItem($cache_t);
     $this->form->addItem($cache);
 }
 protected function initSettingsForm()
 {
     global $ilSetting;
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setTitle($this->lng->txt("settings"));
     $form->setFormAction($this->ctrl->getFormAction($this, 'saveSettings'));
     // default repository view
     $options = array("flat" => $this->lng->txt("flatview"), "tree" => $this->lng->txt("treeview"));
     $si = new ilSelectInputGUI($this->lng->txt("def_repository_view"), "default_rep_view");
     $si->setOptions($options);
     $si->setInfo($this->lng->txt(""));
     if ($ilSetting->get("default_repository_view") == "tree") {
         $si->setValue("tree");
     } else {
         $si->setValue("flat");
     }
     $form->addItem($si);
     //
     $options = array("" => $this->lng->txt("adm_rep_tree_only_container"), "tree" => $this->lng->txt("adm_all_resource_types"));
     // repository tree
     $radg = new ilRadioGroupInputGUI($this->lng->txt("adm_rep_tree_presentation"), "tree_pres");
     $radg->setValue($ilSetting->get("repository_tree_pres"));
     $op1 = new ilRadioOption($this->lng->txt("adm_rep_tree_only_cntr"), "", $this->lng->txt("adm_rep_tree_only_cntr_info"));
     $radg->addOption($op1);
     $op2 = new ilRadioOption($this->lng->txt("adm_rep_tree_all_types"), "all_types", $this->lng->txt("adm_rep_tree_all_types_info"));
     // limit tree in courses and groups
     $cb = new ilCheckboxInputGUI($this->lng->txt("adm_rep_tree_limit_grp_crs"), "rep_tree_limit_grp_crs");
     $cb->setChecked($ilSetting->get("rep_tree_limit_grp_crs"));
     $cb->setInfo($this->lng->txt("adm_rep_tree_limit_grp_crs_info"));
     $op2->addSubItem($cb);
     $radg->addOption($op2);
     $form->addItem($radg);
     /* OBSOLETE
     		// synchronize repository tree with main view
     		$cb = new ilCheckboxInputGUI($this->lng->txt("adm_synchronize_rep_tree"), "rep_tree_synchronize");
     		$cb->setInfo($this->lng->txt("adm_synchronize_rep_tree_info"));
     		$cb->setChecked($ilSetting->get("rep_tree_synchronize"));
     		$form->addItem($cb);
     		*/
     /* DISABLED
     		// repository access check
     		$options = array(
     			0 => "0",
     			10 => "10",
     			30 => "30",
     			60 => "60",
     			120 => "120"
     			);
     		$si = new ilSelectInputGUI($this->lng->txt("adm_repository_cache_time"), "rep_cache");
     		$si->setOptions($options);
     		$si->setValue($ilSetting->get("rep_cache"));
     		$si->setInfo($this->lng->txt("adm_repository_cache_time_info")." ".
     			$this->lng->txt("adm_repository_cache_time_info2"));
     		$form->addItem($si);
     		*/
     // trash
     $cb = new ilCheckboxInputGUI($this->lng->txt("enable_trash"), "enable_trash");
     $cb->setInfo($this->lng->txt("enable_trash_info"));
     if ($ilSetting->get("enable_trash")) {
         $cb->setChecked(true);
     }
     $form->addItem($cb);
     // change event
     require_once 'Services/Tracking/classes/class.ilChangeEvent.php';
     $this->lng->loadLanguageModule("trac");
     $event = new ilCheckboxInputGUI($this->lng->txt('trac_repository_changes'), 'change_event_tracking');
     $event->setChecked(ilChangeEvent::_isActive());
     $form->addItem($event);
     include_once "Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php";
     ilAdministrationSettingsFormHandler::addFieldsToForm(ilAdministrationSettingsFormHandler::FORM_REPOSITORY, $form, $this);
     // object lists
     $lists = new ilFormSectionHeaderGUI();
     $lists->setTitle($this->lng->txt("rep_object_lists"));
     $form->addItem($lists);
     $sdesc = new ilCheckboxInputGUI($this->lng->txt("adm_rep_shorten_description"), "rep_shorten_description");
     $sdesc->setInfo($this->lng->txt("adm_rep_shorten_description_info"));
     $sdesc->setChecked($ilSetting->get("rep_shorten_description"));
     $form->addItem($sdesc);
     $sdesclen = new ilNumberInputGUI($this->lng->txt("adm_rep_shorten_description_length"), "rep_shorten_description_length");
     $sdesclen->setValue($ilSetting->get("rep_shorten_description_length"));
     $sdesclen->setSize(3);
     $sdesc->addSubItem($sdesclen);
     // load action commands asynchronously
     $cb = new ilCheckboxInputGUI($this->lng->txt("adm_item_cmd_asynch"), "item_cmd_asynch");
     $cb->setInfo($this->lng->txt("adm_item_cmd_asynch_info"));
     $cb->setChecked($ilSetting->get("item_cmd_asynch"));
     $form->addItem($cb);
     // notes/comments/tagging
     $pl = new ilCheckboxInputGUI($this->lng->txt('adm_show_comments_tagging_in_lists'), 'comments_tagging_in_lists');
     $pl->setValue(1);
     $pl->setChecked($ilSetting->get('comments_tagging_in_lists'));
     $form->addItem($pl);
     $pltags = new ilCheckboxInputGUI($this->lng->txt('adm_show_comments_tagging_in_lists_tags'), 'comments_tagging_in_lists_tags');
     $pltags->setValue(1);
     $pltags->setChecked($ilSetting->get('comments_tagging_in_lists_tags'));
     $pl->addSubItem($pltags);
     $form->addCommandButton('saveSettings', $this->lng->txt('save'));
     return $form;
 }
示例#13
0
 /**
  * Allows to add suggested solutions for questions
  *
  * @access public
  */
 public function suggestedsolution()
 {
     global $ilUser;
     global $ilAccess;
     if ($_POST["deleteSuggestedSolution"] == 1) {
         $this->object->deleteSuggestedSolutions();
         ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
         $this->ctrl->redirect($this, "suggestedsolution");
     }
     $save = is_array($_POST["cmd"]) && array_key_exists("suggestedsolution", $_POST["cmd"]) ? TRUE : FALSE;
     $output = "";
     $solution_array = $this->object->getSuggestedSolution(0);
     $options = array("lm" => $this->lng->txt("obj_lm"), "st" => $this->lng->txt("obj_st"), "pg" => $this->lng->txt("obj_pg"), "git" => $this->lng->txt("glossary_term"), "file" => $this->lng->txt("fileDownload"), "text" => $this->lng->txt("solutionText"));
     if (strcmp($_POST["solutiontype"], "file") == 0 && strcmp($solution_array["type"], "file") != 0) {
         $solution_array = array("type" => "file");
     } elseif (strcmp($_POST["solutiontype"], "text") == 0 && strcmp($solution_array["type"], "text") != 0) {
         $solution_array = array("type" => "text", "value" => $this->getSolutionOutput(0, NULL, FALSE, FALSE, TRUE, FALSE, TRUE));
     }
     if ($save && strlen($_POST["filename"])) {
         $solution_array["value"]["filename"] = $_POST["filename"];
     }
     if ($save && strlen($_POST["solutiontext"])) {
         $solution_array["value"] = $_POST["solutiontext"];
     }
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     if (count($solution_array)) {
         $form = new ilPropertyFormGUI();
         $form->setFormAction($this->ctrl->getFormAction($this));
         $form->setTitle($this->lng->txt("solution_hint"));
         $form->setMultipart(TRUE);
         $form->setTableWidth("100%");
         $form->setId("suggestedsolutiondisplay");
         // suggested solution output
         include_once "./Modules/TestQuestionPool/classes/class.ilSolutionTitleInputGUI.php";
         $title = new ilSolutionTitleInputGUI($this->lng->txt("showSuggestedSolution"), "solutiontype");
         $template = new ilTemplate("tpl.il_as_qpl_suggested_solution_input_presentation.html", TRUE, TRUE, "Modules/TestQuestionPool");
         if (strlen($solution_array["internal_link"])) {
             $href = assQuestion::_getInternalLinkHref($solution_array["internal_link"]);
             $template->setCurrentBlock("preview");
             $template->setVariable("TEXT_SOLUTION", $this->lng->txt("suggested_solution"));
             $template->setVariable("VALUE_SOLUTION", " <a href=\"{$href}\" target=\"content\">" . $this->lng->txt("view") . "</a> ");
             $template->parseCurrentBlock();
         } elseif (strcmp($solution_array["type"], "file") == 0 && is_array($solution_array["value"])) {
             $href = $this->object->getSuggestedSolutionPathWeb() . $solution_array["value"]["name"];
             $template->setCurrentBlock("preview");
             $template->setVariable("TEXT_SOLUTION", $this->lng->txt("suggested_solution"));
             $template->setVariable("VALUE_SOLUTION", " <a href=\"{$href}\" target=\"content\">" . ilUtil::prepareFormOutput(strlen($solution_array["value"]["filename"]) ? $solution_array["value"]["filename"] : $solution_array["value"]["name"]) . "</a> ");
             $template->parseCurrentBlock();
         }
         $template->setVariable("TEXT_TYPE", $this->lng->txt("type"));
         $template->setVariable("VALUE_TYPE", $options[$solution_array["type"]]);
         $title->setHtml($template->get());
         $deletesolution = new ilCheckboxInputGUI("", "deleteSuggestedSolution");
         $deletesolution->setOptionTitle($this->lng->txt("deleteSuggestedSolution"));
         $title->addSubItem($deletesolution);
         $form->addItem($title);
         if (strcmp($solution_array["type"], "file") == 0) {
             // file
             $file = new ilFileInputGUI($this->lng->txt("fileDownload"), "file");
             $file->setRequired(TRUE);
             $file->enableFileNameSelection("filename");
             //$file->setSuffixes(array("doc","xls","png","jpg","gif","pdf"));
             if ($_FILES["file"]["tmp_name"] && $file->checkInput()) {
                 if (!file_exists($this->object->getSuggestedSolutionPath())) {
                     ilUtil::makeDirParents($this->object->getSuggestedSolutionPath());
                 }
                 $res = ilUtil::moveUploadedFile($_FILES["file"]["tmp_name"], $_FILES["file"]["name"], $this->object->getSuggestedSolutionPath() . $_FILES["file"]["name"]);
                 if ($res) {
                     ilUtil::renameExecutables($this->object->getSuggestedSolutionPath());
                     // remove an old file download
                     if (is_array($solution_array["value"])) {
                         @unlink($this->object->getSuggestedSolutionPath() . $solution_array["value"]["name"]);
                     }
                     $file->setValue($_FILES["file"]["name"]);
                     $this->object->saveSuggestedSolution("file", "", 0, array("name" => $_FILES["file"]["name"], "type" => $_FILES["file"]["type"], "size" => $_FILES["file"]["size"], "filename" => $_POST["filename"]));
                     $originalexists = $this->object->_questionExistsInPool($this->object->original_id);
                     if (($_GET["calling_test"] || isset($_GET['calling_consumer']) && (int) $_GET['calling_consumer']) && $originalexists && assQuestion::_isWriteable($this->object->original_id, $ilUser->getId())) {
                         return $this->originalSyncForm("suggestedsolution");
                     } else {
                         ilUtil::sendSuccess($this->lng->txt("suggested_solution_added_successfully"), TRUE);
                         $this->ctrl->redirect($this, "suggestedsolution");
                     }
                 } else {
                     // BH: $res as info string? wtf? it holds a bool or something else!!?
                     ilUtil::sendInfo($res);
                 }
             } else {
                 if (is_array($solution_array["value"])) {
                     $file->setValue($solution_array["value"]["name"]);
                     $file->setFilename(strlen($solution_array["value"]["filename"]) ? $solution_array["value"]["filename"] : $solution_array["value"]["name"]);
                 }
             }
             $form->addItem($file);
             $hidden = new ilHiddenInputGUI("solutiontype");
             $hidden->setValue("file");
             $form->addItem($hidden);
         } else {
             if (strcmp($solution_array["type"], "text") == 0) {
                 $question = new ilTextAreaInputGUI($this->lng->txt("solutionText"), "solutiontext");
                 $question->setValue($this->object->prepareTextareaOutput($solution_array["value"]));
                 $question->setRequired(TRUE);
                 $question->setRows(10);
                 $question->setCols(80);
                 $question->setUseRte(TRUE);
                 $question->addPlugin("latex");
                 $question->addButton("latex");
                 $question->setRTESupport($this->object->getId(), "qpl", "assessment");
                 $hidden = new ilHiddenInputGUI("solutiontype");
                 $hidden->setValue("text");
                 $form->addItem($hidden);
                 $form->addItem($question);
             }
         }
         if ($ilAccess->checkAccess("write", "", $_GET['ref_id'])) {
             $form->addCommandButton("suggestedsolution", $this->lng->txt("save"));
         }
         if ($save) {
             if ($form->checkInput()) {
                 switch ($solution_array["type"]) {
                     case "file":
                         $this->object->saveSuggestedSolution("file", "", 0, array("name" => $solution_array["value"]["name"], "type" => $solution_array["value"]["type"], "size" => $solution_array["value"]["size"], "filename" => $_POST["filename"]));
                         break;
                     case "text":
                         $this->object->saveSuggestedSolution("text", "", 0, $solution_array["value"]);
                         break;
                 }
                 $originalexists = $this->object->_questionExistsInPool($this->object->original_id);
                 if (($_GET["calling_test"] || isset($_GET['calling_consumer']) && (int) $_GET['calling_consumer']) && $originalexists && assQuestion::_isWriteable($this->object->original_id, $ilUser->getId())) {
                     return $this->originalSyncForm("suggestedsolution");
                 } else {
                     ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
                     $this->ctrl->redirect($this, "suggestedsolution");
                 }
             }
         }
         $output = $form->getHTML();
     }
     $savechange = strcmp($this->ctrl->getCmd(), "saveSuggestedSolution") == 0 ? TRUE : FALSE;
     $changeoutput = "";
     if ($ilAccess->checkAccess("write", "", $_GET['ref_id'])) {
         $formchange = new ilPropertyFormGUI();
         $formchange->setFormAction($this->ctrl->getFormAction($this));
         $formchange->setTitle(count($solution_array) ? $this->lng->txt("changeSuggestedSolution") : $this->lng->txt("addSuggestedSolution"));
         $formchange->setMultipart(FALSE);
         $formchange->setTableWidth("100%");
         $formchange->setId("suggestedsolution");
         $solutiontype = new ilRadioGroupInputGUI($this->lng->txt("suggestedSolutionType"), "solutiontype");
         foreach ($options as $opt_value => $opt_caption) {
             $solutiontype->addOption(new ilRadioOption($opt_caption, $opt_value));
         }
         if (count($solution_array)) {
             $solutiontype->setValue($solution_array["type"]);
         }
         $solutiontype->setRequired(TRUE);
         $formchange->addItem($solutiontype);
         $formchange->addCommandButton("saveSuggestedSolution", $this->lng->txt("select"));
         if ($savechange) {
             $formchange->checkInput();
         }
         $changeoutput = $formchange->getHTML();
     }
     $this->tpl->setVariable("ADM_CONTENT", $changeoutput . $output);
 }
 /**
  * Init category mapping form 
  * @return
  */
 protected function initCategoryMappingForm($a_mode = 'add')
 {
     global $ilDB;
     if (is_object($this->form)) {
         return true;
     }
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     include_once './Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php';
     $this->form = new ilPropertyFormGUI();
     if ($a_mode == 'add') {
         $this->form->setTitle($this->lng->txt('ecs_new_category_mapping'));
         $this->form->setFormAction($this->ctrl->getFormAction($this, 'categoryMapping'));
         $this->form->addCommandButton('addCategoryMapping', $this->lng->txt('save'));
         $this->form->addCommandButton('categoryMapping', $this->lng->txt('cancel'));
     } else {
         $this->form->setTitle($this->lng->txt('ecs_edit_category_mapping'));
         $this->form->setFormAction($this->ctrl->getFormAction($this, 'editCategoryMapping'));
         $this->form->addCommandButton('updateCategoryMapping', $this->lng->txt('save'));
         $this->form->addCommandButton('categoryMapping', $this->lng->txt('cancel'));
     }
     $imp = new ilCustomInputGUI($this->lng->txt('ecs_import_id'), 'import_id');
     $imp->setRequired(true);
     $tpl = new ilTemplate('tpl.ecs_import_id_form.html', true, true, 'Services/WebServices/ECS');
     $tpl->setVariable('SIZE', 5);
     $tpl->setVariable('MAXLENGTH', 11);
     $tpl->setVariable('POST_VAR', 'import_id');
     $tpl->setVariable('PROPERTY_VALUE', $this->rule->getContainerId());
     if ($this->settings->getImportId()) {
         $tpl->setVariable('COMPLETE_PATH', $this->buildPath($this->rule->getContainerId()));
     }
     $imp->setHTML($tpl->get());
     $imp->setInfo($this->lng->txt('ecs_import_id_info'));
     $this->form->addItem($imp);
     include_once './Services/WebServices/ECS/classes/class.ilECSCategoryMapping.php';
     $select = new ilSelectInputGUI($this->lng->txt('ecs_attribute_name'), 'field');
     $select->setValue($this->rule->getFieldName());
     $select->setRequired(true);
     $select->setOptions(ilECSCategoryMapping::getPossibleFields());
     $this->form->addItem($select);
     //	Value
     $value = new ilRadioGroupInputGUI($this->lng->txt('ecs_cat_mapping_type'), 'type');
     $value->setValue($this->rule->getMappingType());
     $value->setRequired(true);
     $fixed = new ilRadioOption($this->lng->txt('ecs_cat_mapping_fixed'), ilECSCategoryMappingRule::TYPE_FIXED);
     $fixed->setInfo($this->lng->txt('ecs_cat_mapping_fixed_info'));
     $fixed_val = new ilTextInputGUI($this->lng->txt('ecs_cat_mapping_values'), 'mapping_value');
     $fixed_val->setValue($this->rule->getMappingValue());
     $fixed_val->setMaxLength(255);
     $fixed_val->setSize(40);
     $fixed_val->setRequired(true);
     $fixed->addSubItem($fixed_val);
     $value->addOption($fixed);
     $duration = new ilRadioOption($this->lng->txt('ecs_cat_mapping_duration'), ilECSCategoryMappingRule::TYPE_DURATION);
     $duration->setInfo($this->lng->txt('ecs_cat_mapping_duration_info'));
     $dur_start = new ilDateTimeInputGUI($this->lng->txt('from'), 'dur_begin');
     $dur_start->setDate($this->rule->getDateRangeStart());
     $duration->addSubItem($dur_start);
     $dur_end = new ilDateTimeInputGUI($this->lng->txt('to'), 'dur_end');
     $dur_end->setDate($this->rule->getDateRangeEnd());
     $duration->addSubItem($dur_end);
     $value->addOption($duration);
     $type = new ilRadioOption($this->lng->txt('ecs_cat_mapping_by_type'), ilECSCategoryMappingRule::TYPE_BY_TYPE);
     $type->setInfo($this->lng->txt('ecs_cat_mapping_by_type_info'));
     $options = ilECSUtils::getPossibleRemoteTypes(true);
     $types = new ilSelectInputGUI($this->lng->txt('type'), 'by_type');
     $types->setOptions($options);
     $types->setValue($this->rule->getByType());
     $types->setRequired(true);
     $type->addSubitem($types);
     $value->addOption($type);
     $this->form->addItem($value);
 }
 /**
  * init edit/create category form 
  *
  * @access protected
  * @return
  */
 protected function initFormCategory($a_mode)
 {
     global $rbacsystem, $ilUser;
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     include_once './Services/Calendar/classes/class.ilCalendarCategory.php';
     include_once './Services/Calendar/classes/class.ilCalendarCategories.php';
     $cat_info = ilCalendarCategories::_getInstance()->getCategoryInfo((int) $_GET['category_id']);
     $this->form = new ilPropertyFormGUI();
     #$this->form->setTableWidth('40%');
     switch ($a_mode) {
         case 'edit':
             $category = new ilCalendarCategory((int) $_GET['category_id']);
             $this->form->setTitle($this->lng->txt('cal_edit_category'));
             $this->ctrl->saveParameter($this, array('seed', 'category_id'));
             $this->form->setFormAction($this->ctrl->getFormAction($this));
             if ($this->isEditable()) {
                 $this->form->addCommandButton('update', $this->lng->txt('save'));
                 /*
                 					if($cat_info['type'] == ilCalendarCategory::TYPE_USR)
                 					{
                 						$this->form->addCommandButton('shareSearch',$this->lng->txt('cal_share'));
                 					}
                 					$this->form->addCommandButton('confirmDelete',$this->lng->txt('delete'));
                 */
                 $this->form->addCommandButton('manage', $this->lng->txt('cancel'));
             }
             break;
         case 'create':
             $this->editable = true;
             $category = new ilCalendarCategory(0);
             $this->ctrl->saveParameter($this, array('category_id'));
             $this->form->setFormAction($this->ctrl->getFormAction($this));
             $this->form->setTitle($this->lng->txt('cal_add_category'));
             $this->form->addCommandButton('save', $this->lng->txt('save'));
             $this->form->addCommandButton('manage', $this->lng->txt('cancel'));
             break;
     }
     // Calendar name
     $title = new ilTextInputGUI($this->lng->txt('cal_calendar_name'), 'title');
     if ($a_mode == 'edit') {
         $title->setDisabled(!$this->isEditable());
     }
     $title->setRequired(true);
     $title->setMaxLength(64);
     $title->setSize(32);
     $title->setValue($category->getTitle());
     $this->form->addItem($title);
     include_once './Services/Calendar/classes/class.ilCalendarSettings.php';
     if ($a_mode == 'create' and $rbacsystem->checkAccess('edit_event', ilCalendarSettings::_getInstance()->getCalendarSettingsId())) {
         $type = new ilRadioGroupInputGUI($this->lng->txt('cal_cal_type'), 'type');
         $type->setValue($category->getType());
         $type->setRequired(true);
         $opt = new ilRadioOption($this->lng->txt('cal_type_personal'), ilCalendarCategory::TYPE_USR);
         $type->addOption($opt);
         $opt = new ilRadioOption($this->lng->txt('cal_type_system'), ilCalendarCategory::TYPE_GLOBAL);
         $type->addOption($opt);
         $type->setInfo($this->lng->txt('cal_type_info'));
         $this->form->addItem($type);
     }
     $color = new ilColorPickerInputGUI($this->lng->txt('cal_calendar_color'), 'color');
     $color->setValue($category->getColor());
     if (!$this->isEditable()) {
         $color->setDisabled(true);
     }
     $color->setRequired(true);
     $this->form->addItem($color);
     $location = new ilRadioGroupInputGUI($this->lng->txt('cal_type_rl'), 'type_rl');
     $location->setDisabled($a_mode == 'edit');
     $location_local = new ilRadioOption($this->lng->txt('cal_type_local'), ilCalendarCategory::LTYPE_LOCAL);
     $location->addOption($location_local);
     $location_remote = new ilRadioOption($this->lng->txt('cal_type_remote'), ilCalendarCategory::LTYPE_REMOTE);
     $location->addOption($location_remote);
     $location->setValue($category->getLocationType());
     $url = new ilTextInputGUI($this->lng->txt('cal_remote_url'), 'remote_url');
     $url->setDisabled($a_mode == 'edit');
     $url->setValue($category->getRemoteUrl());
     $url->setMaxLength(500);
     $url->setSize(60);
     $url->setRequired(true);
     $location_remote->addSubItem($url);
     $user = new ilTextInputGUI($this->lng->txt('username'), 'remote_user');
     $user->setDisabled($a_mode == 'edit');
     $user->setValue($category->getRemoteUser());
     $user->setMaxLength(50);
     $user->setSize(20);
     $user->setRequired(false);
     $location_remote->addSubItem($user);
     $pass = new ilPasswordInputGUI($this->lng->txt('password'), 'remote_pass');
     $pass->setDisabled($a_mode == 'edit');
     $pass->setValue($category->getRemotePass());
     $pass->setMaxLength(50);
     $pass->setSize(20);
     $pass->setRetype(false);
     $pass->setInfo($this->lng->txt('remote_pass_info'));
     $location_remote->addSubItem($pass);
     $this->form->addItem($location);
 }
 public function initFormSearch()
 {
     global $ilCtrl;
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($this->ctrl->getFormAction($this, 'search'));
     $this->form->setTitle($this->getTitle());
     $this->form->addCommandButton('performSearch', $this->lng->txt('search'));
     $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
     $kind = new ilRadioGroupInputGUI($this->lng->txt('search_type'), 'search_for');
     $kind->setValue($this->search_type);
     $this->form->addItem($kind);
     // Users
     $users = new ilRadioOption($this->lng->txt('search_for_users'), 'usr');
     // UDF
     include_once 'Services/Search/classes/class.ilUserSearchOptions.php';
     foreach (ilUserSearchOptions::_getSearchableFieldsInfo(!$this->isSearchableCheckEnabled()) as $info) {
         switch ($info['type']) {
             case FIELD_TYPE_UDF_SELECT:
             case FIELD_TYPE_SELECT:
                 $sel = new ilSelectInputGUI($info['lang'], "rep_query[usr][" . $info['db'] . "]");
                 $sel->setOptions($info['values']);
                 $users->addSubItem($sel);
                 break;
             case FIELD_TYPE_UDF_TEXT:
             case FIELD_TYPE_TEXT:
                 if (isset($info['autoComplete']) and $info['autoComplete']) {
                     $ilCtrl->setParameterByClass(get_class($this), 'autoCompleteField', $info['db']);
                     $ul = new ilTextInputGUI($info['lang'], "rep_query[usr][" . $info['db'] . "]");
                     $ul->setDataSource($ilCtrl->getLinkTarget($this, "doUserAutoComplete", "", true));
                     $ul->setSize(30);
                     $ul->setMaxLength(120);
                     $users->addSubItem($ul);
                 } else {
                     $txt = new ilTextInputGUI($info['lang'], "rep_query[usr][" . $info['db'] . "]");
                     $txt->setSize(30);
                     $txt->setMaxLength(120);
                     $users->addSubItem($txt);
                 }
                 break;
         }
     }
     $kind->addOption($users);
     // Role
     $roles = new ilRadioOption($this->lng->txt('search_for_role_members'), 'role');
     $role = new ilTextInputGUI($this->lng->txt('search_role_title'), 'rep_query[role][title]');
     $role->setSize(30);
     $role->setMaxLength(120);
     $roles->addSubItem($role);
     $kind->addOption($roles);
     // Course
     $groups = new ilRadioOption($this->lng->txt('search_for_crs_members'), 'crs');
     $group = new ilTextInputGUI($this->lng->txt('search_crs_title'), 'rep_query[crs][title]');
     $group->setSize(30);
     $group->setMaxLength(120);
     $groups->addSubItem($group);
     $kind->addOption($groups);
     // Group
     $groups = new ilRadioOption($this->lng->txt('search_for_grp_members'), 'grp');
     $group = new ilTextInputGUI($this->lng->txt('search_grp_title'), 'rep_query[grp][title]');
     $group->setSize(30);
     $group->setMaxLength(120);
     $groups->addSubItem($group);
     $kind->addOption($groups);
 }
 public function editPriceObject()
 {
     $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment');
     $price_id = $_GET['price_id'] ? $_GET['price_id'] : $_POST['price_id'];
     $price = ilPaymentPrices::_getPrice($price_id);
     $this->ctrl->setParameter($this, 'pobject_id', (int) $_GET['pobject_id']);
     $tmp_pobject = ilPaymentObject::_getObjectData($_GET['pobject_id']);
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $tmp_obj = ilObjectFactory::getInstanceByRefId($tmp_pobject['ref_id'], false);
     if ($tmp_obj) {
         $form->setTitle($tmp_obj->getTitle());
     } else {
         $form->setTitle($this->lng->txt('object_not_found'));
     }
     //price_type
     $radio_group = new ilRadioGroupInputGUI('', 'price_type');
     $radio_group->setTitle($this->lng->txt('duration'));
     $radio_group->setRequired(true);
     $radio_group->setValue($price['price_type']);
     $radio_group->setPostVar('price_type');
     $radio_option_1 = new ilRadioOption($this->lng->txt('duration_month'), ilPaymentPrices::TYPE_DURATION_MONTH);
     // duration month
     $oDuration = new ilNumberInputGUI();
     $oDuration->setTitle($this->lng->txt('paya_months'));
     $oDuration->setSize('20%');
     $oDuration->setValue($price['duration']);
     $oDuration->setPostVar('duration_month');
     $radio_option_1->addSubItem($oDuration);
     $radio_group->addOption($radio_option_1);
     $radio_option_3 = new ilRadioOption($this->lng->txt('duration_date'), ilPaymentPrices::TYPE_DURATION_DATE);
     // duration_date from
     $o_date_from = new ilDateTimeInputGUI();
     $o_date_from->setTitle($this->lng->txt('cal_from'));
     $o_date_from->setDate(new ilDate($price['duration_from'], IL_CAL_DATE));
     $o_date_from->setPostVar('duration_date_from');
     $radio_option_3->addSubItem($o_date_from);
     // duration_date until
     $o_date_until = new ilDateTimeInputGUI();
     $o_date_until->setTitle($this->lng->txt('cal_until'));
     $o_date_until->setDate(new ilDate($price['duration_until'], IL_CAL_DATE));
     $o_date_until->setPostVar('duration_date_until');
     $radio_option_3->addSubItem($o_date_until);
     $radio_group->addOption($radio_option_3);
     $radio_option_2 = new ilRadioOption($this->lng->txt('unlimited_duration'), ilPaymentPrices::TYPE_UNLIMITED_DURATION);
     $radio_group->addOption($radio_option_2);
     $form->addItem($radio_group);
     // description
     $oDescription = new ilTextAreaInputGUI($this->lng->txt('description'), 'description');
     $oDescription->setRows(4);
     $oDescription->setCols(35);
     $oDescription->setValue($price['description']);
     $form->addItem($oDescription);
     // price
     $oPrice = new ilNumberInputGUI();
     $oPrice->setTitle($this->lng->txt('price_a'));
     $oPrice->setSize('20%');
     $oPrice->setRequired(true);
     $oPrice->setValue($price['price']);
     include_once './Services/Payment/classes/class.ilPaymentSettings.php';
     $genSet = ilPaymentSettings::_getInstance();
     $oPrice->setInfo($genSet->get('currency_unit'));
     $oPrice->setPostVar('price');
     $oPrice->allowDecimals(true);
     $form->addItem($oPrice);
     //extension
     $oExtension = new ilCheckboxInputGUI($this->lng->txt('extension_price'), 'extension');
     $oExtension->setChecked($price['extension']);
     $form->addItem($oExtension);
     $o_hidden_1 = new ilHiddenInputGUI('pobject_id');
     $o_hidden_1->setValue((int) $_GET['pobject_id']);
     $o_hidden_1->setPostVar('pobject_id');
     $o_hidden_2 = new ilHiddenInputGUI('price_id');
     $o_hidden_2->setValue((int) $_GET['price_id']);
     $o_hidden_2->setPostVar('price_id');
     $form->addItem($o_hidden_1);
     $form->addItem($o_hidden_2);
     $form->addCommandButton('updatePrice', $this->lng->txt('save'));
     $form->addCommandButton('editPrices', $this->lng->txt('cancel'));
     $this->tpl->setVariable('FORM', $form->getHTML());
 }
 public function initForm($a_as_multi_assignment = FALSE)
 {
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setTitle($this->lng->txt('crs_loc_tst_assignment'));
     $form->setFormAction($this->ctrl->getFormAction($this->getGUI()));
     if ($a_as_multi_assignment) {
         $form->addCommandButton('saveMultiTestAssignment', $this->lng->txt('save'));
     } else {
         $form->addCommandButton('saveTest', $this->lng->txt('save'));
     }
     switch ($this->getTestType()) {
         case ilLOSettings::TYPE_TEST_INITIAL:
             $form->setTitle($this->lng->txt('crs_loc_settings_itest_tbl'));
             break;
         case ilLOSettings::TYPE_TEST_QUALIFIED:
             $form->setTitle($this->lng->txt('crs_loc_settings_qtest_tbl'));
             break;
     }
     $assignable = $this->getAssignableTests();
     $cr_mode = new ilRadioGroupInputGUI($this->lng->txt('crs_loc_form_assign_it'), 'mode');
     $cr_mode->setRequired(true);
     $cr_mode->setValue(self::TEST_NEW);
     $new = new ilRadioOption($this->lng->txt('crs_loc_form_tst_new'), self::TEST_NEW);
     switch ($this->getTestType()) {
         case ilLOSettings::TYPE_TEST_INITIAL:
             $new->setInfo($this->lng->txt("crs_loc_form_tst_new_initial_info"));
             break;
         case ilLOSettings::TYPE_TEST_QUALIFIED:
             $new->setInfo($this->lng->txt("crs_loc_form_tst_new_qualified_info"));
             break;
     }
     // title
     $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
     $ti->setMaxLength(128);
     $ti->setSize(40);
     $ti->setRequired(true);
     $new->addSubItem($ti);
     // description
     $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
     $ta->setCols(40);
     $ta->setRows(2);
     $new->addSubItem($ta);
     // Question assignment type
     include_once './Modules/Test/classes/class.ilObjTest.php';
     $this->lng->loadLanguageModule('assessment');
     $qst = new ilRadioGroupInputGUI($this->lng->txt('tst_question_set_type'), 'qtype');
     $qst->setRequired(true);
     $random = new ilRadioOption($this->lng->txt('tst_question_set_type_random'), ilObjTest::QUESTION_SET_TYPE_RANDOM);
     $qst->addOption($random);
     $fixed = new ilRadioOption($this->lng->txt('tst_question_set_type_fixed'), ilObjTest::QUESTION_SET_TYPE_FIXED);
     $qst->addOption($fixed);
     $new->addSubItem($qst);
     $cr_mode->addOption($new);
     // assign existing
     $existing = new ilRadioOption($this->lng->txt('crs_loc_form_assign'), self::TEST_ASSIGN);
     switch ($this->getTestType()) {
         case ilLOSettings::TYPE_TEST_INITIAL:
             $existing->setInfo($this->lng->txt("crs_loc_form_assign_initial_info"));
             break;
         case ilLOSettings::TYPE_TEST_QUALIFIED:
             $existing->setInfo($this->lng->txt("crs_loc_form_assign_qualified_info"));
             break;
     }
     if (!$assignable) {
         $existing->setDisabled(true);
     }
     $cr_mode->addOption($existing);
     $options = array();
     $options[''] = $this->lng->txt('select_one');
     foreach ((array) $assignable as $tst_ref_id) {
         $tst_obj_id = ilObject::_lookupObjId($tst_ref_id);
         $options[$tst_ref_id] = ilObject::_lookupTitle($tst_obj_id);
     }
     $selectable = new ilSelectInputGUI($this->lng->txt('crs_loc_form_available_tsts'), 'tst');
     $selectable->setRequired(true);
     $selectable->setOptions($options);
     $existing->addSubItem($selectable);
     $form->addItem($cr_mode);
     if ($a_as_multi_assignment) {
         include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
         $assignments = ilLOTestAssignments::getInstance($this->getContainer()->getId());
         include_once './Modules/Course/classes/class.ilCourseObjective.php';
         $objective_ids = ilCourseObjective::_getObjectiveIds($this->getContainer()->getId(), FALSE);
         $options = array();
         $options[''] = $this->lng->txt('select_one');
         foreach ($objective_ids as $oid) {
             $already_assigned_tst = $assignments->getTestByObjective($oid, $this->getTestType());
             if (!$already_assigned_tst) {
                 $options[$oid] = ilCourseObjective::lookupObjectiveTitle($oid);
             }
         }
         $objective = new ilSelectInputGUI($this->lng->txt('crs_objectives'), 'objective');
         $objective->setRequired(TRUE);
         $objective->setOptions($options);
         $form->addItem($objective);
     }
     return $form;
 }
 /**
  * Process the language maintenance
  */
 function maintainObject()
 {
     require_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTitle($this->lng->txt("language_maintenance"));
     $form->setPreventDoubleSubmission(false);
     $form->addCommandButton('maintainExecute', $this->lng->txt("language_process_maintenance"));
     $rg = new ilRadioGroupInputGUI($this->lng->txt("language_maintain_local_changes"), "maintain");
     $ro = new ilRadioOption($this->lng->txt("language_save_local_changes"), "save");
     $ro->setInfo(sprintf($this->lng->txt("language_save_local_changes_info"), $this->object->key));
     $rg->addOption($ro);
     $ro = new ilRadioOption($this->lng->txt("language_load_local_changes"), "load");
     $ro->setInfo(sprintf($this->lng->txt("language_load_local_changes_info"), $this->object->key));
     $rg->addOption($ro);
     $ro = new ilRadioOption($this->lng->txt("language_clear_local_changes"), "clear");
     $ro->setInfo(sprintf($this->lng->txt("language_clear_local_changes_info"), $this->object->key));
     $rg->addOption($ro);
     if ($this->langmode) {
         $ro = new ilRadioOption($this->lng->txt("language_delete_local_additions"), "delete_added");
         $ro->setInfo(sprintf($this->lng->txt("language_delete_local_additions_info"), $this->object->key));
         $rg->addOption($ro);
         $ro = new ilRadioOption($this->lng->txt("language_merge_local_changes"), "merge");
         $ro->setInfo(sprintf($this->lng->txt("language_merge_local_changes_info"), $this->object->key));
         $rg->addOption($ro);
         $ro = new ilRadioOption($this->lng->txt("language_remove_local_file"), "remove_local_file");
         $ro->setInfo(sprintf($this->lng->txt("language_remove_local_file_info"), $this->object->key));
         $rg->addOption($ro);
     }
     $rg->setValue($this->session["maintain"]);
     $form->addItem($rg);
     $this->tpl->setContent($form->getHTML());
 }
 /**
  * Init print view selection form.
  */
 public function initPrintViewSelectionForm()
 {
     global $lng, $ilCtrl;
     $terms = $this->glossary->getTermList();
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     $this->form->setTarget("print_view");
     $this->form->setFormAction($ilCtrl->getFormAction($this));
     // selection type
     $radg = new ilRadioGroupInputGUI($lng->txt("cont_selection"), "sel_type");
     $radg->setValue("glossary");
     // current term
     if ((int) $this->term_id > 0) {
         $op1 = new ilRadioOption($lng->txt("cont_current_term"), "term");
         $radg->addOption($op1);
         $radg->setValue("term");
     }
     // whole glossary
     $op2 = new ilRadioOption($lng->txt("cont_whole_glossary") . " (" . $lng->txt("cont_terms") . ": " . count($terms) . ")", "glossary");
     $radg->addOption($op2);
     // selected topic
     if (($t_id = $this->glossary->getTaxonomyId()) > 0 && $this->glossary->getShowTaxonomy()) {
         $op4 = new ilRadioOption($lng->txt("cont_selected_topic"), "sel_topic");
         $radg->addOption($op4);
         // topic drop down
         include_once "./Services/Taxonomy/classes/class.ilTaxAssignInputGUI.php";
         $si = new ilTaxAssignInputGUI($t_id, false, $lng->txt("cont_topic"), "topic", false);
         if ($this->tax_node > 0) {
             $si->setValue((int) $this->tax_node);
         }
         $op4->addSubItem($si);
     }
     // selected terms
     $op3 = new ilRadioOption($lng->txt("cont_selected_terms"), "selection");
     $radg->addOption($op3);
     include_once "./Services/Form/classes/class.ilNestedListInputGUI.php";
     $nl = new ilNestedListInputGUI("", "obj_id");
     $op3->addSubItem($nl);
     //var_dump($terms);
     foreach ($terms as $t) {
         $nl->addListNode($t["id"], $t["term"], 0, false, false);
     }
     $this->form->addItem($radg);
     $this->form->addCommandButton("printView", $lng->txt("cont_show_print_view"));
     $this->form->setTitle($lng->txt("cont_print_selection"));
 }
 /**
  * FORM NewsItem: Init form.
  *
  * @param	int	$a_mode	Form Edit Mode (IL_FORM_EDIT | IL_FORM_CREATE)
  */
 public function initFormNewsItem($a_mode)
 {
     global $lng, $ilTabs;
     $ilTabs->clearTargets();
     //$this->setTabs();
     $lng->loadLanguageModule("news");
     include "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form_gui = new ilPropertyFormGUI();
     // Property Title
     $text_input = new ilTextInputGUI($lng->txt("news_news_item_title"), "news_title");
     $text_input->setInfo("");
     $text_input->setRequired(true);
     $text_input->setMaxLength(200);
     $this->form_gui->addItem($text_input);
     // Property Content
     $text_area = new ilTextAreaInputGUI($lng->txt("news_news_item_content"), "news_content");
     $text_area->setInfo("");
     $text_area->setRequired(false);
     $this->form_gui->addItem($text_area);
     // Property Visibility
     $radio_group = new ilRadioGroupInputGUI($lng->txt("news_news_item_visibility"), "news_visibility");
     $radio_option = new ilRadioOption($lng->txt("news_visibility_users"), "users");
     $radio_group->addOption($radio_option);
     $radio_option = new ilRadioOption($lng->txt("news_visibility_public"), "public");
     $radio_group->addOption($radio_option);
     $radio_group->setInfo($lng->txt("news_news_item_visibility_info"));
     $radio_group->setRequired(false);
     $radio_group->setValue("users");
     $this->form_gui->addItem($radio_group);
     // Property ContentLong
     $text_area = new ilTextAreaInputGUI($lng->txt("news_news_item_content_long"), "news_content_long");
     $text_area->setInfo($lng->txt("news_news_item_content_long_info"));
     $text_area->setRequired(false);
     $text_area->setCols("40");
     $text_area->setRows("8");
     $text_area->setUseRte(true);
     $this->form_gui->addItem($text_area);
     // save and cancel commands
     if (in_array($a_mode, array(IL_FORM_CREATE, IL_FORM_RE_CREATE))) {
         $this->form_gui->addCommandButton("saveNewsItem", $lng->txt("save"));
         $this->form_gui->addCommandButton("cancelSaveNewsItem", $lng->txt("cancel"));
     } else {
         $this->form_gui->addCommandButton("updateNewsItem", $lng->txt("save"));
         $this->form_gui->addCommandButton("cancelUpdateNewsItem", $lng->txt("cancel"));
     }
     $this->form_gui->setTitle($lng->txt("news_news_item_head"));
     $this->form_gui->setFormAction($this->ctrl->getFormAction($this));
     $this->form_gui->setTitleIcon(ilUtil::getImagePath("icon_news.png"));
     $news_set = new ilSetting("news");
     if (!$news_set->get("enable_rss_for_internal")) {
         $this->form_gui->removeItemByPostVar("news_visibility");
     } else {
         $nv = $this->form_gui->getItemByPostVar("news_visibility");
         if (is_object($nv)) {
             $nv->setValue(ilNewsItem::_getDefaultVisibilityForRefId($_GET["ref_id"]));
         }
     }
 }
 private function buildCreateQuestionForm()
 {
     global $ilUser;
     // form
     require_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setTitle($this->lng->txt('ass_create_question'));
     $form->setFormAction($this->ctrl->getFormAction($this));
     // question type
     $options = array();
     foreach ($this->object->getQuestionTypes(false, true) as $translation => $data) {
         $options[$data['type_tag']] = $translation;
     }
     require_once "Services/Form/classes/class.ilSelectInputGUI.php";
     $si = new ilSelectInputGUI($this->lng->txt('question_type'), 'sel_question_types');
     $si->setOptions($options);
     //$si->setValue($ilUser->getPref("tst_lastquestiontype"));
     $form->addItem($si);
     // content editing mode
     if (ilObjAssessmentFolder::isAdditionalQuestionContentEditingModePageObjectEnabled()) {
         $ri = new ilRadioGroupInputGUI($this->lng->txt("tst_add_quest_cont_edit_mode"), "add_quest_cont_edit_mode");
         $ri->addOption(new ilRadioOption($this->lng->txt('tst_add_quest_cont_edit_mode_default'), assQuestion::ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT));
         $ri->addOption(new ilRadioOption($this->lng->txt('tst_add_quest_cont_edit_mode_page_object'), assQuestion::ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT));
         $ri->setValue(assQuestion::ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT);
         $form->addItem($ri, true);
     } else {
         $hi = new ilHiddenInputGUI("question_content_editing_type");
         $hi->setValue(assQuestion::ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT);
         $form->addItem($hi, true);
     }
     // commands
     $form->addCommandButton('createQuestion', $this->lng->txt('create'));
     $form->addCommandButton('questions', $this->lng->txt('cancel'));
     return $form;
 }
示例#23
0
 /**
  * Show didactic template types
  * @param ilPropertyFormGUI $form
  * @return ilPropertyFormGUI $form
  */
 protected function initDidacticTemplate(ilPropertyFormGUI $form)
 {
     global $lng;
     $lng->loadLanguageModule('didactic');
     $options = array();
     $options['dtpl_0'] = array($this->lng->txt('didactic_default_type'), sprintf($this->lng->txt('didactic_default_type_info'), $this->lng->txt('objs_' . $this->type)));
     include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateSettings.php';
     $templates = ilDidacticTemplateSettings::getInstanceByObjectType($this->type)->getTemplates();
     if ($templates) {
         foreach ($templates as $template) {
             $options["dtpl_" . $template->getId()] = array($template->getTitle(), $template->getDescription());
         }
     }
     $this->addDidacticTemplateOptions($options);
     if (sizeof($options) > 1) {
         $type = new ilRadioGroupInputGUI($this->lng->txt('type'), 'didactic_type');
         // workaround for containers in edit mode
         if (!$this->getCreationMode()) {
             include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateObjSettings.php';
             $type->setValue('dtpl_' . ilDidacticTemplateObjSettings::lookupTemplateId($this->object->getRefId()));
         } else {
             $type->setValue('dtpl_0');
         }
         $form->addItem($type);
         ilUtil::sortArray($options, 0);
         foreach ($options as $id => $data) {
             $option = new ilRadioOption($data[0], $id, $data[1]);
             $type->addOption($option);
         }
     }
     return $form;
 }
 /**
  * Edit settings.
  */
 public function editWebDAVSettings()
 {
     global $rbacsystem, $ilErr, $ilTabs;
     global $tpl, $ilCtrl, $lng, $tree, $settings;
     $this->tabs_gui->setTabActive('webdav');
     if (!$rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
         $ilErr->raiseError($lng->txt("no_permission"), $ilErr->WARNING);
     }
     require_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     require_once "./Services/Form/classes/class.ilCheckboxInputGUI.php";
     require_once "./Services/Form/classes/class.ilRadioGroupInputGUI.php";
     require_once "./Services/Form/classes/class.ilRadioOption.php";
     require_once "./Services/Form/classes/class.ilTextAreaInputGUI.php";
     require_once "./Services/WebDAV/classes/class.ilDAVServer.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($ilCtrl->getFormAction($this));
     $form->setTitle($lng->txt("settings"));
     // Enable webdav
     $ilDAVServer = ilDAVServer::getInstance();
     $isPearAuthHTTPInstalled = @(include_once "Auth/HTTP.php");
     $cb_prop = new ilCheckboxInputGUI($lng->txt("enable_webdav"), "enable_webdav");
     $cb_prop->setValue('1');
     $cb_prop->setChecked($this->object->isWebdavEnabled() && $isPearAuthHTTPInstalled);
     $cb_prop->setDisabled(!$isPearAuthHTTPInstalled);
     $cb_prop->setInfo($isPearAuthHTTPInstalled ? sprintf($lng->txt('enable_webdav_info'), $ilDAVServer->getMountURI($tree->getRootId(), 0, null, null, true)) : $lng->txt('webdav_pear_auth_http_needed'));
     $form->addItem($cb_prop);
     // Webdav help text
     if ($isPearAuthHTTPInstalled) {
         $rgi_prop = new ilRadioGroupInputGUI($lng->txt('webfolder_instructions'), 'custom_webfolder_instructions_choice');
         $rgi_prop->addOption(new ilRadioOption($lng->txt('use_default_instructions'), 'default'));
         $rgi_prop->addOption(new ilRadioOption($lng->txt('use_customized_instructions'), 'custom'));
         $rgi_prop->setValue($this->object->isCustomWebfolderInstructionsEnabled() ? 'custom' : 'default');
         $rgi_prop->setDisabled(!$isPearAuthHTTPInstalled);
         $form->addItem($rgi_prop);
         $tai_prop = new ilTextAreaInputGUI('', 'custom_webfolder_instructions');
         $tai_prop->setValue($this->object->getCustomWebfolderInstructions());
         $tai_prop->setInfo($lng->txt("webfolder_instructions_info"));
         $tai_prop->setCols(80);
         $tai_prop->setRows(20);
         $tai_prop->setDisabled(!$isPearAuthHTTPInstalled);
         $form->addItem($tai_prop);
     }
     // command buttons
     $form->addCommandButton('saveWebDAVSettings', $lng->txt('save'));
     $form->addCommandButton('view', $lng->txt('cancel'));
     $tpl->setContent($form->getHTML());
 }
 /**
  * Edit resources form.
  */
 function edit($a_insert = false)
 {
     global $ilCtrl, $tpl, $lng, $objDefinition;
     $this->displayValidationError();
     // edit form
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($ilCtrl->getFormAction($this));
     if ($a_insert) {
         $form->setTitle($this->lng->txt("cont_insert_resources"));
     } else {
         $form->setTitle($this->lng->txt("cont_update_resources"));
     }
     // count number of existing objects per type and collect item groups
     $ref_id = (int) $_GET["ref_id"];
     $childs = $this->rep_tree->getChilds($ref_id);
     $type_counts = array();
     $item_groups = array();
     foreach ($childs as $c) {
         $type_counts[$c["type"]] += 1;
         if ($c["type"] == "itgr") {
             $item_groups[$c["ref_id"]] = $c["title"];
         }
     }
     if (count($item_groups) > 0) {
         // radio group for type selection
         $radg = new ilRadioGroupInputGUI($lng->txt("cont_resources"), "res_type");
         if (!$a_insert && $this->content_obj->getMainType() == "ItemGroup") {
             $radg->setValue("itgr");
         } else {
             $radg->setValue("by_type");
         }
         $op_type = new ilRadioOption($lng->txt("cont_resources_of_type"), "by_type", "");
         $radg->addOption($op_type);
         $op_itemgroup = new ilRadioOption($lng->txt("obj_itgr"), "itgr", "");
         $radg->addOption($op_itemgroup);
         $form->addItem($radg);
     }
     // type selection
     $type_prop = new ilSelectInputGUI($this->lng->txt("cont_type"), "type");
     $obj_id = ilObject::_lookupObjId($_GET["ref_id"]);
     $obj_type = ilObject::_lookupType($obj_id);
     $sub_objs = $objDefinition->getGroupedRepositoryObjectTypes($obj_type);
     $types = array();
     foreach ($sub_objs as $k => $so) {
         if ($k != "itgr") {
             $types[$k] = $this->lng->txt("objs_" . $k) . " (" . (int) $type_counts[$k] . ")";
         }
     }
     $type_prop->setOptions($types);
     $selected = $a_insert ? "" : $this->content_obj->getResourceListType();
     $type_prop->setValue($selected);
     if (count($item_groups) > 0) {
         $op_type->addSubItem($type_prop);
     } else {
         $form->addItem($type_prop);
     }
     if (count($item_groups) > 0) {
         // item groups
         $options = $item_groups;
         $si = new ilSelectInputGUI($this->lng->txt("obj_itgr"), "itgr");
         $si->setOptions($options);
         $selected = $a_insert ? "" : $this->content_obj->getItemGroupRefId();
         $op_itemgroup->addSubItem($si);
     }
     // save/cancel buttons
     if ($a_insert) {
         $form->addCommandButton("create_resources", $lng->txt("save"));
         $form->addCommandButton("cancelCreate", $lng->txt("cancel"));
     } else {
         $form->addCommandButton("update_resources", $lng->txt("save"));
         $form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
     }
     $html = $form->getHTML();
     $tpl->setContent($html);
     return $ret;
 }
 public function showDetails()
 {
     global $ilMainMenu, $ilTabs, $ilToolbar, $ilUser;
     $this->__initPaymentObject();
     $this->__initPricesObject();
     $this->__initShoppingCartObject();
     $ilToolbar->addButton($this->lng->txt('payment_back_to_shop'), 'ilias.php?baseClass=ilShopController');
     $this->tpl->getStandardTemplate();
     $ilTabs->setTabActive('buy');
     $ilMainMenu->setActive('shop');
     if ($this->pobject->getStatus() == $this->pobject->STATUS_EXPIRES) {
         ilUtil::sendInfo($this->lng->txt('pay_expires_info'));
         return false;
     }
     $extension_prices = array();
     if ($ilUser->getId() != ANONYMOUS_USER_ID) {
         include_once './Services/Payment/classes/class.ilPaymentBookings.php';
         $has_extension_price = ilPaymentBookings::_hasAccesstoExtensionPrice($ilUser->getId(), $this->pobject->getPobjectId());
         if ($has_extension_price) {
             $extension_prices = $this->price_obj->getExtensionPrices();
         }
     }
     $org_prices = $this->price_obj->getPrices();
     $tmp_prices = array_merge($org_prices, $extension_prices);
     $prices = array();
     foreach ($tmp_prices as $price) {
         // expired prices must be filtered out
         if ($price['price_type'] == ilPaymentPrices::TYPE_DURATION_DATE && $price['duration_until'] < date('Y-m-d')) {
             //do nothing
         } else {
             $prices[] = $price;
         }
     }
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $buyedObject = "";
     if ($this->sc_obj->isInShoppingCart($this->pobject->getPobjectId())) {
         $buyedObject = $this->sc_obj->getEntry($this->pobject->getPobjectId());
         if (is_array($prices) && count($prices) > 1) {
             ilUtil::sendInfo($this->lng->txt('pay_item_already_in_sc_choose_another'));
         } else {
             ilUtil::sendInfo($this->lng->txt('pay_item_already_in_sc'));
         }
     }
     $this->ctrl->setParameter($this, "ref_id", $this->pobject->getRefId());
     $subtype = '';
     if ($this->object) {
         if ($this->object->getType() == 'exc') {
             $subtype = ' (' . $this->lng->txt($this->pobject->getSubtype()) . ')';
         }
         $form->setTitle($this->object->getTitle() . ' ' . $subtype);
         $form->setTitleIcon(ilObject::_getIcon($this->object->getId()));
     } else {
         ilUtil::sendFailure($this->lng->txt('object_not_found'));
     }
     // payment infos
     $info = new ilNonEditableValueGUI($this->lng->txt('info'));
     $info->setValue($this->lng->txt('pay_info'));
     $form->addItem($info);
     if (is_array($buyedObject)) {
         if (is_array($prices) && count($prices) > 1) {
             $button_txt = $this->lng->txt('pay_change_price');
         } else {
             $button_txt = $this->lng->txt('pay_add_to_shopping_cart');
         }
     } else {
         $button_txt = $this->lng->txt('pay_add_to_shopping_cart');
     }
     $rg_prices = new ilRadioGroupInputGUI($this->lng->txt('prices'), 'price_id');
     if (is_array($prices)) {
         foreach ($prices as $price) {
             if (is_array($buyedObject) && $buyedObject["price_id"] == $price['price_id']) {
                 $rg_prices->setValue($price['price_id']);
             } else {
                 if (count($prices) == 1) {
                     $rg_prices->setValue($price['price_id']);
                 }
             }
             switch ($price['price_type']) {
                 case ilPaymentPrices::TYPE_DURATION_MONTH:
                     $txt_price = $price['duration'] . ' ' . $this->lng->txt('paya_months') . ': ';
                     break;
                 case ilPaymentPrices::TYPE_DURATION_DATE:
                     $txt_price = ilDatePresentation::formatDate(new ilDate($price['duration_from'], IL_CAL_DATE)) . ' - ' . ilDatePresentation::formatDate(new ilDate($price['duration_until'], IL_CAL_DATE)) . ':  ';
                     break;
                 case ilPaymentPrices::TYPE_UNLIMITED_DURATION:
                     $txt_price = $this->lng->txt('unlimited_duration') . ': ';
                     break;
             }
             $tmp_price = $price['price'];
             $extension_txt = '';
             if ($price['extension'] == 1) {
                 $extension_txt = '(' . $this->lng->txt('extension_price') . ')';
             }
             $price_row = new ilRadioOption($txt_price . ' ' . ilPaymentPrices::_formatPriceToString((double) $tmp_price) . ' ' . $extension_txt, $price['price_id']);
             $price_row->setInfo($price['description']);
             $rg_prices->addOption($price_row);
         }
         $form->addItem($rg_prices);
     }
     $form->addCommandButton('addToShoppingCart', $button_txt);
     return $this->tpl->setContent($form->getHTML());
 }
 /**
  * Insert new question form
  */
 function insert($a_mode = "create")
 {
     global $ilUser, $lng, $ilCtrl;
     $this->setInsertTabs("new_question");
     $this->displayValidationError();
     // get all question types (@todo: we have to check, whether they are
     // suitable for self assessment or not)
     include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
     $all_types = ilObjQuestionPool::_getSelfAssessmentQuestionTypes();
     $options = array();
     $all_types = ilUtil::sortArray($all_types, "order", "asc", true, true);
     foreach ($all_types as $k => $v) {
         $options[$v["type_tag"]] = $k;
     }
     // new table form (input of rows and columns)
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form_gui = new ilPropertyFormGUI();
     $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
     $this->form_gui->setTitle($lng->txt("cont_ed_insert_pcqst"));
     // Select Question Type
     $qtype_input = new ilSelectInputGUI($lng->txt("cont_question_type"), "q_type");
     $qtype_input->setOptions($options);
     $qtype_input->setRequired(true);
     $this->form_gui->addItem($qtype_input);
     // additional content editor
     // assessment
     include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
     if (ilObjAssessmentFolder::isAdditionalQuestionContentEditingModePageObjectEnabled()) {
         $ri = new ilRadioGroupInputGUI($this->lng->txt("tst_add_quest_cont_edit_mode"), "add_quest_cont_edit_mode");
         $ri->addOption(new ilRadioOption($this->lng->txt('tst_add_quest_cont_edit_mode_default'), assQuestion::ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT));
         $ri->addOption(new ilRadioOption($this->lng->txt('tst_add_quest_cont_edit_mode_page_object'), assQuestion::ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT));
         $ri->setValue(assQuestion::ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT);
         $this->form_gui->addItem($ri, true);
     } else {
         $hi = new ilHiddenInputGUI("question_content_editing_type");
         $hi->setValue(assQuestion::ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT);
         $this->form_gui->addItem($hi, true);
     }
     // Select Question Pool
     /*
     		include_once("./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
     		$qpools = ilObjQuestionPool::_getAvailableQuestionpools(false, false, false, true, false, "write");
     
     		if (count($qpools) > 0)
     		{
     			$pool_options = array();
     			foreach ($qpools as $key => $value)
     			{
     				$pool_options[$key] = $value["title"];
     			}
     			$pool_input = new ilSelectInputGUI($lng->txt("cont_question_pool"), "qpool_ref_id");
     			$pool_input->setOptions($pool_options);
     			$pool_input->setRequired(true);
     			$this->form_gui->addItem($pool_input);
     		}
     		else
     		{
     			$pool_input = new ilTextInputGUI($lng->txt("cont_question_pool"), "qpool_title");
     			$pool_input->setRequired(true);
     			$this->form_gui->addItem($pool_input);
     		}
     */
     if ($a_mode == "edit_empty") {
         $this->form_gui->addCommandButton("edit", $lng->txt("save"));
     } else {
         $this->form_gui->addCommandButton("create_pcqst", $lng->txt("save"));
         $this->form_gui->addCommandButton("cancelCreate", $lng->txt("cancel"));
     }
     $this->tpl->setContent($this->form_gui->getHTML());
 }
示例#28
0
 /**
  * Init survey settings form
  * 
  * @return ilPropertyFormGUI
  */
 function initPropertiesForm()
 {
     $template_settings = $hide_rte_switch = null;
     $template = $this->object->getTemplate();
     if ($template) {
         include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
         $template = new ilSettingsTemplate($template);
         $template_settings = $template->getSettings();
         $hide_rte_switch = $template_settings["rte_switch"]["hide"];
     }
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTableWidth("100%");
     $form->setId("survey_properties");
     // general properties
     $header = new ilFormSectionHeaderGUI();
     $header->setTitle($this->lng->txt("settings"));
     $form->addItem($header);
     // title & description (meta data)
     include_once 'Services/MetaData/classes/class.ilMD.php';
     $md_obj = new ilMD($this->object->getId(), 0, "svy");
     $md_section = $md_obj->getGeneral();
     $title = new ilTextInputGUI($this->lng->txt("title"), "title");
     $title->setRequired(true);
     $title->setValue($md_section->getTitle());
     $form->addItem($title);
     $ids = $md_section->getDescriptionIds();
     if ($ids) {
         $desc_obj = $md_section->getDescription(array_pop($ids));
         $desc = new ilTextAreaInputGUI($this->lng->txt("description"), "description");
         $desc->setCols(50);
         $desc->setRows(4);
         $desc->setValue($desc_obj->getDescription());
         $form->addItem($desc);
     }
     // pool usage
     $pool_usage = new ilRadioGroupInputGUI($this->lng->txt("survey_question_pool_usage"), "use_pool");
     $opt = new ilRadioOption($this->lng->txt("survey_question_pool_usage_active"), 1);
     $opt->setInfo($this->lng->txt("survey_question_pool_usage_active_info"));
     $pool_usage->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt("survey_question_pool_usage_inactive"), 0);
     $opt->setInfo($this->lng->txt("survey_question_pool_usage_inactive_info"));
     $pool_usage->addOption($opt);
     $pool_usage->setValue($this->object->getPoolUsage());
     $form->addItem($pool_usage);
     // 360°: appraisees
     if ($this->object->get360Mode()) {
         $self_eval = new ilCheckboxInputGUI($this->lng->txt("survey_360_self_evaluation"), "self_eval");
         $self_eval->setInfo($this->lng->txt("survey_360_self_evaluation_info"));
         $self_eval->setChecked($this->object->get360SelfEvaluation());
         $form->addItem($self_eval);
         $self_rate = new ilCheckboxInputGUI($this->lng->txt("survey_360_self_raters"), "self_rate");
         $self_rate->setInfo($this->lng->txt("survey_360_self_raters_info"));
         $self_rate->setChecked($this->object->get360SelfRaters());
         $form->addItem($self_rate);
         $self_appr = new ilCheckboxInputGUI($this->lng->txt("survey_360_self_appraisee"), "self_appr");
         $self_appr->setInfo($this->lng->txt("survey_360_self_appraisee_info"));
         $self_appr->setChecked($this->object->get360SelfAppraisee());
         $form->addItem($self_appr);
     }
     // activation
     include_once "Services/Object/classes/class.ilObjectActivation.php";
     $this->lng->loadLanguageModule('rep');
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('rep_activation_availability'));
     $form->addItem($section);
     // additional info only with multiple references
     $act_obj_info = $act_ref_info = "";
     if (sizeof(ilObject::_getAllReferences($this->object->getId())) > 1) {
         $act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info');
         $act_ref_info = $this->lng->txt('rep_activation_access_ref_info');
     }
     $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online');
     $online->setInfo($this->lng->txt('svy_activation_online_info') . $act_obj_info);
     $online->setChecked($this->object->isOnline());
     $form->addItem($online);
     $act_type = new ilCheckboxInputGUI($this->lng->txt('rep_visibility_until'), 'access_type');
     // $act_type->setInfo($this->lng->txt('svy_availability_until_info'));
     $act_type->setChecked($this->object->isActivationLimited());
     $this->tpl->addJavaScript('./Services/Form/js/date_duration.js');
     include_once "Services/Form/classes/class.ilDateDurationInputGUI.php";
     $dur = new ilDateDurationInputGUI($this->lng->txt('rep_time_period'), "access_period");
     $dur->setShowTime(true);
     $date = $this->object->getActivationStartDate();
     $dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
     $dur->setStartText($this->lng->txt('rep_activation_limited_start'));
     $date = $this->object->getActivationEndDate();
     $dur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
     $dur->setEndText($this->lng->txt('rep_activation_limited_end'));
     $act_type->addSubItem($dur);
     $visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'access_visiblity');
     $visible->setInfo($this->lng->txt('svy_activation_limited_visibility_info'));
     $visible->setChecked($this->object->getActivationVisibility());
     $act_type->addSubItem($visible);
     $form->addItem($act_type);
     // before start
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('svy_settings_section_before_start'));
     $form->addItem($section);
     // introduction
     $intro = new ilTextAreaInputGUI($this->lng->txt("introduction"), "introduction");
     $intro->setValue($this->object->prepareTextareaOutput($this->object->getIntroduction()));
     $intro->setRows(10);
     $intro->setCols(80);
     $intro->setUseRte(TRUE);
     $intro->setInfo($this->lng->txt("survey_introduction_info"));
     include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
     $intro->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("survey"));
     $intro->addPlugin("latex");
     $intro->addButton("latex");
     $intro->addButton("pastelatex");
     $intro->setRTESupport($this->object->getId(), "svy", "survey", null, $hide_rte_switch);
     $form->addItem($intro);
     // access
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('svy_settings_section_access'));
     $form->addItem($section);
     // enable start date
     $start = $this->object->getStartDate();
     $enablestartingtime = new ilCheckboxInputGUI($this->lng->txt("start_date"), "enabled_start_date");
     $enablestartingtime->setValue(1);
     // $enablestartingtime->setOptionTitle($this->lng->txt("enabled"));
     $enablestartingtime->setChecked($start);
     // start date
     $startingtime = new ilDateTimeInputGUI('', 'start_date');
     $startingtime->setShowTime(true);
     if ($start) {
         $startingtime->setDate(new ilDate($start, IL_CAL_TIMESTAMP));
     }
     $enablestartingtime->addSubItem($startingtime);
     $form->addItem($enablestartingtime);
     // enable end date
     $end = $this->object->getEndDate();
     $enableendingtime = new ilCheckboxInputGUI($this->lng->txt("end_date"), "enabled_end_date");
     $enableendingtime->setValue(1);
     // $enableendingtime->setOptionTitle($this->lng->txt("enabled"));
     $enableendingtime->setChecked($end);
     // end date
     $endingtime = new ilDateTimeInputGUI('', 'end_date');
     $endingtime->setShowTime(true);
     if ($end) {
         $endingtime->setDate(new ilDate($end, IL_CAL_TIMESTAMP));
     }
     $enableendingtime->addSubItem($endingtime);
     $form->addItem($enableendingtime);
     // anonymization
     if (!$this->object->get360Mode()) {
         $codes = new ilCheckboxInputGUI($this->lng->txt("survey_access_codes"), "acc_codes");
         $codes->setInfo($this->lng->txt("survey_access_codes_info"));
         $codes->setChecked(!$this->object->isAccessibleWithoutCode());
         $form->addItem($codes);
         if ($this->object->_hasDatasets($this->object->getSurveyId())) {
             $codes->setDisabled(true);
         }
     }
     // question behaviour
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('svy_settings_section_question_behaviour'));
     $form->addItem($section);
     // show question titles
     $show_question_titles = new ilCheckboxInputGUI($this->lng->txt("svy_show_questiontitles"), "show_question_titles");
     $show_question_titles->setValue(1);
     $show_question_titles->setChecked($this->object->getShowQuestionTitles());
     $form->addItem($show_question_titles);
     // finishing
     $info = new ilFormSectionHeaderGUI();
     $info->setTitle($this->lng->txt("svy_settings_section_finishing"));
     $form->addItem($info);
     $view_own = new ilCheckboxInputGUI($this->lng->txt("svy_results_view_own"), "view_own");
     $view_own->setInfo($this->lng->txt("svy_results_view_own_info"));
     $view_own->setChecked($this->object->hasViewOwnResults());
     $form->addItem($view_own);
     $mail_own = new ilCheckboxInputGUI($this->lng->txt("svy_results_mail_own"), "mail_own");
     $mail_own->setInfo($this->lng->txt("svy_results_mail_own_info"));
     $mail_own->setChecked($this->object->hasMailOwnResults());
     $form->addItem($mail_own);
     // final statement
     $finalstatement = new ilTextAreaInputGUI($this->lng->txt("outro"), "outro");
     $finalstatement->setValue($this->object->prepareTextareaOutput($this->object->getOutro()));
     $finalstatement->setRows(10);
     $finalstatement->setCols(80);
     $finalstatement->setUseRte(TRUE);
     $finalstatement->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("survey"));
     $finalstatement->addPlugin("latex");
     $finalstatement->addButton("latex");
     $finalstatement->addButton("pastelatex");
     $finalstatement->setRTESupport($this->object->getId(), "svy", "survey", null, $hide_rte_switch);
     $form->addItem($finalstatement);
     // mail notification
     $mailnotification = new ilCheckboxInputGUI($this->lng->txt("mailnotification"), "mailnotification");
     // $mailnotification->setOptionTitle($this->lng->txt("activate"));
     $mailnotification->setInfo($this->lng->txt("svy_result_mail_notification_info"));
     // #11762
     $mailnotification->setValue(1);
     $mailnotification->setChecked($this->object->getMailNotification());
     // addresses
     $mailaddresses = new ilTextInputGUI($this->lng->txt("mailaddresses"), "mailaddresses");
     $mailaddresses->setValue($this->object->getMailAddresses());
     $mailaddresses->setSize(80);
     $mailaddresses->setInfo($this->lng->txt('mailaddresses_info'));
     $mailaddresses->setRequired(true);
     // participant data
     $participantdata = new ilTextAreaInputGUI($this->lng->txt("mailparticipantdata"), "mailparticipantdata");
     $participantdata->setValue($this->object->getMailParticipantData());
     $participantdata->setRows(6);
     $participantdata->setCols(80);
     $participantdata->setUseRte(false);
     $participantdata->setInfo($this->lng->txt("mailparticipantdata_info"));
     // #12755 - because of privacy concerns we restrict user data to a minimum
     $placeholders = array("FIRST_NAME" => "firstname", "LAST_NAME" => "lastname", "LOGIN" => "login");
     $txt = array();
     foreach ($placeholders as $placeholder => $caption) {
         $txt[] = "[" . strtoupper($placeholder) . "]: " . $this->lng->txt($caption);
     }
     $txt = implode("<br />", $txt);
     $participantdatainfo = new ilNonEditableValueGUI($this->lng->txt("mailparticipantdata_placeholder"), "", true);
     $participantdatainfo->setValue($txt);
     $mailnotification->addSubItem($mailaddresses);
     $mailnotification->addSubItem($participantdata);
     $mailnotification->addSubItem($participantdatainfo);
     $form->addItem($mailnotification);
     // tutor notification - currently not available for 360°
     if (!$this->object->get360Mode()) {
         // parent course?
         global $tree;
         $has_parent = $tree->checkForParentType($this->object->getRefId(), "grp");
         if (!$has_parent) {
             $has_parent = $tree->checkForParentType($this->object->getRefId(), "crs");
         }
         $num_inv = sizeof($this->object->getInvitedUsers());
         // notification
         $tut = new ilCheckboxInputGUI($this->lng->txt("survey_notification_tutor_setting"), "tut");
         $tut->setChecked($this->object->getTutorNotificationStatus());
         $form->addItem($tut);
         $tut_logins = array();
         $tuts = $this->object->getTutorNotificationRecipients();
         if ($tuts) {
             foreach ($tuts as $tut_id) {
                 $tmp = ilObjUser::_lookupName($tut_id);
                 if ($tmp["login"]) {
                     $tut_logins[] = $tmp["login"];
                 }
             }
         }
         $tut_ids = new ilTextInputGUI($this->lng->txt("survey_notification_tutor_recipients"), "tut_ids");
         $tut_ids->setDataSource($this->ctrl->getLinkTarget($this, "doAutoComplete", "", true));
         $tut_ids->setRequired(true);
         $tut_ids->setMulti(true);
         $tut_ids->setMultiValues($tut_logins);
         $tut_ids->setValue(array_shift($tut_logins));
         $tut->addSubItem($tut_ids);
         $tut_grp = new ilRadioGroupInputGUI($this->lng->txt("survey_notification_target_group"), "tut_grp");
         $tut_grp->setRequired(true);
         $tut_grp->setValue($this->object->getTutorNotificationTarget());
         $tut->addSubItem($tut_grp);
         $tut_grp_crs = new ilRadioOption($this->lng->txt("survey_notification_target_group_parent_course"), ilObjSurvey::NOTIFICATION_PARENT_COURSE);
         if (!$has_parent) {
             $tut_grp_crs->setInfo($this->lng->txt("survey_notification_target_group_parent_course_inactive"));
         }
         $tut_grp->addOption($tut_grp_crs);
         $tut_grp_inv = new ilRadioOption($this->lng->txt("survey_notification_target_group_invited"), ilObjSurvey::NOTIFICATION_INVITED_USERS);
         $tut_grp_inv->setInfo(sprintf($this->lng->txt("survey_notification_target_group_invited_info"), $num_inv));
         $tut_grp->addOption($tut_grp_inv);
     }
     // reminders
     // reminder - currently not available for 360°
     if (!$this->object->get360Mode()) {
         $info = new ilFormSectionHeaderGUI();
         $info->setTitle($this->lng->txt("svy_settings_section_reminders"));
         $form->addItem($info);
         $rmd = new ilCheckboxInputGUI($this->lng->txt("survey_reminder_setting"), "rmd");
         $rmd->setChecked($this->object->getReminderStatus());
         $form->addItem($rmd);
         $rmd_start = new ilDateTimeInputGUI($this->lng->txt("survey_reminder_start"), "rmd_start");
         $rmd_start->setRequired(true);
         $start = $this->object->getReminderStart();
         if ($start) {
             $rmd_start->setDate($start);
         }
         $rmd->addSubItem($rmd_start);
         $end = $this->object->getReminderEnd();
         $rmd_end = new ilDateTimeInputGUI($this->lng->txt("survey_reminder_end"), "rmd_end");
         $rmd_end->enableDateActivation("", "rmd_end_tgl", (bool) $end);
         if ($end) {
             $rmd_end->setDate($end);
         }
         $rmd->addSubItem($rmd_end);
         $rmd_freq = new ilNumberInputGUI($this->lng->txt("survey_reminder_frequency"), "rmd_freq");
         $rmd_freq->setRequired(true);
         $rmd_freq->setSize(3);
         $rmd_freq->setSuffix($this->lng->txt("survey_reminder_frequency_days"));
         $rmd_freq->setValue($this->object->getReminderFrequency());
         $rmd_freq->setMinValue(1);
         $rmd->addSubItem($rmd_freq);
         $rmd_grp = new ilRadioGroupInputGUI($this->lng->txt("survey_notification_target_group"), "rmd_grp");
         $rmd_grp->setRequired(true);
         $rmd_grp->setValue($this->object->getReminderTarget());
         $rmd->addSubItem($rmd_grp);
         $rmd_grp_crs = new ilRadioOption($this->lng->txt("survey_notification_target_group_parent_course"), ilObjSurvey::NOTIFICATION_PARENT_COURSE);
         if (!$has_parent) {
             $rmd_grp_crs->setInfo($this->lng->txt("survey_notification_target_group_parent_course_inactive"));
         }
         $rmd_grp->addOption($rmd_grp_crs);
         $rmd_grp_inv = new ilRadioOption($this->lng->txt("survey_notification_target_group_invited"), ilObjSurvey::NOTIFICATION_INVITED_USERS);
         $rmd_grp_inv->setInfo(sprintf($this->lng->txt("survey_notification_target_group_invited_info"), $num_inv));
         $rmd_grp->addOption($rmd_grp_inv);
     }
     // results
     $results = new ilFormSectionHeaderGUI();
     $results->setTitle($this->lng->txt("results"));
     $form->addItem($results);
     // evaluation access
     if (!$this->object->get360Mode()) {
         $evaluation_access = new ilRadioGroupInputGUI($this->lng->txt('evaluation_access'), "evaluation_access");
         $option = new ilCheckboxOption($this->lng->txt("evaluation_access_off"), ilObjSurvey::EVALUATION_ACCESS_OFF, '');
         $option->setInfo($this->lng->txt("svy_evaluation_access_off_info"));
         $evaluation_access->addOption($option);
         $option = new ilCheckboxOption($this->lng->txt("evaluation_access_all"), ilObjSurvey::EVALUATION_ACCESS_ALL, '');
         $option->setInfo($this->lng->txt("svy_evaluation_access_all_info"));
         $evaluation_access->addOption($option);
         $option = new ilCheckboxOption($this->lng->txt("evaluation_access_participants"), ilObjSurvey::EVALUATION_ACCESS_PARTICIPANTS, '');
         $option->setInfo($this->lng->txt("svy_evaluation_access_participants_info"));
         $evaluation_access->addOption($option);
         $evaluation_access->setValue($this->object->getEvaluationAccess());
         $form->addItem($evaluation_access);
         $anonymization_options = new ilRadioGroupInputGUI($this->lng->txt("survey_results_anonymization"), "anonymization_options");
         $option = new ilCheckboxOption($this->lng->txt("survey_results_personalized"), "statpers");
         $option->setInfo($this->lng->txt("survey_results_personalized_info"));
         $anonymization_options->addOption($option);
         $option = new ilCheckboxOption($this->lng->txt("survey_results_anonymized"), "statanon");
         $option->setInfo($this->lng->txt("survey_results_anonymized_info"));
         $anonymization_options->addOption($option);
         $anonymization_options->setValue($this->object->hasAnonymizedResults() ? "statanon" : "statpers");
         $form->addItem($anonymization_options);
         if ($this->object->_hasDatasets($this->object->getSurveyId())) {
             $anonymization_options->setDisabled(true);
         }
     } else {
         $ts_results = new ilRadioGroupInputGUI($this->lng->txt("survey_360_results"), "ts_res");
         $ts_results->setValue($this->object->get360Results());
         $option = new ilRadioOption($this->lng->txt("survey_360_results_none"), ilObjSurvey::RESULTS_360_NONE);
         $option->setInfo($this->lng->txt("survey_360_results_none_info"));
         $ts_results->addOption($option);
         $option = new ilRadioOption($this->lng->txt("survey_360_results_own"), ilObjSurvey::RESULTS_360_OWN);
         $option->setInfo($this->lng->txt("survey_360_results_own_info"));
         $ts_results->addOption($option);
         $option = new ilRadioOption($this->lng->txt("survey_360_results_all"), ilObjSurvey::RESULTS_360_ALL);
         $option->setInfo($this->lng->txt("survey_360_results_all_info"));
         $ts_results->addOption($option);
         $form->addItem($ts_results);
     }
     // competence service activation for 360 mode
     include_once "./Services/Skill/classes/class.ilSkillManagementSettings.php";
     $skmg_set = new ilSkillManagementSettings();
     if ($this->object->get360Mode() && $skmg_set->isActivated()) {
         $other = new ilFormSectionHeaderGUI();
         $other->setTitle($this->lng->txt("other"));
         $form->addItem($other);
         $skill_service = new ilCheckboxInputGUI($this->lng->txt("survey_activate_skill_service"), "skill_service");
         $skill_service->setInfo($this->lng->txt("survey_activate_skill_service_info"));
         $skill_service->setChecked($this->object->get360SkillService());
         $form->addItem($skill_service);
     }
     $form->addCommandButton("saveProperties", $this->lng->txt("save"));
     // remove items when using template
     if ($template_settings) {
         foreach ($template_settings as $id => $item) {
             if ($item["hide"]) {
                 $form->removeItemByPostVar($id);
             }
         }
     }
     return $form;
 }
示例#29
0
 public function adoptTeamAssignmentsFormObject()
 {
     global $ilCtrl, $ilTabs, $lng, $tpl;
     $this->checkPermission("write");
     if (!$this->ass) {
         $ilCtrl->redirect($this, "listAssignments");
     }
     $ilTabs->activateTab("content");
     $this->addContentSubTabs("list_assignments");
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setTitle($lng->txt("exc_team_assignment_adopt"));
     $form->setFormAction($ilCtrl->getFormAction($this, "adoptTeamAssignments"));
     $options = ilExAssignment::getAdoptableTeamAssignments($this->ass->getExerciseId());
     // we must not have existing teams in assignment
     if (array_key_exists($this->ass->getId(), $options)) {
         $ilCtrl->redirect($this, "listAssignments");
     }
     $teams = new ilRadioGroupInputGUI($lng->txt("exc_assignment"), "ass_adpt");
     $teams->setValue(-1);
     $teams->addOption(new ilRadioOption($lng->txt("exc_team_assignment_adopt_none"), -1));
     foreach ($options as $id => $item) {
         $option = new ilRadioOption($item["title"], $id);
         $option->setInfo($lng->txt("exc_team_assignment_adopt_teams") . ": " . $item["teams"]);
         $teams->addOption($option);
     }
     $form->addItem($teams);
     $form->addCommandButton("adoptTeamAssignments", $lng->txt("save"));
     $form->addCommandButton("listAssignments", $lng->txt("cancel"));
     $tpl->setContent($form->getHTML());
 }
 /**
  * init auth mode determinitation form
  *
  * @access protected
  */
 protected function initAuthModeDetermination()
 {
     if (is_object($this->form)) {
         return true;
     }
     // Are there any authentication methods that support automatic determination ?
     include_once 'Services/Authentication/classes/class.ilAuthModeDetermination.php';
     $det = ilAuthModeDetermination::_getInstance();
     if ($det->getCountActiveAuthModes() <= 1) {
         return false;
     }
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($this->ctrl->getFormAction($this));
     $this->form->setTableWidth('100%');
     $this->form->setTitle($this->lng->txt('auth_auth_settings'));
     $this->form->addCommandButton('updateAuthModeDetermination', $this->lng->txt('save'));
     require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php';
     $cap = new ilCheckboxInputGUI($this->lng->txt('adm_captcha_anonymous_short'), 'activate_captcha_anonym');
     $cap->setInfo($this->lng->txt('adm_captcha_anonymous_auth'));
     $cap->setValue(1);
     if (!ilCaptchaUtil::checkFreetype()) {
         $cap->setAlert(ilCaptchaUtil::getPreconditionsMessage());
     }
     $cap->setChecked(ilCaptchaUtil::isActiveForLogin());
     $this->form->addItem($cap);
     $header = new ilFormSectionHeaderGUI();
     $header->setTitle($this->lng->txt('auth_auth_mode_determination'));
     $this->form->addItem($header);
     $kind = new ilRadioGroupInputGUI($this->lng->txt('auth_kind_determination'), 'kind');
     $kind->setInfo($this->lng->txt('auth_mode_determination_info'));
     $kind->setValue($det->getKind());
     $kind->setRequired(true);
     $option_user = new ilRadioOption($this->lng->txt('auth_by_user'), 0);
     $kind->addOption($option_user);
     $option_determination = new ilRadioOption($this->lng->txt('auth_automatic'), 1);
     include_once 'Services/Authentication/classes/class.ilAuthUtils.php';
     $auth_sequenced = $det->getAuthModeSequence();
     $counter = 1;
     foreach ($auth_sequenced as $auth_mode) {
         switch ($auth_mode) {
             case AUTH_LDAP:
                 $text = $this->lng->txt('auth_ldap');
                 break;
             case AUTH_RADIUS:
                 $text = $this->lng->txt('auth_radius');
                 break;
             case AUTH_LOCAL:
                 $text = $this->lng->txt('auth_local');
                 break;
             case AUTH_SOAP:
                 $text = $this->lng->txt('auth_soap');
                 break;
             case AUTH_APACHE:
                 $text = $this->lng->txt('auth_apache');
                 break;
                 // begin-patch auth_plugin
             // begin-patch auth_plugin
             default:
                 foreach (ilAuthUtils::getAuthPlugins() as $pl) {
                     $option = $pl->getMultipleAuthModeOptions($auth_mode);
                     $text = $option[$auth_mode]['txt'];
                 }
                 break;
                 // end-patch auth_plugin
         }
         $pos = new ilTextInputGUI($text, 'position[' . $auth_mode . ']');
         $pos->setValue($counter++);
         $pos->setSize(1);
         $pos->setMaxLength(1);
         $option_determination->addSubItem($pos);
     }
     $kind->addOption($option_determination);
     $this->form->addItem($kind);
     return true;
 }