本文整理汇总了PHP中ilRadioGroupInputGUI::setDisabled方法的典型用法代码示例。如果您正苦于以下问题:PHP ilRadioGroupInputGUI::setDisabled方法的具体用法?PHP ilRadioGroupInputGUI::setDisabled怎么用?PHP ilRadioGroupInputGUI::setDisabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilRadioGroupInputGUI
的用法示例。
在下文中一共展示了ilRadioGroupInputGUI::setDisabled方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addCustomEditForm
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);
}
示例2: addCustomEditForm
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);
}
示例3: editWebDAVSettings
/**
* 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());
}
示例4: buildForm
private function buildForm()
{
require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->addCommandButton(self::CMD_SAVE_FORM, $this->lng->txt("save"));
$form->setTableWidth("100%");
$form->setId("test_properties");
if (!$this->settingsTemplate || $this->formShowGeneralSection($this->settingsTemplate->getSettings())) {
// general properties
$header = new ilFormSectionHeaderGUI();
$header->setTitle($this->lng->txt("tst_general_properties"));
$form->addItem($header);
}
// title & description (meta data)
include_once 'Services/MetaData/classes/class.ilMD.php';
$md_obj = new ilMD($this->testOBJ->getId(), 0, "tst");
$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);
}
// anonymity
$anonymity = new ilRadioGroupInputGUI($this->lng->txt('tst_anonymity'), 'anonymity');
if ($this->testOBJ->participantDataExist()) {
$anonymity->setDisabled(true);
}
$rb = new ilRadioOption($this->lng->txt('tst_anonymity_no_anonymization'), 0);
$anonymity->addOption($rb);
$rb = new ilRadioOption($this->lng->txt('tst_anonymity_anonymous_test'), 1);
$anonymity->addOption($rb);
$anonymity->setValue((int) $this->testOBJ->getAnonymity());
$form->addItem($anonymity);
// test mode (question set type)
$questSetType = new ilRadioGroupInputGUI($this->lng->txt("tst_question_set_type"), 'question_set_type');
$questSetTypeFixed = new ilRadioOption($this->lng->txt("tst_question_set_type_fixed"), ilObjTest::QUESTION_SET_TYPE_FIXED, $this->lng->txt("tst_question_set_type_fixed_desc"));
$questSetType->addOption($questSetTypeFixed);
$questSetTypeRandom = new ilRadioOption($this->lng->txt("tst_question_set_type_random"), ilObjTest::QUESTION_SET_TYPE_RANDOM, $this->lng->txt("tst_question_set_type_random_desc"));
$questSetType->addOption($questSetTypeRandom);
$questSetTypeContinues = new ilRadioOption($this->lng->txt("tst_question_set_type_dynamic"), ilObjTest::QUESTION_SET_TYPE_DYNAMIC, $this->lng->txt("tst_question_set_type_dynamic_desc"));
$questSetType->addOption($questSetTypeContinues);
$questSetType->setValue($this->testOBJ->getQuestionSetType());
if ($this->testOBJ->participantDataExist()) {
$questSetType->setDisabled(true);
}
$form->addItem($questSetType);
// pool usage
$pool_usage = new ilCheckboxInputGUI($this->lng->txt("test_question_pool_usage"), "use_pool");
$pool_usage->setValue(1);
$pool_usage->setChecked($this->testOBJ->getPoolUsage());
$form->addItem($pool_usage);
// enable_archiving
$enable_archiving = new ilCheckboxInputGUI($this->lng->txt('test_enable_archiving'), 'enable_archiving');
$enable_archiving->setValue(1);
$enable_archiving->setChecked($this->testOBJ->getEnableArchiving());
$form->addItem($enable_archiving);
// activation/availability (no template support yet)
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->testOBJ->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->setChecked($this->testOBJ->isOnline());
$online->setInfo($this->lng->txt('tst_activation_online_info') . $act_obj_info);
$form->addItem($online);
$act_type = new ilRadioGroupInputGUI($this->lng->txt('rep_activation_access'), 'activation_type');
$act_type->setInfo($act_ref_info);
$act_type->setValue($this->testOBJ->isActivationLimited() ? ilObjectActivation::TIMINGS_ACTIVATION : ilObjectActivation::TIMINGS_DEACTIVATED);
$opt = new ilRadioOption($this->lng->txt('rep_visibility_limitless'), ilObjectActivation::TIMINGS_DEACTIVATED);
$opt->setInfo($this->lng->txt('tst_availability_limitless_info'));
$act_type->addOption($opt);
$opt = new ilRadioOption($this->lng->txt('rep_visibility_until'), ilObjectActivation::TIMINGS_ACTIVATION);
$opt->setInfo($this->lng->txt('tst_availability_until_info'));
$this->tpl->addJavaScript('./Services/Form/js/date_duration.js');
include_once "Services/Form/classes/class.ilDateDurationInputGUI.php";
$dur = new ilDateDurationInputGUI("", "access_period");
$dur->setShowTime(true);
$date = $this->testOBJ->getActivationStartingTime();
$dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
$dur->setStartText($this->lng->txt('rep_activation_limited_start'));
$date = $this->testOBJ->getActivationEndingTime();
$dur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
$dur->setEndText($this->lng->txt('rep_activation_limited_end'));
$opt->addSubItem($dur);
//.........这里部分代码省略.........
示例5: initQuestionForm
protected function initQuestionForm($a_read_only = false)
{
global $lng, $ilCtrl;
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($ilCtrl->getFormAction($this, "saveQuestion"));
$form->setTitle($lng->txt("obj_poll"));
$question = new ilTextAreaInputGUI($lng->txt("poll_question"), "question");
$question->setRequired(true);
$question->setCols(40);
$question->setRows(2);
$question->setValue($this->object->getQuestion());
$question->setDisabled($a_read_only);
$form->addItem($question);
$dimensions = " (" . ilObjPoll::getImageSize() . "px)";
$img = new ilImageFileInputGUI($lng->txt("poll_image") . $dimensions, "image");
$img->setDisabled($a_read_only);
$form->addItem($img);
// show existing file
$file = $this->object->getImageFullPath(true);
if ($file) {
$img->setImage($file);
}
$anonymous = new ilRadioGroupInputGUI($lng->txt("poll_mode"), "mode");
$anonymous->setRequired(true);
$option = new ilRadioOption($lng->txt("poll_mode_anonymous"), 0);
$option->setInfo($lng->txt("poll_mode_anonymous_info"));
$anonymous->addOption($option);
$option = new ilRadioOption($lng->txt("poll_mode_personal"), 1);
$option->setInfo($lng->txt("poll_mode_personal_info"));
$anonymous->addOption($option);
$anonymous->setValue($this->object->getNonAnonymous());
$anonymous->setDisabled($a_read_only);
$form->addItem($anonymous);
$nanswers = new ilNumberInputGUI($lng->txt("poll_max_number_of_answers"), "nanswers");
$nanswers->setRequired(true);
$nanswers->setMinValue(1);
$nanswers->setSize(3);
$nanswers->setValue($this->object->getMaxNumberOfAnswers());
$nanswers->setDisabled($a_read_only);
$form->addItem($nanswers);
$answers = new ilTextInputGUI($lng->txt("poll_answers"), "answers");
$answers->setRequired(true);
$answers->setMulti(true, true);
$answers->setDisabled($a_read_only);
$form->addItem($answers);
$multi_answers = array();
foreach ($this->object->getAnswers() as $idx => $item) {
if (!$idx) {
$answers->setValue($item["answer"]);
}
$multi_answers[] = $item["answer"];
}
$answers->setMultiValues($multi_answers);
if (!$a_read_only) {
$form->addCommandButton("saveQuestion", $lng->txt("save"));
}
return $form;
}
示例6: initAdobeSettingsForm
/**
* ilPropertyFormGUI initialisation
*
* @access private
*/
private function initAdobeSettingsForm()
{
/**
* @var $ilCtrl ilCtrl
* @var $lng $lng
*/
global $lng, $ilCtrl;
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
require_once './Services/Authentication/classes/class.ilAuthUtils.php';
$this->tabs->setTabActive('editAdobeSettings');
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($ilCtrl->getFormAction($this, 'saveAdobeSettings'));
$this->form->setTitle($this->getPluginObject()->txt('adobe_settings'));
$this->form->addCommandButton('saveAdobeSettings', $lng->txt('save'));
$this->form->addCommandButton('cancelAdobeSettings', $lng->txt('cancel'));
$form_server = new ilTextInputGUI($lng->txt('server'), 'server');
$form_server->setRequired(true);
$form_server->setInfo($this->getPluginObject()->txt('xavc_host_info'));
$this->form->addItem($form_server);
$form_port = new ilNumberInputGUI($lng->txt('port'), 'port');
$form_port->setSize(5);
$form_port->setMaxLength(5);
$form_port->setInfo($this->getPluginObject()->txt('xavc_port_info'));
$this->form->addItem($form_port);
$form_login = new ilTextInputGUI($lng->txt('login'), 'login');
$form_login->setRequired(true);
$this->form->addItem($form_login);
$form_passwd = new ilPasswordInputGUI($lng->txt('password'), 'password');
$form_passwd->setRequired(true);
$form_passwd->setRetype(false);
$this->form->addItem($form_passwd);
//Address to SWITCH Cave Server
$form_cave = new ilTextInputGUI($this->getPluginObject()->txt('cave'), 'cave');
$form_cave->setRequired(true);
// you can choose the mode for the creation of user-accounts at AdobeServer: the AC-Loginname could be the users-email-address or the ilias-loginname
$radio_group = new ilRadioGroupInputGUI($this->getPluginObject()->txt('user_assignment_mode'), 'user_assignment_mode');
$radio_option_1 = new ilRadioOption($this->getPluginObject()->txt('assign_users_with_email'), 'assign_user_email');
$radio_group->addOption($radio_option_1);
$radio_option_2 = new ilRadioOption($this->getPluginObject()->txt('assign_users_with_ilias_login'), 'assign_ilias_login');
$radio_group->addOption($radio_option_2);
$radio_option_3 = new ilRadioOption($this->getPluginObject()->txt('assign_users_with_switch_aai_login'), 'assign_breezeSession');
$radio_option_3->addSubItem($form_cave);
$radio_group->addOption($radio_option_3);
$radio_group->setInfo($this->getPluginObject()->txt('assignment_info'));
$radio_option_4 = new ilRadioOption($this->getPluginObject()->txt('assign_users_with_email_dfn'), 'assign_dfn_email');
$radio_group->addOption($radio_option_4);
if (ilAdobeConnectServer::getSetting('user_assignment_mode') != NULL) {
$radio_group->setDisabled(true);
}
$this->form->addItem($radio_group);
$auth_radio_grp = new ilRadioGroupInputGUI($this->getPluginObject()->txt('auth_mode'), 'auth_mode');
$auth_radio_opt_1 = new ilRadioOption($this->getPluginObject()->txt('auth_mode_password'), 'auth_mode_password');
$auth_radio_grp->addOption($auth_radio_opt_1);
$auth_radio_opt_2 = new ilRadioOption($this->getPluginObject()->txt('auth_mode_header'), 'auth_mode_header');
$form_x_user_id = new ilTextInputGUI($this->getPluginObject()->txt('x_user_id_header_var'), 'x_user_id');
$form_x_user_id->setInfo($this->getPluginObject()->txt('xavc_x_user_id_info'));
$auth_radio_opt_2->addSubItem($form_x_user_id);
$auth_radio_grp->addOption($auth_radio_opt_2);
$auth_radio_opt_3 = new ilRadioOption($this->getPluginObject()->txt('auth_mode_switchaai'), 'auth_mode_switchaai');
$switchaai_checkbox_grp = new ilCheckboxGroupInputGUI($this->getPluginObject()->txt('auth_mode_switchaai_accounts'), 'auth_mode_switchaai_account_type');
$switchaai_checkbox_grp->addOption(new ilCheckboxOption($this->getPluginObject()->txt('auth_mode_switchaai_local'), AUTH_LOCAL));
$switchaai_checkbox_grp->addOption(new ilCheckboxOption($this->getPluginObject()->txt('auth_mode_switchaai_ldap'), AUTH_LDAP));
$auth_radio_opt_3->addSubItem($switchaai_checkbox_grp);
$auth_radio_grp->addOption($auth_radio_opt_3);
$form_auth_mode_dfn = new ilRadioOption($this->getPluginObject()->txt('auth_mode_dfn'), 'auth_mode_dfn');
$auth_radio_grp->addOption($form_auth_mode_dfn);
$auth_radio_grp->setInfo($this->getPluginObject()->txt('authentification_mode_info'));
$this->form->addItem($auth_radio_grp);
$form_lead_time = new ilNumberInputGUI($this->getPluginObject()->txt('schedule_lead_time'), 'schedule_lead_time');
$form_lead_time->setDecimals(0);
$form_lead_time->setMinValue(0);
$form_lead_time->setRequired(true);
$form_lead_time->setSize(5);
$form_lead_time->setInfo($this->getPluginObject()->txt('schedule_lead_time_info'));
$this->form->addItem($form_lead_time);
$head_line = new ilFormSectionHeaderGUI();
$head_line->setTitle($this->getPluginObject()->txt('presentation_server_settings'));
$this->form->addItem($head_line);
$form_fe_server = new ilTextInputGUI($this->getPluginObject()->txt('presentation_server'), 'presentation_server');
$form_fe_server->setRequired(true);
$form_fe_server->setInfo($this->getPluginObject()->txt('xavc_presentation_host_info'));
$this->form->addItem($form_fe_server);
$form_fe_port = new ilNumberInputGUI($this->getPluginObject()->txt('presentation_port'), 'presentation_port');
$form_fe_port->setSize(5);
$form_fe_port->setMaxLength(5);
$form_fe_port->setInfo($this->getPluginObject()->txt('xavc_presentation_port_info'));
$this->form->addItem($form_fe_port);
}
示例7: addStandardFieldsToForm
/**
* Add standard fields to form
*/
function addStandardFieldsToForm($a_form, $a_user = NULL, array $custom_fields = NULL)
{
global $ilSetting, $lng, $rbacreview, $ilias;
// custom registration settings
if (self::$mode == self::MODE_REGISTRATION) {
include_once 'Services/Registration/classes/class.ilRegistrationSettings.php';
$registration_settings = new ilRegistrationSettings();
self::$user_field["username"]["group"] = "login_data";
self::$user_field["password"]["group"] = "login_data";
self::$user_field["language"]["default"] = $lng->lang_key;
// different position for role
$roles = self::$user_field["roles"];
unset(self::$user_field["roles"]);
self::$user_field["roles"] = $roles;
self::$user_field["roles"]["group"] = "settings";
}
$fields = $this->getStandardFields();
$current_group = "";
$custom_fields_done = false;
foreach ($fields as $f => $p) {
// next group? -> diplay subheader
if ($p["group"] != $current_group && ilUserProfile::userSettingVisible($f)) {
if (is_array($custom_fields) && !$custom_fields_done) {
// should be appended to "other" or at least before "settings"
if ($current_group == "other" || $p["group"] == "settings") {
// add "other" subheader
if ($current_group != "other") {
$sh = new ilFormSectionHeaderGUI();
$sh->setTitle($lng->txt("other"));
$a_form->addItem($sh);
}
foreach ($custom_fields as $custom_field) {
$a_form->addItem($custom_field);
}
$custom_fields_done = true;
}
}
$sh = new ilFormSectionHeaderGUI();
$sh->setTitle($lng->txt($p["group"]));
$a_form->addItem($sh);
$current_group = $p["group"];
}
$m = "";
if (isset($p["method"])) {
$m = $p["method"];
}
$lv = isset($p["lang_var"]) && $p["lang_var"] != "" ? $p["lang_var"] : $f;
switch ($p["input"]) {
case "login":
if ((int) $ilSetting->get('allow_change_loginname') || self::$mode == self::MODE_REGISTRATION) {
$val = new ilTextInputGUI($lng->txt('username'), 'username');
if ($a_user) {
$val->setValue($a_user->getLogin());
}
$val->setMaxLength(32);
$val->setSize(40);
$val->setRequired(true);
} else {
// user account name
$val = new ilNonEditableValueGUI($lng->txt("username"), 'ne_un');
if ($a_user) {
$val->setValue($a_user->getLogin());
}
}
$a_form->addItem($val);
break;
case "text":
if (ilUserProfile::userSettingVisible($f)) {
$ti = new ilTextInputGUI($lng->txt($lv), "usr_" . $f);
if ($a_user) {
$ti->setValue($a_user->{$m}());
}
$ti->setMaxLength($p["maxlength"]);
$ti->setSize($p["size"]);
$ti->setRequired($ilSetting->get("require_" . $f));
if (!$ti->getRequired() || $ti->getValue()) {
$ti->setDisabled($ilSetting->get("usr_settings_disable_" . $f));
}
$a_form->addItem($ti);
}
break;
case "sel_country":
if (ilUserProfile::userSettingVisible($f)) {
include_once "./Services/Form/classes/class.ilCountrySelectInputGUI.php";
$ci = new ilCountrySelectInputGUI($lng->txt($lv), "usr_" . $f);
if ($a_user) {
$ci->setValue($a_user->{$m}());
}
$ci->setRequired($ilSetting->get("require_" . $f));
if (!$ci->getRequired() || $ci->getValue()) {
$ci->setDisabled($ilSetting->get("usr_settings_disable_" . $f));
}
$a_form->addItem($ci);
}
break;
case "birthday":
if (ilUserProfile::userSettingVisible($f)) {
//.........这里部分代码省略.........
示例8: addMiscSettingsFormSection
private function addMiscSettingsFormSection(ilPropertyFormGUI $form)
{
// misc settings
$header_misc = new ilFormSectionHeaderGUI();
$header_misc->setTitle($this->lng->txt('misc'));
$form->addItem($header_misc);
// result filter taxonomies
if ($this->testQuestionSetConfigFactory->getQuestionSetConfig()->isResultTaxonomyFilterSupported()) {
$availableTaxonomyIds = $this->getAvailableTaxonomyIds();
if (count($availableTaxonomyIds)) {
require_once 'Modules/Test/classes/class.ilTestTaxonomyFilterLabelTranslater.php';
$labelTranslater = new ilTestTaxonomyFilterLabelTranslater($this->db);
$labelTranslater->loadLabelsFromTaxonomyIds($availableTaxonomyIds);
$results_presentation = new ilCheckboxGroupInputGUI($this->lng->txt('tst_results_tax_filters'), 'results_tax_filters');
foreach ($availableTaxonomyIds as $taxonomyId) {
$results_presentation->addOption(new ilCheckboxOption($labelTranslater->getTaxonomyTreeLabel($taxonomyId), $taxonomyId, ''));
}
$results_presentation->setValue($this->testOBJ->getResultFilterTaxIds());
$form->addItem($results_presentation);
}
}
// anonymity
$anonymity = new ilRadioGroupInputGUI($this->lng->txt('tst_anonymity'), 'anonymity');
if ($this->testOBJ->participantDataExist()) {
$anonymity->setDisabled(true);
}
$rb = new ilRadioOption($this->lng->txt('tst_anonymity_no_anonymization'), 0);
$anonymity->addOption($rb);
$rb = new ilRadioOption($this->lng->txt('tst_anonymity_anonymous_test'), 1);
$anonymity->addOption($rb);
$anonymity->setValue((int) $this->testOBJ->getAnonymity());
$form->addItem($anonymity);
// enable_archiving
$enable_archiving = new ilCheckboxInputGUI($this->lng->txt('test_enable_archiving'), 'enable_archiving');
$enable_archiving->setInfo($this->lng->txt('test_enable_archiving_desc'));
$enable_archiving->setValue(1);
$enable_archiving->setChecked($this->testOBJ->getEnableArchiving());
$form->addItem($enable_archiving);
}
示例9: initAppointmentCreationForm
protected function initAppointmentCreationForm($a_create = true)
{
global $lng;
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
if ($a_create) {
$form->setTitle(ilViteroPlugin::getInstance()->txt('tbl_add_appointment'));
$form->addCommandButton('createAppointment', ilViteroPlugin::getInstance()->txt('btn_add_appointment'));
} else {
$form->setTitle(ilViteroPlugin::getInstance()->txt('tbl_update_appointment'));
$form->addCommandButton('updateBooking', ilViteroPlugin::getInstance()->txt('save'));
}
$form->addCommandButton('showContent', $GLOBALS['lng']->txt('cancel'));
$settings = ilViteroSettings::getInstance();
// show selection
if ($settings->isCafeEnabled() and $settings->isStandardRoomEnabled()) {
$type_select = new ilRadioGroupInputGUI(ilViteroPlugin::getInstance()->txt('app_type'), 'atype');
if (!$a_create) {
$type_select->setDisabled(true);
}
$type_select->setValue(ilViteroRoom::TYPE_CAFE);
// Cafe
$cafe = new ilRadioOption(ilViteroPlugin::getInstance()->txt('app_type_cafe'), ilViteroRoom::TYPE_CAFE);
$type_select->addOption($cafe);
$this->initFormCafe($cafe, $a_create);
// Standard
$std = new ilRadioOption(ilViteroPlugin::getInstance()->txt('app_type_standard'), ilViteroRoom::TYPE_STD);
$type_select->addOption($std);
$this->initFormStandardRoom($std, $a_create);
$form->addItem($type_select);
} elseif ($settings->isCafeEnabled()) {
$this->initFormCafe($form, $a_create);
} elseif ($settings->isStandardRoomEnabled()) {
$this->initFormStandardRoom($form, $a_create);
}
$this->initFormTimeBuffer($form);
$this->initFormRoomSize($form, $a_create);
return $form;
}
示例10: initPropertiesForm
/**
* 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);
}
// anonymization
if (!$this->object->get360Mode()) {
$anonymization_options = new ilRadioGroupInputGUI($this->lng->txt("survey_auth_mode"), "anonymization_options");
$hasDatasets = $this->object->_hasDatasets($this->object->getSurveyId());
if ($hasDatasets) {
$anonymization_options->setDisabled(true);
}
$anonymization_options->addOption(new ilCheckboxOption($this->lng->txt("anonymize_personalized"), 'personalized', ''));
$anonymization_options->addOption(new ilCheckboxOption($this->lng->txt("anonymize_without_code"), 'anonymize_without_code', ''));
$anonymization_options->addOption(new ilCheckboxOption($this->lng->txt("anonymize_with_code"), 'anonymize_with_code', ''));
if (!$this->object->getAnonymize()) {
$anonymization_options->setValue('personalized');
} else {
$anonymization_options->setValue($this->object->isAccessibleWithoutCode() ? 'anonymize_without_code' : 'anonymize_with_code');
}
$anonymization_options->setInfo($this->lng->txt("anonymize_survey_description"));
$form->addItem($anonymization_options);
} else {
$self_eval = new ilCheckboxInputGUI($this->lng->txt("survey_360_self_evaluation"), "self_eval");
$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->setChecked($this->object->get360SelfRaters());
$form->addItem($self_rate);
$self_appr = new ilCheckboxInputGUI($this->lng->txt("survey_360_self_appraisee"), "self_appr");
$self_appr->setChecked($this->object->get360SelfAppraisee());
$form->addItem($self_appr);
}
// 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);
// 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 ilRadioGroupInputGUI($this->lng->txt('rep_activation_access'), 'access_type');
$act_type->setInfo($act_ref_info);
$act_type->setValue($this->object->isActivationLimited() ? ilObjectActivation::TIMINGS_ACTIVATION : ilObjectActivation::TIMINGS_DEACTIVATED);
$opt = new ilRadioOption($this->lng->txt('rep_visibility_limitless'), ilObjectActivation::TIMINGS_DEACTIVATED);
$opt->setInfo($this->lng->txt('svy_availability_limitless_info'));
//.........这里部分代码省略.........
示例11: addGeneralProperties
/**
* @param ilPropertyFormGUI $form
*/
private function addGeneralProperties(ilPropertyFormGUI $form)
{
$header = new ilFormSectionHeaderGUI();
$header->setTitle($this->lng->txt("tst_general_properties"));
$form->addItem($header);
// title & description (meta data)
include_once 'Services/MetaData/classes/class.ilMD.php';
$md_obj = new ilMD($this->testOBJ->getId(), 0, "tst");
$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('test_question_pool_usage'), 'use_pool');
$optional_qpl = new ilRadioOption($this->lng->txt('test_question_pool_usage_optional'), 1);
$optional_qpl->setInfo($this->lng->txt('test_question_pool_usage_optional_info'));
$pool_usage->addOption($optional_qpl);
$tst_directly = new ilRadioOption($this->lng->txt('test_question_pool_usage_tst_directly'), 0);
$tst_directly->setInfo($this->lng->txt('test_question_pool_usage_tst_directly_info'));
$pool_usage->addOption($tst_directly);
$pool_usage->setValue($this->testOBJ->getPoolUsage() ? 1 : 0);
$form->addItem($pool_usage);
// test mode (question set type)
$questSetType = new ilRadioGroupInputGUI($this->lng->txt("tst_question_set_type"), 'question_set_type');
$questSetTypeFixed = new ilRadioOption($this->lng->txt("tst_question_set_type_fixed"), ilObjTest::QUESTION_SET_TYPE_FIXED, $this->lng->txt("tst_question_set_type_fixed_desc"));
$questSetType->addOption($questSetTypeFixed);
$questSetTypeRandom = new ilRadioOption($this->lng->txt("tst_question_set_type_random"), ilObjTest::QUESTION_SET_TYPE_RANDOM, $this->lng->txt("tst_question_set_type_random_desc"));
$questSetType->addOption($questSetTypeRandom);
$questSetTypeContinues = new ilRadioOption($this->lng->txt("tst_question_set_type_dynamic"), ilObjTest::QUESTION_SET_TYPE_DYNAMIC, $this->lng->txt("tst_question_set_type_dynamic_desc"));
$questSetType->addOption($questSetTypeContinues);
$questSetType->setValue($this->testOBJ->getQuestionSetType());
if ($this->testOBJ->participantDataExist()) {
$questSetType->setDisabled(true);
}
$form->addItem($questSetType);
}
示例12: propertiesObject
/**
* Display and fill the properties form of the test
*
* @access public
*/
function propertiesObject($checkonly = FALSE)
{
global $ilAccess;
if (!$ilAccess->checkAccess("write", "", $this->ref_id)) {
// allow only write access
ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
$this->ctrl->redirect($this, "infoScreen");
}
// using template?
$template_settings = null;
$template = $this->object->getTemplate();
if ($template) {
include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
$template = new ilSettingsTemplate($template, ilObjAssessmentFolderGUI::getSettingsTemplateConfig());
$template_settings = $template->getSettings();
$hide_rte_switch = $template_settings["rte_switch"]["hide"];
}
$save = strcmp($this->ctrl->getCmd(), "saveProperties") == 0 ? TRUE : FALSE;
$total = $this->object->evalTotalPersons();
$this->tpl->addJavascript("./Services/JavaScript/js/Basic.js");
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTableWidth("100%");
$form->setId("test_properties");
if (!$template || $template && $this->formShowGeneralSection($template_settings)) {
// general properties
$header = new ilFormSectionHeaderGUI();
$header->setTitle($this->lng->txt("tst_general_properties"));
$form->addItem($header);
}
// title & description (meta data)
include_once 'Services/MetaData/classes/class.ilMD.php';
$md_obj = new ilMD($this->object->getId(), 0, "tst");
$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);
}
// anonymity
$anonymity = new ilRadioGroupInputGUI($this->lng->txt('tst_anonymity'), 'anonymity');
if ($total) {
$anonymity->setDisabled(true);
}
$rb = new ilRadioOption($this->lng->txt('tst_anonymity_no_anonymization'), 0);
$anonymity->addOption($rb);
$rb = new ilRadioOption($this->lng->txt('tst_anonymity_anonymous_test'), 1);
$anonymity->addOption($rb);
$anonymity->setValue((int) $this->object->getAnonymity());
$form->addItem($anonymity);
// random selection of questions
$random = new ilCheckboxInputGUI($this->lng->txt("tst_random_selection"), "random_test");
$random->setValue(1);
if ($total) {
$random->setDisabled(true);
}
$random->setChecked($this->object->isRandomTest());
$info = $this->lng->txt("tst_random_test_description");
if ($this->object->hasQuestionsWithoutQuestionpool()) {
$info .= $this->lng->txt("tst_random_test_description_warning");
}
$random->setInfo($info);
$form->addItem($random);
// pool usage
$pool_usage = new ilCheckboxInputGUI($this->lng->txt("test_question_pool_usage"), "use_pool");
$pool_usage->setValue(1);
$pool_usage->setChecked($this->object->getPoolUsage());
$form->addItem($pool_usage);
// activation/availability (no template support yet)
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->setChecked($this->object->isOnline());
$online->setInfo($this->lng->txt('tst_activation_online_info') . $act_obj_info);
$form->addItem($online);
$act_type = new ilRadioGroupInputGUI($this->lng->txt('rep_activation_access'), 'activation_type');
$act_type->setInfo($act_ref_info);
//.........这里部分代码省略.........
示例13: populateFullProperties
private function populateFullProperties()
{
$evaluationMode = new ilRadioGroupInputGUI($this->lng->txt('condition'), 'eval_mode');
$evalOptionReachedQuestionPoints = new ilRadioOption($this->lng->txt('qpl_skill_point_eval_by_quest_result'), 'result');
$evaluationMode->addOption($evalOptionReachedQuestionPoints);
$evalOptionLogicalAnswerCompare = new ilRadioOption($this->lng->txt('qpl_skill_point_eval_by_solution_compare'), 'solution');
$evaluationMode->addOption($evalOptionLogicalAnswerCompare);
$evaluationMode->setRequired(true);
$evaluationMode->setValue($this->assignment->getEvalMode());
if (!$this->isManipulationEnabled()) {
$evaluationMode->setDisabled(true);
}
$this->addItem($evaluationMode);
$questSolutionCompareExpressions = new ilLogicalAnswerComparisonExpressionInputGUI($this->lng->txt('tst_solution_compare_cfg'), 'solution_compare_expressions');
$questSolutionCompareExpressions->setInfo($this->buildLacLegendToggleButton());
$questSolutionCompareExpressions->setRequired(true);
$questSolutionCompareExpressions->setAllowMove(true);
$questSolutionCompareExpressions->setQuestionObject($this->question);
$questSolutionCompareExpressions->setValues($this->assignment->getSolutionComparisonExpressionList()->get());
$questSolutionCompareExpressions->setMinvalueShouldBeGreater(false);
$questSolutionCompareExpressions->setMinValue(1);
if (!$this->isManipulationEnabled()) {
$questSolutionCompareExpressions->setDisabled(true);
}
$evalOptionLogicalAnswerCompare->addSubItem($questSolutionCompareExpressions);
$questResultSkillPoints = $this->buildResultSkillPointsInputField();
$evalOptionReachedQuestionPoints->addSubItem($questResultSkillPoints);
}
示例14: scoringObject
/**
* Display and fill the scoring settings form of the test
*
* @access public
*/
function scoringObject($checkonly = FALSE)
{
global $ilAccess;
if (!$ilAccess->checkAccess("write", "", $this->ref_id)) {
// allow only write access
ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
$this->ctrl->redirect($this, "infoScreen");
}
// using template?
$template_settings = null;
$template = $this->object->getTemplate();
if ($template) {
include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
include_once "Modules/Test/classes/class.ilObjAssessmentFolderGUI.php";
$template = new ilSettingsTemplate($template, ilObjAssessmentFolderGUI::getSettingsTemplateConfig());
$template_settings = $template->getSettings();
}
$save = strcmp($this->ctrl->getCmd(), "saveScoring") == 0 ? TRUE : FALSE;
$total = $this->object->evalTotalPersons();
$this->tpl->addJavascript("./Services/JavaScript/js/Basic.js");
// Determine settings availability
$setting_available = true;
// In general, the scoring settings are available.
if ($total != 0) {
$setting_available = false;
// Unless there are results from users.
}
if ($this->object->getScoreReporting() == 4) {
$setting_available = true;
// But if the results are not public since they will never be
}
if ($this->object->getScoreReporting() == 3 && $this->object->getReportingDate() > time()) {
$setting_available = true;
// or the presentation date is not reached, then we can still edit them.
}
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTableWidth("100%");
$form->setId("test_properties_scoring");
// scoring properties
$header = new ilFormSectionHeaderGUI();
$header->setTitle($this->lng->txt("test_scoring"));
$form->addItem($header);
// scoring system
$count_system = new ilRadioGroupInputGUI($this->lng->txt("tst_text_count_system"), "count_system");
$count_system->addOption(new ilRadioOption($this->lng->txt("tst_count_partial_solutions"), 0, ''));
$count_system->addOption(new ilRadioOption($this->lng->txt("tst_count_correct_solutions"), 1, ''));
$count_system->setValue($this->object->getCountSystem());
$count_system->setInfo($this->lng->txt("tst_count_system_description"));
$count_system->setDisabled(!$setting_available);
$form->addItem($count_system);
// mc questions
$mc_scoring = new ilRadioGroupInputGUI($this->lng->txt("tst_score_mcmr_questions"), "mc_scoring");
$mc_scoring->addOption(new ilRadioOption($this->lng->txt("tst_score_mcmr_zero_points_when_unanswered"), 0, ''));
$mc_scoring->addOption(new ilRadioOption($this->lng->txt("tst_score_mcmr_use_scoring_system"), 1, ''));
$mc_scoring->setValue($this->object->getMCScoring());
$mc_scoring->setInfo($this->lng->txt("tst_score_mcmr_questions_description"));
$mc_scoring->setDisabled(!$setting_available);
$form->addItem($mc_scoring);
// score cutting
$score_cutting = new ilRadioGroupInputGUI($this->lng->txt("tst_score_cutting"), "score_cutting");
$score_cutting->addOption(new ilRadioOption($this->lng->txt("tst_score_cut_question"), 0, ''));
$score_cutting->addOption(new ilRadioOption($this->lng->txt("tst_score_cut_test"), 1, ''));
$score_cutting->setValue($this->object->getScoreCutting());
$score_cutting->setInfo($this->lng->txt("tst_score_cutting_description"));
$score_cutting->setDisabled(!$setting_available);
$form->addItem($score_cutting);
// pass scoring
$pass_scoring = new ilRadioGroupInputGUI($this->lng->txt("tst_pass_scoring"), "pass_scoring");
$pass_scoring->addOption(new ilRadioOption($this->lng->txt("tst_pass_last_pass"), 0, ''));
$pass_scoring->addOption(new ilRadioOption($this->lng->txt("tst_pass_best_pass"), 1, ''));
$pass_scoring->setValue($this->object->getPassScoring());
$pass_scoring->setInfo($this->lng->txt("tst_pass_scoring_description"));
$pass_scoring->setDisabled(!$setting_available);
$form->addItem($pass_scoring);
// test presentation
$header_tp = new ilFormSectionHeaderGUI();
$header_tp->setTitle($this->lng->txt("test_presentation"));
$form->addItem($header_tp);
// enable obligations
$checkBoxEnableObligations = new ilCheckboxInputGUI($this->lng->txt("tst_setting_enable_obligations_label"), "obligations_enabled");
$checkBoxEnableObligations->setChecked($this->object->areObligationsEnabled());
$checkBoxEnableObligations->setInfo($this->lng->txt("tst_setting_enable_obligations_info"));
if ($total) {
$checkBoxEnableObligations->setDisabled(true);
}
$form->addItem($checkBoxEnableObligations);
// offer hints
$checkBoxOfferHints = new ilCheckboxInputGUI($this->lng->txt("tst_setting_offer_hints_label"), "offer_hints");
$checkBoxOfferHints->setChecked($this->object->isOfferingQuestionHintsEnabled());
$checkBoxOfferHints->setInfo($this->lng->txt("tst_setting_offer_hints_info"));
if ($total) {
$checkBoxOfferHints->setDisabled(true);
}
//.........这里部分代码省略.........
示例15: initForm
/**
* initEditCustomForm
*
* @param string $a_mode values: create | edit
*/
public function initForm($a_mode = "create")
{
global $ilCtrl, $lng;
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$this->form = new ilPropertyFormGUI();
if ($a_mode == "edit") {
$this->form->setTitle($lng->txt('dcl_edit_field'));
$hidden_prop = new ilHiddenInputGUI("field_id");
$this->form->addItem($hidden_prop);
$this->form->setFormAction($ilCtrl->getFormAction($this), "update");
$this->form->addCommandButton('update', $lng->txt('dcl_update_field'));
} else {
$this->form->setTitle($lng->txt('dcl_new_field'));
$hidden_prop = new ilHiddenInputGUI("table_id");
$hidden_prop->setValue($this->field_obj->getTableId());
$this->form->addItem($hidden_prop);
$this->form->setFormAction($ilCtrl->getFormAction($this), "save");
$this->form->addCommandButton('save', $lng->txt('dcl_create_field'));
}
$this->form->addCommandButton('cancel', $lng->txt('cancel'));
$text_prop = new ilTextInputGUI($lng->txt("title"), "title");
$text_prop->setRequired(true);
$text_prop->setValidationRegexp("/^[a-zA-Z\\d -.,äöüÄÖÜàéèÀÉÈç¢]*\$/i");
$this->form->addItem($text_prop);
$edit_datatype = new ilRadioGroupInputGUI($lng->txt('dcl_datatype'), 'datatype');
foreach (ilDataCollectionDatatype::getAllDatatypes() as $datatype) {
$opt = new ilRadioOption($lng->txt('dcl_' . $datatype['title']), $datatype['id']);
foreach (ilDataCollectionDatatype::getProperties($datatype['id']) as $property) {
//Type Reference: List Tabels
if ($datatype['id'] == ilDataCollectionDatatype::INPUTFORMAT_REFERENCE and $property['id'] == ilDataCollectionField::PROPERTYID_REFERENCE) {
// Get Tables
require_once "./Modules/DataCollection/classes/class.ilDataCollectionTable.php";
$tables = $this->parent_obj->getDataCollectionObject()->getTables();
foreach ($tables as $table) {
foreach ($table->getRecordFields() as $field) {
//referencing references may lead to endless loops.
if ($field->getDatatypeId() != ilDataCollectionDatatype::INPUTFORMAT_REFERENCE) {
$options[$field->getId()] = $table->getTitle() . "->" . $field->getTitle();
}
}
}
$table_selection = new ilSelectInputGUI('', 'prop_' . $property['id']);
$table_selection->setOptions($options);
//$table_selection->setValue($this->table_id);
$opt->addSubItem($table_selection);
} elseif ($property['datatype_id'] == $datatype['id']) {
if ($property['inputformat'] == ilDataCollectionDatatype::INPUTFORMAT_BOOLEAN) {
$subitem = new ilCheckboxInputGUI($lng->txt('dcl_' . $property['title']), 'prop_' . $property['id']);
$opt->addSubItem($subitem);
} else {
$subitem = new ilTextInputGUI($lng->txt('dcl_' . $property['title']), 'prop_' . $property['id']);
$opt->addSubItem($subitem);
}
}
}
$edit_datatype->addOption($opt);
}
$edit_datatype->setRequired(true);
//you can't change type but we still need it in POST
if ($a_mode == "edit") {
$edit_datatype->setDisabled(true);
}
$this->form->addItem($edit_datatype);
// Description
$text_prop = new ilTextAreaInputGUI($lng->txt("dcl_field_description"), "description");
$this->form->addItem($text_prop);
// Required
$cb = new ilCheckboxInputGUI($lng->txt("dcl_field_required"), "required");
$this->form->addItem($cb);
//Unique
$cb = new ilCheckboxInputGUI($lng->txt("dcl_unique"), "unique");
$this->form->addItem($cb);
}