当前位置: 首页>>代码示例>>PHP>>正文


PHP ilRadioOption::addSubItem方法代码示例

本文整理汇总了PHP中ilRadioOption::addSubItem方法的典型用法代码示例。如果您正苦于以下问题:PHP ilRadioOption::addSubItem方法的具体用法?PHP ilRadioOption::addSubItem怎么用?PHP ilRadioOption::addSubItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ilRadioOption的用法示例。


在下文中一共展示了ilRadioOption::addSubItem方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addMembershipFormElements

 /**
  * Add membership form elements
  * @param ilPropertyFormGUI $form
  */
 public final function addMembershipFormElements(ilPropertyFormGUI $form, $a_parent_post = '')
 {
     // Registration type
     $reg_type = new ilRadioGroupInputGUI($this->txt('reg_type'), 'registration_type');
     //$reg_type->setValue($this->object->getRegistrationType());
     if (in_array(ilMembershipRegistrationSettings::TYPE_DIRECT, $this->getOptions())) {
         $opt_dir = new ilRadioOption($this->txt('reg_direct'), ilMembershipRegistrationSettings::TYPE_DIRECT);
         #$this->lng->txt('grp_reg_direct_info'));
         $reg_type->addOption($opt_dir);
     }
     if (in_array(ilMembershipRegistrationSettings::TYPE_PASSWORD, $this->getOptions())) {
         $opt_pass = new ilRadioOption($this->txt('reg_pass'), ilMembershipRegistrationSettings::TYPE_PASSWORD);
         $pass = new ilTextInputGUI($GLOBALS['lng']->txt("password"), 'password');
         $pass->setInfo($this->txt('reg_password_info'));
         #$pass->setValue($this->object->getPassword());
         $pass->setSize(10);
         $pass->setMaxLength(32);
         $opt_pass->addSubItem($pass);
         $reg_type->addOption($opt_pass);
     }
     if (in_array(ilMembershipRegistrationSettings::TYPE_REQUEST, $this->getOptions())) {
         $opt_req = new ilRadioOption($this->txt('reg_request'), ilMembershipRegistrationSettings::TYPE_REQUEST, $this->txt('reg_request_info'));
         $reg_type->addOption($opt_req);
     }
     if (in_array(ilMembershipRegistrationSettings::TYPE_NONE, $this->getOptions())) {
         $opt_deact = new ilRadioOption($this->txt('reg_disabled'), ilMembershipRegistrationSettings::TYPE_NONE, $this->txt('reg_disabled_info'));
         $reg_type->addOption($opt_deact);
     }
     // Add to form
     $form->addItem($reg_type);
     if (in_array(ilMembershipRegistrationSettings::REGISTRATION_LIMITED_USERS, $this->getOptions())) {
         // max member
         $lim = new ilCheckboxInputGUI($this->txt('reg_max_members_short'), 'registration_membership_limited');
         $lim->setValue(1);
         #$lim->setOptionTitle($this->lng->txt('reg_grp_max_members'));
         #$lim->setChecked($this->object->isMembershipLimited());
         $max = new ilTextInputGUI($this->txt('reg_max_members'), 'registration_max_members');
         #$max->setValue($this->object->getMaxMembers() ? $this->object->getMaxMembers() : '');
         //$max->setTitle($this->lng->txt('members'));
         $max->setSize(3);
         $max->setMaxLength(4);
         $max->setInfo($this->txt('reg_max_members_info'));
         $lim->addSubItem($max);
         $wait = new ilCheckboxInputGUI($this->txt('reg_waiting_list'), 'waiting_list');
         $wait->setValue(1);
         //$wait->setOptionTitle($this->lng->txt('grp_waiting_list'));
         $wait->setInfo($this->txt('reg_waiting_list_info'));
         #$wait->setChecked($this->object->isWaitingListEnabled() ? true : false);
         $lim->addSubItem($wait);
         $form->addItem($lim);
     }
     $this->setFormValues($form);
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:57,代码来源:class.ilMembershipRegistrationSettingsGUI.php

示例2: initPluginCreationFormSection

 /**
  * @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);
 }
开发者ID:studer-raimann,项目名称:Dropbox,代码行数:25,代码来源:class.ilDropboxCreationGUI.php

示例3: addFormProperties

 /**
  * add the configuration elements to a property form
  * @param object	property form
  */
 public function addFormProperties(ilPropertyFormGUI $a_form)
 {
     global $lng;
     $lng->loadLanguageModule('adve');
     $availability = new ilRadioGroupInputGUI($lng->txt('char_selector'), 'char_selector_availability');
     $inactive = new ilRadioOption($lng->txt('char_selector_inactive'), ilCharSelectorConfig::INACTIVE);
     $inactive->setInfo($lng->txt('char_selector_inactive_info_' . $this->config->getContext()));
     $inherit = new ilRadioOption($lng->txt('char_selector_inherit'), ilCharSelectorConfig::INHERIT);
     $inherit->setInfo($lng->txt('char_selector_inherit_info_' . $this->config->getContext()));
     $enabled = new ilRadioOption($lng->txt('char_selector_enabled'), ilCharSelectorConfig::ENABLED);
     $enabled->setInfo($lng->txt('char_selector_enabled_info_' . $this->config->getContext()));
     $disabled = new ilRadioOption($lng->txt('char_selector_disabled'), ilCharSelectorConfig::DISABLED);
     $disabled->setInfo($lng->txt('char_selector_disabled_info_' . $this->config->getContext()));
     $blocks = new ilSelectInputGUI($lng->txt('char_selector_blocks'), 'char_selector_blocks');
     $blocks->setInfo($lng->txt('char_selector_blocks_info'));
     $blocks->setOptions($this->config->getBlockOptions());
     $blocks->setMulti(true);
     $enabled->addSubItem($blocks);
     $custom_items = new ilTextAreaInputGUI($lng->txt('char_selector_custom_items'), 'char_selector_custom_items');
     $tpl = new ilTemplate("tpl.char_selector_custom_info.html", true, true, "Services/UIComponent/CharSelector");
     $tpl->setVariable('1', $lng->txt('char_selector_custom_items_info1'));
     $tpl->setVariable('2a', $lng->txt('char_selector_custom_items_info2a'));
     $tpl->setVariable('2b', $lng->txt('char_selector_custom_items_info2b'));
     $tpl->setVariable('3a', $lng->txt('char_selector_custom_items_info3a'));
     $tpl->setVariable('3b', $lng->txt('char_selector_custom_items_info3b'));
     $tpl->setVariable('4a', $lng->txt('char_selector_custom_items_info4a'));
     $tpl->setVariable('4b', $lng->txt('char_selector_custom_items_info4b'));
     $tpl->setVariable('5a', $lng->txt('char_selector_custom_items_info5a'));
     $tpl->setVariable('5b', $lng->txt('char_selector_custom_items_info5b'));
     $tpl->setVariable('6a', $lng->txt('char_selector_custom_items_info6a'));
     $tpl->setVariable('6b', $lng->txt('char_selector_custom_items_info6b'));
     $custom_items->setInfo($tpl->get());
     $enabled->addSubItem($custom_items);
     switch ($this->config->getContext()) {
         case ilCharSelectorConfig::CONTEXT_ADMIN:
             $availability->addOption($inactive);
             $availability->addOption($enabled);
             $availability->addOption($disabled);
             $a_form->addItem($availability);
             break;
         case ilCharSelectorConfig::CONTEXT_USER:
         case ilCharSelectorConfig::CONTEXT_TEST:
             $availability->addOption($inherit);
             $availability->addOption($enabled);
             $availability->addOption($disabled);
             $a_form->addItem($availability);
             break;
     }
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:53,代码来源:class.ilCharSelectorGUI.php

示例4: 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);
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:24,代码来源:class.ilObjRemoteTestGUI.php

示例5: initPluginCreationFormSection

 /**
  * @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);
 }
开发者ID:pschmitt77,项目名称:OneDrive,代码行数:20,代码来源:class.ilOneDriveCreationGUI.php

示例6: 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);
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:78,代码来源:class.ilDataCollectionFieldEditGUI.php

示例7: initForm

 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;
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:99,代码来源:class.ilLOTestAssignmentForm.php

示例8: initSettingsForm

 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;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:100,代码来源:class.ilObjRepositorySettingsGUI.php

示例9: initFormEdit

 /**
  * init form edit
  *
  * @access protected
  * @return
  */
 protected function initFormEdit()
 {
     global $tree;
     include_once "Services/Object/classes/class.ilObjectActivation.php";
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($this->ctrl->getFormAction($this));
     $title = ilObject::_lookupTitle(ilObject::_lookupObjId($this->getItemId()));
     $this->form->setTitle($title . ': ' . $this->lng->txt('crs_edit_timings'));
     $timings = new ilRadioGroupInputGUI($this->lng->txt('timings'), 'timing_type');
     // opt deactivated
     $dea = new ilRadioOption($this->lng->txt('crs_timings_disabled'), ilObjectActivation::TIMINGS_DEACTIVATED);
     $dea->setInfo($this->lng->txt('crs_timings_disabled_info'));
     $timings->addOption($dea);
     // Visiblity
     $vis = new ilRadioOption($this->lng->txt('crs_timings_availability_enabled'), ilObjectActivation::TIMINGS_ACTIVATION);
     #$vis->setInfo($this->lng->txt('crs_timings_visibility'));
     $start = new ilDateTimeInputGUI($this->lng->txt('crs_timings_start'), 'timing_start');
     $start->setShowTime(true);
     #$start->setMinuteStepSize(5);
     $vis->addSubItem($start);
     $end = new ilDateTimeInputGUI($this->lng->txt('crs_timings_end'), 'timing_end');
     $end->setShowTime(true);
     #$end->setMinuteStepSize(5);
     $vis->addSubItem($end);
     $isv = new ilCheckboxInputGUI($this->lng->txt('crs_timings_visibility_short'), 'visible');
     $isv->setInfo($this->lng->txt('crs_timings_visibility'));
     $isv->setValue(1);
     $vis->addSubItem($isv);
     $timings->addOption($vis);
     // Timings
     $tim = new ilRadioOption($this->lng->txt('crs_timings_presetting'), ilObjectActivation::TIMINGS_PRESETTING);
     $tim->setInfo($this->lng->txt('crs_item_presetting_info'));
     $start = new ilDateTimeInputGUI($this->lng->txt('crs_timings_sug_begin'), 'sug_start');
     $tim->addSubItem($start);
     $end = new ilDateTimeInputGUI($this->lng->txt('crs_timings_sug_end'), 'sug_end');
     $tim->addSubItem($end);
     if ($tree->checkForParentType($this->parent_ref_id, 'crs')) {
         $cha = new ilCheckboxInputGUI($this->lng->txt('crs_timings_changeable'), 'changeable');
         $tim->addSubItem($cha);
         $start = new ilDateTimeInputGUI($this->lng->txt('crs_timings_early_begin'), 'early_start');
         $tim->addSubItem($start);
         $late = new ilDateTimeInputGUI($this->lng->txt('crs_timings_short_limit_start_end'), 'late_end');
         $tim->addSubItem($late);
     }
     $timings->addOption($tim);
     $this->form->addItem($timings);
     $this->form->addCommandButton('update', $this->lng->txt('save'));
     $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:56,代码来源:class.ilObjectActivationGUI.php

示例10: 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);
//.........这里部分代码省略.........
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:101,代码来源:class.ilObjTestSettingsGeneralGUI.php

示例11: initBasicSettingsForm

 /**
  * Init basic settings form.
  */
 public function initBasicSettingsForm()
 {
     /**
      * @var $lng ilLanguage
      * @var $ilSetting ilSetting
      */
     global $lng, $ilSetting;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     $lng->loadLanguageModule("pd");
     // installation short title
     $ti = new ilTextInputGUI($this->lng->txt("short_inst_name"), "short_inst_name");
     $ti->setMaxLength(200);
     $ti->setSize(40);
     $ti->setValue($ilSetting->get("short_inst_name"));
     $ti->setInfo($this->lng->txt("short_inst_name_info"));
     $this->form->addItem($ti);
     // public section
     $cb = new ilCheckboxInputGUI($this->lng->txt("pub_section"), "pub_section");
     $cb->setInfo($lng->txt("pub_section_info"));
     if ($ilSetting->get("pub_section")) {
         $cb->setChecked(true);
     }
     $this->form->addItem($cb);
     // Enable Global Profiles
     $cb_prop = new ilCheckboxInputGUI($lng->txt('pd_enable_user_publish'), 'enable_global_profiles');
     $cb_prop->setInfo($lng->txt('pd_enable_user_publish_info'));
     $cb_prop->setChecked($ilSetting->get('enable_global_profiles'));
     $cb->addSubItem($cb_prop);
     // search engine
     include_once 'Services/PrivacySecurity/classes/class.ilRobotSettings.php';
     $robot_settings = ilRobotSettings::_getInstance();
     $cb2 = new ilCheckboxInputGUI($this->lng->txt("search_engine"), "open_google");
     $cb2->setInfo($this->lng->txt("enable_search_engine"));
     $this->form->addItem($cb2);
     if (!$robot_settings->checkRewrite()) {
         $cb2->setAlert($lng->txt("allow_override_alert"));
         $cb2->setChecked(false);
         $cb2->setDisabled(true);
     } else {
         if ($ilSetting->get("open_google")) {
             $cb2->setChecked(true);
         }
     }
     // locale
     $ti = new ilTextInputGUI($this->lng->txt("adm_locale"), "locale");
     $ti->setMaxLength(80);
     $ti->setSize(40);
     $ti->setInfo($this->lng->txt("adm_locale_info"));
     $ti->setValue($ilSetting->get("locale"));
     $this->form->addItem($ti);
     // starting point
     include_once "Services/User/classes/class.ilUserUtil.php";
     $si = new ilRadioGroupInputGUI($this->lng->txt("adm_user_starting_point"), "usr_start");
     $si->setRequired(true);
     $si->setInfo($this->lng->txt("adm_user_starting_point_info"));
     $valid = array_keys(ilUserUtil::getPossibleStartingPoints());
     foreach (ilUserUtil::getPossibleStartingPoints(true) as $value => $caption) {
         $opt = new ilRadioOption($caption, $value);
         $si->addOption($opt);
         if (!in_array($value, $valid)) {
             $opt->setInfo($this->lng->txt("adm_user_starting_point_invalid_info"));
         }
     }
     $si->setValue(ilUserUtil::getStartingPoint());
     $this->form->addItem($si);
     // starting point: repository object
     $repobj = new ilRadioOption($lng->txt("adm_user_starting_point_object"), ilUserUtil::START_REPOSITORY_OBJ);
     $repobj_id = new ilTextInputGUI($lng->txt("adm_user_starting_point_ref_id"), "usr_start_ref_id");
     $repobj_id->setRequired(true);
     $repobj_id->setSize(5);
     if ($si->getValue() == ilUserUtil::START_REPOSITORY_OBJ) {
         $start_ref_id = ilUserUtil::getStartingObject();
         $repobj_id->setValue($start_ref_id);
         if ($start_ref_id) {
             $start_obj_id = ilObject::_lookupObjId($start_ref_id);
             if ($start_obj_id) {
                 $repobj_id->setInfo($lng->txt("obj_" . ilObject::_lookupType($start_obj_id)) . ": " . ilObject::_lookupTitle($start_obj_id));
             }
         }
     }
     $repobj->addSubItem($repobj_id);
     $si->addOption($repobj);
     // starting point: personal
     $startp = new ilCheckboxInputGUI($lng->txt("adm_user_starting_point_personal"), "usr_start_pers");
     $startp->setInfo($lng->txt("adm_user_starting_point_personal_info"));
     $startp->setChecked(ilUserUtil::hasPersonalStartingPoint());
     $si->addSubItem($startp);
     // save and cancel commands
     $this->form->addCommandButton("saveBasicSettings", $lng->txt("save"));
     $this->form->setTitle($lng->txt("basic_settings"));
     $this->form->setFormAction($this->ctrl->getFormAction($this));
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:96,代码来源:class.ilObjSystemFolderGUI.php

示例12: showSecurity

 /**
  * Show Privacy settings
  *
  * @access public
  */
 public function showSecurity()
 {
     global $ilSetting, $ilUser, $rbacreview;
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $security = ilSecuritySettings::_getInstance();
     $this->tabs_gui->setTabActive('show_security');
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTitle($this->lng->txt('ps_security_protection'));
     // Form checkbox
     $check = new ilCheckboxInputGUI($this->lng->txt('ps_auto_https'), 'auto_https_detect_enabled');
     $check->setOptionTitle($this->lng->txt('ps_auto_https_description'));
     $check->setChecked($security->isAutomaticHTTPSEnabled() ? 1 : 0);
     $check->setValue(1);
     $text = new ilTextInputGUI($this->lng->txt('ps_auto_https_header_name'), 'auto_https_detect_header_name');
     $text->setValue($security->getAutomaticHTTPSHeaderName());
     $text->setSize(24);
     $text->setMaxLength(64);
     $check->addSubItem($text);
     $text = new ilTextInputGUI($this->lng->txt('ps_auto_https_header_value'), 'auto_https_detect_header_value');
     $text->setValue($security->getAutomaticHTTPSHeaderValue());
     $text->setSize(24);
     $text->setMaxLength(64);
     $check->addSubItem($text);
     $form->addItem($check);
     $check2 = new ilCheckboxInputGUI($this->lng->txt('activate_https'), 'https_enabled');
     $check2->setChecked($security->isHTTPSEnabled() ? 1 : 0);
     $check2->setValue(1);
     $form->addItem($check2);
     $radio_group = new ilRadioGroupInputGUI($this->lng->txt('ps_account_security_mode'), 'account_security_mode');
     $radio_group->setValue($security->getAccountSecurityMode());
     $radio_opt = new ilRadioOption($this->lng->txt('ps_account_security_mode_default'), ilSecuritySettings::ACCOUNT_SECURITY_MODE_DEFAULT);
     $radio_group->addOption($radio_opt);
     $radio_opt = new ilRadioOption($this->lng->txt('ps_account_security_mode_customized'), ilSecuritySettings::ACCOUNT_SECURITY_MODE_CUSTOMIZED);
     $check = new ilCheckboxInputGUI($this->lng->txt('ps_password_chars_and_numbers_enabled'), 'password_chars_and_numbers_enabled');
     $check->setChecked($security->isPasswordCharsAndNumbersEnabled() ? 1 : 0);
     //$check->setOptionTitle($this->lng->txt('ps_password_chars_and_numbers_enabled'));
     $check->setInfo($this->lng->txt('ps_password_chars_and_numbers_enabled_info'));
     $radio_opt->addSubItem($check);
     $check = new ilCheckboxInputGUI($this->lng->txt('ps_password_special_chars_enabled'), 'password_special_chars_enabled');
     $check->setChecked($security->isPasswordSpecialCharsEnabled() ? 1 : 0);
     //$check->setOptionTitle($this->lng->txt('ps_password_special_chars_enabled'));
     $check->setInfo($this->lng->txt('ps_password_special_chars_enabled_info'));
     $radio_opt->addSubItem($check);
     $text = new ilTextInputGUI($this->lng->txt('ps_password_min_length'), 'password_min_length');
     $text->setInfo($this->lng->txt('ps_password_min_length_info'));
     $text->setValue($security->getPasswordMinLength());
     $text->setSize(1);
     $text->setMaxLength(2);
     $radio_opt->addSubItem($text);
     $text = new ilTextInputGUI($this->lng->txt('ps_password_max_length'), 'password_max_length');
     $text->setInfo($this->lng->txt('ps_password_max_length_info'));
     $text->setValue($security->getPasswordMaxLength());
     $text->setSize(2);
     $text->setMaxLength(3);
     $radio_opt->addSubItem($text);
     $text = new ilTextInputGUI($this->lng->txt('ps_password_max_age'), 'password_max_age');
     $text->setInfo($this->lng->txt('ps_password_max_age_info'));
     $text->setValue($security->getPasswordMaxAge());
     $text->setSize(2);
     $text->setMaxLength(3);
     $radio_opt->addSubItem($text);
     $text = new ilTextInputGUI($this->lng->txt('ps_login_max_attempts'), 'login_max_attempts');
     $text->setInfo($this->lng->txt('ps_login_max_attempts_info'));
     $text->setValue($security->getLoginMaxAttempts());
     $text->setSize(1);
     $text->setMaxLength(2);
     $radio_opt->addSubItem($text);
     $radio_group->addOption($radio_opt);
     $form->addItem($radio_group);
     $check = new ilCheckboxInputGUI($this->lng->txt('ps_password_change_on_first_login_enabled'), 'password_change_on_first_login_enabled');
     $check->setInfo($this->lng->txt('ps_password_change_on_first_login_enabled_info'));
     $check->setChecked($security->isPasswordChangeOnFirstLoginEnabled() ? 1 : 0);
     $form->addItem($check);
     // file suffix replacement
     $ti = new ilTextInputGUI($this->lng->txt("file_suffix_repl"), "suffix_repl_additional");
     $ti->setMaxLength(200);
     $ti->setSize(40);
     $ti->setInfo($this->lng->txt("file_suffix_repl_info") . " " . SUFFIX_REPL_DEFAULT);
     $ti->setValue($ilSetting->get("suffix_repl_additional"));
     $form->addItem($ti);
     // prevent login from multiple pcs at the same time
     $objCb = new ilCheckboxInputGUI($this->lng->txt('ps_prevent_simultaneous_logins'), 'ps_prevent_simultaneous_logins');
     $objCb->setChecked((int) $security->isPreventionOfSimultaneousLoginsEnabled());
     $objCb->setValue(1);
     $objCb->setOptionTitle($this->lng->txt('ps_prevent_simultaneous_logins_info'));
     $form->addItem($objCb);
     // protected admin
     $admin = new ilCheckboxInputGUI($GLOBALS['lng']->txt('adm_adm_role_protect'), 'admin_role');
     $admin->setDisabled(!$rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID));
     $admin->setInfo($GLOBALS['lng']->txt('adm_adm_role_protect_info'));
     $admin->setChecked((int) $security->isAdminRoleProtected());
     $admin->setValue(1);
     $form->addItem($admin);
     $form->addCommandButton('save_security', $this->lng->txt('save'));
//.........这里部分代码省略.........
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:101,代码来源:class.ilObjPrivacySecurityGUI.php

示例13: 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->setInfo(sprintf($lng->txt('fieldtitle_allow_chars'), ilDataCollectionField::_getTitleValidChars(false)));
     $text_prop->setValidationRegexp(ilDataCollectionField::_getTitleValidChars(true));
     $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) {
                 $options = array();
                 // 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() . self::REFERENCE_SEPARATOR . $field->getTitle();
                         }
                     }
                 }
                 $table_selection = new ilSelectInputGUI('', 'prop_' . $property['id']);
                 $table_selection->setOptions($options);
                 //$table_selection->setValue($this->table_id);
                 $opt->addSubItem($table_selection);
             } elseif ($datatype['id'] == ilDataCollectionDatatype::INPUTFORMAT_REFERENCELIST and $property['id'] == ilDataCollectionField::PROPERTYID_N_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_REFERENCELIST) {
                             $options[$field->getId()] = $table->getTitle() . self::REFERENCE_SEPARATOR . $field->getTitle();
                         }
                     }
                 }
                 $table_selection = new ilSelectInputGUI('', 'prop_' . $property['id']);
                 $table_selection->setOptions($options);
                 $opt->addSubItem($table_selection);
             } elseif ($property['id'] == ilDataCollectionField::PROPERTYID_FORMULA_EXPRESSION) {
                 $table = ilDataCollectionCache::getTableCache((int) $_GET['table_id']);
                 $fields = array();
                 foreach ($table->getFieldsForFormula() as $f) {
                     $placeholder = $f->isStandardField() ? $f->getId() : $f->getTitle();
                     $fields[] = '<a class="dclPropExpressionField" data-placeholder="' . $placeholder . '">' . $f->getTitle() . '</a>';
                 }
                 $subitem = new ilTextAreaInputGUI($lng->txt('dcl_prop_expression'), 'prop_' . $property['id']);
                 $operators = implode(', ', array_keys(ilDclExpressionParser::getOperators()));
                 $functions = implode(', ', ilDclExpressionParser::getFunctions());
                 $subitem->setInfo(sprintf($lng->txt('dcl_prop_expression_info'), $operators, $functions, implode('<br>', $fields)));
                 $opt->addSubItem($subitem);
             } elseif ($property['datatype_id'] == $datatype['id']) {
                 //All other Types: List properties saved in propertie definition table
                 if ($property['inputformat'] == ilDataCollectionDatatype::INPUTFORMAT_BOOLEAN) {
                     $subitem = new ilCheckboxInputGUI($lng->txt('dcl_' . $property['title']), 'prop_' . $property['id']);
                     $opt->addSubItem($subitem);
                 } elseif ($property['inputformat'] == ilDataCollectionDatatype::INPUTFORMAT_NUMBER) {
                     $subitem = new ilNumberInputGUI($lng->txt('dcl_' . $property['title']), 'prop_' . $property['id']);
                     // TODO: Nicer way to add additional info to fields (need changes in language-logic)
                     /*if($lng->txt('dcl_'.$property['title'].'_info') != '-dcl_'.$property['title'].'_info-') {
                     			$subitem->setInfo($lng->txt('dcl_'.$property['title'].'_info'));
                     		}*/
                     $subitem->setSize(5);
                     if ($property['title'] == 'length') {
                         $subitem->setMaxValue(4000);
                         $subitem->setInfo($lng->txt('dcl_' . $property['title'] . '_info'));
                     }
                     $opt->addSubItem($subitem);
                 } elseif ($property['inputformat'] == ilDataCollectionDatatype::INPUTFORMAT_NON_EDITABLE_VALUE) {
                     $subitem = new ilNonEditableValueGUI($lng->txt('dcl_' . $property['title']));
                     $subitem->setValue(implode(', ', ilDataCollectionDatatype::$mob_suffixes));
                     $opt->addSubItem($subitem);
//.........这里部分代码省略.........
开发者ID:arlendotcn,项目名称:ilias,代码行数:101,代码来源:class.ilDataCollectionFieldEditGUI.php

示例14: initGeneralSettingsForm


//.........这里部分代码省略.........
     // Store last visited
     $lv = new ilSelectInputGUI($this->lng->txt("user_store_last_visited"), "store_last_visited");
     $options = array(0 => $this->lng->txt("user_lv_keep_entries"), 1 => $this->lng->txt("user_lv_keep_only_for_session"), 2 => $this->lng->txt("user_lv_do_not_store"));
     $lv->setOptions($options);
     $lv->setValue((int) $ilUser->prefs["store_last_visited"]);
     $this->form->addItem($lv);
     // hide_own_online_status
     if ($this->userSettingVisible("hide_own_online_status")) {
         $cb = new ilCheckboxInputGUI($this->lng->txt("hide_own_online_status"), "hide_own_online_status");
         $cb->setChecked($ilUser->prefs["hide_own_online_status"] == "y");
         $cb->setDisabled($ilSetting->get("usr_settings_disable_hide_own_online_status"));
         $this->form->addItem($cb);
     }
     include_once 'Services/Authentication/classes/class.ilSessionReminder.php';
     if (ilSessionReminder::isGloballyActivated()) {
         $cb = new ilCheckboxInputGUI($this->lng->txt('session_reminder'), 'session_reminder_enabled');
         $cb->setInfo($this->lng->txt('session_reminder_info'));
         $cb->setValue(1);
         $cb->setChecked((int) $ilUser->getPref('session_reminder_enabled'));
         $expires = ilSession::getSessionExpireValue();
         $lead_time_gui = new ilNumberInputGUI($this->lng->txt('session_reminder_lead_time'), 'session_reminder_lead_time');
         $lead_time_gui->setInfo(sprintf($this->lng->txt('session_reminder_lead_time_info'), ilFormat::_secondsToString($expires, true)));
         $min_value = ilSessionReminder::MIN_LEAD_TIME;
         $max_value = max($min_value, (int) $expires / 60 - 1);
         $current_user_value = $ilUser->getPref('session_reminder_lead_time');
         if ($current_user_value < $min_value || $current_user_value > $max_value) {
             $current_user_value = ilSessionReminder::SUGGESTED_LEAD_TIME;
         }
         $value = min(max($min_value, $current_user_value), $max_value);
         $lead_time_gui->setValue($value);
         $lead_time_gui->setSize(3);
         $lead_time_gui->setMinValue($min_value);
         $lead_time_gui->setMaxValue($max_value);
         $cb->addSubItem($lead_time_gui);
         $this->form->addItem($cb);
     }
     // calendar settings (copied here to be reachable when calendar is inactive)
     // they cannot be hidden/deactivated
     include_once 'Services/Calendar/classes/class.ilCalendarUserSettings.php';
     include_once 'Services/Calendar/classes/class.ilCalendarUtil.php';
     $lng->loadLanguageModule("dateplaner");
     $user_settings = ilCalendarUserSettings::_getInstanceByUserId($ilUser->getId());
     $select = new ilSelectInputGUI($lng->txt('cal_user_timezone'), 'timezone');
     $select->setOptions(ilCalendarUtil::_getShortTimeZoneList());
     $select->setInfo($lng->txt('cal_timezone_info'));
     $select->setValue($user_settings->getTimeZone());
     $this->form->addItem($select);
     $year = date("Y");
     $select = new ilSelectInputGUI($lng->txt('cal_user_date_format'), '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($lng->txt('cal_date_format_info'));
     $select->setValue($user_settings->getDateFormat());
     $this->form->addItem($select);
     $select = new ilSelectInputGUI($lng->txt('cal_user_time_format'), 'time_format');
     $select->setOptions(array(ilCalendarSettings::TIME_FORMAT_24 => '13:00', ilCalendarSettings::TIME_FORMAT_12 => '1:00pm'));
     $select->setInfo($lng->txt('cal_time_format_info'));
     $select->setValue($user_settings->getTimeFormat());
     $this->form->addItem($select);
     // starting point
     include_once "Services/User/classes/class.ilUserUtil.php";
     if (ilUserUtil::hasPersonalStartingPoint()) {
         $this->lng->loadLanguageModule("administration");
         $si = new ilRadioGroupInputGUI($this->lng->txt("adm_user_starting_point"), "usr_start");
         $si->setRequired(true);
         $si->setInfo($this->lng->txt("adm_user_starting_point_info"));
         foreach (ilUserUtil::getPossibleStartingPoints() as $value => $caption) {
开发者ID:JKN-INC,项目名称:SHELBY-ILIAS,代码行数:67,代码来源:class.ilPersonalSettingsGUI.php

示例15: initAliasForm

 /**
  * Init alias form
  */
 function initAliasForm()
 {
     global $lng, $ilCtrl;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form_gui = new ilPropertyFormGUI();
     // standard view resource
     $std_alias_item =& new ilMediaAliasItem($this->dom, $this->getHierId(), "Standard", $this->content_obj->getPcId());
     $std_item = $this->content_obj->getMediaObject()->getMediaItem("Standard");
     // title, location and format
     $title = new ilNonEditableValueGUI($lng->txt("title"), "title");
     $this->form_gui->addItem($title);
     $loc = new ilNonEditableValueGUI($this->lng->txt("cont_" . strtolower($std_item->getLocationType())), "st_location");
     $this->form_gui->addItem($loc);
     $format = new ilNonEditableValueGUI($this->lng->txt("cont_format"), "st_format");
     $this->form_gui->addItem($format);
     // standard size
     $radio_size = new ilRadioGroupInputGUI($lng->txt("size"), "st_derive_size");
     $op1 = new ilRadioOption($lng->txt("cont_default") . " (" . $std_item->getWidth() . " x " . $std_item->getHeight() . ")", "y");
     $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
     $radio_size->addOption($op1);
     // width height
     include_once "./Services/MediaObjects/classes/class.ilWidthHeightInputGUI.php";
     $width_height = new ilWidthHeightInputGUI($lng->txt("cont_width") . " / " . $lng->txt("cont_height"), "st_width_height");
     $width_height->setConstrainProportions(true);
     $op2->addSubItem($width_height);
     $radio_size->addOption($op2);
     $this->form_gui->addItem($radio_size);
     // standard caption
     $rad_caption = new ilRadioGroupInputGUI($lng->txt("cont_caption"), "st_derive_caption");
     $op1 = new ilRadioOption($lng->txt("cont_default"), "y");
     $def_cap = new ilNonEditableValueGUI("", "def_caption");
     $op1->addSubItem($def_cap);
     $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
     $rad_caption->addOption($op1);
     $caption = new ilTextAreaInputGUI("", "st_caption");
     $caption->setCols(30);
     $caption->setRows(2);
     $op2->addSubItem($caption);
     /*$caption = new ilTextInputGUI("", "st_caption");
     		$caption->setSize(40);
     		$caption->setMaxLength(200);
     		$op2->addSubItem($caption);*/
     $rad_caption->addOption($op2);
     $this->form_gui->addItem($rad_caption);
     // standard text representation
     if (substr($std_item->getFormat(), 0, 5) == "image") {
         $rad_tr = new ilRadioGroupInputGUI($lng->txt("text_repr"), "st_derive_text_representation");
         $op1 = new ilRadioOption($lng->txt("cont_default"), "y");
         $def_tr = new ilNonEditableValueGUI("", "def_text_representation");
         $op1->addSubItem($def_tr);
         $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
         $tr = new ilTextAreaInputGUI("", "st_text_representation");
         $tr->setCols(30);
         $tr->setRows(2);
         $rad_tr->addOption($op1);
         $op2->addSubItem($tr);
         $rad_tr->addOption($op2);
         $this->form_gui->addItem($rad_tr);
         $rad_tr->setInfo($lng->txt("text_repr_info"));
     }
     // standard parameters
     if (!in_array($std_item->getFormat(), ilObjMediaObject::_getSimpleMimeTypes())) {
         if (ilObjMediaObject::_useAutoStartParameterOnly($std_item->getLocation(), $std_item->getFormat())) {
             $par = $std_item->getParameters();
             $def_str = $par["autostart"] == "true" ? " (" . $lng->txt("yes") . ")" : " (" . $lng->txt("no") . ")";
             $rad_auto = new ilRadioGroupInputGUI($lng->txt("cont_autostart"), "st_derive_parameters");
             $op1 = new ilRadioOption($lng->txt("cont_default") . $def_str, "y");
             $rad_auto->addOption($op1);
             $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
             $auto = new ilCheckboxInputGUI($lng->txt("enabled"), "st_autostart");
             $op2->addSubItem($auto);
             $rad_auto->addOption($op2);
             $this->form_gui->addItem($rad_auto);
         } else {
             $rad_parameters = new ilRadioGroupInputGUI($lng->txt("cont_parameter"), "st_derive_parameters");
             $op1 = new ilRadioOption($lng->txt("cont_default"), "y");
             $def_par = new ilNonEditableValueGUI("", "def_parameters");
             $op1->addSubItem($def_par);
             $rad_parameters->addOption($op1);
             $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
             $par = new ilTextAreaInputGUI("", "st_parameters");
             $par->setRows(5);
             $par->setCols(50);
             $op2->addSubItem($par);
             $rad_parameters->addOption($op2);
             $this->form_gui->addItem($rad_parameters);
         }
     }
     // fullscreen view
     if ($this->content_obj->getMediaObject()->hasFullScreenItem()) {
         $full_alias_item =& new ilMediaAliasItem($this->dom, $this->getHierId(), "Fullscreen", $this->content_obj->getPcId());
         $full_item = $this->content_obj->getMediaObject()->getMediaItem("Fullscreen");
         $fs_sec = new ilFormSectionHeaderGUI();
         $fs_sec->setTitle($lng->txt("cont_fullscreen"));
         $this->form_gui->addItem($fs_sec);
         // resource
         $radio_prop = new ilRadioGroupInputGUI($lng->txt("cont_resource"), "fullscreen");
//.........这里部分代码省略.........
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:101,代码来源:class.ilPCMediaObjectGUI.php


注:本文中的ilRadioOption::addSubItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。