/**
  * Init form.
  *
  * @param string $a_mode edit mode
  */
 public function initForm($a_mode = "edit")
 {
     global $lng, $ilCtrl;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     // title
     $ti = new ilTextInputGUI($lng->txt("title"), "title");
     $ti->setMaxLength(200);
     $ti->setSize(50);
     $ti->setRequired(true);
     $this->form->addItem($ti);
     // order nr
     $ni = new ilNumberInputGUI($lng->txt("skmg_order_nr"), "order_nr");
     $ni->setMaxLength(6);
     $ni->setSize(6);
     $ni->setRequired(true);
     $this->form->addItem($ni);
     // save and cancel commands
     if ($a_mode == "create") {
         $this->form->addCommandButton("save", $lng->txt("save"));
         $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
         $this->form->setTitle($lng->txt("skmg_create_skll"));
     } else {
         $this->form->addCommandButton("update", $lng->txt("save"));
         $this->form->setTitle($lng->txt("skmg_edit_skll"));
     }
     $ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
     $this->form->setFormAction($ilCtrl->getFormAction($this));
 }
 /**
  * Add all fields to the form
  */
 protected function initForm()
 {
     $this->setFormAction($this->ctrl->getFormAction($this->parent_gui));
     $this->setTitle($this->lng->txt('orgu_settings'));
     $item = new ilTextInputGUI($this->lng->txt('title'), 'title');
     $item->setRequired(true);
     $item->setValue($this->obj_orgu->getTitle());
     $this->addItem($item);
     $item = new ilTextAreaInputGUI($this->lng->txt('description'), 'description');
     $item->setValue($this->obj_orgu->getDescription());
     $this->addItem($item);
     $item = new ilFormSectionHeaderGUI();
     $item->setTitle($this->lng->txt('orgu_type'));
     $this->addItem($item);
     $types = ilOrgUnitType::getAllTypes();
     $options = array(0 => '');
     /** @var ilOrgUnitType $type */
     foreach ($types as $type) {
         $options[$type->getId()] = $type->getTitle();
     }
     asort($options);
     $item = new ilSelectInputGUI($this->lng->txt('orgu_type'), 'orgu_type');
     $item->setOptions($options);
     $item->setValue($this->obj_orgu->getOrgUnitTypeId());
     $this->addItem($item);
     $item = new ilFormSectionHeaderGUI();
     $item->setTitle($this->lng->txt('ext_id'));
     $this->addItem($item);
     $item = new ilTextInputGUI($this->lng->txt('ext_id'), 'ext_id');
     $item->setValue($this->obj_orgu->getImportId());
     $this->addItem($item);
     $this->addCommandButton('updateSettings', $this->lng->txt('save'));
 }
 /**
  * Init settings property form
  *
  * @access private
  */
 private function initForm()
 {
     $this->setFormAction($this->ctrl->getFormAction($this->parent_gui));
     $name = new ilTextInputGUI($this->lng->txt("bibl_library_name"), 'name');
     $name->setRequired(true);
     $name->setValue('');
     $this->addItem($name);
     $url = new ilTextInputGUI($this->lng->txt("bibl_library_url"), 'url');
     $url->setRequired(true);
     $url->setValue('');
     $this->addItem($url);
     $img = new ilTextInputGUI($this->lng->txt("bibl_library_img"), 'img');
     $img->setValue('');
     $this->addItem($img);
     $show_in_list = new ilCheckboxInputGUI($this->lng->txt("bibl_library_show_in_list"), 'show_in_list');
     $show_in_list->setValue(1);
     $this->addItem($show_in_list);
     switch ($this->action) {
         case 'create':
             $this->setTitle($this->lng->txt("bibl_settings_new"));
             $this->addCommandButton('create', $this->lng->txt('save'));
             break;
         case 'update':
             $this->addCommandButton('update', $this->lng->txt('save'));
             $this->fillForm();
             $this->setTitle($this->lng->txt("bibl_settings_edit"));
             break;
     }
     $this->addCommandButton('cancel', $this->lng->txt("cancel"));
 }
 /**
  * Init configuration form.
  *
  * @return object form object
  */
 public function initConfigurationForm()
 {
     global $lng, $ilCtrl, $ilDB;
     $pl = $this->getPluginObject();
     $this->getPluginObject()->includeClass('class.ilOpenmeetingsConfig.php');
     $this->object = ilOpenmeetingsConfig::getInstance();
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     $this->form->setTitle($pl->txt("openmeetings_plugin_configuration"));
     $this->form->setFormAction($ilCtrl->getFormAction($this));
     $this->form->addCommandButton("save", $lng->txt("save"));
     // url (text)
     $ti = new ilTextInputGUI($pl->txt("url"), "frmurl");
     $ti->setRequired(true);
     $ti->setMaxLength(256);
     $ti->setSize(60);
     $this->form->addItem($ti);
     // port (text)
     $ti = new ilTextInputGUI($pl->txt("port"), "frmport");
     $ti->setRequired(true);
     $ti->setMaxLength(10);
     $ti->setSize(10);
     $this->form->addItem($ti);
     // appname
     $ti = new ilTextInputGUI($pl->txt("appname"), "frmappname");
     $ti->setRequired(true);
     $ti->setMaxLength(32);
     $ti->setSize(20);
     $this->form->addItem($ti);
     // username (text)
     $ti = new ilTextInputGUI($pl->txt("username"), "frmusername");
     $ti->setRequired(true);
     $ti->setMaxLength(256);
     $ti->setSize(20);
     $this->form->addItem($ti);
     // password (text)
     $ti = new ilPasswordInputGUI($pl->txt("password"), "frmpassword");
     $ti->setRequired(true);
     $ti->setMaxLength(256);
     $ti->setSize(20);
     $ti->setRetype(false);
     $this->form->addItem($ti);
     foreach ($this->fields as $key => $item) {
         $field = new $item["type"]($this->plugin_object->txt('conf_' . $key), $key);
         $field->setInfo($this->plugin_object->txt($item["info"]));
         if (is_array($item["subelements"])) {
             foreach ($item["subelements"] as $subkey => $subitem) {
                 $subfield = new $subitem["type"]($this->plugin_object->txt('conf_' . $key . "_" . $subkey), $subkey);
                 $subfield->setInfo($this->plugin_object->txt($subitem["info"]));
                 $field->addSubItem($subfield);
             }
         }
         $this->form->addItem($field);
     }
     return $this->form;
 }
 public function showSettings($item)
 {
     global $lng;
     $txt = new ilTextInputGUI($lng->txt('polling_intervall'), 'osd_polling_intervall');
     $txt->setRequired(true);
     $txt->setInfo($lng->txt('polling_in_seconds'));
     $txt->setValue('300');
     $item->addSubItem($txt);
     return array('osd_polling_intervall');
 }
 /**
  * Init Social Bookmark edit/create Form
  *
  * @param        ilObjectGUI	$formhandlerObject        taken as form target
  * @param        int        	$mode        "create" / "edit"
  */
 public static function _initForm($formhandlerObject, $mode = "create", $id = 0)
 {
     global $lng, $ilCtrl;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setMultipart(true);
     // File Title
     $in_title = new ilTextInputGUI($lng->txt("title"), "title");
     $in_title->setMaxLength(128);
     $in_title->setSize(40);
     $in_title->setRequired(true);
     $form->addItem($in_title);
     // Link
     $in_link = new ilTextInputGUI($lng->txt("link"), "link");
     $in_link->setMaxLength(300);
     $in_link->setSize(40);
     $in_link->setRequired(true);
     $in_link->setInfo($lng->txt('socialbm_link_description'));
     $form->addItem($in_link);
     // File
     $in_file = new ilFileInputGUI($lng->txt("file"), "image_file");
     $in_file->setSuffixes(array('bmp', 'gif', 'jpg', 'jpeg', 'png'));
     $form->addItem($in_file);
     // Activate on submit
     $in_activate = new ilCheckboxInputGUI($lng->txt("activate"), "activate");
     $in_activate->setValue('1');
     $form->addItem($in_activate);
     // save and cancel commands
     if ($mode == "create") {
         $form->addCommandButton("createSocialBookmark", $lng->txt("create"));
         $form->addCommandButton("editSocialBookmarks", $lng->txt("cancel"));
         $form->setTitle($lng->txt("adm_social_bm_create"));
         $in_file->setRequired(true);
     } else {
         if ($mode == "update") {
             $in_hidden = new ilHiddenInputGUI("sbm_id", $id);
             $form->addItem($in_hidden);
             $form->addCommandButton("updateSocialBookmark", $lng->txt("update"));
             $form->addCommandButton("cancel", $lng->txt("cancel"));
             $form->setTitle($lng->txt("adm_social_bm_edit"));
             $in_file->setRequired(false);
         }
     }
     $form->setTableWidth("60%");
     $form->setFormAction($ilCtrl->getFormAction($formhandlerObject));
     return $form;
 }
