/**
  * Init property form
  *
  * @return ilPropertyFormGUI $form
  */
 protected function initFormSettings()
 {
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setTitle($this->lng->txt('tracking_settings'));
     $form->setFormAction($this->ctrl->getFormAction($this));
     // Mode
     $mod = new ilRadioGroupInputGUI($this->lng->txt('trac_mode'), 'modus');
     $mod->setRequired(true);
     $mod->setValue($this->obj_lp->getCurrentMode());
     $form->addItem($mod);
     foreach ($this->obj_lp->getValidModes() as $mode_key) {
         $opt = new ilRadioOption($this->obj_lp->getModeText($mode_key), $mode_key, $this->obj_lp->getModeInfoText($mode_key));
         $opt->setValue($mode_key);
         $mod->addOption($opt);
         // :TODO: Subitem for visits ?!
         if ($mode_key == ilLPObjSettings::LP_MODE_VISITS) {
             $vis = new ilNumberInputGUI($this->lng->txt('trac_visits'), 'visits');
             $vis->setSize(3);
             $vis->setMaxLength(4);
             $vis->setInfo(sprintf($this->lng->txt('trac_visits_info'), ilObjUserTracking::_getValidTimeSpan()));
             $vis->setRequired(true);
             $vis->setValue($this->obj_settings->getVisits());
             $opt->addSubItem($vis);
         }
     }
     $form->addCommandButton('saveSettings', $this->lng->txt('save'));
     return $form;
 }
예제 #2
0
 protected function initLicenseForm()
 {
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this, "updateLicense"));
     $form->setTitle($this->lng->txt('edit_license'));
     $exist = new ilNumberInputGUI($this->lng->txt("existing_licenses"), "licenses");
     $exist->setInfo($this->lng->txt("zero_licenses_explanation"));
     $exist->setMaxLength(10);
     $exist->setSize(10);
     $exist->setValue($this->license->getLicenses());
     $form->addItem($exist);
     $info_used = new ilNonEditableValueGUI($this->lng->txt("used_licenses"));
     $info_used->setInfo($this->lng->txt("used_licenses_explanation"));
     $info_used->setValue($this->license->getAccesses());
     $form->addItem($info_used);
     $remaining_licenses = $this->license->getLicenses() == "0" ? $this->lng->txt("arbitrary") : $this->license->getRemainingLicenses();
     $info_remain = new ilNonEditableValueGUI($this->lng->txt("remaining_licenses"));
     $info_remain->setInfo($this->lng->txt("remaining_licenses_explanation"));
     $info_remain->setValue($remaining_licenses);
     $form->addItem($info_remain);
     $info_potential = new ilNonEditableValueGUI($this->lng->txt("potential_accesses"));
     $info_potential->setInfo($this->lng->txt("potential_accesses_explanation"));
     $info_potential->setValue($this->license->getPotentialAccesses());
     $form->addItem($info_potential);
     $comm = new ilTextAreaInputGUI($this->lng->txt("comment"), "remarks");
     $comm->setRows(5);
     $comm->setValue($this->license->getRemarks());
     $form->addItem($comm);
     $form->addCommandButton('updateLicense', $this->lng->txt('save'));
     return $form;
 }
 public function addCustomSettingsToForm(ilPropertyFormGUI $a_form)
 {
     global $lng, $ilSetting;
     $num_days = new ilNumberInputGUI($lng->txt('payment_notification_days'), 'payment_notification_days');
     $num_days->setSize(3);
     $num_days->setMinValue(0);
     $num_days->setMaxValue(120);
     $num_days->setRequired(true);
     $num_days->setValue($ilSetting->get('payment_notification_days'));
     $num_days->setInfo($lng->txt('payment_notification_days_desc'));
     $a_form->addItem($num_days);
 }
 /**
  * Init property form
  *
  * @return ilPropertyFormGUI $form
  */
 protected function initFormSettings()
 {
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setTitle($this->lng->txt('tracking_settings'));
     $form->setFormAction($this->ctrl->getFormAction($this));
     // Mode
     $mod = new ilRadioGroupInputGUI($this->lng->txt('trac_mode'), 'modus');
     $mod->setRequired(true);
     $mod->setValue($this->obj_settings->getMode());
     $form->addItem($mod);
     foreach ($this->obj_settings->getValidModes() as $mode_key => $mode_name) {
         $opt = new ilRadioOption($mode_name, $mode_key, ilLPObjSettings::_mode2InfoText($mode_key));
         $opt->setValue($mode_key);
         $mod->addOption($opt);
         // Subitem for vistits
         if ($mode_key == LP_MODE_VISITS) {
             $vis = new ilNumberInputGUI($this->lng->txt('trac_visits'), 'visits');
             $vis->setSize(3);
             $vis->setMaxLength(4);
             $vis->setInfo(sprintf($this->lng->txt('trac_visits_info'), ilObjUserTracking::_getValidTimeSpan()));
             $vis->setRequired(true);
             $vis->setValue($this->obj_settings->getVisits());
             $opt->addSubItem($vis);
         }
     }
     /*
     // Info Active
     $act = new ilCustomInputGUI($this->lng->txt('trac_activated'), '');
     $img = new ilTemplate('tpl.obj_settings_img_row.html',true,true,'Services/Tracking');
     $img->setVariable("IMG_SRC",
     	$activated = ilObjUserTracking::_enabledLearningProgress()
     		? ilUtil::getImagePath('icon_ok.png')
     		: ilUtil::getImagePath('icon_not_ok.png')
     );
     $act->setHTML($img->get());
     $form->addItem($act);
     
      		// Info Anonymized
      		$ano = new ilCustomInputGUI($this->lng->txt('trac_anonymized'), '');
     $img = new ilTemplate('tpl.obj_settings_img_row.html',true,true,'Services/Tracking');
     $img->setVariable("IMG_SRC",
     	$anonymized = !ilObjUserTracking::_enabledUserRelatedData()
     		? ilUtil::getImagePath('icon_ok.png')
     		: ilUtil::getImagePath('icon_not_ok.png')
     );
     $ano->setHTML($img->get());
     $form->addItem($ano);
     */
     $form->addCommandButton('saveSettings', $this->lng->txt('save'));
     return $form;
 }
 public function initPluginSettings()
 {
     if ($this->getAdminConfigObject()->getDefaultAllowPublicLinksConfigAllowPublicLinks() && $this->getAdminConfigObject()->getDefaultAllowPublicLinks()) {
         $public_links = new ilCheckboxInputGUI($this->txt("activate_public_links"), "activate_public_links");
         $public_links->setInfo($this->txt("info_activate_public_links"));
         $this->form->addItem($public_links);
     }
     if ($this->getAdminConfigObject()->getConfigMaxFileSize()) {
         $max_file_size = new ilNumberInputGUI($this->txt("max_file_size"), "max_file_size");
         $max_file_size->setInfo($this->txt("info_max_file_size"));
         $max_file_size->setMaxLength(10);
         $max_file_size->setSize(10);
         $this->form->addItem($max_file_size);
     }
 }
 /**
  * Edit personal desktop settings.
  */
 public function editSettings()
 {
     global $ilCtrl, $lng, $ilSetting;
     $pd_set = new ilSetting("pd");
     $enable_calendar = ilCalendarSettings::_getInstance()->isEnabled();
     #$enable_calendar = $ilSetting->get("enable_calendar");
     $enable_block_moving = $pd_set->get("enable_block_moving");
     $enable_active_users = $ilSetting->get("block_activated_pdusers");
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($ilCtrl->getFormAction($this));
     $form->setTitle($lng->txt("pd_settings"));
     // Enable calendar
     $cb_prop = new ilCheckboxInputGUI($lng->txt("enable_calendar"), "enable_calendar");
     $cb_prop->setValue("1");
     //$cb_prop->setInfo($lng->txt("pd_enable_block_moving_info"));
     $cb_prop->setChecked($enable_calendar);
     $form->addItem($cb_prop);
     // Enable bookmarks
     $cb_prop = new ilCheckboxInputGUI($lng->txt("pd_enable_bookmarks"), "enable_bookmarks");
     $cb_prop->setValue("1");
     $cb_prop->setChecked($ilSetting->get("disable_bookmarks") ? "0" : "1");
     $form->addItem($cb_prop);
     // Enable contacts
     $cb_prop = new ilCheckboxInputGUI($lng->txt("pd_enable_contacts"), "enable_contacts");
     $cb_prop->setValue("1");
     $cb_prop->setChecked($ilSetting->get("disable_contacts") ? "0" : "1");
     $cb_prop_requires_mail = new ilCheckboxInputGUI($lng->txt('pd_enable_contacts_requires_mail'), 'enable_contacts_require_mail');
     $cb_prop_requires_mail->setValue("1");
     $cb_prop_requires_mail->setChecked($ilSetting->get("disable_contacts_require_mail") ? "0" : "1");
     $cb_prop->addSubItem($cb_prop_requires_mail);
     $form->addItem($cb_prop);
     // Enable notes
     $cb_prop = new ilCheckboxInputGUI($lng->txt("pd_enable_notes"), "enable_notes");
     $cb_prop->setValue("1");
     $cb_prop->setChecked($ilSetting->get("disable_notes") ? "0" : "1");
     $form->addItem($cb_prop);
     // Enable notes
     $cb_prop = new ilCheckboxInputGUI($lng->txt("pd_enable_comments"), "enable_comments");
     $cb_prop->setValue("1");
     $cb_prop->setChecked($ilSetting->get("disable_comments") ? "0" : "1");
     $form->addItem($cb_prop);
     $comm_del_user = new ilCheckboxInputGUI($lng->txt("pd_enable_comments_del_user"), "comm_del_user");
     $comm_del_user->setChecked($ilSetting->get("comments_del_user", 0));
     $cb_prop->addSubItem($comm_del_user);
     $comm_del_tutor = new ilCheckboxInputGUI($lng->txt("pd_enable_comments_del_tutor"), "comm_del_tutor");
     $comm_del_tutor->setChecked($ilSetting->get("comments_del_tutor", 1));
     $cb_prop->addSubItem($comm_del_tutor);
     // Enable Chatviewer
     $cb_prop = new ilCheckboxInputGUI($lng->txt("pd_enable_chatviewer"), "block_activated_chatviewer");
     $cb_prop->setValue("1");
     $cb_prop->setChecked($ilSetting->get("block_activated_chatviewer"));
     $form->addItem($cb_prop);
     // Enable block moving
     $cb_prop = new ilCheckboxInputGUI($lng->txt("pd_enable_block_moving"), "enable_block_moving");
     $cb_prop->setValue("1");
     $cb_prop->setInfo($lng->txt("pd_enable_block_moving_info"));
     $cb_prop->setChecked($enable_block_moving);
     $form->addItem($cb_prop);
     // Enable active users block
     $cb_prop = new ilCheckboxInputGUI($lng->txt("pd_enable_active_users"), "block_activated_pdusers");
     $cb_prop->setValue("1");
     $cb_prop->setChecked($enable_active_users);
     // maximum inactivity time
     $ti_prop = new ilNumberInputGUI($lng->txt("pd_time_before_removal"), "time_removal");
     $ti_prop->setValue($pd_set->get("user_activity_time"));
     $ti_prop->setInfo($lng->txt("pd_time_before_removal_info"));
     $ti_prop->setMaxLength(3);
     $ti_prop->setSize(3);
     $cb_prop->addSubItem($ti_prop);
     // osi host
     // see http://www.onlinestatus.org
     $ti_prop = new ilTextInputGUI($lng->txt("pd_osi_host"), "osi_host");
     $ti_prop->setValue($pd_set->get("osi_host"));
     $ti_prop->setInfo($lng->txt("pd_osi_host_info") . ' <a href="http://www.onlinestatus.org" target="_blank">http://www.onlinestatus.org</a>');
     $cb_prop->addSubItem($ti_prop);
     $form->addItem($cb_prop);
     // Enable 'My Offers' (default personal items)
     $cb_prop = new ilCheckboxInputGUI($lng->txt('pd_enable_my_offers'), 'enable_my_offers');
     $cb_prop->setValue('1');
     $cb_prop->setInfo($lng->txt('pd_enable_my_offers_info'));
     $cb_prop->setChecked($ilSetting->get('disable_my_offers') ? '0' : '1');
     $form->addItem($cb_prop);
     // Enable 'My Memberships'
     $cb_prop = new ilCheckboxInputGUI($lng->txt('pd_enable_my_memberships'), 'enable_my_memberships');
     $cb_prop->setValue('1');
     $cb_prop->setInfo($lng->txt('pd_enable_my_memberships_info'));
     $cb_prop->setChecked($ilSetting->get('disable_my_memberships') ? '0' : '1');
     $form->addItem($cb_prop);
     if ($ilSetting->get('disable_my_offers') == 0 && $ilSetting->get('disable_my_memberships') == 0) {
         // Default view of personal items
         $sb_prop = new ilSelectInputGUI($lng->txt('pd_personal_items_default_view'), 'personal_items_default_view');
         $sb_prop->setInfo($lng->txt('pd_personal_items_default_view_info'));
         $option = array();
         $option[0] = $lng->txt('pd_my_offers');
         $option[1] = $lng->txt('my_courses_groups');
         $sb_prop->setOptions($option);
         $sb_prop->setValue((int) $ilSetting->get('personal_items_default_view'));
         $form->addItem($sb_prop);
     }
     // command buttons
     $form->addCommandButton("saveSettings", $lng->txt("save"));
     $form->addCommandButton("view", $lng->txt("cancel"));
     $this->tpl->setContent($form->getHTML());
 }
