/** * initEditCustomForm * * @param string $a_mode */ public function initForm($a_mode = "create") { global $ilCtrl, $ilErr, $lng; include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); $item = new ilTextInputGUI($lng->txt('title'), 'title'); $item->setRequired(true); $this->form->addItem($item); $item = new ilCheckboxInputGUI($lng->txt('dcl_visible'), 'is_visible'); $this->form->addItem($item); $item = new ilTextAreaInputGUI($lng->txt('additional_info'), 'description'); $item->setUseRte(true); // $item->setRTESupport($this->table->getId(), 'dcl', 'table_settings'); $item->setRteTagSet('mini'); $this->form->addItem($item); $section = new ilFormSectionHeaderGUI(); $section->setTitle($lng->txt('dcl_permissions_form')); $this->form->addItem($section); $item = new ilCustomInputGUI(); $item->setHtml($lng->txt('dcl_table_info')); $item->setTitle($lng->txt('dcl_table_info_title')); $this->form->addItem($item); $item = new ilCheckboxInputGUI($lng->txt('dcl_add_perm'), 'add_perm'); // $item->setInfo($lng->txt("dcl_add_perm_info")); $this->form->addItem($item); $item = new ilCheckboxInputGUI($lng->txt('dcl_edit_perm'), 'edit_perm'); // $item->setInfo($lng->txt("dcl_edit_perm_info")); $this->form->addItem($item); $item = new ilCheckboxInputGUI($lng->txt('dcl_delete_perm'), 'delete_perm'); // $item->setInfo($lng->txt("dcl_delete_perm_info")); $this->form->addItem($item); $item = new ilCheckboxInputGUI($lng->txt('dcl_edit_by_owner'), 'edit_by_owner'); // $item->setInfo($lng->txt("dcl_edit_by_owner_info")); $this->form->addItem($item); $item = new ilCheckboxInputGUI($lng->txt('dcl_export_enabled'), 'export_enabled'); $this->form->addItem($item); $item = new ilCheckboxInputGUI($lng->txt('dcl_limited'), 'limited'); $sitem1 = new ilDateTimeInputGUI($lng->txt('dcl_limit_start'), 'limit_start'); $sitem2 = new ilDateTimeInputGUI($lng->txt('dcl_limit_end'), 'limit_end'); // $item->setInfo($lng->txt("dcl_limited_info")); $item->addSubItem($sitem1); $item->addSubItem($sitem2); $this->form->addItem($item); if ($a_mode == "edit") { $this->form->addCommandButton('update', $lng->txt('dcl_table_' . $a_mode)); } else { $this->form->addCommandButton('save', $lng->txt('dcl_table_' . $a_mode)); } $this->form->addCommandButton('cancel', $lng->txt('cancel')); $this->form->setFormAction($ilCtrl->getFormAction($this, $a_mode)); if ($a_mode == "edit") { $this->form->setTitle($lng->txt('dcl_edit_table')); } else { $this->form->setTitle($lng->txt('dcl_new_table')); } }
/** * Init form * * @return ilPropertyFormGUI */ public function initForm() { global $lng, $ilCtrl; /** @var $ilCtrl ilCtrl */ $ilCtrl = $ilCtrl; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $item = new ilCustomInputGUI(); $item->setHtml($lng->txt('dcl_file_format_description')); $item->setTitle("Info"); $form->addItem($item); $file = new ilFileInputGUI($lng->txt("import_file"), "import_file"); $file->setRequired(true); $form->addItem($file); $cb = new ilCheckboxInputGUI($lng->txt("dcl_simulate_import"), "simulate"); $cb->setInfo($lng->txt("dcl_simulate_info")); $form->addItem($cb); $form->addCommandButton("importExcel", $lng->txt("save")); return $form; }
/** * initEditCustomForm * * @param string $a_mode */ public function initForm($a_mode = "create") { include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); $item = new ilTextInputGUI($this->lng->txt('title'), 'title'); $item->setRequired(true); $this->form->addItem($item); $item = new ilCheckboxInputGUI($this->lng->txt('dcl_visible'), 'is_visible'); $this->form->addItem($item); // Show default order field and direction only in edit mode, because table id is not yet given and there are no fields to select if ($a_mode != 'create') { $item = new ilSelectInputGUI($this->lng->txt('dcl_default_sort_field'), 'default_sort_field'); $fields = $this->table->getVisibleFields(); $options = array(0 => $this->lng->txt('dcl_please_select')); foreach ($fields as $field) { $options[$field->getId()] = $field->getTitle(); } $item->setOptions($options); $this->form->addItem($item); $item = new ilSelectInputGUI($this->lng->txt('dcl_default_sort_field_order'), 'default_sort_field_order'); $options = array('asc' => $this->lng->txt('dcl_asc'), 'desc' => $this->lng->txt('dcl_desc')); $item->setOptions($options); $this->form->addItem($item); } $item = new ilTextAreaInputGUI($this->lng->txt('additional_info'), 'description'); $item->setUseRte(true); // $item->setRTESupport($this->table->getId(), 'dcl', 'table_settings'); $item->setRteTagSet('mini'); $this->form->addItem($item); $item = new ilCheckboxInputGUI($this->lng->txt('dcl_public_comments'), 'public_comments'); $this->form->addItem($item); $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('dcl_permissions_form')); $this->form->addItem($section); $item = new ilCustomInputGUI(); $item->setHtml($this->lng->txt('dcl_table_info')); $item->setTitle($this->lng->txt('dcl_table_info_title')); $this->form->addItem($item); $item = new ilCheckboxInputGUI($this->lng->txt('dcl_add_perm'), 'add_perm'); // $item->setInfo($this->lng->txt("dcl_add_perm_info")); $this->form->addItem($item); $item = new ilCheckboxInputGUI($this->lng->txt('dcl_edit_perm'), 'edit_perm'); // $item->setInfo($this->lng->txt("dcl_edit_perm_info")); $this->form->addItem($item); $item = new ilCheckboxInputGUI($this->lng->txt('dcl_delete_perm'), 'delete_perm'); // $item->setInfo($this->lng->txt("dcl_delete_perm_info")); $this->form->addItem($item); $item = new ilCheckboxInputGUI($this->lng->txt('dcl_edit_by_owner'), 'edit_by_owner'); // $item->setInfo($this->lng->txt("dcl_edit_by_owner_info")); $this->form->addItem($item); $item = new ilCheckboxInputGUI($this->lng->txt('dcl_view_own_records_perm'), 'view_own_records_perm'); // $item->setInfo($this->lng->txt("dcl_edit_by_owner_info")); $this->form->addItem($item); $item = new ilCheckboxInputGUI($this->lng->txt('dcl_export_enabled'), 'export_enabled'); $this->form->addItem($item); $item = new ilCheckboxInputGUI($this->lng->txt('dcl_limited'), 'limited'); $sitem1 = new ilDateTimeInputGUI($this->lng->txt('dcl_limit_start'), 'limit_start'); $sitem1->setShowTime(true); $sitem2 = new ilDateTimeInputGUI($this->lng->txt('dcl_limit_end'), 'limit_end'); $sitem2->setShowTime(true); // $item->setInfo($this->lng->txt("dcl_limited_info")); $item->addSubItem($sitem1); $item->addSubItem($sitem2); $this->form->addItem($item); if ($a_mode == "edit") { $this->form->addCommandButton('update', $this->lng->txt('dcl_table_' . $a_mode)); } else { $this->form->addCommandButton('save', $this->lng->txt('dcl_table_' . $a_mode)); } $this->form->addCommandButton('cancel', $this->lng->txt('cancel')); $this->form->setFormAction($this->ctrl->getFormAction($this, $a_mode)); if ($a_mode == "edit") { $this->form->setTitle($this->lng->txt('dcl_edit_table')); } else { $this->form->setTitle($this->lng->txt('dcl_new_table')); } }