예제 #7
0
 /**
  * structure / page object creation form
  */
 function create()
 {
     $new_type = $_REQUEST["new_type"];
     $this->ctrl->setParameter($this, "new_type", $new_type);
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this, "save"));
     $form->setTitle($this->lng->txt($new_type . "_new"));
     $title = new ilTextInputGUI($this->lng->txt("title"), "Fobject[title]");
     $title->setRequired(true);
     $form->addItem($title);
     $desc = new ilTextAreaInputGUI($this->lng->txt("description"), "Fobject[desc]");
     $form->addItem($desc);
     $form->addCommandButton("save", $this->lng->txt($new_type . "_add"));
     $form->addCommandButton("cancel", $this->lng->txt("cancel"));
     $this->tpl->setContent($form->getHTML());
 }
예제 #8
0
 function owner()
 {
     $this->__initSubTabs("owner");
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this, "owner"));
     $form->setTitle($this->lng->txt("info_owner_of_object"));
     $login = new ilTextInputGUI($this->lng->txt("login"), "owner");
     $login->setDataSource($this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilRepositorySearchGUI'), 'doUserAutoComplete', '', true));
     $login->setRequired(true);
     $login->setSize(50);
     $login->setInfo($this->lng->txt("chown_warning"));
     $login->setValue(ilObjUser::_lookupLogin($this->gui_obj->object->getOwner()));
     $form->addItem($login);
     $form->addCommandButton("changeOwner", $this->lng->txt("change_owner"));
     $this->tpl->setContent($form->getHTML());
 }
 /**
  * @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);
 }
 /**
  * Init  form.
  *
  * @param        int $a_mode        Edit Mode
  */
 public function initCreateFolder()
 {
     global $ilCtrl, $lng;
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     $this->form->setId("cld_create_folder");
     $name = new ilTextInputGUI($lng->txt("cld_folder_name"), "folder_name");
     $name->setRequired(true);
     $this->form->addItem($name);
     // folder id
     $id = new ilHiddenInputGUI("parent_folder_id");
     $id->setValue($_POST["id"]);
     $this->form->addItem($id);
     $this->form->addCommandButton("createFolder", $lng->txt("cld_create_folder"));
     $this->form->addCommandButton("cancel", $lng->txt("cancel"));
     $this->form->setTitle($lng->txt("cld_create_folder"));
     $this->form->setFormAction($ilCtrl->getFormAction($this));
     $this->form->setTarget("cld_blank_target");
 }
 /**
  * Init configuration form.
  *
  * @return object form object
  */
 public function initConfigurationForm()
 {
     global $lng, $ilCtrl;
     $pl = $this->getPluginObject();
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     // setting 1 (a checkbox)
     $cb = new ilCheckboxInputGUI($pl->txt("setting_1"), "setting_1");
     $form->addItem($cb);
     // setting 2 (text)
     $ti = new ilTextInputGUI($pl->txt("setting_2"), "setting_2");
     $ti->setRequired(true);
     $ti->setMaxLength(10);
     $ti->setSize(10);
     $form->addItem($ti);
     $form->addCommandButton("save", $lng->txt("save"));
     $form->setTitle($pl->txt("example_plugin_configuration"));
     $form->setFormAction($ilCtrl->getFormAction($this));
     return $form;
 }
 /**
  * @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);
 }
 /**
  * Init configuration form.
  *
  * @return object form object
  */
 public function initConfigurationForm()
 {
     global $lng, $ilCtrl;
     $pl = $this->getPluginObject();
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     // Setting for the ephorus logging
     $ephorus_logging = new ilCheckboxInputGUI($pl->txt("ephorus_logging"), "ephorus_logging");
     $ephorus_logging->setValue(1);
     $ephorus_logging->setInfo($pl->txt("ephorus_logging_description"));
     $form->addItem($ephorus_logging);
     // Setting for the hand-in code
     $handin_code = new ilTextInputGUI($pl->txt("handin_code"), "handin_code");
     $handin_code->setRequired(true);
     $form->addItem($handin_code);
     // Setting for the hand-in address
     $handin_address = new ilTextInputGUI($pl->txt("handin_address"), "handin_address");
     $handin_address->setSize(80);
     $handin_address->setRequired(true);
     $form->addItem($handin_address);
     // Setting for the index address
     $index_address = new ilTextInputGUI($pl->txt("index_address"), "index_address");
     $index_address->setSize(80);
     $index_address->setRequired(true);
     $form->addItem($index_address);
     // Setting for the processtype
     $processtype = new ilSelectInputGUI($pl->txt("default_processtype"), "processtype");
     $processtype->setOptions(array(1 => $pl->txt("default"), 3 => $pl->txt("private")));
     $processtype->setInfo($pl->txt("default_processtype_description"));
     $form->addItem($processtype);
     // Setting for the disclosure
     $disclosure = new ilTextAreaInputGUI($pl->txt("disclosure"), "disclosure");
     $disclosure->setCols(79);
     $disclosure->setRows(4);
     $form->addItem($disclosure);
     $form->addCommandButton("save", $lng->txt("save") . " / " . $pl->txt("check_connection"));
     $form->setTitle($pl->txt("ephorus_plugin_configuration"));
     $form->setFormAction($ilCtrl->getFormAction($this));
     return $form;
 }