예제 #7
0
 protected function initJavaServerIniForm()
 {
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form = new ilPropertyFormGUI();
     $GLOBALS['lng']->loadLanguageModule('search');
     $this->form->setTitle($this->lng->txt('lucene_tbl_create_ini'));
     $this->form->setFormAction($this->ctrl->getFormAction($this, 'createJavaServerIni'));
     $this->form->addCommandButton('downloadJavaServerIni', $this->lng->txt('lucene_download_ini'));
     $this->form->addCommandButton('showJavaServer', $this->lng->txt('cancel'));
     // Host
     $ip = new ilTextInputGUI($this->lng->txt('lucene_host'), 'ho');
     $ip->setInfo($this->lng->txt('lucene_host_info'));
     $ip->setMaxLength(128);
     $ip->setSize(32);
     $ip->setRequired(true);
     $this->form->addItem($ip);
     // Port
     $port = new ilNumberInputGUI($this->lng->txt('lucene_port'), 'po');
     $port->setSize(5);
     $port->setMinValue(1);
     $port->setMaxValue(65535);
     $port->setRequired(true);
     $this->form->addItem($port);
     // Index Path
     $path = new ilTextInputGUI($this->lng->txt('lucene_index_path'), 'in');
     $path->setSize(80);
     $path->setMaxLength(1024);
     $path->setInfo($this->lng->txt('lucene_index_path_info'));
     $path->setRequired(true);
     $this->form->addItem($path);
     // Logging
     $log = new ilTextInputGUI($this->lng->txt('lucene_log'), 'lo');
     $log->setSize(80);
     $log->setMaxLength(1024);
     $log->setInfo($this->lng->txt('lucene_log_info'));
     $log->setRequired(true);
     $this->form->addItem($log);
     // Level
     $lev = new ilSelectInputGUI($this->lng->txt('lucene_level'), 'le');
     $lev->setOptions(array('DEBUG' => 'DEBUG', 'INFO' => 'INFO', 'WARN' => 'WARN', 'ERROR' => 'ERROR', 'FATAL' => 'FATAL'));
     $lev->setValue('INFO');
     $lev->setRequired(true);
     $this->form->addItem($lev);
     // CPU
     $cpu = new ilNumberInputGUI($this->lng->txt('lucene_cpu'), 'cp');
     $cpu->setValue(1);
     $cpu->setSize(1);
     $cpu->setMaxLength(2);
     $cpu->setMinValue(1);
     $cpu->setRequired(true);
     $this->form->addItem($cpu);
     // Max file size
     $fs = new ilNumberInputGUI($this->lng->txt('lucene_max_fs'), 'fs');
     $fs->setInfo($this->lng->txt('lucene_max_fs_info'));
     $fs->setValue(500);
     $fs->setSize(4);
     $fs->setMaxLength(4);
     $fs->setMinValue(1);
     $fs->setRequired(true);
     $this->form->addItem($fs);
     return true;
 }