예제 #14
0
 public function showTopicForm()
 {
     $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment');
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     if ($this->objCurrentTopic->getId()) {
         $this->ctrl->setParameter($this, 'topic_id', $this->objCurrentTopic->getId());
     }
     $form->setFormAction($this->ctrl->getFormAction($this, 'saveTopic'));
     $form->setTitle($this->lng->txt($this->objCurrentTopic->getId() ? 'edit_topic' : 'new_topic'));
     $title = new ilTextInputGUI($this->lng->txt('title'), 'title');
     $title->setValue($this->objCurrentTopic->getTitle());
     $title->setRequired(true);
     $form->addItem($title);
     $sorting = new ilTextInputGUI($this->lng->txt('pay_sorting_value'), 'sorting');
     $sorting->setValue($this->objCurrentTopic->getSorting());
     $sorting->setMaxLength(11);
     $sorting->setSize(11);
     $form->addItem($sorting);
     $form->addCommandButton('saveTopic', $this->lng->txt('save'));
     $form->addCommandButton('showTopicsList', $this->lng->txt('cancel'));
     $this->tpl->setVariable('FORM', $form->getHTML());
     return true;
 }
예제 #15
0
 /**
  * Init assignment form.
  *
  * @param        int        $a_mode        "create"/"edit"
  */
 public function initAssignmentForm($a_mode = "create")
 {
     global $lng, $ilCtrl, $ilSetting;
     // init form
     $lng->loadLanguageModule("form");
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     $this->form->setTableWidth("600px");
     if ($a_mode == "edit") {
         $this->form->setTitle($lng->txt("exc_edit_assignment"));
     } else {
         $this->form->setTitle($lng->txt("exc_new_assignment"));
     }
     $this->form->setFormAction($ilCtrl->getFormAction($this));
     // type
     include_once "./Modules/Exercise/classes/class.ilExAssignment.php";
     $types = array(ilExAssignment::TYPE_UPLOAD => $this->lng->txt("exc_type_upload"), ilExAssignment::TYPE_UPLOAD_TEAM => $this->lng->txt("exc_type_upload_team"), ilExAssignment::TYPE_TEXT => $this->lng->txt("exc_type_text"));
     if (!$ilSetting->get('disable_wsp_blogs')) {
         $types[ilExAssignment::TYPE_BLOG] = $this->lng->txt("exc_type_blog");
     }
     if ($ilSetting->get('user_portfolios')) {
         $types[ilExAssignment::TYPE_PORTFOLIO] = $this->lng->txt("exc_type_portfolio");
     }
     if (sizeof($types) > 1) {
         $ty = new ilSelectInputGUI($this->lng->txt("exc_assignment_type"), "type");
         $ty->setOptions($types);
         $ty->setRequired(true);
     } else {
         $ty = new ilHiddenInputGUI("type");
         $ty->setValue(ilExAssignment::TYPE_UPLOAD);
     }
     $this->form->addItem($ty);
     // title
     $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
     $ti->setMaxLength(200);
     $ti->setRequired(true);
     $this->form->addItem($ti);
     // start time y/n
     $cb = new ilCheckboxInputGUI($this->lng->txt("exc_start_time"), "start_time_cb");
     $this->form->addItem($cb);
     // start time
     $edit_date = new ilDateTimeInputGUI("", "start_time");
     $edit_date->setShowTime(true);
     $cb->addSubItem($edit_date);
     // deadline y/n
     $dcb = new ilCheckboxInputGUI($this->lng->txt("exc_deadline"), "deadline_cb");
     $dcb->setChecked(true);
     $this->form->addItem($dcb);
     // Deadline
     $edit_date = new ilDateTimeInputGUI($lng->txt(""), "deadline");
     $edit_date->setShowTime(true);
     $dcb->addSubItem($edit_date);
     // mandatory
     $cb = new ilCheckboxInputGUI($this->lng->txt("exc_mandatory"), "mandatory");
     $cb->setInfo($this->lng->txt("exc_mandatory_info"));
     $cb->setChecked(true);
     $this->form->addItem($cb);
     // Work Instructions
     $desc_input = new ilTextAreaInputGUI($lng->txt("exc_instruction"), "instruction");
     $desc_input->setRows(20);
     $desc_input->setUseRte(true);
     $desc_input->setRteTagSet("mini");
     $this->form->addItem($desc_input);
     // files
     if ($a_mode == "create") {
         $files = new ilFileWizardInputGUI($this->lng->txt('objs_file'), 'files');
         $files->setFilenames(array(0 => ''));
         $this->form->addItem($files);
     }
     // peer review
     $peer = new ilCheckboxInputGUI($lng->txt("exc_peer_review"), "peer");
     $peer->setInfo($this->lng->txt("exc_peer_review_ass_setting_info"));
     $this->form->addItem($peer);
     if ($a_mode == "create") {
         $peer->setInfo($lng->txt("exc_peer_review_info"));
     }
     $peer_min = new ilNumberInputGUI($lng->txt("exc_peer_review_min_number"), "peer_min");
     $peer_min->setInfo($lng->txt("exc_peer_review_min_number_info"));
     $peer_min->setRequired(true);
     $peer_min->setValue(5);
     $peer_min->setSize(3);
     $peer_min->setValue(2);
     $peer->addSubItem($peer_min);
     $peer_dl = new ilDateTimeInputGUI($lng->txt("exc_peer_review_deadline"), "peer_dl");
     $peer_dl->setInfo($lng->txt("exc_peer_review_deadline_info"));
     $peer_dl->enableDateActivation("", "peer_dl_tgl");
     $peer_dl->setShowTime(true);
     $peer->addSubItem($peer_dl);
     $peer_file = new ilCheckboxInputGUI($lng->txt("exc_peer_review_file"), "peer_file");
     $peer_file->setInfo($lng->txt("exc_peer_review_file_info"));
     $peer->addSubItem($peer_file);
     $peer_prsl = new ilCheckboxInputGUI($lng->txt("exc_peer_review_personal"), "peer_prsl");
     $peer_prsl->setInfo($lng->txt("exc_peer_review_personal_info"));
     $peer->addSubItem($peer_prsl);
     if ($a_mode != "create" && $this->ass && $this->ass->getDeadline() && $this->ass->getDeadline() < time()) {
         $peer_prsl->setDisabled(true);
     }
     // global feedback
     $fb = new ilCheckboxInputGUI($lng->txt("exc_global_feedback_file"), "fb");
     $this->form->addItem($fb);
     $fb_file = new ilFileInputGUI($lng->txt("file"), "fb_file");
     // $fb_file->setRequired(true);
     $fb_file->setALlowDeletion(true);
     $fb->addSubItem($fb_file);
     $fb_date = new ilRadioGroupInputGUI($lng->txt("exc_global_feedback_file_date"), "fb_date");
     $fb_date->setRequired(true);
     $fb_date->addOption(new ilRadioOption($lng->txt("exc_global_feedback_file_date_deadline"), ilExAssignment::FEEDBACK_DATE_DEADLINE));
     $fb_date->addOption(new ilRadioOption($lng->txt("exc_global_feedback_file_date_upload"), ilExAssignment::FEEDBACK_DATE_SUBMISSION));
     $fb->addSubItem($fb_date);
     $fb_cron = new ilCheckboxInputGUI($lng->txt("exc_global_feedback_file_cron"), "fb_cron");
     $fb_cron->setInfo($lng->txt("exc_global_feedback_file_cron_info"));
     $fb->addSubItem($fb_cron);
     // save and cancel commands
     if ($a_mode == "create") {
         $this->form->addCommandButton("saveAssignment", $lng->txt("save"));
         $this->form->addCommandButton("listAssignments", $lng->txt("cancel"));
     } else {
         $this->form->addCommandButton("updateAssignment", $lng->txt("save"));
         $this->form->addCommandButton("listAssignments", $lng->txt("cancel"));
     }
 }
 public function populateQuestionSpecificFormPart(\ilPropertyFormGUI $form)
 {
     // points
     $points = new ilNumberInputGUI($this->lng->txt("points"), "points");
     $points->setValue($this->object->getPoints());
     $points->setRequired(TRUE);
     $points->setSize(3);
     $points->setMinValue(0.0);
     $form->addItem($points);
     $header = new ilFormSectionHeaderGUI();
     $header->setTitle($this->lng->txt("applet_attributes"));
     $form->addItem($header);
     // java applet
     $javaapplet = $this->object->getJavaAppletFilename();
     $applet = new ilFileInputGUI($this->lng->txt('javaapplet'), 'javaappletName');
     $applet->setSuffixes(array('jar', 'class'));
     $applet->setRequired(false);
     if (strlen($javaapplet)) {
         $filename = new ilNonEditableValueGUI($this->lng->txt('filename'), 'uploaded_javaapplet');
         $filename->setValue($javaapplet);
         $applet->addSubItem($filename);
         $delete = new ilCheckboxInputGUI('', 'delete_applet');
         $delete->setOptionTitle($this->lng->txt('delete'));
         $delete->setValue(1);
         $applet->addSubItem($delete);
     }
     $form->addItem($applet);
     // Code
     $code = new ilTextInputGUI($this->lng->txt("code"), "java_code");
     $code->setValue($this->object->getJavaCode());
     $code->setRequired(TRUE);
     $form->addItem($code);
     if (!strlen($javaapplet)) {
         // Archive
         $archive = new ilTextInputGUI($this->lng->txt("archive"), "java_archive");
         $archive->setValue($this->object->getJavaArchive());
         $archive->setRequired(false);
         $form->addItem($archive);
         // Codebase
         $codebase = new ilTextInputGUI($this->lng->txt("codebase"), "java_codebase");
         $codebase->setValue($this->object->getJavaCodebase());
         $codebase->setRequired(false);
         $form->addItem($codebase);
     }
     // Width
     $width = new ilNumberInputGUI($this->lng->txt("width"), "java_width");
     $width->setDecimals(0);
     $width->setSize(6);
     $width->setMinValue(50);
     $width->setMaxLength(6);
     $width->setValue($this->object->getJavaWidth());
     $width->setRequired(TRUE);
     $form->addItem($width);
     // Height
     $height = new ilNumberInputGUI($this->lng->txt("height"), "java_height");
     $height->setDecimals(0);
     $height->setSize(6);
     $height->setMinValue(50);
     $height->setMaxLength(6);
     $height->setValue($this->object->getJavaHeight());
     $height->setRequired(TRUE);
     $form->addItem($height);
     $header = new ilFormSectionHeaderGUI();
     $header->setTitle($this->lng->txt("applet_parameters"));
     $form->addItem($header);
     include_once "./Modules/TestQuestionPool/classes/class.ilKVPWizardInputGUI.php";
     $kvp = new ilKVPWizardInputGUI($this->lng->txt("applet_parameters"), "kvp");
     $values = array();
     for ($i = 0; $i < $this->object->getParameterCount(); $i++) {
         $param = $this->object->getParameter($i);
         array_push($values, array($param['name'], $param['value']));
     }
     if (count($values) == 0) {
         array_push($values, array("", ""));
     }
     $kvp->setKeyName($this->lng->txt('name'));
     $kvp->setValueName($this->lng->txt('value'));
     $kvp->setValues($values);
     $form->addItem($kvp);
 }
 /**
  * init edit/create category form 
  *
  * @access protected
  * @return
  */
 protected function initFormCategory($a_mode)
 {
     global $rbacsystem, $ilUser;
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     include_once './Services/Calendar/classes/class.ilCalendarCategory.php';
     include_once './Services/Calendar/classes/class.ilCalendarCategories.php';
     $cat_info = ilCalendarCategories::_getInstance()->getCategoryInfo((int) $_GET['category_id']);
     $this->form = new ilPropertyFormGUI();
     #$this->form->setTableWidth('40%');
     switch ($a_mode) {
         case 'edit':
             $category = new ilCalendarCategory((int) $_GET['category_id']);
             $this->form->setTitle($this->lng->txt('cal_edit_category'));
             $this->ctrl->saveParameter($this, array('seed', 'category_id'));
             $this->form->setFormAction($this->ctrl->getFormAction($this));
             if ($this->isEditable()) {
                 $this->form->addCommandButton('update', $this->lng->txt('save'));
                 /*
                 					if($cat_info['type'] == ilCalendarCategory::TYPE_USR)
                 					{
                 						$this->form->addCommandButton('shareSearch',$this->lng->txt('cal_share'));
                 					}
                 					$this->form->addCommandButton('confirmDelete',$this->lng->txt('delete'));
                 */
                 $this->form->addCommandButton('manage', $this->lng->txt('cancel'));
             }
             break;
         case 'create':
             $this->editable = true;
             $category = new ilCalendarCategory(0);
             $this->ctrl->saveParameter($this, array('category_id'));
             $this->form->setFormAction($this->ctrl->getFormAction($this));
             $this->form->setTitle($this->lng->txt('cal_add_category'));
             $this->form->addCommandButton('save', $this->lng->txt('save'));
             $this->form->addCommandButton('manage', $this->lng->txt('cancel'));
             break;
     }
     // Calendar name
     $title = new ilTextInputGUI($this->lng->txt('cal_calendar_name'), 'title');
     if ($a_mode == 'edit') {
         $title->setDisabled(!$this->isEditable());
     }
     $title->setRequired(true);
     $title->setMaxLength(64);
     $title->setSize(32);
     $title->setValue($category->getTitle());
     $this->form->addItem($title);
     include_once './Services/Calendar/classes/class.ilCalendarSettings.php';
     if ($a_mode == 'create' and $rbacsystem->checkAccess('edit_event', ilCalendarSettings::_getInstance()->getCalendarSettingsId())) {
         $type = new ilRadioGroupInputGUI($this->lng->txt('cal_cal_type'), 'type');
         $type->setValue($category->getType());
         $type->setRequired(true);
         $opt = new ilRadioOption($this->lng->txt('cal_type_personal'), ilCalendarCategory::TYPE_USR);
         $type->addOption($opt);
         $opt = new ilRadioOption($this->lng->txt('cal_type_system'), ilCalendarCategory::TYPE_GLOBAL);
         $type->addOption($opt);
         $type->setInfo($this->lng->txt('cal_type_info'));
         $this->form->addItem($type);
     }
     $color = new ilColorPickerInputGUI($this->lng->txt('cal_calendar_color'), 'color');
     $color->setValue($category->getColor());
     if (!$this->isEditable()) {
         $color->setDisabled(true);
     }
     $color->setRequired(true);
     $this->form->addItem($color);
     $location = new ilRadioGroupInputGUI($this->lng->txt('cal_type_rl'), 'type_rl');
     $location->setDisabled($a_mode == 'edit');
     $location_local = new ilRadioOption($this->lng->txt('cal_type_local'), ilCalendarCategory::LTYPE_LOCAL);
     $location->addOption($location_local);
     $location_remote = new ilRadioOption($this->lng->txt('cal_type_remote'), ilCalendarCategory::LTYPE_REMOTE);
     $location->addOption($location_remote);
     $location->setValue($category->getLocationType());
     $url = new ilTextInputGUI($this->lng->txt('cal_remote_url'), 'remote_url');
     $url->setDisabled($a_mode == 'edit');
     $url->setValue($category->getRemoteUrl());
     $url->setMaxLength(500);
     $url->setSize(60);
     $url->setRequired(true);
     $location_remote->addSubItem($url);
     $user = new ilTextInputGUI($this->lng->txt('username'), 'remote_user');
     $user->setDisabled($a_mode == 'edit');
     $user->setValue($category->getRemoteUser());
     $user->setMaxLength(50);
     $user->setSize(20);
     $user->setRequired(false);
     $location_remote->addSubItem($user);
     $pass = new ilPasswordInputGUI($this->lng->txt('password'), 'remote_pass');
     $pass->setDisabled($a_mode == 'edit');
     $pass->setValue($category->getRemotePass());
     $pass->setMaxLength(50);
     $pass->setSize(20);
     $pass->setRetype(false);
     $pass->setInfo($this->lng->txt('remote_pass_info'));
     $location_remote->addSubItem($pass);
     $this->form->addItem($location);
 }
 public function editCurrencyObject()
 {
     $currency_id = $_POST['currency_id'];
     $obj_currency = ilPaymentCurrency::_getCurrency($currency_id);
     $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment');
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTitle($this->lng->txt('paya_edit_currency'));
     $o_Unit = new ilTextInputGUI($this->lng->txt('paya_currency_unit'), 'currency_unit');
     $o_Unit->setValue($obj_currency[$currency_id]['unit']);
     $o_Unit->setPostVar('currency_unit');
     $o_Unit->setRequired(true);
     $o_Isocode = new ilTextInputGUI($this->lng->txt('iso_code'), 'iso_code');
     $o_Isocode->setValue($obj_currency[$currency_id]['iso_code']);
     $o_Isocode->setPostVar('iso_code');
     $o_Isocode->setRequired(true);
     $o_Symbol = new ilTextInputGUI($this->lng->txt('symbol'), 'symbol');
     $o_Symbol->setValue($obj_currency[$currency_id]['symbol']);
     $o_Symbol->setPostVar('symbol');
     $o_Symbol->setRequired(true);
     $o_Conversionrate = new IlTextInputGUI($this->lng->txt('conversion_rate'), 'conversion_rate');
     $o_Conversionrate->setValue($obj_currency[$currency_id]['conversion_rate']);
     $o_Conversionrate->setPostVar('conversion_rate');
     $o_Conversionrate->setRequired(true);
     $o_hidden = new ilHiddenInputGUI('currency_id');
     $o_hidden->setValue($obj_currency[$currency_id]['currency_id']);
     $o_hidden->setPostVar('currency_id');
     $form->addItem($o_hidden);
     $form->addItem($o_Unit);
     $form->addItem($o_Isocode);
     $form->addItem($o_Symbol);
     $form->addItem($o_Conversionrate);
     $form->addCommandButton('updateCurrency', $this->lng->txt('save'));
     $form->addCommandButton('currencies', $this->lng->txt('cancel'));
     $this->tpl->setVariable('FORM', $form->getHTML());
 }
 /**
  * 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);
 }
 /**
  * Build property form
  * @param	string	$a_mode
  * @param	int		$id
  * @return	object
  */
 function initForm($a_mode = "create", $id = NULL)
 {
     global $lng, $ilCtrl;
     $lng->loadLanguageModule("dateplaner");
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form_gui = new ilPropertyFormGUI();
     $title = new ilTextInputGUI($lng->txt("title"), "title");
     $title->setRequired(true);
     $title->setSize(40);
     $title->setMaxLength(120);
     $form_gui->addItem($title);
     /*
     $type = new ilRadioGroupInputGUI($lng->txt("book_schedule_type"), "type");
     $type->setRequired(true);
     $form_gui->addItem($type);
     $fix = new ilRadioOption($lng->txt("book_schedule_type_fix"), "fix");
     $fix->setInfo($lng->txt("book_schedule_type_fix_info"));
     $type->addOption($fix);
     $flex = new ilRadioOption($lng->txt("book_schedule_type_flexible"), "flexible");
     $flex->setInfo($lng->txt("book_schedule_type_flexible_info"));
     $type->addOption($flex);
     
     $raster = new ilNumberInputGUI($lng->txt("book_schedule_raster"), "raster");
     $raster->setRequired(true);
     $raster->setInfo($lng->txt("book_schedule_raster_info"));
     $raster->setMinValue(1);
     $raster->setSize(3);
     $raster->setMaxLength(3);
     $raster->setSuffix($lng->txt("book_minutes"));
     $flex->addSubItem($raster);
     
     $rent_min = new ilNumberInputGUI($lng->txt("book_schedule_rent_min"), "rent_min");
     $rent_min->setInfo($lng->txt("book_schedule_rent_info"));
     $rent_min->setMinValue(1);
     $rent_min->setSize(3);
     $rent_min->setMaxLength(3);
     $flex->addSubItem($rent_min);
     
     $rent_max = new ilNumberInputGUI($lng->txt("book_schedule_rent_max"), "rent_max");
     $rent_max->setInfo($lng->txt("book_schedule_rent_info"));
     $rent_max->setMinValue(1);
     $rent_max->setSize(3);
     $rent_max->setMaxLength(3);
     $flex->addSubItem($rent_max);
     
     $break = new ilNumberInputGUI($lng->txt("book_schedule_break"), "break");
     $break->setInfo($lng->txt("book_schedule_break_info"));
     $break->setMinValue(1);
     $break->setSize(3);
     $break->setMaxLength(3);
     $flex->addSubItem($break);
     */
     include_once "Modules/BookingManager/classes/class.ilScheduleInputGUI.php";
     $definition = new ilScheduleInputGUI($lng->txt("book_schedule_days"), "days");
     $definition->setInfo($lng->txt("book_schedule_days_info"));
     $definition->setRequired(true);
     $form_gui->addItem($definition);
     $deadline = new ilNumberInputGUI($lng->txt("book_deadline"), "deadline");
     $deadline->setInfo($lng->txt("book_deadline_info"));
     $deadline->setSuffix($lng->txt("book_hours"));
     $deadline->setMinValue(0);
     $deadline->setSize(3);
     $deadline->setMaxLength(3);
     $form_gui->addItem($deadline);
     if ($a_mode == "edit") {
         $form_gui->setTitle($lng->txt("book_edit_schedule"));
         $item = new ilHiddenInputGUI('schedule_id');
         $item->setValue($id);
         $form_gui->addItem($item);
         include_once 'Modules/BookingManager/classes/class.ilBookingSchedule.php';
         $schedule = new ilBookingSchedule($id);
         $title->setValue($schedule->getTitle());
         $deadline->setValue($schedule->getDeadline());
         /*
         if($schedule->getRaster())
         {
         	$type->setValue("flexible");
         	$raster->setValue($schedule->getRaster());
         	$rent_min->setValue($schedule->getMinRental());
         	$rent_max->setValue($schedule->getMaxRental());
         	$break->setValue($schedule->getAutoBreak());
         }
         else
         {
         	$type->setValue("fix");
         }
         */
         $definition->setValue($schedule->getDefinitionBySlots());
         $form_gui->addCommandButton("update", $lng->txt("save"));
     } else {
         $form_gui->setTitle($lng->txt("book_add_schedule"));
         $form_gui->addCommandButton("save", $lng->txt("save"));
         $form_gui->addCommandButton("render", $lng->txt("cancel"));
     }
     $form_gui->setFormAction($ilCtrl->getFormAction($this));
     return $form_gui;
 }