예제 #8
0
 public function populateQuestionSpecificFormPart(\ilPropertyFormGUI $form)
 {
     // maxchars
     $maxchars = new ilNumberInputGUI($this->lng->txt("maxchars"), "maxchars");
     $maxchars->setInfo($this->lng->txt('qpl_maxchars_info_numeric_question'));
     $maxchars->setSize(10);
     $maxchars->setDecimals(0);
     $maxchars->setMinValue(1);
     $maxchars->setRequired(true);
     if ($this->object->getMaxChars() > 0) {
         $maxchars->setValue($this->object->getMaxChars());
     }
     $form->addItem($maxchars);
 }
 /**
  * Creates an output of the edit form for the question
  *
  * @access public
  */
 public function editQuestion($checkonly = FALSE)
 {
     $save = $this->isSaveCommand();
     $this->getQuestionTemplate();
     #		if ($_REQUEST['prev_qid']) {
     #		    $this->ctrl->setParameter($this, 'prev_qid', $_REQUEST['prev_qid']);
     #		}
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTitle($this->outQuestionType());
     $form->setMultipart(FALSE);
     $form->setTableWidth("100%");
     $form->setId("assclozetest");
     // title, author, description, question, working time (assessment mode)
     $this->addBasicQuestionFormProperties($form);
     $q_item = $form->getItemByPostVar("question");
     $q_item->setInfo($this->lng->txt("close_text_hint"));
     $q_item->setTitle($this->lng->txt("cloze_text"));
     // text rating
     if (!$this->getSelfAssessmentEditingMode()) {
         $textrating = new ilSelectInputGUI($this->lng->txt("text_rating"), "textgap_rating");
         $text_options = array("ci" => $this->lng->txt("cloze_textgap_case_insensitive"), "cs" => $this->lng->txt("cloze_textgap_case_sensitive"), "l1" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "1"), "l2" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "2"), "l3" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "3"), "l4" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "4"), "l5" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "5"));
         $textrating->setOptions($text_options);
         $textrating->setValue($this->object->getTextgapRating());
         $form->addItem($textrating);
         // text field length
         $fixedTextLength = new ilNumberInputGUI($this->lng->txt("cloze_fixed_textlength"), "fixedTextLength");
         $fixedTextLength->setValue(ilUtil::prepareFormOutput($this->object->getFixedTextLength()));
         $fixedTextLength->setMinValue(0);
         $fixedTextLength->setSize(3);
         $fixedTextLength->setMaxLength(6);
         $fixedTextLength->setInfo($this->lng->txt('cloze_fixed_textlength_description'));
         $fixedTextLength->setRequired(false);
         $form->addItem($fixedTextLength);
         // identical scoring
         $identical_scoring = new ilCheckboxInputGUI($this->lng->txt("identical_scoring"), "identical_scoring");
         $identical_scoring->setValue(1);
         $identical_scoring->setChecked($this->object->getIdenticalScoring());
         $identical_scoring->setInfo($this->lng->txt('identical_scoring_desc'));
         $identical_scoring->setRequired(FALSE);
         $form->addItem($identical_scoring);
     }
     for ($i = 0; $i < $this->object->getGapCount(); $i++) {
         $gap = $this->object->getGap($i);
         $header = new ilFormSectionHeaderGUI();
         $header->setTitle($this->lng->txt("gap") . " " . ($i + 1));
         $form->addItem($header);
         $gapcounter = new ilHiddenInputGUI("gap[{$i}]");
         $gapcounter->setValue($i);
         $form->addItem($gapcounter);
         $gaptype = new ilSelectInputGUI($this->lng->txt('type'), "clozetype_{$i}");
         $options = array(0 => $this->lng->txt("text_gap"), 1 => $this->lng->txt("select_gap"), 2 => $this->lng->txt("numeric_gap"));
         $gaptype->setOptions($options);
         $gaptype->setValue($gap->getType());
         $form->addItem($gaptype);
         if ($gap->getType() == CLOZE_TEXT) {
             // Choices
             include_once "./Modules/TestQuestionPool/classes/class.ilAnswerWizardInputGUI.php";
             include_once "./Modules/TestQuestionPool/classes/class.assAnswerCloze.php";
             $values = new ilAnswerWizardInputGUI($this->lng->txt("values"), "gap_" . $i . "");
             $values->setRequired(true);
             $values->setQuestionObject($this->object);
             $values->setSingleline(true);
             $values->setAllowMove(false);
             if (count($gap->getItemsRaw()) == 0) {
                 $gap->addItem(new assAnswerCloze("", 0, 0));
             }
             $values->setValues($gap->getItemsRaw());
             $form->addItem($values);
         } else {
             if ($gap->getType() == CLOZE_SELECT) {
                 include_once "./Modules/TestQuestionPool/classes/class.ilAnswerWizardInputGUI.php";
                 include_once "./Modules/TestQuestionPool/classes/class.assAnswerCloze.php";
                 $values = new ilAnswerWizardInputGUI($this->lng->txt("values"), "gap_" . $i . "");
                 $values->setRequired(true);
                 $values->setQuestionObject($this->object);
                 $values->setSingleline(true);
                 $values->setAllowMove(false);
                 if (count($gap->getItemsRaw()) == 0) {
                     $gap->addItem(new assAnswerCloze("", 0, 0));
                 }
                 $values->setValues($gap->getItemsRaw());
                 $form->addItem($values);
                 // shuffle
                 $shuffle = new ilCheckboxInputGUI($this->lng->txt("shuffle_answers"), "shuffle_" . $i . "");
                 $shuffle->setValue(1);
                 $shuffle->setChecked($gap->getShuffle());
                 $shuffle->setRequired(FALSE);
                 $form->addItem($shuffle);
             } else {
                 if ($gap->getType() == CLOZE_NUMERIC) {
                     if (count($gap->getItemsRaw()) == 0) {
                         $gap->addItem(new assAnswerCloze("", 0, 0));
                     }
                     foreach ($gap->getItemsRaw() as $item) {
                         // #8944: the js-based ouput in self-assessment cannot support formulas
                         if (!$this->getSelfAssessmentEditingMode()) {
                             $value = new ilFormulaInputGUI($this->lng->txt('value'), "gap_" . $i . "_numeric");
                             $value->setInlineStyle('text-align: right;');
                             $lowerbound = new ilFormulaInputGUI($this->lng->txt('range_lower_limit'), "gap_" . $i . "_numeric_lower");
                             $lowerbound->setInlineStyle('text-align: right;');
                             $upperbound = new ilFormulaInputGUI($this->lng->txt('range_upper_limit'), "gap_" . $i . "_numeric_upper");
                             $upperbound->setInlineStyle('text-align: right;');
                         } else {
                             $value = new ilNumberInputGUI($this->lng->txt('value'), "gap_" . $i . "_numeric");
                             $value->allowDecimals(true);
                             $lowerbound = new ilNumberInputGUI($this->lng->txt('range_lower_limit'), "gap_" . $i . "_numeric_lower");
                             $lowerbound->allowDecimals(true);
                             $upperbound = new ilNumberInputGUI($this->lng->txt('range_upper_limit'), "gap_" . $i . "_numeric_upper");
                             $upperbound->allowDecimals(true);
                         }
                         $value->setSize(10);
                         $value->setValue(ilUtil::prepareFormOutput($item->getAnswertext()));
                         $value->setRequired(true);
                         $form->addItem($value);
                         $lowerbound->setSize(10);
                         $lowerbound->setRequired(true);
                         $lowerbound->setValue(ilUtil::prepareFormOutput($item->getLowerBound()));
                         $form->addItem($lowerbound);
                         $upperbound->setSize(10);
                         $upperbound->setRequired(true);
                         $upperbound->setValue(ilUtil::prepareFormOutput($item->getUpperBound()));
                         $form->addItem($upperbound);
                         $points = new ilNumberInputGUI($this->lng->txt('points'), "gap_" . $i . "_numeric_points");
                         $points->setSize(3);
                         $points->setRequired(true);
                         $points->setValue(ilUtil::prepareFormOutput($item->getPoints()));
                         $form->addItem($points);
                     }
                 }
             }
         }
     }
     $form->addCommandButton('createGaps', $this->lng->txt('create_gaps'));
     $this->addQuestionFormCommandButtons($form);
     $errors = false;
     if ($save) {
         $form->setValuesByPost();
         $errors = !$form->checkInput();
         $form->setValuesByPost();
         // again, because checkInput now performs the whole stripSlashes handling and we need this if we don't want to have duplication of backslashes
         if ($errors) {
             $checkonly = false;
         }
     }
     if (!$checkonly) {
         $this->tpl->setVariable("QUESTION_DATA", $form->getHTML());
     }
     return $errors;
 }
 /**
  * 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;
 }
 public function editPriceObject()
 {
     $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment');
     $price_id = $_GET['price_id'] ? $_GET['price_id'] : $_POST['price_id'];
     $price = ilPaymentPrices::_getPrice($price_id);
     $this->ctrl->setParameter($this, 'pobject_id', (int) $_GET['pobject_id']);
     $tmp_pobject = ilPaymentObject::_getObjectData($_GET['pobject_id']);
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $tmp_obj = ilObjectFactory::getInstanceByRefId($tmp_pobject['ref_id'], false);
     if ($tmp_obj) {
         $form->setTitle($tmp_obj->getTitle());
     } else {
         $form->setTitle($this->lng->txt('object_not_found'));
     }
     //price_type
     $radio_group = new ilRadioGroupInputGUI('', 'price_type');
     $radio_group->setTitle($this->lng->txt('duration'));
     $radio_group->setRequired(true);
     $radio_group->setValue($price['price_type']);
     $radio_group->setPostVar('price_type');
     $radio_option_1 = new ilRadioOption($this->lng->txt('duration_month'), ilPaymentPrices::TYPE_DURATION_MONTH);
     // duration month
     $oDuration = new ilNumberInputGUI();
     $oDuration->setTitle($this->lng->txt('paya_months'));
     $oDuration->setSize('20%');
     $oDuration->setValue($price['duration']);
     $oDuration->setPostVar('duration_month');
     $radio_option_1->addSubItem($oDuration);
     $radio_group->addOption($radio_option_1);
     $radio_option_3 = new ilRadioOption($this->lng->txt('duration_date'), ilPaymentPrices::TYPE_DURATION_DATE);
     // duration_date from
     $o_date_from = new ilDateTimeInputGUI();
     $o_date_from->setTitle($this->lng->txt('cal_from'));
     $o_date_from->setDate(new ilDate($price['duration_from'], IL_CAL_DATE));
     $o_date_from->setPostVar('duration_date_from');
     $radio_option_3->addSubItem($o_date_from);
     // duration_date until
     $o_date_until = new ilDateTimeInputGUI();
     $o_date_until->setTitle($this->lng->txt('cal_until'));
     $o_date_until->setDate(new ilDate($price['duration_until'], IL_CAL_DATE));
     $o_date_until->setPostVar('duration_date_until');
     $radio_option_3->addSubItem($o_date_until);
     $radio_group->addOption($radio_option_3);
     $radio_option_2 = new ilRadioOption($this->lng->txt('unlimited_duration'), ilPaymentPrices::TYPE_UNLIMITED_DURATION);
     $radio_group->addOption($radio_option_2);
     $form->addItem($radio_group);
     // description
     $oDescription = new ilTextAreaInputGUI($this->lng->txt('description'), 'description');
     $oDescription->setRows(4);
     $oDescription->setCols(35);
     $oDescription->setValue($price['description']);
     $form->addItem($oDescription);
     // price
     $oPrice = new ilNumberInputGUI();
     $oPrice->setTitle($this->lng->txt('price_a'));
     $oPrice->setSize('20%');
     $oPrice->setRequired(true);
     $oPrice->setValue($price['price']);
     include_once './Services/Payment/classes/class.ilPaymentSettings.php';
     $genSet = ilPaymentSettings::_getInstance();
     $oPrice->setInfo($genSet->get('currency_unit'));
     $oPrice->setPostVar('price');
     $oPrice->allowDecimals(true);
     $form->addItem($oPrice);
     //extension
     $oExtension = new ilCheckboxInputGUI($this->lng->txt('extension_price'), 'extension');
     $oExtension->setChecked($price['extension']);
     $form->addItem($oExtension);
     $o_hidden_1 = new ilHiddenInputGUI('pobject_id');
     $o_hidden_1->setValue((int) $_GET['pobject_id']);
     $o_hidden_1->setPostVar('pobject_id');
     $o_hidden_2 = new ilHiddenInputGUI('price_id');
     $o_hidden_2->setValue((int) $_GET['price_id']);
     $o_hidden_2->setPostVar('price_id');
     $form->addItem($o_hidden_1);
     $form->addItem($o_hidden_2);
     $form->addCommandButton('updatePrice', $this->lng->txt('save'));
     $form->addCommandButton('editPrices', $this->lng->txt('cancel'));
     $this->tpl->setVariable('FORM', $form->getHTML());
 }
 public function populateQuestionSpecificFormPart(\ilPropertyFormGUI $form)
 {
     // shuffle
     $shuffle = new ilCheckboxInputGUI($this->lng->txt("shuffle_answers"), "shuffle");
     $shuffle->setValue(1);
     $shuffle->setChecked($this->object->getShuffle());
     $shuffle->setRequired(FALSE);
     $form->addItem($shuffle);
     if ($this->object->getId()) {
         $hidden = new ilHiddenInputGUI("", "ID");
         $hidden->setValue($this->object->getId());
         $form->addItem($hidden);
     }
     if (!$this->object->getSelfAssessmentEditingMode()) {
         $isSingleline = $this->object->lastChange == 0 && !array_key_exists('types', $_POST) ? $this->object->getMultilineAnswerSetting() ? false : true : $this->object->isSingleline;
         // Answer types
         $types = new ilSelectInputGUI($this->lng->txt("answer_types"), "types");
         $types->setRequired(false);
         $types->setValue($isSingleline ? 0 : 1);
         $types->setOptions(array(0 => $this->lng->txt('answers_singleline'), 1 => $this->lng->txt('answers_multiline')));
         $form->addItem($types);
     }
     if ($isSingleline) {
         // thumb size
         $thumb_size = new ilNumberInputGUI($this->lng->txt("thumb_size"), "thumb_size");
         $thumb_size->setMinValue(20);
         $thumb_size->setDecimals(0);
         $thumb_size->setSize(6);
         $thumb_size->setInfo($this->lng->txt('thumb_size_info'));
         $thumb_size->setValue($this->object->getThumbSize());
         $thumb_size->setRequired(false);
         $form->addItem($thumb_size);
         return $isSingleline;
     }
     return $isSingleline;
 }
 private function initLoginSettingsForm()
 {
     $this->setSubTabs('settings');
     $this->tabs_gui->setTabActive('settings');
     $this->tabs_gui->setSubTabActive('loginname_settings');
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->loginSettingsForm = new ilPropertyFormGUI();
     $this->loginSettingsForm->setFormAction($this->ctrl->getFormAction($this, 'saveLoginnameSettings'));
     $this->loginSettingsForm->setTitle($this->lng->txt('loginname_settings'));
     $chbChangeLogin = new ilCheckboxInputGUI($this->lng->txt('allow_change_loginname'), 'allow_change_loginname');
     $chbChangeLogin->setValue(1);
     $this->loginSettingsForm->addItem($chbChangeLogin);
     $chbCreateHistory = new ilCheckboxInputGUI($this->lng->txt('history_loginname'), 'create_history_loginname');
     $chbCreateHistory->setInfo($this->lng->txt('loginname_history_info'));
     $chbCreateHistory->setValue(1);
     $chbChangeLogin->addSubItem($chbCreateHistory);
     $chbReuseLoginnames = new ilCheckboxInputGUI($this->lng->txt('reuse_of_loginnames_contained_in_history'), 'reuse_of_loginnames');
     $chbReuseLoginnames->setValue(1);
     $chbReuseLoginnames->setInfo($this->lng->txt('reuse_of_loginnames_contained_in_history_info'));
     $chbChangeLogin->addSubItem($chbReuseLoginnames);
     $chbChangeBlockingTime = new ilNumberInputGUI($this->lng->txt('loginname_change_blocking_time'), 'loginname_change_blocking_time');
     $chbChangeBlockingTime->allowDecimals(true);
     $chbChangeBlockingTime->setSuffix($this->lng->txt('days'));
     $chbChangeBlockingTime->setInfo($this->lng->txt('loginname_change_blocking_time_info'));
     $chbChangeBlockingTime->setSize(10);
     $chbChangeBlockingTime->setMaxLength(10);
     $chbChangeLogin->addSubItem($chbChangeBlockingTime);
     $this->loginSettingsForm->addCommandButton('saveLoginnameSettings', $this->lng->txt('save'));
 }
예제 #14
0
 private function initForm()
 {
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($this->ctrl->getFormAction($this, 'save'));
     $this->form->setTitle($this->lng->txt('general_settings'));
     // Subject prefix
     $pre = new ilTextInputGUI($this->lng->txt('mail_subject_prefix'), 'mail_subject_prefix');
     $pre->setSize(12);
     $pre->setMaxLength(32);
     $pre->setInfo($this->lng->txt('mail_subject_prefix_info'));
     $this->form->addItem($pre);
     // incoming type
     include_once 'Services/Mail/classes/class.ilMailOptions.php';
     $options = array(IL_MAIL_LOCAL => $this->lng->txt('mail_incoming_local'), IL_MAIL_EMAIL => $this->lng->txt('mail_incoming_smtp'), IL_MAIL_BOTH => $this->lng->txt('mail_incoming_both'));
     $si = new ilSelectInputGUI($this->lng->txt('mail_incoming'), 'mail_incoming_mail');
     $si->setOptions($options);
     $this->ctrl->setParameterByClass('ilobjuserfoldergui', 'ref_id', USER_FOLDER_ID);
     $si->setInfo(sprintf($this->lng->txt('mail_settings_incoming_type_see_also'), $this->ctrl->getLinkTargetByClass('ilobjuserfoldergui', 'settings')));
     $this->ctrl->clearParametersByClass('ilobjuserfoldergui');
     $this->form->addItem($si);
     // noreply address
     $ti = new ilTextInputGUI($this->lng->txt('mail_external_sender_noreply'), 'mail_external_sender_noreply');
     $ti->setInfo($this->lng->txt('info_mail_external_sender_noreply'));
     $ti->setMaxLength(255);
     $this->form->addItem($ti);
     $system_sender_name = new ilTextInputGUI($this->lng->txt('mail_system_sender_name'), 'mail_system_sender_name');
     $system_sender_name->setInfo($this->lng->txt('mail_system_sender_name_info'));
     $system_sender_name->setMaxLength(255);
     $this->form->addItem($system_sender_name);
     $cb = new ilCheckboxInputGUI($this->lng->txt('mail_use_pear_mail'), 'pear_mail_enable');
     $cb->setInfo($this->lng->txt('mail_use_pear_mail_info'));
     $cb->setValue(1);
     $this->form->addItem($cb);
     // prevent smtp mails
     $cb = new ilCheckboxInputGUI($this->lng->txt('mail_prevent_smtp_globally'), 'prevent_smtp_globally');
     $cb->setValue(1);
     $this->form->addItem($cb);
     $cron_mail = new ilSelectInputGUI($this->lng->txt('cron_mail_notification'), 'mail_notification');
     $cron_options = array(0 => $this->lng->txt('cron_mail_notification_never'), 1 => $this->lng->txt('cron_mail_notification_cron'));
     $cron_mail->setOptions($cron_options);
     $cron_mail->setInfo($this->lng->txt('cron_mail_notification_desc'));
     $this->form->addItem($cron_mail);
     // section header
     $sh = new ilFormSectionHeaderGUI();
     $sh->setTitle($this->lng->txt('mail') . ' (' . $this->lng->txt('internal_system') . ')');
     $this->form->addItem($sh);
     // max attachment size
     $ti = new ilNumberInputGUI($this->lng->txt('mail_maxsize_attach'), 'mail_maxsize_attach');
     $ti->setSuffix($this->lng->txt('kb'));
     $ti->setInfo($this->lng->txt('mail_max_size_attachments_total'));
     $ti->setMaxLength(10);
     $ti->setSize(10);
     $this->form->addItem($ti);
     // Course/Group member notification
     $mn = new ilFormSectionHeaderGUI();
     $mn->setTitle($this->lng->txt('mail_member_notification'));
     $this->form->addItem($mn);
     include_once "Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php";
     ilAdministrationSettingsFormHandler::addFieldsToForm(ilAdministrationSettingsFormHandler::FORM_MAIL, $this->form, $this);
     $this->form->addCommandButton('save', $this->lng->txt('save'));
 }
 public function populateQuestionSpecificFormPart(\ilPropertyFormGUI $form)
 {
     $orderingtype = $this->getOrderingTypeFromPost();
     // Edit mode
     $hidden = new ilHiddenInputGUI("ordering_type");
     $hidden->setValue($orderingtype);
     $form->addItem($hidden);
     if (!$this->object->getSelfAssessmentEditingMode()) {
         $element_height = new ilNumberInputGUI($this->lng->txt("element_height"), "element_height");
         $element_height->setValue($this->object->getElementHeight());
         $element_height->setRequired(false);
         $element_height->setMaxLength(6);
         $element_height->setMinValue(20);
         $element_height->setSize(6);
         $element_height->setInfo($this->lng->txt("element_height_info"));
         $form->addItem($element_height);
     }
     if ($orderingtype == OQ_PICTURES) {
         $geometry = new ilNumberInputGUI($this->lng->txt("thumb_geometry"), "thumb_geometry");
         $geometry->setValue($this->object->getThumbGeometry());
         $geometry->setRequired(true);
         $geometry->setMaxLength(6);
         $geometry->setMinValue(20);
         $geometry->setSize(6);
         $geometry->setInfo($this->lng->txt("thumb_geometry_info"));
         $form->addItem($geometry);
     }
     // points
     $points = new ilNumberInputGUI($this->lng->txt("points"), "points");
     $points->allowDecimals(true);
     $points->setValue($this->object->getPoints());
     $points->setRequired(TRUE);
     $points->setSize(3);
     $points->setMinValue(0);
     $points->setMinvalueShouldBeGreater(true);
     $form->addItem($points);
     return $form;
 }
 public function populateQuestionSpecificFormPart(\ilPropertyFormGUI $form)
 {
     // ordertext
     $ordertext = new ilTextAreaInputGUI($this->lng->txt("ordertext"), "ordertext");
     $ordertext->setValue($this->object->prepareTextareaOutput($this->object->getOrderText()));
     $ordertext->setRequired(TRUE);
     $ordertext->setInfo(sprintf($this->lng->txt("ordertext_info"), $this->object->separator));
     $ordertext->setRows(10);
     $ordertext->setCols(80);
     $form->addItem($ordertext);
     // textsize
     $textsize = new ilNumberInputGUI($this->lng->txt("textsize"), "textsize");
     $textsize->setValue($this->object->getTextSize());
     $textsize->setInfo($this->lng->txt("textsize_info"));
     $textsize->setSize(6);
     $textsize->setMinValue(10);
     $textsize->setRequired(FALSE);
     $form->addItem($textsize);
     // points
     $points = new ilNumberInputGUI($this->lng->txt("points"), "points");
     $points->allowDecimals(true);
     // mbecker: Fix for mantis bug 7866: Predefined values schould make sense.
     // This implements a default value of "1" for this question type.
     if ($this->object->getPoints() == null) {
         $points->setValue("1");
     } else {
         $points->setValue($this->object->getPoints());
     }
     $points->setRequired(TRUE);
     $points->setSize(3);
     $points->setMinValue(0.0);
     $points->setMinvalueShouldBeGreater(true);
     $form->addItem($points);
 }
 /**
  * Creates an output of the edit form for the question
  *
  * @access public
  */
 public function editQuestion($checkonly = FALSE)
 {
     $save = $this->isSaveCommand();
     $this->getQuestionTemplate();
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTitle($this->outQuestionType());
     $form->setMultipart(TRUE);
     $form->setTableWidth("100%");
     $form->setId("asstextquestion");
     // title, author, description, question, working time (assessment mode)
     $this->addBasicQuestionFormProperties($form);
     // maxchars
     $maxchars = new ilNumberInputGUI($this->lng->txt("maxchars"), "maxchars");
     $maxchars->setSize(5);
     if ($this->object->getMaxNumOfChars() > 0) {
         $maxchars->setValue($this->object->getMaxNumOfChars());
     }
     $maxchars->setInfo($this->lng->txt("description_maxchars"));
     $form->addItem($maxchars);
     if (!$this->getSelfAssessmentEditingMode()) {
         if ($this->object->getAnswerCount() == 0) {
             $this->object->addAnswer("", 0, 0, 0);
         }
         $scoringMode = new ilRadioGroupInputGUI($this->lng->txt('essay_scoring_mode'), 'scoring_mode');
         $scoringOptionNone = new ilRadioOption($this->lng->txt('essay_scoring_mode_without_keywords'), 'non', $this->lng->txt('essay_scoring_mode_without_keywords_desc'));
         $scoringOptionAnyKeyword = new ilRadioOption($this->lng->txt('essay_scoring_mode_keyword_relation_any'), 'any', $this->lng->txt('essay_scoring_mode_keyword_relation_any_desc'));
         $scoringOptionAllKeyword = new ilRadioOption($this->lng->txt('essay_scoring_mode_keyword_relation_all'), 'all', $this->lng->txt('essay_scoring_mode_keyword_relation_all_desc'));
         $scoringOptionOneKeyword = new ilRadioOption($this->lng->txt('essay_scoring_mode_keyword_relation_one'), 'one', $this->lng->txt('essay_scoring_mode_keyword_relation_one_desc'));
         $scoringMode->addOption($scoringOptionNone);
         $scoringMode->addOption($scoringOptionAnyKeyword);
         $scoringMode->addOption($scoringOptionAllKeyword);
         $scoringMode->addOption($scoringOptionOneKeyword);
         $scoringMode->setRequired(true);
         $scoringMode->setValue(strlen($this->object->getKeywordRelation()) ? $this->object->getKeywordRelation() : 'non');
         require_once "./Modules/TestQuestionPool/classes/class.ilEssayKeywordWizardInputGUI.php";
         // Without Keywords
         $nonKeywordPoints = new ilNumberInputGUI($this->lng->txt("points"), "non_keyword_points");
         $nonKeywordPoints->setValue($this->object->getPoints());
         $nonKeywordPoints->setRequired(TRUE);
         $nonKeywordPoints->setSize(3);
         $nonKeywordPoints->setMinValue(0.0);
         $nonKeywordPoints->setMinvalueShouldBeGreater(true);
         $scoringOptionNone->addSubItem($nonKeywordPoints);
         // Any Keyword
         $anyKeyword = new ilEssayKeywordWizardInputGUI($this->lng->txt("answers"), "any_keyword");
         $anyKeyword->setRequired(TRUE);
         $anyKeyword->setQuestionObject($this->object);
         $anyKeyword->setSingleline(TRUE);
         $anyKeyword->setValues($this->object->getAnswers());
         $scoringOptionAnyKeyword->addSubItem($anyKeyword);
         // All Keywords
         $allKeyword = new ilTextWizardInputGUI($this->lng->txt("answers"), "all_keyword");
         $allKeyword->setRequired(TRUE);
         //$allKeyword->setQuestionObject($this->object);
         //$allKeyword->setSingleline(TRUE);
         $allKeyword->setValues(self::buildAnswerTextOnlyArray($this->object->getAnswers()));
         $scoringOptionAllKeyword->addSubItem($allKeyword);
         $allKeywordPoints = new ilNumberInputGUI($this->lng->txt("points"), "all_keyword_points");
         $allKeywordPoints->setValue($this->object->getPoints());
         $allKeywordPoints->setRequired(TRUE);
         $allKeywordPoints->setSize(3);
         $allKeywordPoints->setMinValue(0.0);
         $allKeywordPoints->setMinvalueShouldBeGreater(true);
         $scoringOptionAllKeyword->addSubItem($allKeywordPoints);
         // One Keywords
         $oneKeyword = new ilTextWizardInputGUI($this->lng->txt("answers"), "one_keyword");
         $oneKeyword->setRequired(TRUE);
         //$oneKeyword->setQuestionObject($this->object);
         //$oneKeyword->setSingleline(TRUE);
         $oneKeyword->setValues(self::buildAnswerTextOnlyArray($this->object->getAnswers()));
         $scoringOptionOneKeyword->addSubItem($oneKeyword);
         $oneKeywordPoints = new ilNumberInputGUI($this->lng->txt("points"), "one_keyword_points");
         $oneKeywordPoints->setValue($this->object->getPoints());
         $oneKeywordPoints->setRequired(TRUE);
         $oneKeywordPoints->setSize(3);
         $oneKeywordPoints->setMinValue(0.0);
         $oneKeywordPoints->setMinvalueShouldBeGreater(true);
         $scoringOptionOneKeyword->addSubItem($oneKeywordPoints);
         $form->addItem($scoringMode);
     }
     $this->addQuestionFormCommandButtons($form);
     $errors = false;
     if ($save) {
         $form->setValuesByPost();
         $errors = !$form->checkInput();
         $form->setValuesByPost();
         // again, because checkInput now performs the whole stripSlashes handling and we need this if we don't want to have duplication of backslashes
         if ($errors) {
             $checkonly = false;
         }
     }
     if (!$checkonly) {
         $this->tpl->setVariable("QUESTION_DATA", $form->getHTML());
     }
     return $errors;
 }
 /**
  * Creates an output of the edit form for the question
  *
  * @access public
  */
 public function editQuestion($checkonly = FALSE)
 {
     $save = $this->isSaveCommand();
     $this->getQuestionTemplate();
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTitle($this->outQuestionType());
     $form->setMultipart(false);
     $form->setTableWidth("100%");
     $form->setId("assfileupload");
     $this->addBasicQuestionFormProperties($form);
     // maxsize
     $maxsize = new ilNumberInputGUI($this->lng->txt("maxsize"), "maxsize");
     $maxsize->setValue($this->object->getMaxSize());
     $maxsize->setInfo($this->lng->txt("maxsize_info"));
     $maxsize->setSize(10);
     $maxsize->setMinValue(0);
     //mbecker: Quick fix for mantis bug 8595: Change size file
     $umf = get_cfg_var("upload_max_filesize");
     // get the value for the maximal post data from the php.ini (if available)
     $pms = get_cfg_var("post_max_size");
     //convert from short-string representation to "real" bytes
     $multiplier_a = array("K" => 1024, "M" => 1024 * 1024, "G" => 1024 * 1024 * 1024);
     $umf_parts = preg_split("/(\\d+)([K|G|M])/", $umf, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
     $pms_parts = preg_split("/(\\d+)([K|G|M])/", $pms, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
     if (count($umf_parts) == 2) {
         $umf = $umf_parts[0] * $multiplier_a[$umf_parts[1]];
     }
     if (count($pms_parts) == 2) {
         $pms = $pms_parts[0] * $multiplier_a[$pms_parts[1]];
     }
     // use the smaller one as limit
     $max_filesize = min($umf, $pms);
     if (!$max_filesize) {
         $max_filesize = max($umf, $pms);
     }
     $maxsize->setMaxValue($max_filesize);
     // end quick fix
     $maxsize->setRequired(FALSE);
     $form->addItem($maxsize);
     // allowedextensions
     $allowedextensions = new ilTextInputGUI($this->lng->txt("allowedextensions"), "allowedextensions");
     $allowedextensions->setInfo($this->lng->txt("allowedextensions_info"));
     $allowedextensions->setValue($this->object->getAllowedExtensions());
     $allowedextensions->setRequired(FALSE);
     $form->addItem($allowedextensions);
     // points
     $points = new ilNumberInputGUI($this->lng->txt("points"), "points");
     $points->setValue(is_numeric($this->object->getPoints()) && $this->object->getPoints() >= 0 ? $this->object->getPoints() : '');
     $points->setRequired(TRUE);
     $points->setSize(3);
     $points->setMinValue(0.0);
     $points->setMinvalueShouldBeGreater(false);
     $form->addItem($points);
     $subcompl = new ilCheckboxInputGUI($this->lng->txt('ass_completion_by_submission'), 'completion_by_submission');
     $subcompl->setInfo($this->lng->txt('ass_completion_by_submission_info'));
     $subcompl->setValue(1);
     $subcompl->setChecked($this->object->isCompletionBySubmissionEnabled());
     $form->addItem($subcompl);
     $this->addQuestionFormCommandButtons($form);
     $errors = false;
     if ($save) {
         $form->setValuesByPost();
         $errors = !$form->checkInput();
         $form->setValuesByPost();
         // again, because checkInput now performs the whole stripSlashes handling and we need this if we don't want to have duplication of backslashes
         if ($errors) {
             $checkonly = false;
         }
     }
     if (!$checkonly) {
         $this->tpl->setVariable("QUESTION_DATA", $form->getHTML());
     }
     return $errors;
 }
 /**
  * Creates an output of the edit form for the question
  *
  * @access public
  */
 public function editQuestion($checkonly = FALSE)
 {
     $save = $this->isSaveCommand();
     $this->getQuestionTemplate();
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTitle($this->outQuestionType());
     $form->setMultipart(FALSE);
     $form->setTableWidth("100%");
     $form->setId("orderinghorizontal");
     $this->addBasicQuestionFormProperties($form);
     // errortext
     $errortext = new ilTextAreaInputGUI($this->lng->txt("errortext"), "errortext");
     $errortext->setValue(ilUtil::prepareFormOutput($this->object->getErrorText()));
     $errortext->setRequired(TRUE);
     $errortext->setInfo($this->lng->txt("errortext_info"));
     $errortext->setRows(10);
     $errortext->setCols(80);
     $form->addItem($errortext);
     if (!$this->getSelfAssessmentEditingMode()) {
         // textsize
         $textsize = new ilNumberInputGUI($this->lng->txt("textsize"), "textsize");
         $textsize->setValue(strlen($this->object->getTextSize()) ? $this->object->getTextSize() : 100.0);
         $textsize->setInfo($this->lng->txt("textsize_errortext_info"));
         $textsize->setSize(6);
         $textsize->setSuffix("%");
         $textsize->setMinValue(10);
         $textsize->setRequired(true);
         $form->addItem($textsize);
     }
     if (count($this->object->getErrorData()) || $checkonly) {
         $header = new ilFormSectionHeaderGUI();
         $header->setTitle($this->lng->txt("errors_section"));
         $form->addItem($header);
         include_once "./Modules/TestQuestionPool/classes/class.ilErrorTextWizardInputGUI.php";
         $errordata = new ilErrorTextWizardInputGUI($this->lng->txt("errors"), "errordata");
         $values = array();
         $errordata->setKeyName($this->lng->txt('text_wrong'));
         $errordata->setValueName($this->lng->txt('text_correct'));
         $errordata->setValues($this->object->getErrorData());
         $form->addItem($errordata);
         // points for wrong selection
         $points_wrong = new ilNumberInputGUI($this->lng->txt("points_wrong"), "points_wrong");
         $points_wrong->setValue($this->object->getPointsWrong());
         $points_wrong->setInfo($this->lng->txt("points_wrong_info"));
         $points_wrong->setSize(6);
         $points_wrong->setRequired(true);
         $form->addItem($points_wrong);
     }
     $form->addCommandButton("analyze", $this->lng->txt('analyze_errortext'));
     $this->addQuestionFormCommandButtons($form);
     $errors = false;
     if ($save) {
         $form->setValuesByPost();
         $errors = !$form->checkInput();
         $form->setValuesByPost();
         // again, because checkInput now performs the whole stripSlashes handling and we need this if we don't want to have duplication of backslashes
         if ($errors) {
             $checkonly = false;
         }
     }
     if (!$checkonly) {
         $this->tpl->setVariable("QUESTION_DATA", $form->getHTML());
     }
     return $errors;
 }
 /**
  * Initializes the preview settings form.
  */
 private function initPreviewSettingsForm()
 {
     global $ilCtrl, $lng;
     require_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($ilCtrl->getFormAction($this));
     $form->setTitle($lng->txt("settings"));
     require_once "Services/Preview/classes/class.ilPreviewSettings.php";
     // drag and drop file upload in repository
     $chk_prop = new ilCheckboxInputGUI($lng->txt("enable_preview"), "enable_preview");
     $chk_prop->setValue('1');
     $chk_prop->setChecked(ilPreviewSettings::isPreviewEnabled());
     $chk_prop->setInfo($lng->txt('enable_preview_info'));
     $form->addItem($chk_prop);
     $num_prop = new ilNumberInputGUI($lng->txt("max_previews_per_object"), "max_previews_per_object");
     $num_prop->setDecimals(0);
     $num_prop->setMinValue(1);
     $num_prop->setMinvalueShouldBeGreater(false);
     $num_prop->setMaxValue(ilPreviewSettings::MAX_PREVIEWS_MAX);
     $num_prop->setMaxvalueShouldBeLess(false);
     $num_prop->setMaxLength(5);
     $num_prop->setSize(10);
     $num_prop->setValue(ilPreviewSettings::getMaximumPreviews());
     $num_prop->setInfo($lng->txt('max_previews_per_object_info'));
     $form->addItem($num_prop);
     // command buttons
     $form->addCommandButton('savePreviewSettings', $lng->txt('save'));
     $form->addCommandButton('view', $lng->txt('cancel'));
     return $form;
 }
예제 #21
0
 public function populateQuestionSpecificFormPart(ilPropertyFormGUI $form)
 {
     // maxsize
     $maxsize = new ilNumberInputGUI($this->lng->txt("maxsize"), "maxsize");
     $maxsize->setValue($this->object->getMaxSize());
     $maxsize->setInfo($this->lng->txt("maxsize_info"));
     $maxsize->setSize(10);
     $maxsize->setMinValue(0);
     $maxsize->setMaxValue($this->determineMaxFilesize());
     $maxsize->setRequired(FALSE);
     $form->addItem($maxsize);
     // allowedextensions
     $allowedextensions = new ilTextInputGUI($this->lng->txt("allowedextensions"), "allowedextensions");
     $allowedextensions->setInfo($this->lng->txt("allowedextensions_info"));
     $allowedextensions->setValue($this->object->getAllowedExtensions());
     $allowedextensions->setRequired(FALSE);
     $form->addItem($allowedextensions);
     // points
     $points = new ilNumberInputGUI($this->lng->txt("points"), "points");
     $points->allowDecimals(true);
     $points->setValue(is_numeric($this->object->getPoints()) && $this->object->getPoints() >= 0 ? $this->object->getPoints() : '');
     $points->setRequired(TRUE);
     $points->setSize(3);
     $points->setMinValue(0.0);
     $points->setMinvalueShouldBeGreater(false);
     $form->addItem($points);
     $subcompl = new ilCheckboxInputGUI($this->lng->txt('ass_completion_by_submission'), 'completion_by_submission');
     $subcompl->setInfo($this->lng->txt('ass_completion_by_submission_info'));
     $subcompl->setValue(1);
     $subcompl->setChecked($this->object->isCompletionBySubmissionEnabled());
     $form->addItem($subcompl);
     return $form;
 }
 /**
  * Init Settings Form
  */
 function initSettingsForm()
 {
     global $tpl, $lng, $ilCtrl;
     $lng->loadLanguageModule("mcst");
     include "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form_gui = new ilPropertyFormGUI();
     $this->form_gui->setTitle($lng->txt("mcst_settings"));
     // Title
     $tit = new ilTextInputGUI($lng->txt("title"), "title");
     $tit->setValue($this->object->getTitle());
     $tit->setRequired(true);
     $this->form_gui->addItem($tit);
     // description
     $des = new ilTextAreaInputGUI($lng->txt("description"), "description");
     $des->setValue($this->object->getLongDescription());
     $this->form_gui->addItem($des);
     // Online
     $online = new ilCheckboxInputGUI($lng->txt("online"), "online");
     $online->setChecked($this->object->getOnline());
     $this->form_gui->addItem($online);
     // Sorting
     $sort = new ilRadioGroupInputGUI($lng->txt("mcst_ordering"), "order");
     $sort->addOption(new ilRadioOption($lng->txt("mcst_ordering_title"), ilObjMediaCast::ORDER_TITLE));
     $sort->addOption(new ilRadioOption($lng->txt("mcst_ordering_creation_date_asc"), ilObjMediaCast::ORDER_CREATION_DATE_ASC));
     $sort->addOption(new ilRadioOption($lng->txt("mcst_ordering_creation_date_desc"), ilObjMediaCast::ORDER_CREATION_DATE_DESC));
     $sort->addOption(new ilRadioOption($lng->txt("mcst_ordering_manual"), ilObjMediaCast::ORDER_MANUAL));
     $sort->setValue($this->object->getOrder());
     $this->form_gui->addItem($sort);
     // view mode
     $options = array(ilObjMediaCast::VIEW_LIST => $lng->txt("mcst_list"), ilObjMediaCast::VIEW_GALLERY => $lng->txt("mcst_gallery"));
     $si = new ilSelectInputGUI($this->lng->txt("mcst_viewmode"), "viewmode");
     $si->setOptions($options);
     $si->setValue($this->object->getViewMode());
     $this->form_gui->addItem($si);
     // Downloadable
     $downloadable = new ilCheckboxInputGUI($lng->txt("mcst_downloadable"), "downloadable");
     $downloadable->setChecked($this->object->getDownloadable());
     $downloadable->setInfo($lng->txt("mcst_downloadable_info"));
     $this->form_gui->addItem($downloadable);
     $news_set = new ilSetting("news");
     $enable_internal_rss = $news_set->get("enable_rss_for_internal");
     //Default Visibility
     if ($enable_internal_rss) {
         $radio_group = new ilRadioGroupInputGUI($lng->txt("news_default_visibility"), "defaultaccess");
         $radio_option = new ilRadioOption($lng->txt("news_visibility_users"), "0");
         $radio_group->addOption($radio_option);
         $radio_option = new ilRadioOption($lng->txt("news_visibility_public"), "1");
         $radio_group->addOption($radio_option);
         $radio_group->setInfo($lng->txt("news_news_item_visibility_info"));
         $radio_group->setRequired(false);
         $radio_group->setValue($this->object->getDefaultAccess());
         #$ch->addSubItem($radio_group);
         $this->form_gui->addItem($radio_group);
         //Extra Feed
         include_once "./Services/Block/classes/class.ilBlockSetting.php";
         $public_feed = ilBlockSetting::_lookup("news", "public_feed", 0, $this->object->getId());
         $ch = new ilCheckboxInputGUI($lng->txt("news_public_feed"), "extra_feed");
         $ch->setInfo($lng->txt("news_public_feed_info"));
         $ch->setChecked($public_feed);
         $this->form_gui->addItem($ch);
         // keep minimal x number of items
         $ni = new ilNumberInputGUI($this->lng->txt("news_keep_minimal_x_items"), "keep_rss_min");
         $ni->setMaxValue(100);
         $ni->setMinValue(0);
         $ni->setMaxLength(3);
         $ni->setSize(3);
         $ni->setInfo($this->lng->txt("news_keep_minimal_x_items_info") . " (" . ilNewsItem::_lookupRSSPeriod() . " " . (ilNewsItem::_lookupRSSPeriod() == 1 ? $lng->txt("day") : $lng->txt("days")) . ")");
         $ni->setValue((int) ilBlockSetting::_lookup("news", "keep_rss_min", 0, $this->object->getId()));
         $ch->addSubItem($ni);
         // Include Files in Pubic Items
         $incl_files = new ilCheckboxInputGUI($lng->txt("mcst_incl_files_in_rss"), "public_files");
         $incl_files->setChecked($this->object->getPublicFiles());
         $incl_files->setInfo($lng->txt("mcst_incl_files_in_rss_info"));
         #$ch->addSubItem($incl_files);
         $this->form_gui->addItem($incl_files);
     }
     // Form action and save button
     $this->form_gui->addCommandButton("saveSettings", $lng->txt("save"));
     $this->form_gui->setFormAction($ilCtrl->getFormAction($this, "saveSettings"));
 }
 /**
  * Creates an output of the edit form for the question
  *
  * @access public
  */
 function editQuestion($checkonly = FALSE)
 {
     $save = $this->isSaveCommand();
     $this->getQuestionTemplate();
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $orderingtype = array_key_exists('ordering_type', $_POST) ? $_POST['ordering_type'] : $this->object->getOrderingType();
     if (strcmp($this->ctrl->getCmd(), 'changeToText') == 0) {
         $orderingtype = OQ_TERMS;
     }
     if (strcmp($this->ctrl->getCmd(), 'changeToPictures') == 0) {
         $orderingtype = OQ_PICTURES;
     }
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTitle($this->outQuestionType());
     $form->setMultipart($orderingtype == OQ_PICTURES ? TRUE : FALSE);
     $form->setTableWidth("100%");
     $form->setId("ordering");
     // Edit mode
     $hidden = new ilHiddenInputGUI("ordering_type");
     $hidden->setValue($orderingtype);
     $form->addItem($hidden);
     // title, author, description, question, working time (assessment mode)
     $this->addBasicQuestionFormProperties($form);
     if (!$this->getSelfAssessmentEditingMode()) {
         $element_height = new ilNumberInputGUI($this->lng->txt("element_height"), "element_height");
         $element_height->setValue($this->object->getElementHeight());
         $element_height->setRequired(false);
         $element_height->setMaxLength(6);
         $element_height->setMinValue(20);
         $element_height->setSize(6);
         $element_height->setInfo($this->lng->txt("element_height_info"));
         $form->addItem($element_height);
     }
     if ($orderingtype == OQ_PICTURES) {
         $geometry = new ilNumberInputGUI($this->lng->txt("thumb_geometry"), "thumb_geometry");
         $geometry->setValue($this->object->getThumbGeometry());
         $geometry->setRequired(true);
         $geometry->setMaxLength(6);
         $geometry->setMinValue(20);
         $geometry->setSize(6);
         $geometry->setInfo($this->lng->txt("thumb_geometry_info"));
         $form->addItem($geometry);
     }
     if (count($this->object->getAnswers()) == 0) {
         $this->object->addAnswer();
     }
     // Answers
     if ($orderingtype == OQ_PICTURES) {
         include_once "./Modules/TestQuestionPool/classes/class.ilImageWizardInputGUI.php";
         $answers = new ilImageWizardInputGUI($this->lng->txt("answers"), "answers");
         $answers->setRequired(TRUE);
         $answers->setQuestionObject($this->object);
         $answers->setInfo($this->lng->txt('ordering_answer_sequence_info'));
         $answers->setAllowMove(TRUE);
         $answervalues = array();
         foreach ($this->object->getAnswers() as $index => $answervalue) {
             $answervalues[$index] = $answervalue->getAnswertext();
         }
         $answers->setValues($answervalues);
         $form->addItem($answers);
     } else {
         $answers = new ilTextWizardInputGUI($this->lng->txt("answers"), "answers");
         $answers->setRequired(TRUE);
         $answers->setInfo($this->lng->txt('ordering_answer_sequence_info'));
         $answers->setAllowMove(TRUE);
         $answervalues = array();
         foreach ($this->object->getAnswers() as $index => $answervalue) {
             $answervalues[$index] = $answervalue->getAnswertext();
         }
         ksort($answervalues);
         $answers->setValues($answervalues);
         $form->addItem($answers);
     }
     // points
     $points = new ilNumberInputGUI($this->lng->txt("points"), "points");
     $points->setValue($this->object->getPoints());
     $points->setRequired(TRUE);
     $points->setSize(3);
     $points->setMinValue(0);
     $points->setMinvalueShouldBeGreater(true);
     $form->addItem($points);
     if (true || !$this->getSelfAssessmentEditingMode()) {
         if ($orderingtype == OQ_PICTURES) {
             $form->addCommandButton("changeToText", $this->lng->txt("order_terms"));
         } else {
             $form->addCommandButton("changeToPictures", $this->lng->txt("order_pictures"));
         }
     }
     $this->addQuestionFormCommandButtons($form);
     $errors = false;
     if ($save) {
         $form->setValuesByPost();
         $errors = !$form->checkInput();
         $form->setValuesByPost();
         // again, because checkInput now performs the whole stripSlashes handling and we need this if we don't want to have duplication of backslashes
         if ($errors) {
             $checkonly = false;
         }
     }
     if (!$checkonly) {
         $this->tpl->setVariable("QUESTION_DATA", $form->getHTML());
     }
     return $errors;
 }
 /**
  * Creates an output of the edit form for the question
  *
  * @access public
  */
 public function editQuestion($checkonly = FALSE)
 {
     $save = $this->isSaveCommand();
     $this->getQuestionTemplate();
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTitle($this->outQuestionType());
     $form->setMultipart(FALSE);
     $form->setTableWidth("100%");
     $form->setId("orderinghorizontal");
     $this->addBasicQuestionFormProperties($form);
     // ordertext
     $ordertext = new ilTextAreaInputGUI($this->lng->txt("ordertext"), "ordertext");
     $ordertext->setValue($this->object->prepareTextareaOutput($this->object->getOrderText()));
     $ordertext->setRequired(TRUE);
     $ordertext->setInfo(sprintf($this->lng->txt("ordertext_info"), $this->object->separator));
     $ordertext->setRows(10);
     $ordertext->setCols(80);
     $form->addItem($ordertext);
     // textsize
     $textsize = new ilNumberInputGUI($this->lng->txt("textsize"), "textsize");
     $textsize->setValue($this->object->getTextSize());
     $textsize->setInfo($this->lng->txt("textsize_info"));
     $textsize->setSize(6);
     $textsize->setMinValue(10);
     $textsize->setRequired(FALSE);
     $form->addItem($textsize);
     // points
     $points = new ilNumberInputGUI($this->lng->txt("points"), "points");
     // mbecker: Fix for mantis bug 7866: Predefined values schould make sense.
     // This implements a default value of "1" for this question type.
     if ($this->object->getPoints() == null) {
         $points->setValue("1");
     } else {
         $points->setValue($this->object->getPoints());
     }
     $points->setRequired(TRUE);
     $points->setSize(3);
     $points->setMinValue(0.0);
     $points->setMinvalueShouldBeGreater(true);
     $form->addItem($points);
     $this->addQuestionFormCommandButtons($form);
     $errors = false;
     if ($save) {
         $form->setValuesByPost();
         $errors = !$form->checkInput();
         $form->setValuesByPost();
         // again, because checkInput now performs the whole stripSlashes handling and we need this if we don't want to have duplication of backslashes
         if ($errors) {
             $checkonly = false;
         }
     }
     if (!$checkonly) {
         $this->tpl->setVariable("QUESTION_DATA", $form->getHTML());
     }
     return $errors;
 }
예제 #25
0
 /**
  * @param $form ilPropertyFormGUI
  * @return \ilPropertyFormGUI|void
  */
 public function populateQuestionSpecificFormPart(ilPropertyFormGUI $form)
 {
     // errortext
     $errortext = new ilTextAreaInputGUI($this->lng->txt("errortext"), "errortext");
     $errortext->setValue($this->object->getErrorText());
     $errortext->setRequired(TRUE);
     $errortext->setInfo($this->lng->txt("errortext_info"));
     $errortext->setRows(10);
     $errortext->setCols(80);
     $form->addItem($errortext);
     if (!$this->object->getSelfAssessmentEditingMode()) {
         // textsize
         $textsize = new ilNumberInputGUI($this->lng->txt("textsize"), "textsize");
         $textsize->setValue(strlen($this->object->getTextSize()) ? $this->object->getTextSize() : 100.0);
         $textsize->setInfo($this->lng->txt("textsize_errortext_info"));
         $textsize->setSize(6);
         $textsize->setSuffix("%");
         $textsize->setMinValue(10);
         $textsize->setRequired(true);
         $form->addItem($textsize);
     }
 }
 /**
  * Show lucene settings form 
  * @param
  * @return
  */
 protected function initFormLuceneSettings()
 {
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     include_once './Services/Search/classes/class.ilSearchSettings.php';
     $this->settings = ilSearchSettings::getInstance();
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($this->ctrl->getFormAction($this, 'cancel'));
     $this->form->setTitle($this->lng->txt('lucene_settings_title'));
     $this->form->addCommandButton('saveLuceneSettings', $this->lng->txt('save'));
     $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
     // Offline filter
     /*
     		$offline = new ilCheckboxInputGUI($this->lng->txt('lucene_offline_filter_setting'),'offline_filter');
     		$offline->setInfo($this->lng->txt('lucene_offline_filter_setting_info'));
     		$offline->setValue(1);
     		$offline->setChecked($this->settings->isLuceneOfflineFilterEnabled());
     		$this->form->addItem($offline);
     */
     // user search
     $us = new ilCheckboxInputGUI($this->lng->txt('search_user_search_form'), 'user_search_enabled');
     $us->setInfo($this->lng->txt('search_user_search_info_form'));
     $us->setValue(1);
     $us->setChecked($this->settings->isLuceneUserSearchEnabled());
     $this->form->addItem($us);
     // Item filter
     $if = new ilCheckboxInputGUI($this->lng->txt('search_mime_filter_form'), 'mime_enabled');
     $if->setValue(1);
     $if->setChecked($this->settings->isLuceneMimeFilterEnabled());
     $if->setInfo($this->lng->txt('search_item_filter_form_info'));
     $this->form->addItem($if);
     $mimes = $this->settings->getLuceneMimeFilter();
     foreach (ilSearchSettings::getLuceneMimeFilterDefinitions() as $mime => $def) {
         $ch = new ilCheckboxInputGUI($this->lng->txt($def['trans']), 'mime[' . $mime . ']');
         if (isset($mimes[$mime]) and $mimes[$mime]) {
             $ch->setChecked(true);
         }
         $ch->setValue(1);
         $if->addSubItem($ch);
     }
     $prefix = new ilCheckboxInputGUI($this->lng->txt('lucene_prefix_wildcard'), 'prefix');
     $prefix->setValue(1);
     $prefix->setInfo($this->lng->txt('lucene_prefix_wildcard_info'));
     $prefix->setChecked($this->settings->isPrefixWildcardQueryEnabled());
     $this->form->addItem($prefix);
     $numFrag = new ilNumberInputGUI($this->lng->txt('lucene_num_fragments'), 'fragmentCount');
     $numFrag->setRequired(true);
     $numFrag->setSize(2);
     $numFrag->setMaxLength(2);
     $numFrag->setMinValue(1);
     $numFrag->setMaxValue(10);
     $numFrag->setInfo($this->lng->txt('lucene_num_frag_info'));
     $numFrag->setValue($this->settings->getFragmentCount());
     $this->form->addItem($numFrag);
     $sizeFrag = new ilNumberInputGUI($this->lng->txt('lucene_size_fragments'), 'fragmentSize');
     $sizeFrag->setRequired(true);
     $sizeFrag->setSize(2);
     $sizeFrag->setMaxLength(4);
     $sizeFrag->setMinValue(10);
     $sizeFrag->setMaxValue(1000);
     $sizeFrag->setInfo($this->lng->txt('lucene_size_frag_info'));
     $sizeFrag->setValue($this->settings->getFragmentSize());
     $this->form->addItem($sizeFrag);
     $maxSub = new ilNumberInputGUI($this->lng->txt('lucene_max_sub'), 'maxSubitems');
     $maxSub->setRequired(true);
     $maxSub->setSize(2);
     $maxSub->setMaxLength(2);
     $maxSub->setMinValue(1);
     $maxSub->setMaxValue(10);
     $maxSub->setInfo($this->lng->txt('lucene_max_sub_info'));
     $maxSub->setValue($this->settings->getMaxSubitems());
     $this->form->addItem($maxSub);
     $relevance = new ilCheckboxInputGUI($this->lng->txt('lucene_relevance'), 'relevance');
     $relevance->setOptionTitle($this->lng->txt('lucene_show_relevance'));
     $relevance->setInfo($this->lng->txt('lucene_show_relevance_info'));
     $relevance->setValue(1);
     $relevance->setChecked($this->settings->isRelevanceVisible());
     $this->form->addItem($relevance);
     // begin-patch mime_filter
     $subrel = new ilCheckboxInputGUI('', 'subrelevance');
     $subrel->setOptionTitle($this->lng->txt('lucene_show_sub_relevance'));
     $subrel->setValue(1);
     $subrel->setChecked($this->settings->isSubRelevanceVisible());
     $relevance->addSubItem($subrel);
     // end-patch mime_filter
     $last_index = new ilDateTimeInputGUI($this->lng->txt('lucene_last_index_time'), 'last_index');
     $last_index->setShowTime(true);
     $last_index->setDate($this->settings->getLastIndexTime());
     $last_index->setInfo($this->lng->txt('lucene_last_index_time_info'));
     $this->form->addItem($last_index);
     return true;
 }
예제 #27
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"));
     }
 }