예제 #21
0
 /**
  * Init object edit form
  *
  * @return ilPropertyFormGUI
  */
 protected function initEditForm()
 {
     global $lng, $ilCtrl;
     $lng->loadLanguageModule($this->object->getType());
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this, "update"));
     $form->setTitle($this->lng->txt($this->object->getType() . "_edit"));
     // title
     $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
     $ti->setSize(min(40, ilObject::TITLE_LENGTH));
     $ti->setMaxLength(ilObject::TITLE_LENGTH);
     $ti->setRequired(true);
     $form->addItem($ti);
     // description
     $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
     $ta->setCols(40);
     $ta->setRows(2);
     $form->addItem($ta);
     $this->initEditCustomForm($form);
     $form->addCommandButton("update", $this->lng->txt("save"));
     //$this->form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
     return $form;
 }
 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;
 }
 /**
  * Init properties form
  */
 function initPropertiesForm()
 {
     global $ilCtrl, $lng;
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     // title
     $ti = new ilTextInputGUI($lng->txt("title"), "title");
     //$ti->setMaxLength();
     //$ti->setSize();
     //$ti->setInfo($lng->txt(""));
     $ti->setRequired(true);
     $this->form->addItem($ti);
     // description
     $ta = new ilTextAreaInputGUI($lng->txt("desc"), "description");
     //$ta->setCols();
     //$ta->setRows();
     //$ta->setInfo($lng->txt(""));
     $this->form->addItem($ta);
     // online
     $online = new ilCheckboxInputGUI($lng->txt("cont_online"), "cobj_online");
     $this->form->addItem($online);
     // default layout
     $layout = self::getLayoutOption($lng->txt("cont_def_layout"), "lm_layout");
     $this->form->addItem($layout);
     // page header
     $page_header = new ilSelectInputGUI($lng->txt("cont_page_header"), "lm_pg_header");
     $option = array("st_title" => $this->lng->txt("cont_st_title"), "pg_title" => $this->lng->txt("cont_pg_title"), "none" => $this->lng->txt("cont_none"));
     $page_header->setOptions($option);
     $this->form->addItem($page_header);
     // chapter numeration
     $chap_num = new ilCheckboxInputGUI($lng->txt("cont_act_number"), "cobj_act_number");
     $this->form->addItem($chap_num);
     // toc mode
     $toc_mode = new ilSelectInputGUI($lng->txt("cont_toc_mode"), "toc_mode");
     $option = array("chapters" => $this->lng->txt("cont_chapters_only"), "pages" => $this->lng->txt("cont_chapters_and_pages"));
     $toc_mode->setOptions($option);
     $this->form->addItem($toc_mode);
     // public notes
     if (!$this->ilias->getSetting('disable_comments')) {
         $this->lng->loadLanguageModule("notes");
         $pub_nodes = new ilCheckboxInputGUI($lng->txt("notes_comments"), "cobj_pub_notes");
         $pub_nodes->setInfo($this->lng->txt("cont_lm_comments_desc"));
         $this->form->addItem($pub_nodes);
     }
     // layout per page
     $lpp = new ilCheckboxInputGUI($lng->txt("cont_layout_per_page"), "layout_per_page");
     $lpp->setInfo($this->lng->txt("cont_layout_per_page_info"));
     $this->form->addItem($lpp);
     // synchronize frames
     $synch = new ilCheckboxInputGUI($lng->txt("cont_synchronize_frames"), "cobj_clean_frames");
     $synch->setInfo($this->lng->txt("cont_synchronize_frames_desc"));
     $this->form->addItem($synch);
     // history user comments
     $com = new ilCheckboxInputGUI($lng->txt("enable_hist_user_comments"), "cobj_user_comments");
     $com->setInfo($this->lng->txt("enable_hist_user_comments_desc"));
     $this->form->addItem($com);
     // rating
     $this->lng->loadLanguageModule('rating');
     $rate = new ilCheckboxInputGUI($this->lng->txt('rating_activate_rating'), 'rating');
     $rate->setInfo($this->lng->txt('rating_activate_rating_info'));
     $this->form->addItem($rate);
     // disable default feedback for questions
     $qfeed = new ilCheckboxInputGUI($lng->txt("cont_disable_def_feedback"), "disable_def_feedback");
     $qfeed->setInfo($this->lng->txt("cont_disable_def_feedback_info"));
     $this->form->addItem($qfeed);
     $this->form->setTitle($lng->txt("cont_general_properties"));
     $this->form->addCommandButton("saveProperties", $lng->txt("save"));
     $this->form->setFormAction($ilCtrl->getFormAction($this));
 }
 /**
  * FORM NewsItem: Init form.
  *
  * @param	int	$a_mode	Form Edit Mode (IL_FORM_EDIT | IL_FORM_CREATE)
  */
 public function initFormNewsItem($a_mode)
 {
     global $lng, $ilTabs;
     $ilTabs->clearTargets();
     //$this->setTabs();
     $lng->loadLanguageModule("news");
     include "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form_gui = new ilPropertyFormGUI();
     // Property Title
     $text_input = new ilTextInputGUI($lng->txt("news_news_item_title"), "news_title");
     $text_input->setInfo("");
     $text_input->setRequired(true);
     $text_input->setMaxLength(200);
     $this->form_gui->addItem($text_input);
     // Property Content
     $text_area = new ilTextAreaInputGUI($lng->txt("news_news_item_content"), "news_content");
     $text_area->setInfo("");
     $text_area->setRequired(false);
     $this->form_gui->addItem($text_area);
     // Property Visibility
     $radio_group = new ilRadioGroupInputGUI($lng->txt("news_news_item_visibility"), "news_visibility");
     $radio_option = new ilRadioOption($lng->txt("news_visibility_users"), "users");
     $radio_group->addOption($radio_option);
     $radio_option = new ilRadioOption($lng->txt("news_visibility_public"), "public");
     $radio_group->addOption($radio_option);
     $radio_group->setInfo($lng->txt("news_news_item_visibility_info"));
     $radio_group->setRequired(false);
     $radio_group->setValue("users");
     $this->form_gui->addItem($radio_group);
     // Property ContentLong
     $text_area = new ilTextAreaInputGUI($lng->txt("news_news_item_content_long"), "news_content_long");
     $text_area->setInfo($lng->txt("news_news_item_content_long_info"));
     $text_area->setRequired(false);
     $text_area->setCols("40");
     $text_area->setRows("8");
     $text_area->setUseRte(true);
     $this->form_gui->addItem($text_area);
     // save and cancel commands
     if (in_array($a_mode, array(IL_FORM_CREATE, IL_FORM_RE_CREATE))) {
         $this->form_gui->addCommandButton("saveNewsItem", $lng->txt("save"));
         $this->form_gui->addCommandButton("cancelSaveNewsItem", $lng->txt("cancel"));
     } else {
         $this->form_gui->addCommandButton("updateNewsItem", $lng->txt("save"));
         $this->form_gui->addCommandButton("cancelUpdateNewsItem", $lng->txt("cancel"));
     }
     $this->form_gui->setTitle($lng->txt("news_news_item_head"));
     $this->form_gui->setFormAction($this->ctrl->getFormAction($this));
     $this->form_gui->setTitleIcon(ilUtil::getImagePath("icon_news.png"));
     $news_set = new ilSetting("news");
     if (!$news_set->get("enable_rss_for_internal")) {
         $this->form_gui->removeItemByPostVar("news_visibility");
     } else {
         $nv = $this->form_gui->getItemByPostVar("news_visibility");
         if (is_object($nv)) {
             $nv->setValue(ilNewsItem::_getDefaultVisibilityForRefId($_GET["ref_id"]));
         }
     }
 }