예제 #28
0
 private function formTimingObject()
 {
     global $ilAccess;
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTableWidth("100%");
     $form->setId("tst_change_workingtime");
     $form->setTitle($this->lng->txt("tst_change_workingtime"));
     // test users
     $participantslist = new ilSelectInputGUI($this->lng->txt('participants'), "participant");
     $participants =& $this->object->getTestParticipants();
     $times = $this->object->getStartingTimeOfParticipants();
     $addons = $this->object->getTimeExtensionsOfParticipants();
     $options = array('' => $this->lng->txt('please_select'), '0' => $this->lng->txt('all_participants'));
     foreach ($participants as $participant) {
         $started = "";
         if ($this->object->getAnonymity()) {
             $name = $this->lng->txt("anonymous");
         } else {
             $name = $participant['lastname'] . ', ' . $participant['firstname'];
         }
         if ($times[$participant['active_id']]) {
             $started = ", " . $this->lng->txt('tst_started') . ': ' . ilDatePresentation::formatDate(new ilDateTime($times[$participant['active_id']], IL_CAL_DATETIME));
         }
         if ($addons[$participant['active_id']] > 0) {
             $started .= ", " . $this->lng->txt('extratime') . ': ' . $addons[$participant['active_id']] . ' ' . $this->lng->txt('minutes');
         }
         $options[$participant['active_id']] = $participant['login'] . ' (' . $name . ')' . $started;
     }
     $participantslist->setRequired(true);
     $participantslist->setOptions($options);
     $form->addItem($participantslist);
     // extra time
     $extratime = new ilNumberInputGUI($this->lng->txt("extratime"), "extratime");
     $extratime->setInfo($this->lng->txt('tst_extratime_info'));
     $extratime->setRequired(true);
     $extratime->setMinValue(0);
     $extratime->setMinvalueShouldBeGreater(false);
     $extratime->setSuffix($this->lng->txt('minutes'));
     $extratime->setSize(5);
     $form->addItem($extratime);
     if (is_array($_POST) && strlen($_POST['cmd']['timing'])) {
         $form->setValuesByArray($_POST);
     }
     if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
         $form->addCommandButton("timing", $this->lng->txt("save"));
     }
     $form->addCommandButton('timingOverview', $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);
 }