예제 #25
0
 protected function initAddNewEntryForm($a_id = null)
 {
     global $ilCtrl;
     if (!$a_id) {
         $a_id = $_POST["id"];
     }
     if (!$a_id || !in_array($a_id, ilObjLanguageAccess::_getSavedTopics())) {
         $ilCtrl->redirect($this, "view");
     }
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($ilCtrl->getFormAction($this, "saveNewEntry"));
     $form->setTitle($this->lng->txt("adm_missing_entry_add"));
     $mods = ilObjLanguageAccess::_getSavedModules();
     $options = array_combine($mods, $mods);
     $mod = new ilSelectInputGUI(ucfirst($this->lng->txt("module")), "mod");
     $mod->setOptions(array("" => $this->lng->txt("please_select")) + $options);
     $mod->setRequired(true);
     $form->addItem($mod);
     $id = new ilTextInputGUI(ucfirst($this->lng->txt("identifier")), "id");
     $id->setValue($a_id);
     $id->setDisabled(true);
     $form->addItem($id);
     foreach ($this->lng->getInstalledLanguages() as $lang_key) {
         $trans = new ilTextInputGUI($this->lng->txt("meta_l_" . $lang_key), "trans_" . $lang_key);
         if (in_array($lang_key, array("de", "en"))) {
             $trans->setRequired(true);
         }
         $form->addItem($trans);
     }
     $form->addCommandButton("saveNewEntry", $this->lng->txt("save"));
     $form->addCommandButton("view", $this->lng->txt("cancel"));
     return $form;
 }
 private function initForm($a_type = 'create')
 {
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form_gui = new ilPropertyFormGUI();
     $this->form_gui->setFormAction($this->ctrl->getFormAction($this, 'saveForm'));
     $this->form_gui->setTitle($this->lng->txt('mail_mailing_list'));
     $titleGui = new ilTextInputGUI($this->lng->txt('title'), 'title');
     $titleGui->setRequired(true);
     $this->form_gui->addItem($titleGui);
     $descriptionGui = new ilTextAreaInputGUI($this->lng->txt('description'), 'description');
     $descriptionGui->setCols(40);
     $descriptionGui->setRows(8);
     $this->form_gui->addItem($descriptionGui);
     $this->form_gui->addCommandButton('saveForm', $this->lng->txt('save'));
     $this->form_gui->addCommandButton('showMailingLists', $this->lng->txt('cancel'));
 }
 protected function initNewItemGroupForm($a_grp_id = false)
 {
     $this->setModuleSubTabs("new_item_groups");
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $this->lng->loadLanguageModule("meta");
     $def_lng = $this->lng->getDefaultLanguage();
     $title = new ilTextInputGUI($this->lng->txt("title"), "title_" . $def_lng);
     $title->setInfo($this->lng->txt("meta_l_" . $def_lng) . " (" . $this->lng->txt("default_language") . ")");
     $title->setRequired(true);
     $form->addItem($title);
     foreach ($this->lng->getInstalledLanguages() as $lang_id) {
         if ($lang_id != $def_lng) {
             $title = new ilTextInputGUI($this->lng->txt("translation"), "title_" . $lang_id);
             $title->setInfo($this->lng->txt("meta_l_" . $lang_id));
             $form->addItem($title);
         }
     }
     if (!$a_grp_id) {
         $form->setTitle($this->lng->txt("rep_new_item_group_add"));
         $form->setFormAction($this->ctrl->getFormAction($this, "saveNewItemGroup"));
         $form->addCommandButton("saveNewItemGroup", $this->lng->txt("save"));
     } else {
         $form->setTitle($this->lng->txt("rep_new_item_group_edit"));
         $form->setFormAction($this->ctrl->getFormAction($this, "updateNewItemGroup"));
         include_once "Services/Repository/classes/class.ilObjRepositorySettings.php";
         $grp = ilObjRepositorySettings::getNewItemGroups();
         $grp = $grp[$a_grp_id];
         foreach ($grp["titles"] as $id => $value) {
             $field = $form->getItemByPostVar("title_" . $id);
             if ($field) {
                 $field->setValue($value);
             }
         }
         $form->addCommandButton("updateNewItemGroup", $this->lng->txt("save"));
     }
     $form->addCommandButton("listNewItemGroups", $this->lng->txt("cancel"));
     return $form;
 }
 /**
  * Init form
  * @param int $a_mode
  * @return 
  */
 protected function initFormSequence($a_mode)
 {
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     include_once './Services/YUI/classes/class.ilYuiUtil.php';
     ilYuiUtil::initDomEvent();
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($this->ctrl->getFormAction($this));
     switch ($a_mode) {
         case self::MODE_CREATE:
             $this->form->setTitle($this->lng->txt('cal_ch_add_sequence'));
             $this->form->addCommandButton('saveSequence', $this->lng->txt('save'));
             $this->form->addCommandButton('appointmentList', $this->lng->txt('cancel'));
             break;
             /*
             			case self::MODE_UPDATE:
             				$this->form->setTitle($this->lng->txt('cal_ch_edit_sequence'));
             				$this->form->addCommandButton('updateSequence', $this->lng->txt('save'));
             				$this->form->addCommandButton('appointmentList', $this->lng->txt('cancel'));
             				break;
             */
         /*
         			case self::MODE_UPDATE:
         				$this->form->setTitle($this->lng->txt('cal_ch_edit_sequence'));
         				$this->form->addCommandButton('updateSequence', $this->lng->txt('save'));
         				$this->form->addCommandButton('appointmentList', $this->lng->txt('cancel'));
         				break;
         */
         case self::MODE_MULTI:
             $this->form->setTitle($this->lng->txt('cal_ch_multi_edit_sequence'));
             $this->form->addCommandButton('updateMulti', $this->lng->txt('save'));
             $this->form->addCommandButton('appointmentList', $this->lng->txt('cancel'));
             break;
     }
     // in case of existing groups show a selection
     include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroups.php';
     if (count($options = ilConsultationHourGroups::getGroupSelectOptions($this->getUserId()))) {
         $group = new ilSelectInputGUI($this->lng->txt('cal_ch_grp_selection'), 'grp');
         $group->setOptions($options);
         $group->setRequired(false);
         $this->form->addItem($group);
     }
     // Title
     $ti = new ilTextInputGUI($this->lng->txt('title'), 'ti');
     $ti->setSize(32);
     $ti->setMaxLength(128);
     $ti->setRequired(true);
     $this->form->addItem($ti);
     if ($a_mode != self::MODE_MULTI) {
         // Start
         include_once './Services/Form/classes/class.ilDateTimeInputGUI.php';
         $dur = new ilDateTimeInputGUI($this->lng->txt('cal_start'), 'st');
         $dur->setShowTime(true);
         $dur->setMinuteStepSize(5);
         $this->form->addItem($dur);
         // Duration
         $du = new ilDurationInputGUI($this->lng->txt('cal_ch_duration'), 'du');
         $du->setShowMinutes(true);
         $du->setShowHours(true);
         $this->form->addItem($du);
         // Number of appointments
         $nu = new ilNumberInputGUI($this->lng->txt('cal_ch_num_appointments'), 'ap');
         $nu->setInfo($this->lng->txt('cal_ch_num_appointments_info'));
         $nu->setSize(2);
         $nu->setMaxLength(2);
         $nu->setRequired(true);
         $nu->setMinValue(1);
         $this->form->addItem($nu);
         // Recurrence
         include_once './Services/Calendar/classes/Form/class.ilRecurrenceInputGUI.php';
         $rec = new ilRecurrenceInputGUI($this->lng->txt('cal_recurrences'), 'frequence');
         $rec->setEnabledSubForms(array(IL_CAL_FREQ_DAILY, IL_CAL_FREQ_WEEKLY, IL_CAL_FREQ_MONTHLY));
         $this->form->addItem($rec);
     }
     // Number of bookings
     $nu = new ilNumberInputGUI($this->lng->txt('cal_ch_num_bookings'), 'bo');
     $nu->setSize(2);
     $nu->setMaxLength(2);
     $nu->setMinValue(1);
     $nu->setRequired(true);
     $this->form->addItem($nu);
     // Deadline
     $dead = new ilDurationInputGUI($this->lng->txt('cal_ch_deadline'), 'dead');
     $dead->setInfo($this->lng->txt('cal_ch_deadline_info'));
     $dead->setShowMinutes(false);
     $dead->setShowHours(true);
     $dead->setShowDays(true);
     $this->form->addItem($dead);
     // Location
     $lo = new ilTextInputGUI($this->lng->txt('cal_where'), 'lo');
     $lo->setSize(32);
     $lo->setMaxLength(128);
     $this->form->addItem($lo);
     // Description
     $de = new ilTextAreaInputGUI($this->lng->txt('description'), 'de');
     $de->setRows(10);
     $de->setCols(60);
     $this->form->addItem($de);
     // Target Object
     $tgt = new ilTextInputGUI($this->lng->txt('cal_ch_target_object'), 'tgt');
     $tgt->setInfo($this->lng->txt('cal_ch_target_object_info'));
     $tgt->setSize(16);
     $tgt->setMaxLength(128);
     $this->form->addItem($tgt);
 }
 /**
  * Init settings form.
  * This command uses the form class to display an input form.
  */
 protected function initSettingsForm()
 {
     $this->settingsForm = new ilPropertyFormGUI();
     // Title and description (Standard)
     $titleField = new ilTextInputGUI($this->lng->txt('title'), 'title');
     $titleField->setMaxLength(128);
     $titleField->setRequired(true);
     $this->settingsForm->addItem($titleField);
     $descField = new ilTextAreaInputGUI($this->lng->txt('description'), 'desc');
     $descField->setCols(50);
     $descField->setRows(5);
     $this->settingsForm->addItem($descField);
     // Online flag
     $onlineField = new ilCheckboxInputGUI($this->lng->txt('online'), 'online');
     $this->settingsForm->addItem($onlineField);
     // Max booking time
     //		$maxtimeField = new ilRoomSharingTimeInputGUI($this->lng->txt('rep_robj_xrs_max_book_time'), 'max_book_time');
     //		$maxtimeField->setShowTime(true);
     //		$maxtimeField->setMinuteStepSize(5);
     //		$maxtimeField->setShowDate(false);
     //		$this->settingsForm->addItem($maxtimeField);
     require_once './Customizing/global/plugins/Services/Repository/RepositoryObject/RoomSharing/classes/utils/class.xrsTimeInputGUI.php';
     $xrsTimeInputGUI = new xrsTimeInputGUI($this->lng->txt('rep_robj_xrs_max_book_time'), 'max_book_time');
     $this->settingsForm->addItem($xrsTimeInputGUI);
     // Rooms agreement
     $roomsAgrField = new ilFileInputGUI($this->lng->txt('rep_robj_xrs_rooms_user_agreement'), "rooms_agreement");
     $roomsAgrField->setSize(50);
     $roomsAgrField->setRequired(false);
     $roomsAgrField->setInfo($this->lng->txt("rep_robj_xrs_room_agreement_filetypes") . " .bmp, .jpg, .jpeg, .png, .gif, .txt, .pdf");
     $this->settingsForm->addItem($roomsAgrField);
     $this->settingsForm->addCommandButton('updateSettings', $this->lng->txt('save'));
     $this->settingsForm->setTitle($this->lng->txt('edit_properties'));
     $this->settingsForm->setFormAction($this->ctrl->getFormAction($this));
 }
 protected function initSettingsForm($a_mode = 'create')
 {
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form_gui = new ilPropertyFormGUI();
     $this->form_gui->setTableWidth('600');
     if ($a_mode == 'create') {
         $this->form_gui->setTitle($this->lng->txt('icrs_new'));
     } else {
         $this->form_gui->setTitle($this->lng->txt('icrs_edit'));
     }
     $this->form_gui->setTitleIcon(ilUtil::getTypeIconPath('icrs', 0));
     // Title
     $text_input = new ilTextInputGUI($this->lng->txt('title'), 'title');
     $text_input->setRequired(true);
     $this->form_gui->addItem($text_input);
     // Description
     $text_area = new ilTextAreaInputGUI($this->lng->txt('desc'), 'desc');
     $this->form_gui->addItem($text_area);
     // Access
     $text_area = new ilCheckboxInputGUI($this->lng->txt('online'), 'activated');
     $this->form_gui->addItem($text_area);
     // AKClassValues
     if ($this->ilias->getSetting('ilinc_akclassvalues_active')) {
         $section_header = new ilFormSectionHeaderGUI();
         $section_header->setTitle($this->lng->txt('akclassvalues'));
         $this->form_gui->addItem($section_header);
         $text_input = new ilTextInputGUI($this->lng->txt('akclassvalue1'), 'akclassvalue1');
         if ($this->ilias->getSetting('ilinc_akclassvalues_required')) {
             $text_input->setRequired(true);
         }
         $this->form_gui->addItem($text_input);
         $text_input = new ilTextInputGUI($this->lng->txt('akclassvalue2'), 'akclassvalue2');
         $this->form_gui->addItem($text_input);
     }
     if ($this->call_by_reference) {
         $this->ctrl->setParameter($this, 'obj_id', $this->obj_id);
     }
     // save and cancel commands
     if ($a_mode == 'create') {
         $this->ctrl->setParameter($this, 'mode', 'create');
         $this->ctrl->setParameter($this, 'new_type', 'icrs');
         $this->form_gui->addCommandButton('save', $this->lng->txt('icrs_add'));
         $this->form_gui->addCommandButton('cancel', $this->lng->txt('cancel'));
         $this->form_gui->setFormAction($this->ctrl->getFormAction($this, 'save'));
     } else {
         $this->form_gui->addCommandButton('update', $this->lng->txt('save'));
         $this->form_gui->addCommandButton('cancel', $this->lng->txt('cancel'));
         $this->form_gui->setFormAction($this->ctrl->getFormAction($this, 'update'));
     }
 }