예제 #30
0
 /**
  * @param ilPropertyFormGUI $form
  * @return ilPropertyFormGUI
  */
 public function populateQuestionSpecificFormPart(ilPropertyFormGUI $form)
 {
     // shuffle answers
     $shuffleAnswers = new ilCheckboxInputGUI($this->lng->txt("shuffle_answers"), "shuffle_answers_enabled");
     $shuffleAnswers->setChecked($this->object->isShuffleAnswersEnabled());
     $form->addItem($shuffleAnswers);
     if (!$this->object->getSelfAssessmentEditingMode()) {
         // answer mode (single-/multi-line)
         $answerType = new ilSelectInputGUI($this->lng->txt('answer_types'), 'answer_type');
         $answerType->setOptions($this->object->getAnswerTypeSelectOptions($this->lng));
         $answerType->setValue($this->object->getAnswerType());
         $form->addItem($answerType);
     }
     if (!$this->object->getSelfAssessmentEditingMode() && $this->object->isSingleLineAnswerType($this->object->getAnswerType())) {
         // thumb size
         $thumbSize = new ilNumberInputGUI($this->lng->txt('thumb_size'), 'thumb_size');
         $thumbSize->setSuffix($this->lng->txt("thumb_size_unit_pixel"));
         $thumbSize->setInfo($this->lng->txt('thumb_size_info'));
         $thumbSize->setDecimals(false);
         $thumbSize->setMinValue(20);
         $thumbSize->setSize(6);
         $thumbSize->setValue($this->object->getThumbSize());
         $form->addItem($thumbSize);
     }
     // option label
     $optionLabel = new ilRadioGroupInputGUI($this->lng->txt('option_label'), 'option_label');
     $optionLabel->setInfo($this->lng->txt('option_label_info'));
     $optionLabel->setRequired(true);
     $optionLabel->setValue($this->object->getOptionLabel());
     foreach ($this->object->getValidOptionLabelsTranslated($this->lng) as $labelValue => $labelText) {
         $option = new ilRadioOption($labelText, $labelValue);
         $optionLabel->addOption($option);
         if ($this->object->isCustomOptionLabel($labelValue)) {
             $customLabelTrue = new ilTextInputGUI($this->lng->txt('option_label_custom_true'), 'option_label_custom_true');
             $customLabelTrue->setValue($this->object->getCustomTrueOptionLabel());
             $option->addSubItem($customLabelTrue);
             $customLabelFalse = new ilTextInputGUI($this->lng->txt('option_label_custom_false'), 'option_label_custom_false');
             $customLabelFalse->setValue($this->object->getCustomFalseOptionLabel());
             $option->addSubItem($customLabelFalse);
         }
     }
     $form->addItem($optionLabel);
     // points
     $points = new ilNumberInputGUI($this->lng->txt('points'), 'points');
     $points->setRequired(true);
     $points->setSize(3);
     $points->allowDecimals(true);
     $points->setMinValue(0);
     $points->setMinvalueShouldBeGreater(true);
     $points->setValue($this->object->getPoints());
     $form->addItem($points);
     // score partial solution
     $scorePartialSolution = new ilCheckboxInputGUI($this->lng->txt('score_partsol_enabled'), 'score_partsol_enabled');
     $scorePartialSolution->setInfo($this->lng->txt('score_partsol_enabled_info'));
     $scorePartialSolution->setChecked($this->object->isScorePartialSolutionEnabled());
     $form->addItem($scorePartialSolution);
     return $form;
 }