public function addToForm()
 {
     $def = $this->getADT()->getCopyOfDefinition();
     if (!$this->isMulti()) {
         $text = new ilTextInputGUI($this->getTitle(), $this->getElementId());
         if ($def->getMaxLength()) {
             $max = $def->getMaxLength();
             $size = $text->getSize();
             $text->setMaxLength($max);
             if ($size && $max < $size) {
                 $text->setSize($max);
             }
         }
     } else {
         $text = new ilTextAreaInputGUI($this->getTitle(), $this->getElementId());
         if ($this->multi_rows) {
             $text->setRows($this->multi_rows);
         }
         if ($this->multi_cols) {
             $text->setCols($this->multi_cols);
         }
     }
     $this->addBasicFieldProperties($text, $def);
     $text->setValue($this->getADT()->getText());
     $this->addToParentElement($text);
 }
 /**
  * Init form.
  *
  * @param string $a_mode edit mode
  */
 public function initForm($a_mode = "edit")
 {
     global $lng, $ilCtrl;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     // title
     $ti = new ilTextInputGUI($lng->txt("title"), "title");
     $ti->setMaxLength(200);
     $ti->setSize(50);
     $ti->setRequired(true);
     $this->form->addItem($ti);
     // order nr
     $ni = new ilNumberInputGUI($lng->txt("skmg_order_nr"), "order_nr");
     $ni->setMaxLength(6);
     $ni->setSize(6);
     $ni->setRequired(true);
     $this->form->addItem($ni);
     // save and cancel commands
     if ($a_mode == "create") {
         $this->form->addCommandButton("save", $lng->txt("save"));
         $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
         $this->form->setTitle($lng->txt("skmg_create_skll"));
     } else {
         $this->form->addCommandButton("update", $lng->txt("save"));
         $this->form->setTitle($lng->txt("skmg_edit_skll"));
     }
     $ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
     $this->form->setFormAction($ilCtrl->getFormAction($this));
 }
 public function showTrustees($a_show_delete = false)
 {
     global $ilToolbar;
     $_SESSION['paya_delete_trustee'] = $_SESSION['paya_delete_trustee'] ? $_SESSION['paya_delete_trustee'] : array();
     $actions = array(0 => $this->lng->txt("paya_disabled"), 1 => $this->lng->txt("paya_enabled"));
     include_once "./Services/Form/classes/class.ilTextInputGUI.php";
     $ul = new ilTextInputGUI($this->lng->txt("user"), "search_str");
     $ul->setDataSource($this->ctrl->getLinkTarget($this, "performSearch", "", true));
     $ul->setSize(20);
     $ilToolbar->addInputItem($ul, true);
     $ilToolbar->addFormButton($this->lng->txt("add"), "performSearch");
     $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
     $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment');
     if ($a_show_delete) {
         $oConfirmationGUI = new ilConfirmationGUI();
         // set confirm/cancel commands
         $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this, "performDeleteTrustee"));
         $oConfirmationGUI->setHeaderText($this->lng->txt("paya_sure_delete_selected_trustees"));
         $oConfirmationGUI->setCancel($this->lng->txt("cancel"), "cancelDelete");
         $oConfirmationGUI->setConfirm($this->lng->txt("confirm"), "performDeleteTrustee");
         foreach ($this->trustee_obj->getTrustees() as $trustee) {
             $delete_row = '';
             if (in_array($trustee['trustee_id'], $_POST['trustee'])) {
                 if ($tmp_obj = ilObjectFactory::getInstanceByObjId($trustee['trustee_id'], false)) {
                     $delete_row = $tmp_obj->getLogin() . ' -> ' . $tmp_obj->getFirstname() . ' ' . $tmp_obj->getLastname();
                 }
             }
             $oConfirmationGUI->addItem('', $delete_row, $delete_row);
         }
         $this->tpl->setVariable("CONFIRMATION", $oConfirmationGUI->getHTML());
     }
     if (!count($this->trustee_obj->getTrustees())) {
         ilUtil::sendInfo($this->lng->txt('paya_no_trustees'));
         return true;
     }
     $counter = 0;
     $f_result = array();
     require_once 'Services/Mail/classes/class.ilMailFormCall.php';
     foreach ($this->trustee_obj->getTrustees() as $trustee) {
         // GET USER OBJ
         if ($tmp_obj = ilObjectFactory::getInstanceByObjId($trustee['trustee_id'], false)) {
             $f_result[$counter]['trustee_id'] = ilUtil::formCheckbox(in_array($trustee['trustee_id'], $_SESSION['paya_delete_trustee']) ? 1 : 0, "trustee[]", $trustee['trustee_id']);
             $f_result[$counter]['login'] = $tmp_obj->getLogin();
             $f_result[$counter]['firstname'] = $tmp_obj->getFirstname();
             $f_result[$counter]['lastname'] = $tmp_obj->getLastname();
             $f_result[$counter]['perm_stat'] = ilUtil::formSelect((int) $trustee['perm_stat'], 'perm_stat[' . $trustee['trustee_id'] . ']', $actions, false, true);
             $f_result[$counter]['perm_obj'] = ilUtil::formSelect((int) $trustee['perm_obj'], 'perm_obj[' . $trustee['trustee_id'] . ']', $actions, false, true);
             $f_result[$counter]['perm_coupons'] = ilUtil::formSelect((int) $trustee['perm_coupons'], 'perm_coupons[' . $trustee['trustee_id'] . ']', $actions, false, true);
             #				$link_mail = "<a target=\"_blank\" href=\"./ilias.php?baseClass=ilMailGUI&type=new&rcp_to=".
             #					$tmp_obj->getLogin()."\"".$img_mail."</a>";
             $url_mail = ilMailFormCall::getLinkTarget($this, '', array(), array('type' => 'new', 'rcp_to' => $tmp_obj->getLogin()));
             $link_mail = "<div class=\"il_ContainerItemCommands\"><a class=\"il_ContainerItemCommand\" href=\"" . $url_mail . "\">" . $this->lng->txt("mail") . "</a></div>";
             $f_result[$counter]['options'] = $link_mail;
             unset($tmp_obj);
             ++$counter;
         }
     }
     return $this->__showTrusteesTable($f_result);
 }
 public function addToForm()
 {
     $text = new ilTextInputGUI($this->getTitle(), $this->getElementId());
     $text->setSize(20);
     $text->setMaxLength(512);
     $text->setSubmitFormOnEnter(true);
     $text->setValue($this->getADT()->getText());
     $this->addToParentElement($text);
 }
 /**
  * Init configuration form.
  *
  * @return object form object
  */
 public function initConfigurationForm()
 {
     global $lng, $ilCtrl, $ilDB;
     $pl = $this->getPluginObject();
     $this->getPluginObject()->includeClass('class.ilOpenmeetingsConfig.php');
     $this->object = ilOpenmeetingsConfig::getInstance();
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     $this->form->setTitle($pl->txt("openmeetings_plugin_configuration"));
     $this->form->setFormAction($ilCtrl->getFormAction($this));
     $this->form->addCommandButton("save", $lng->txt("save"));
     // url (text)
     $ti = new ilTextInputGUI($pl->txt("url"), "frmurl");
     $ti->setRequired(true);
     $ti->setMaxLength(256);
     $ti->setSize(60);
     $this->form->addItem($ti);
     // port (text)
     $ti = new ilTextInputGUI($pl->txt("port"), "frmport");
     $ti->setRequired(true);
     $ti->setMaxLength(10);
     $ti->setSize(10);
     $this->form->addItem($ti);
     // appname
     $ti = new ilTextInputGUI($pl->txt("appname"), "frmappname");
     $ti->setRequired(true);
     $ti->setMaxLength(32);
     $ti->setSize(20);
     $this->form->addItem($ti);
     // username (text)
     $ti = new ilTextInputGUI($pl->txt("username"), "frmusername");
     $ti->setRequired(true);
     $ti->setMaxLength(256);
     $ti->setSize(20);
     $this->form->addItem($ti);
     // password (text)
     $ti = new ilPasswordInputGUI($pl->txt("password"), "frmpassword");
     $ti->setRequired(true);
     $ti->setMaxLength(256);
     $ti->setSize(20);
     $ti->setRetype(false);
     $this->form->addItem($ti);
     foreach ($this->fields as $key => $item) {
         $field = new $item["type"]($this->plugin_object->txt('conf_' . $key), $key);
         $field->setInfo($this->plugin_object->txt($item["info"]));
         if (is_array($item["subelements"])) {
             foreach ($item["subelements"] as $subkey => $subitem) {
                 $subfield = new $subitem["type"]($this->plugin_object->txt('conf_' . $key . "_" . $subkey), $subkey);
                 $subfield->setInfo($this->plugin_object->txt($subitem["info"]));
                 $field->addSubItem($subfield);
             }
         }
         $this->form->addItem($field);
     }
     return $this->form;
 }
 /**
  * Init filter
  */
 function initFilter()
 {
     global $lng, $rbacreview, $ilUser;
     // title
     include_once "./Services/Form/classes/class.ilTextInputGUI.php";
     $ti = new ilTextInputGUI($lng->txt("title"), "title");
     $ti->setMaxLength(64);
     $ti->setSize(20);
     $ti->setValidationRegexp('/^[^%]+$/is');
     $this->addFilterItem($ti);
     $ti->readFromSession();
     $this->filter["title"] = $ti->getValue();
 }
 /**
  * Init Social Bookmark edit/create Form
  *
  * @param        ilObjectGUI	$formhandlerObject        taken as form target
  * @param        int        	$mode        "create" / "edit"
  */
 public static function _initForm($formhandlerObject, $mode = "create", $id = 0)
 {
     global $lng, $ilCtrl;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setMultipart(true);
     // File Title
     $in_title = new ilTextInputGUI($lng->txt("title"), "title");
     $in_title->setMaxLength(128);
     $in_title->setSize(40);
     $in_title->setRequired(true);
     $form->addItem($in_title);
     // Link
     $in_link = new ilTextInputGUI($lng->txt("link"), "link");
     $in_link->setMaxLength(300);
     $in_link->setSize(40);
     $in_link->setRequired(true);
     $in_link->setInfo($lng->txt('socialbm_link_description'));
     $form->addItem($in_link);
     // File
     $in_file = new ilFileInputGUI($lng->txt("file"), "image_file");
     $in_file->setSuffixes(array('bmp', 'gif', 'jpg', 'jpeg', 'png'));
     $form->addItem($in_file);
     // Activate on submit
     $in_activate = new ilCheckboxInputGUI($lng->txt("activate"), "activate");
     $in_activate->setValue('1');
     $form->addItem($in_activate);
     // save and cancel commands
     if ($mode == "create") {
         $form->addCommandButton("createSocialBookmark", $lng->txt("create"));
         $form->addCommandButton("editSocialBookmarks", $lng->txt("cancel"));
         $form->setTitle($lng->txt("adm_social_bm_create"));
         $in_file->setRequired(true);
     } else {
         if ($mode == "update") {
             $in_hidden = new ilHiddenInputGUI("sbm_id", $id);
             $form->addItem($in_hidden);
             $form->addCommandButton("updateSocialBookmark", $lng->txt("update"));
             $form->addCommandButton("cancel", $lng->txt("cancel"));
             $form->setTitle($lng->txt("adm_social_bm_edit"));
             $in_file->setRequired(false);
         }
     }
     $form->setTableWidth("60%");
     $form->setFormAction($ilCtrl->getFormAction($formhandlerObject));
     return $form;
 }
 function owner()
 {
     $this->__initSubTabs("owner");
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this, "owner"));
     $form->setTitle($this->lng->txt("info_owner_of_object"));
     $login = new ilTextInputGUI($this->lng->txt("login"), "owner");
     $login->setDataSource($this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilRepositorySearchGUI'), 'doUserAutoComplete', '', true));
     $login->setRequired(true);
     $login->setSize(50);
     $login->setInfo($this->lng->txt("chown_warning"));
     $login->setValue(ilObjUser::_lookupLogin($this->gui_obj->object->getOwner()));
     $form->addItem($login);
     $form->addCommandButton("changeOwner", $this->lng->txt("change_owner"));
     $this->tpl->setContent($form->getHTML());
 }
 /**
  * Init configuration form.
  *
  * @return object form object
  */
 public function initConfigurationForm()
 {
     global $lng, $ilCtrl;
     $pl = $this->getPluginObject();
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     // setting 1 (a checkbox)
     $cb = new ilCheckboxInputGUI($pl->txt("setting_1"), "setting_1");
     $form->addItem($cb);
     // setting 2 (text)
     $ti = new ilTextInputGUI($pl->txt("setting_2"), "setting_2");
     $ti->setRequired(true);
     $ti->setMaxLength(10);
     $ti->setSize(10);
     $form->addItem($ti);
     $form->addCommandButton("save", $lng->txt("save"));
     $form->setTitle($pl->txt("example_plugin_configuration"));
     $form->setFormAction($ilCtrl->getFormAction($this));
     return $form;
 }
 /**
  * Init filter
  */
 public function initFilter()
 {
     global $lng;
     $this->setDisableFilterHiding(true);
     // object type selection
     include_once "./Services/Form/classes/class.ilSelectInputGUI.php";
     $si = new ilSelectInputGUI($lng->txt("obj_type"), "type");
     $si->setOptions($this->getPossibleTypes(true, false, true));
     $this->addFilterItem($si);
     $si->readFromSession();
     if (!$si->getValue()) {
         $si->setValue("crs");
     }
     $this->filter["type"] = $si->getValue();
     // title/description
     include_once "./Services/Form/classes/class.ilTextInputGUI.php";
     $ti = new ilTextInputGUI($lng->txt("trac_title_description"), "query");
     $ti->setMaxLength(64);
     $ti->setSize(20);
     $this->addFilterItem($ti);
     $ti->readFromSession();
     $this->filter["query"] = $ti->getValue();
     // read_count/spent_seconds
     $si = new ilSelectInputGUI($lng->txt("trac_figure"), "figure");
     $si->setOptions(array("read_count" => $lng->txt("trac_read_count"), "spent_seconds" => $lng->txt("trac_spent_seconds")));
     $this->addFilterItem($si);
     $si->readFromSession();
     if (!$si->getValue()) {
         $si->setValue("read_count");
     }
     $this->filter["measure"] = $si->getValue();
     // year/month
     $si = new ilSelectInputGUI($lng->txt("year") . " / " . $lng->txt("month"), "yearmonth");
     $si->setOptions($this->getMonthsFilter());
     $this->addFilterItem($si);
     $si->readFromSession();
     if (!$si->getValue()) {
         $si->setValue(date("Y-m"));
     }
     $this->filter["yearmonth"] = $si->getValue();
 }
 /**
  * Init configuration form.
  *
  * @return object form object
  */
 public function initConfigurationForm()
 {
     global $lng, $ilCtrl;
     $pl = $this->getPluginObject();
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     // Setting for the ephorus logging
     $ephorus_logging = new ilCheckboxInputGUI($pl->txt("ephorus_logging"), "ephorus_logging");
     $ephorus_logging->setValue(1);
     $ephorus_logging->setInfo($pl->txt("ephorus_logging_description"));
     $form->addItem($ephorus_logging);
     // Setting for the hand-in code
     $handin_code = new ilTextInputGUI($pl->txt("handin_code"), "handin_code");
     $handin_code->setRequired(true);
     $form->addItem($handin_code);
     // Setting for the hand-in address
     $handin_address = new ilTextInputGUI($pl->txt("handin_address"), "handin_address");
     $handin_address->setSize(80);
     $handin_address->setRequired(true);
     $form->addItem($handin_address);
     // Setting for the index address
     $index_address = new ilTextInputGUI($pl->txt("index_address"), "index_address");
     $index_address->setSize(80);
     $index_address->setRequired(true);
     $form->addItem($index_address);
     // Setting for the processtype
     $processtype = new ilSelectInputGUI($pl->txt("default_processtype"), "processtype");
     $processtype->setOptions(array(1 => $pl->txt("default"), 3 => $pl->txt("private")));
     $processtype->setInfo($pl->txt("default_processtype_description"));
     $form->addItem($processtype);
     // Setting for the disclosure
     $disclosure = new ilTextAreaInputGUI($pl->txt("disclosure"), "disclosure");
     $disclosure->setCols(79);
     $disclosure->setRows(4);
     $form->addItem($disclosure);
     $form->addCommandButton("save", $lng->txt("save") . " / " . $pl->txt("check_connection"));
     $form->setTitle($pl->txt("ephorus_plugin_configuration"));
     $form->setFormAction($ilCtrl->getFormAction($this));
     return $form;
 }
 /**
  * get html
  *
  * @access public
  * @param
  * @return
  */
 public function initForm()
 {
     $rec = new ilSelectInputGUI($this->lng->txt('cal_recurrences'), 'frequence');
     $rec->setRequired(true);
     $rec->setOptions(array(0 => $this->lng->txt('cal_no_recurrence'), ilCalendarRecurrence::FREQ_DAILY => $this->lng->txt('cal_rec_daily'), ilCalendarRecurrence::FREQ_WEEKLY => $this->lng->txt('cal_rec_weekly'), ilCalendarRecurrence::FREQ_MONTHLY => $this->lng->txt('cal_rec_monthly'), ilCalendarRecurrence::FREQ_YEARLY => $this->lng->txt('cal_rec_yearly')));
     $rec->setValue($this->recurrence->getFrequenceType());
     $this->form->addItem($rec);
     // DAILY part
     $interval = new ilTextInputGUI($this->lng->txt('interval'), 'interval');
     $interval->setSize(2);
     $interval->setMaxLength(3);
     $interval->setValue($this->recurrence->getInterval() ? $this->recurrence->getInterval() : 1);
     $interval->setInfo($this->lng->txt('interval_info'));
     $rec->addSubItem($interval);
     // Weekly
     $check = new ilCheckboxInputGUI($this->lng->txt('Su_short'), 'w_day[0]');
     $check->setChecked(true);
     $rec->addSubItem($check);
     $check = new ilCheckboxInputGUI($this->lng->txt('Mo_short'), 'w_day[1]');
     $check->setChecked(true);
     $rec->addSubItem($check);
     $check = new ilCheckboxInputGUI($this->lng->txt('Tu_short'), 'w_day[2]');
     $check->setChecked(true);
     $rec->addSubItem($check);
     $check = new ilCheckboxInputGUI($this->lng->txt('We_short'), 'w_day[3]');
     $check->setChecked(true);
     $rec->addSubItem($check);
     $check = new ilCheckboxInputGUI($this->lng->txt('Th_short'), 'w_day[4]');
     $check->setChecked(true);
     $rec->addSubItem($check);
     $check = new ilCheckboxInputGUI($this->lng->txt('Fr_short'), 'w_day[5]');
     $check->setChecked(true);
     $rec->addSubItem($check);
     $check = new ilCheckboxInputGUI($this->lng->txt('Sa_short'), 'w_day[6]');
     $check->setChecked(true);
     $rec->addSubItem($check);
 }
 /**
  * Init filter
  */
 function initFilter()
 {
     global $lng, $rbacreview, $ilUser, $ilDB;
     // term
     include_once "./Services/Form/classes/class.ilTextInputGUI.php";
     $ti = new ilTextInputGUI($lng->txt("cont_term"), "term");
     $ti->setMaxLength(64);
     $ti->setSize(20);
     $ti->setSubmitFormOnEnter(true);
     $this->addFilterItem($ti);
     $ti->readFromSession();
     $this->filter["term"] = $ti->getValue();
     // definition
     if ($ilDB->getDBType() != "oracle") {
         include_once "./Services/Form/classes/class.ilTextInputGUI.php";
         $ti = new ilTextInputGUI($lng->txt("cont_definition"), "defintion");
         $ti->setMaxLength(64);
         $ti->setSize(20);
         $ti->setSubmitFormOnEnter(true);
         $this->addFilterItem($ti);
         $ti->readFromSession();
         $this->filter["definition"] = $ti->getValue();
     }
 }
 public function showTopicForm()
 {
     $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment');
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     if ($this->objCurrentTopic->getId()) {
         $this->ctrl->setParameter($this, 'topic_id', $this->objCurrentTopic->getId());
     }
     $form->setFormAction($this->ctrl->getFormAction($this, 'saveTopic'));
     $form->setTitle($this->lng->txt($this->objCurrentTopic->getId() ? 'edit_topic' : 'new_topic'));
     $title = new ilTextInputGUI($this->lng->txt('title'), 'title');
     $title->setValue($this->objCurrentTopic->getTitle());
     $title->setRequired(true);
     $form->addItem($title);
     $sorting = new ilTextInputGUI($this->lng->txt('pay_sorting_value'), 'sorting');
     $sorting->setValue($this->objCurrentTopic->getSorting());
     $sorting->setMaxLength(11);
     $sorting->setSize(11);
     $form->addItem($sorting);
     $form->addCommandButton('saveTopic', $this->lng->txt('save'));
     $form->addCommandButton('showTopicsList', $this->lng->txt('cancel'));
     $this->tpl->setVariable('FORM', $form->getHTML());
     return true;
 }
 public function initFormSearch()
 {
     global $ilCtrl;
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($this->ctrl->getFormAction($this, 'search'));
     $this->form->setTitle($this->getTitle());
     $this->form->addCommandButton('performSearch', $this->lng->txt('search'));
     $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
     $kind = new ilRadioGroupInputGUI($this->lng->txt('search_type'), 'search_for');
     $kind->setValue($this->search_type);
     $this->form->addItem($kind);
     // Users
     $users = new ilRadioOption($this->lng->txt('search_for_users'), 'usr');
     // UDF
     include_once 'Services/Search/classes/class.ilUserSearchOptions.php';
     foreach (ilUserSearchOptions::_getSearchableFieldsInfo(!$this->isSearchableCheckEnabled()) as $info) {
         switch ($info['type']) {
             case FIELD_TYPE_UDF_SELECT:
             case FIELD_TYPE_SELECT:
                 $sel = new ilSelectInputGUI($info['lang'], "rep_query[usr][" . $info['db'] . "]");
                 $sel->setOptions($info['values']);
                 $users->addSubItem($sel);
                 break;
             case FIELD_TYPE_UDF_TEXT:
             case FIELD_TYPE_TEXT:
                 if (isset($info['autoComplete']) and $info['autoComplete']) {
                     $ilCtrl->setParameterByClass(get_class($this), 'autoCompleteField', $info['db']);
                     $ul = new ilTextInputGUI($info['lang'], "rep_query[usr][" . $info['db'] . "]");
                     $ul->setDataSource($ilCtrl->getLinkTarget($this, "doUserAutoComplete", "", true));
                     $ul->setSize(30);
                     $ul->setMaxLength(120);
                     $users->addSubItem($ul);
                 } else {
                     $txt = new ilTextInputGUI($info['lang'], "rep_query[usr][" . $info['db'] . "]");
                     $txt->setSize(30);
                     $txt->setMaxLength(120);
                     $users->addSubItem($txt);
                 }
                 break;
         }
     }
     $kind->addOption($users);
     // Role
     $roles = new ilRadioOption($this->lng->txt('search_for_role_members'), 'role');
     $role = new ilTextInputGUI($this->lng->txt('search_role_title'), 'rep_query[role][title]');
     $role->setSize(30);
     $role->setMaxLength(120);
     $roles->addSubItem($role);
     $kind->addOption($roles);
     // Course
     $groups = new ilRadioOption($this->lng->txt('search_for_crs_members'), 'crs');
     $group = new ilTextInputGUI($this->lng->txt('search_crs_title'), 'rep_query[crs][title]');
     $group->setSize(30);
     $group->setMaxLength(120);
     $groups->addSubItem($group);
     $kind->addOption($groups);
     // Group
     $groups = new ilRadioOption($this->lng->txt('search_for_grp_members'), 'grp');
     $group = new ilTextInputGUI($this->lng->txt('search_grp_title'), 'rep_query[grp][title]');
     $group->setSize(30);
     $group->setMaxLength(120);
     $groups->addSubItem($group);
     $kind->addOption($groups);
 }
Beispiel #16
0
 /**
  * Init object edit form
  *
  * @return ilPropertyFormGUI
  */
 protected function initEditForm()
 {
     global $lng, $ilCtrl;
     $lng->loadLanguageModule($this->object->getType());
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this, "update"));
     $form->setTitle($this->lng->txt($this->object->getType() . "_edit"));
     // title
     $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
     $ti->setSize(min(40, ilObject::TITLE_LENGTH));
     $ti->setMaxLength(ilObject::TITLE_LENGTH);
     $ti->setRequired(true);
     $form->addItem($ti);
     // description
     $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
     $ta->setCols(40);
     $ta->setRows(2);
     $form->addItem($ta);
     $this->initEditCustomForm($form);
     $form->addCommandButton("update", $this->lng->txt("save"));
     //$this->form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
     return $form;
 }
 private function initVatForm($a_type = 'create')
 {
     $this->form = new ilPropertyFormGUI();
     if ($a_type == 'edit') {
         $this->ctrl->setParameter($this, 'vat_id', $_GET['vat_id']);
         $this->form->setFormAction($this->ctrl->getFormAction($this, 'updateVat'));
         $this->form->setTitle($this->lng->txt('payment_edit_vat'));
     } else {
         $this->form->setFormAction($this->ctrl->getFormAction($this, 'saveVat'));
         $this->form->setTitle($this->lng->txt('payment_add_vat'));
     }
     $oTitle = new ilTextInputGUI($this->lng->txt('title'), 'vat_title');
     $oTitle->setMaxLength(255);
     $oTitle->setSize(40);
     $oTitle->setRequired(true);
     $oTitle->setInfo($this->lng->txt('payment_vat_title_info'));
     $this->form->addItem($oTitle);
     $oRate = new ilTextInputGUI($this->lng->txt('vat_rate'), 'vat_rate');
     $oRate->setMaxLength(5);
     $oRate->setSize(5);
     $oRate->setRequired(true);
     $oRate->setInfo($this->lng->txt('payment_vat_rate_info'));
     $this->form->addItem($oRate);
     if ($a_type == 'edit') {
         $this->form->addCommandButton('updateVat', $this->lng->txt('save'));
     } else {
         $this->form->addCommandButton('saveVat', $this->lng->txt('save'));
     }
     $this->form->addCommandButton('vats', $this->lng->txt('cancel'));
 }
 /**
  * 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;
 }
 protected function initSearchForm()
 {
     global $ilCtrl;
     if ($_GET["ref"] != "wsp") {
         $this->saveMailData();
         $title = $this->lng->txt('search_recipients');
     } else {
         $this->lng->loadLanguageModule("wsp");
         $title = $this->lng->txt("wsp_share_search_users");
     }
     // searchform
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setTitle($title);
     $form->setId('search_rcp');
     $form->setFormAction($ilCtrl->getFormAction($this, 'search'));
     $inp = new ilTextInputGUI($this->lng->txt("search_for"), 'search');
     $inp->setSize(30);
     $dsDataLink = $ilCtrl->getLinkTarget($this, 'lookupRecipientAsync', '', true, false);
     $inp->setDataSource($dsDataLink);
     if (strlen(trim($_SESSION["mail_search_search"])) > 0) {
         $inp->setValue(ilUtil::prepareFormOutput(trim($_SESSION["mail_search_search"]), true));
     }
     $form->addItem($inp);
     $form->addCommandButton('search', $this->lng->txt("search"));
     $form->addCommandButton('cancel', $this->lng->txt("cancel"));
     return $form;
 }
 public function initForm($a_as_multi_assignment = FALSE)
 {
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setTitle($this->lng->txt('crs_loc_tst_assignment'));
     $form->setFormAction($this->ctrl->getFormAction($this->getGUI()));
     if ($a_as_multi_assignment) {
         $form->addCommandButton('saveMultiTestAssignment', $this->lng->txt('save'));
     } else {
         $form->addCommandButton('saveTest', $this->lng->txt('save'));
     }
     switch ($this->getTestType()) {
         case ilLOSettings::TYPE_TEST_INITIAL:
             $form->setTitle($this->lng->txt('crs_loc_settings_itest_tbl'));
             break;
         case ilLOSettings::TYPE_TEST_QUALIFIED:
             $form->setTitle($this->lng->txt('crs_loc_settings_qtest_tbl'));
             break;
     }
     $assignable = $this->getAssignableTests();
     $cr_mode = new ilRadioGroupInputGUI($this->lng->txt('crs_loc_form_assign_it'), 'mode');
     $cr_mode->setRequired(true);
     $cr_mode->setValue(self::TEST_NEW);
     $new = new ilRadioOption($this->lng->txt('crs_loc_form_tst_new'), self::TEST_NEW);
     switch ($this->getTestType()) {
         case ilLOSettings::TYPE_TEST_INITIAL:
             $new->setInfo($this->lng->txt("crs_loc_form_tst_new_initial_info"));
             break;
         case ilLOSettings::TYPE_TEST_QUALIFIED:
             $new->setInfo($this->lng->txt("crs_loc_form_tst_new_qualified_info"));
             break;
     }
     // title
     $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
     $ti->setMaxLength(128);
     $ti->setSize(40);
     $ti->setRequired(true);
     $new->addSubItem($ti);
     // description
     $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
     $ta->setCols(40);
     $ta->setRows(2);
     $new->addSubItem($ta);
     // Question assignment type
     include_once './Modules/Test/classes/class.ilObjTest.php';
     $this->lng->loadLanguageModule('assessment');
     $qst = new ilRadioGroupInputGUI($this->lng->txt('tst_question_set_type'), 'qtype');
     $qst->setRequired(true);
     $random = new ilRadioOption($this->lng->txt('tst_question_set_type_random'), ilObjTest::QUESTION_SET_TYPE_RANDOM);
     $qst->addOption($random);
     $fixed = new ilRadioOption($this->lng->txt('tst_question_set_type_fixed'), ilObjTest::QUESTION_SET_TYPE_FIXED);
     $qst->addOption($fixed);
     $new->addSubItem($qst);
     $cr_mode->addOption($new);
     // assign existing
     $existing = new ilRadioOption($this->lng->txt('crs_loc_form_assign'), self::TEST_ASSIGN);
     switch ($this->getTestType()) {
         case ilLOSettings::TYPE_TEST_INITIAL:
             $existing->setInfo($this->lng->txt("crs_loc_form_assign_initial_info"));
             break;
         case ilLOSettings::TYPE_TEST_QUALIFIED:
             $existing->setInfo($this->lng->txt("crs_loc_form_assign_qualified_info"));
             break;
     }
     if (!$assignable) {
         $existing->setDisabled(true);
     }
     $cr_mode->addOption($existing);
     $options = array();
     $options[''] = $this->lng->txt('select_one');
     foreach ((array) $assignable as $tst_ref_id) {
         $tst_obj_id = ilObject::_lookupObjId($tst_ref_id);
         $options[$tst_ref_id] = ilObject::_lookupTitle($tst_obj_id);
     }
     $selectable = new ilSelectInputGUI($this->lng->txt('crs_loc_form_available_tsts'), 'tst');
     $selectable->setRequired(true);
     $selectable->setOptions($options);
     $existing->addSubItem($selectable);
     $form->addItem($cr_mode);
     if ($a_as_multi_assignment) {
         include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
         $assignments = ilLOTestAssignments::getInstance($this->getContainer()->getId());
         include_once './Modules/Course/classes/class.ilCourseObjective.php';
         $objective_ids = ilCourseObjective::_getObjectiveIds($this->getContainer()->getId(), FALSE);
         $options = array();
         $options[''] = $this->lng->txt('select_one');
         foreach ($objective_ids as $oid) {
             $already_assigned_tst = $assignments->getTestByObjective($oid, $this->getTestType());
             if (!$already_assigned_tst) {
                 $options[$oid] = ilCourseObjective::lookupObjectiveTitle($oid);
             }
         }
         $objective = new ilSelectInputGUI($this->lng->txt('crs_objectives'), 'objective');
         $objective->setRequired(TRUE);
         $objective->setOptions($options);
         $form->addItem($objective);
     }
     return $form;
 }
 /**
  * Show export IDs overview
  *
  * @param
  * @return
  */
 function showTooltipList()
 {
     global $tpl, $ilToolbar, $ilCtrl, $lng;
     $this->setTabs();
     $this->setContentSubTabs("help_tooltips");
     $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
     include_once "./Services/Form/classes/class.ilTextInputGUI.php";
     $ti = new ilTextInputGUI($this->lng->txt("help_tooltip_id"), "tooltip_id");
     $ti->setMaxLength(200);
     $ti->setSize(20);
     $ilToolbar->addInputItem($ti, true);
     $ilToolbar->addFormButton($lng->txt("add"), "addTooltip");
     $ilToolbar->addSeparator();
     include_once "./Services/Form/classes/class.ilSelectInputGUI.php";
     $options = ilHelp::getTooltipComponents();
     if (ilSession::get("help_tt_comp") != "") {
         $options[ilSession::get("help_tt_comp")] = ilSession::get("help_tt_comp");
     }
     $si = new ilSelectInputGUI($this->lng->txt("help_component"), "help_tt_comp");
     $si->setOptions($options);
     $si->setValue(ilSession::get("help_tt_comp"));
     $ilToolbar->addInputItem($si, true);
     $ilToolbar->addFormButton($lng->txt("help_filter"), "filterTooltips");
     include_once "./Modules/LearningModule/classes/class.ilHelpTooltipTableGUI.php";
     $tbl = new ilHelpTooltipTableGUI($this, "showTooltipList", ilSession::get("help_tt_comp"));
     $tpl->setContent($tbl->getHTML());
 }
 /**
  * init general settings form
  * @return 
  */
 protected function initFormGeneralSettings()
 {
     global $ilSetting;
     $this->setSubTabs('settings');
     $this->tabs_gui->setTabActive('settings');
     $this->tabs_gui->setSubTabActive('general_settings');
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($this->ctrl->getFormAction($this, 'saveGeneralSettings'));
     $this->form->setTitle($this->lng->txt('general_settings'));
     $lua = new ilCheckboxInputGUI($this->lng->txt('enable_local_user_administration'), 'lua');
     $lua->setInfo($this->lng->txt('enable_local_user_administration_info'));
     $lua->setValue(1);
     $this->form->addItem($lua);
     $lrua = new ilCheckboxInputGUI($this->lng->txt('restrict_user_access'), 'lrua');
     $lrua->setInfo($this->lng->txt('restrict_user_access_info'));
     $lrua->setValue(1);
     $this->form->addItem($lrua);
     // enable alphabetical navigation in user administration
     $alph = new ilCheckboxInputGUI($this->lng->txt('user_adm_enable_alpha_nav'), 'user_adm_alpha_nav');
     //$alph->setInfo($this->lng->txt('restrict_user_access_info'));
     $alph->setValue(1);
     $this->form->addItem($alph);
     // account codes
     $code = new ilCheckboxInputGUI($this->lng->txt("user_account_code_setting"), "user_reactivate_code");
     $code->setInfo($this->lng->txt('user_account_code_setting_info'));
     $this->form->addItem($code);
     // delete own account
     $own = new ilCheckboxInputGUI($this->lng->txt("user_allow_delete_own_account"), "user_own_account");
     $this->form->addItem($own);
     $own_email = new ilEMailInputGUI($this->lng->txt("user_delete_own_account_notification_email"), "user_own_account_email");
     $own->addSubItem($own_email);
     // BEGIN SESSION SETTINGS
     // create session handling radio group
     $ssettings = new ilRadioGroupInputGUI($this->lng->txt('sess_mode'), 'session_handling_type');
     // first option, fixed session duration
     $fixed = new ilRadioOption($this->lng->txt('sess_fixed_duration'), ilSession::SESSION_HANDLING_FIXED);
     // create session reminder subform
     $cb = new ilCheckboxInputGUI($this->lng->txt("session_reminder"), "session_reminder_enabled");
     $expires = ilSession::getSessionExpireValue();
     $time = ilFormat::_secondsToString($expires, true);
     $cb->setInfo($this->lng->txt("session_reminder_info") . "<br />" . sprintf($this->lng->txt('session_reminder_session_duration'), $time));
     $fixed->addSubItem($cb);
     // add session handling to radio group
     $ssettings->addOption($fixed);
     // second option, session control
     $ldsh = new ilRadioOption($this->lng->txt('sess_load_dependent_session_handling'), ilSession::SESSION_HANDLING_LOAD_DEPENDENT);
     // add session control subform
     require_once 'Services/Authentication/classes/class.ilSessionControl.php';
     // this is the max count of active sessions
     // that are getting started simlutanously
     $sub_ti = new ilTextInputGUI($this->lng->txt('session_max_count'), 'session_max_count');
     $sub_ti->setMaxLength(5);
     $sub_ti->setSize(5);
     $sub_ti->setInfo($this->lng->txt('session_max_count_info'));
     if (!$ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE)) {
         $sub_ti->setDisabled(true);
     }
     $ldsh->addSubItem($sub_ti);
     // after this (min) idle time the session can be deleted,
     // if there are further requests for new sessions,
     // but max session count is reached yet
     $sub_ti = new ilTextInputGUI($this->lng->txt('session_min_idle'), 'session_min_idle');
     $sub_ti->setMaxLength(5);
     $sub_ti->setSize(5);
     $sub_ti->setInfo($this->lng->txt('session_min_idle_info'));
     if (!$ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE)) {
         $sub_ti->setDisabled(true);
     }
     $ldsh->addSubItem($sub_ti);
     // after this (max) idle timeout the session expires
     // and become invalid, so it is not considered anymore
     // when calculating current count of active sessions
     $sub_ti = new ilTextInputGUI($this->lng->txt('session_max_idle'), 'session_max_idle');
     $sub_ti->setMaxLength(5);
     $sub_ti->setSize(5);
     $sub_ti->setInfo($this->lng->txt('session_max_idle_info'));
     if (!$ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE)) {
         $sub_ti->setDisabled(true);
     }
     $ldsh->addSubItem($sub_ti);
     // this is the max duration that can elapse between the first and the secnd
     // request to the system before the session is immidietly deleted
     $sub_ti = new ilTextInputGUI($this->lng->txt('session_max_idle_after_first_request'), 'session_max_idle_after_first_request');
     $sub_ti->setMaxLength(5);
     $sub_ti->setSize(5);
     $sub_ti->setInfo($this->lng->txt('session_max_idle_after_first_request_info'));
     if (!$ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE)) {
         $sub_ti->setDisabled(true);
     }
     $ldsh->addSubItem($sub_ti);
     // add session control to radio group
     $ssettings->addOption($ldsh);
     // add radio group to form
     if ($ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE)) {
         // just shows the status wether the session
         //setting maintenance is allowed by setup
         $this->form->addItem($ssettings);
     } else {
         // just shows the status wether the session
         //setting maintenance is allowed by setup
         $ti = new ilNonEditableValueGUI($this->lng->txt('session_config'), "session_config");
         $ti->setValue($this->lng->txt('session_config_maintenance_disabled'));
         $ssettings->setDisabled(true);
         $ti->addSubItem($ssettings);
         $this->form->addItem($ti);
     }
     // END SESSION SETTINGS
     $this->lng->loadLanguageModule('ps');
     $pass = new ilFormSectionHeaderGUI();
     $pass->setTitle($this->lng->txt('ps_password_settings'));
     $this->form->addItem($pass);
     // password generation
     $cb = new ilCheckboxInputGUI($this->lng->txt("passwd_generation"), "passwd_auto_generate");
     $cb->setChecked($ilSetting->get("passwd_auto_generate"));
     $cb->setInfo($this->lng->txt("passwd_generation_info"));
     $this->form->addItem($cb);
     $check = new ilCheckboxInputGUI($this->lng->txt('ps_password_change_on_first_login_enabled'), 'password_change_on_first_login_enabled');
     $check->setInfo($this->lng->txt('ps_password_change_on_first_login_enabled_info'));
     $this->form->addItem($check);
     include_once './Services/PrivacySecurity/classes/class.ilSecuritySettings.php';
     $check = new ilCheckboxInputGUI($this->lng->txt('ps_password_must_not_contain_loginame'), 'password_must_not_contain_loginame');
     $check->setInfo($this->lng->txt('ps_password_must_not_contain_loginame_info'));
     $this->form->addItem($check);
     $check = new ilCheckboxInputGUI($this->lng->txt('ps_password_chars_and_numbers_enabled'), 'password_chars_and_numbers_enabled');
     //$check->setOptionTitle($this->lng->txt('ps_password_chars_and_numbers_enabled'));
     $check->setInfo($this->lng->txt('ps_password_chars_and_numbers_enabled_info'));
     $this->form->addItem($check);
     $check = new ilCheckboxInputGUI($this->lng->txt('ps_password_special_chars_enabled'), 'password_special_chars_enabled');
     //$check->setOptionTitle($this->lng->txt('ps_password_special_chars_enabled'));
     $check->setInfo($this->lng->txt('ps_password_special_chars_enabled_info'));
     $this->form->addItem($check);
     $text = new ilNumberInputGUI($this->lng->txt('ps_password_min_length'), 'password_min_length');
     $text->setInfo($this->lng->txt('ps_password_min_length_info'));
     $text->setSize(1);
     $text->setMaxLength(2);
     $this->form->addItem($text);
     $text = new ilNumberInputGUI($this->lng->txt('ps_password_max_length'), 'password_max_length');
     $text->setInfo($this->lng->txt('ps_password_max_length_info'));
     $text->setSize(2);
     $text->setMaxLength(3);
     $this->form->addItem($text);
     $text = new ilNumberInputGUI($this->lng->txt('ps_password_uppercase_chars_num'), 'password_ucase_chars_num');
     $text->setInfo($this->lng->txt('ps_password_uppercase_chars_num_info'));
     $text->setMinValue(0);
     $text->setSize(2);
     $text->setMaxLength(3);
     $this->form->addItem($text);
     $text = new ilNumberInputGUI($this->lng->txt('ps_password_lowercase_chars_num'), 'password_lowercase_chars_num');
     $text->setInfo($this->lng->txt('ps_password_lowercase_chars_num_info'));
     $text->setMinValue(0);
     $text->setSize(2);
     $text->setMaxLength(3);
     $this->form->addItem($text);
     $text = new ilNumberInputGUI($this->lng->txt('ps_password_max_age'), 'password_max_age');
     $text->setInfo($this->lng->txt('ps_password_max_age_info'));
     $text->setSize(2);
     $text->setMaxLength(3);
     $this->form->addItem($text);
     // password assistance
     $cb = new ilCheckboxInputGUI($this->lng->txt("enable_password_assistance"), "password_assistance");
     $cb->setInfo($this->lng->txt("password_assistance_info"));
     $this->form->addItem($cb);
     $pass = new ilFormSectionHeaderGUI();
     $pass->setTitle($this->lng->txt('ps_security_protection'));
     $this->form->addItem($pass);
     $text = new ilNumberInputGUI($this->lng->txt('ps_login_max_attempts'), 'login_max_attempts');
     $text->setInfo($this->lng->txt('ps_login_max_attempts_info'));
     $text->setSize(1);
     $text->setMaxLength(2);
     $this->form->addItem($text);
     // prevent login from multiple pcs at the same time
     $objCb = new ilCheckboxInputGUI($this->lng->txt('ps_prevent_simultaneous_logins'), 'ps_prevent_simultaneous_logins');
     $objCb->setValue(1);
     $objCb->setInfo($this->lng->txt('ps_prevent_simultaneous_logins_info'));
     $this->form->addItem($objCb);
     $log = new ilFormSectionHeaderGUI();
     $log->setTitle($this->lng->txt('loginname_settings'));
     $this->form->addItem($log);
     $chbChangeLogin = new ilCheckboxInputGUI($this->lng->txt('allow_change_loginname'), 'allow_change_loginname');
     $chbChangeLogin->setValue(1);
     $this->form->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->form->addCommandButton('saveGeneralSettings', $this->lng->txt('save'));
 }
 /**
  * show information screen
  */
 function infoScreen()
 {
     global $ilAccess, $ilTabs, $ilUser, $ilToolbar;
     if (!$this->external_rater_360 && !$ilAccess->checkAccess("visible", "", $this->ref_id)) {
         $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"), $this->ilias->error_obj->MESSAGE);
     }
     $ilTabs->activateTab("info_short");
     include_once "./Modules/Survey/classes/class.ilSurveyExecutionGUI.php";
     $output_gui =& new ilSurveyExecutionGUI($this->object);
     include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php";
     $info = new ilInfoScreenGUI($this);
     $info->enablePrivateNotes();
     // "active" survey?
     $canStart = $this->object->canStartSurvey(null, $this->external_rater_360);
     $showButtons = $canStart["result"];
     if (!$showButtons) {
         if ($canStart["edit_settings"] && $ilAccess->checkAccess("write", "", $this->ref_id)) {
             $canStart["messages"][] = "<a href=\"" . $this->ctrl->getLinkTarget($this, "properties") . "\">&raquo; " . $this->lng->txt("survey_edit_settings") . "</a>";
         }
         ilUtil::sendInfo(implode("<br />", $canStart["messages"]));
     }
     $big_button = false;
     if ($showButtons) {
         // closing survey?
         $is_appraisee = false;
         if ($this->object->get360Mode() && $this->object->isAppraisee($ilUser->getId())) {
             $info->addSection($this->lng->txt("survey_360_appraisee_info"));
             $appr_data = $this->object->getAppraiseesData();
             $appr_data = $appr_data[$ilUser->getId()];
             $info->addProperty($this->lng->txt("survey_360_raters_status_info"), $appr_data["finished"]);
             if (!$appr_data["closed"]) {
                 include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
                 $button = ilLinkButton::getInstance();
                 $button->setCaption("survey_360_appraisee_close_action");
                 $button->setUrl($this->ctrl->getLinkTargetByClass("ilsurveyparticipantsgui", "confirmappraiseeclose"));
                 $close_button_360 = '<div>' . $button->render() . '</div>';
                 $txt = "survey_360_appraisee_close_action_info";
                 if ($this->object->get360SkillService()) {
                     $txt .= "_skill";
                 }
                 $info->addProperty($this->lng->txt("status"), $close_button_360 . $this->lng->txt($txt));
             } else {
                 ilDatePresentation::setUseRelativeDates(false);
                 $dt = new ilDateTime($appr_data["closed"], IL_CAL_UNIX);
                 $info->addProperty($this->lng->txt("status"), sprintf($this->lng->txt("survey_360_appraisee_close_action_status"), ilDatePresentation::formatDate($dt)));
             }
             $is_appraisee = true;
         }
         // handle code
         // validate incoming
         $code_input = false;
         $anonymous_code = $_POST["anonymous_id"];
         if ($anonymous_code) {
             $code_input = true;
             // if(!$this->object->isUnusedCode($anonymous_code, $ilUser->getId()))
             if (!$this->object->checkSurveyCode($anonymous_code)) {
                 $anonymous_code = null;
             } else {
                 // #15860
                 $this->object->bindSurveyCodeToUser($ilUser->getId(), $anonymous_code);
             }
         }
         if ($anonymous_code) {
             $_SESSION["anonymous_id"][$this->object->getId()] = $anonymous_code;
         } else {
             $anonymous_code = $_SESSION["anonymous_id"][$this->object->getId()];
             if ($anonymous_code) {
                 $code_input = true;
             }
         }
         // try to find code for current (registered) user from existing run
         if ($this->object->getAnonymize() && !$anonymous_code) {
             $anonymous_code = $this->object->findCodeForUser($ilUser->getId());
         }
         // get existing runs for current user, might generate code
         $participant_status = $this->object->getUserSurveyExecutionStatus($anonymous_code);
         if ($participant_status) {
             $anonymous_code = $participant_status["code"];
             $participant_status = $participant_status["runs"];
         }
         // (final) check for proper anonymous code
         if (!$this->object->isAccessibleWithoutCode() && !$is_appraisee && $code_input && (!$anonymous_code || !$this->object->isAnonymousKey($anonymous_code))) {
             $anonymous_code = null;
             ilUtil::sendInfo($this->lng->txt("wrong_survey_code_used"));
         }
         // :TODO: really save in session?
         $_SESSION["anonymous_id"][$this->object->getId()] = $anonymous_code;
         // code is mandatory and not given yet
         if (!$is_appraisee && !$anonymous_code && !$this->object->isAccessibleWithoutCode()) {
             $info->setFormAction($this->ctrl->getFormAction($this, "infoScreen"));
             $info->addSection($this->lng->txt("anonymization"));
             $info->addProperty("", $this->lng->txt("anonymize_anonymous_introduction"));
             $info->addPropertyTextinput($this->lng->txt("enter_anonymous_id"), "anonymous_id", "", 8, "infoScreen", $this->lng->txt("submit"), true);
         } else {
             // trunk/default
             if (!$this->object->get360Mode()) {
                 if ($anonymous_code) {
                     $info->addHiddenElement("anonymous_id", $anonymous_code);
                 }
                 $survey_started = $this->object->isSurveyStarted($ilUser->getId(), $anonymous_code);
                 if ($survey_started === 1) {
                     if ($ilUser->getId() != ANONYMOUS_USER_ID) {
                         if ($this->object->hasViewOwnResults()) {
                             include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
                             $button = ilLinkButton::getInstance();
                             $button->setCaption("svy_view_own_results");
                             $button->setUrl($this->ctrl->getLinkTarget($this, "viewUserResults"));
                             $ilToolbar->addButtonInstance($button);
                         }
                         if ($this->object->hasMailOwnResults()) {
                             if ($this->object->hasViewOwnResults()) {
                                 $ilToolbar->addSeparator();
                             }
                             require_once "Services/Form/classes/class.ilTextInputGUI.php";
                             $mail = new ilTextInputGUI($this->lng->txt("email"), "mail");
                             $mail->setSize(25);
                             $mail->setValue($ilUser->getEmail());
                             $ilToolbar->addInputItem($mail, true);
                             $ilToolbar->setFormAction($this->ctrl->getFormAction($this, "mailUserResults"));
                             include_once "Services/UIComponent/Button/classes/class.ilSubmitButton.php";
                             $button = ilSubmitButton::getInstance();
                             $button->setCaption("svy_mail_own_results");
                             $button->setCommand("mailUserResults");
                             $ilToolbar->addButtonInstance($button);
                         }
                     }
                     ilUtil::sendInfo($this->lng->txt("already_completed_survey"));
                 } elseif ($survey_started === 0) {
                     $big_button = array("resume", $this->lng->txt("resume_survey"));
                 } elseif ($survey_started === FALSE) {
                     $big_button = array("start", $this->lng->txt("start_survey"));
                 }
             } else {
                 $appr_ids = array();
                 // use given code (if proper external one)
                 if ($anonymous_code) {
                     $anonymous_id = $this->object->getAnonymousIdByCode($anonymous_code);
                     if ($anonymous_id) {
                         $appr_ids = $this->object->getAppraiseesToRate(0, $anonymous_id);
                     }
                 }
                 // registered user
                 // if an auto-code was generated, we still have to check for the original user id
                 if (!$appr_ids && $ilUser->getId() != ANONYMOUS_USER_ID) {
                     $appr_ids = $this->object->getAppraiseesToRate($ilUser->getId());
                 }
                 if (sizeof($appr_ids)) {
                     // map existing runs to appraisees
                     $active_appraisees = array();
                     if ($participant_status) {
                         foreach ($participant_status as $item) {
                             $active_appraisees[$item["appr_id"]] = $item["finished"];
                         }
                     }
                     $list = array();
                     foreach ($appr_ids as $appr_id) {
                         if ($this->object->isAppraiseeClosed($appr_id)) {
                             // closed
                             $list[$appr_id] = $this->lng->txt("survey_360_appraisee_is_closed");
                         } else {
                             if (array_key_exists($appr_id, $active_appraisees)) {
                                 // already done
                                 if ($active_appraisees[$appr_id]) {
                                     $list[$appr_id] = $this->lng->txt("already_completed_survey");
                                 } else {
                                     $list[$appr_id] = array("resume", $this->lng->txt("resume_survey"));
                                 }
                             } else {
                                 // start
                                 $list[$appr_id] = array("start", $this->lng->txt("start_survey"));
                             }
                         }
                     }
                     $info->addSection($this->lng->txt("survey_360_rate_other_appraisees"));
                     include_once "Services/User/classes/class.ilUserUtil.php";
                     foreach ($list as $appr_id => $item) {
                         $appr_name = ilUserUtil::getNamePresentation($appr_id, false, false, "", true);
                         if (!is_array($item)) {
                             $info->addProperty($appr_name, $item);
                         } else {
                             $this->ctrl->setParameter($output_gui, "appr_id", $appr_id);
                             $href = $this->ctrl->getLinkTarget($output_gui, $item[0]);
                             $this->ctrl->setParameter($output_gui, "appr_id", "");
                             include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
                             $button = ilLinkButton::getInstance();
                             $button->setCaption($item[1], false);
                             $button->setUrl($href);
                             $big_button_360 = '<div>' . $button->render() . '</div>';
                             $info->addProperty($appr_name, $big_button_360);
                         }
                     }
                 } else {
                     if (!$is_appraisee) {
                         ilUtil::sendFailure($this->lng->txt("survey_360_no_appraisees"));
                     }
                 }
             }
         }
         if ($this->object->get360Mode() && $this->object->get360SelfAppraisee() && !$this->object->isAppraisee($ilUser->getId()) && $ilUser->getId() != ANONYMOUS_USER_ID) {
             $link = $this->ctrl->getLinkTargetByClass("ilsurveyparticipantsgui", "addSelfAppraisee");
             $link = '<a href="' . $link . '">' . $this->lng->txt("survey_360_add_self_appraisee") . '</a>';
             $info->addProperty("&nbsp;", $link);
         }
     }
     if ($big_button) {
         $ilToolbar->setFormAction($this->ctrl->getFormAction($output_gui, "infoScreen"));
         include_once "Services/UIComponent/Button/classes/class.ilSubmitButton.php";
         $button = ilSubmitButton::getInstance();
         $button->setCaption($big_button[1], false);
         $button->setCommand($big_button[0]);
         $button->setPrimary(true);
         $ilToolbar->addButtonInstance($button);
         $ilToolbar->setCloseFormTag(false);
         $info->setOpenFormTag(false);
     }
     /* #12016
     		else
     		{
     			$info->setFormAction($this->ctrl->getFormAction($output_gui, "infoScreen"));
     		}
     		*/
     if (strlen($this->object->getIntroduction())) {
         $introduction = $this->object->getIntroduction();
         $info->addSection($this->lng->txt("introduction"));
         $info->addProperty("", $this->object->prepareTextareaOutput($introduction) . "<br />" . $info->getHiddenToggleButton());
     } else {
         $info->addSection("");
         $info->addProperty("", $info->getHiddenToggleButton());
     }
     $info->hideFurtherSections(false);
     if (!$this->object->get360Mode()) {
         $info->addSection($this->lng->txt("svy_general_properties"));
         $info->addProperty($this->lng->txt("survey_results_anonymization"), !$this->object->hasAnonymizedResults() ? $this->lng->txt("survey_results_personalized_info") : $this->lng->txt("survey_results_anonymized_info"));
         include_once "./Modules/Survey/classes/class.ilObjSurveyAccess.php";
         if ($ilAccess->checkAccess("write", "", $this->ref_id) || ilObjSurveyAccess::_hasEvaluationAccess($this->object->getId(), $ilUser->getId())) {
             $info->addProperty($this->lng->txt("evaluation_access"), $this->lng->txt("evaluation_access_info"));
         }
     }
     $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
     $this->ctrl->forwardCommand($info);
 }
 /**
  * list files
  */
 function renameFileForm()
 {
     global $lng, $ilCtrl;
     if (!isset($_POST["file"])) {
         $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
     }
     if (count($_POST["file"]) > 1) {
         $this->ilias->raiseError($this->lng->txt("cont_select_max_one_item"), $this->ilias->error_obj->MESSAGE);
     }
     if (ilUtil::stripSlashes($_POST["file"][0]) == "..") {
         $this->ilias->raiseError($this->lng->txt("select_a_file"), $this->ilias->error_obj->MESSAGE);
     }
     $cur_subdir = str_replace(".", "", ilUtil::stripSlashes($_GET["cdir"]));
     $file = !empty($cur_subdir) ? $this->main_dir . "/" . $cur_subdir . "/" . ilUtil::stripSlashes($_POST["file"][0]) : $this->main_dir . "/" . ilUtil::stripSlashes($_POST["file"][0]);
     $this->ctrl->setParameter($this, "old_name", ilUtil::stripSlashes($_POST["file"][0]));
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     // file/dir name
     $ti = new ilTextInputGUI($this->lng->txt("name"), "new_name");
     $ti->setMaxLength(200);
     $ti->setSize(40);
     $ti->setValue(ilUtil::stripSlashes($_POST["file"][0]));
     $form->addItem($ti);
     // save and cancel commands
     $form->addCommandButton("renameFile", $lng->txt("rename"));
     $form->addCommandButton("cancelRename", $lng->txt("cancel"));
     $form->setFormAction($ilCtrl->getFormAction($this, "renameFile"));
     if (@is_dir($file)) {
         $form->setTitle($this->lng->txt("cont_rename_dir"));
     } else {
         $form->setTitle($this->lng->txt("rename_file"));
     }
     $this->tpl->setContent($form->getHTML());
 }
 protected function initSettingsForm()
 {
     global $ilSetting;
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setTitle($this->lng->txt("settings"));
     $form->setFormAction($this->ctrl->getFormAction($this, 'saveSettings'));
     // default repository view
     $options = array("flat" => $this->lng->txt("flatview"), "tree" => $this->lng->txt("treeview"));
     $si = new ilSelectInputGUI($this->lng->txt("def_repository_view"), "default_rep_view");
     $si->setOptions($options);
     $si->setInfo($this->lng->txt(""));
     if ($ilSetting->get("default_repository_view") == "tree") {
         $si->setValue("tree");
     } else {
         $si->setValue("flat");
     }
     $form->addItem($si);
     //
     $options = array("" => $this->lng->txt("adm_rep_tree_only_container"), "tree" => $this->lng->txt("adm_all_resource_types"));
     // repository tree
     $radg = new ilRadioGroupInputGUI($this->lng->txt("adm_rep_tree_presentation"), "tree_pres");
     $radg->setValue($ilSetting->get("repository_tree_pres"));
     $op1 = new ilRadioOption($this->lng->txt("adm_rep_tree_only_cntr"), "", $this->lng->txt("adm_rep_tree_only_cntr_info"));
     $radg->addOption($op1);
     $op2 = new ilRadioOption($this->lng->txt("adm_rep_tree_all_types"), "all_types", $this->lng->txt("adm_rep_tree_all_types_info"));
     // limit tree in courses and groups
     $cb = new ilCheckboxInputGUI($this->lng->txt("adm_rep_tree_limit_grp_crs"), "rep_tree_limit_grp_crs");
     $cb->setChecked($ilSetting->get("rep_tree_limit_grp_crs"));
     $cb->setInfo($this->lng->txt("adm_rep_tree_limit_grp_crs_info"));
     $op2->addSubItem($cb);
     $radg->addOption($op2);
     $form->addItem($radg);
     /* OBSOLETE
     		// synchronize repository tree with main view
     		$cb = new ilCheckboxInputGUI($this->lng->txt("adm_synchronize_rep_tree"), "rep_tree_synchronize");
     		$cb->setInfo($this->lng->txt("adm_synchronize_rep_tree_info"));
     		$cb->setChecked($ilSetting->get("rep_tree_synchronize"));
     		$form->addItem($cb);
     		*/
     /* DISABLED
     		// repository access check
     		$options = array(
     			0 => "0",
     			10 => "10",
     			30 => "30",
     			60 => "60",
     			120 => "120"
     			);
     		$si = new ilSelectInputGUI($this->lng->txt("adm_repository_cache_time"), "rep_cache");
     		$si->setOptions($options);
     		$si->setValue($ilSetting->get("rep_cache"));
     		$si->setInfo($this->lng->txt("adm_repository_cache_time_info")." ".
     			$this->lng->txt("adm_repository_cache_time_info2"));
     		$form->addItem($si);
     		*/
     // trash
     $cb = new ilCheckboxInputGUI($this->lng->txt("enable_trash"), "enable_trash");
     $cb->setInfo($this->lng->txt("enable_trash_info"));
     if ($ilSetting->get("enable_trash")) {
         $cb->setChecked(true);
     }
     $form->addItem($cb);
     // change event
     require_once 'Services/Tracking/classes/class.ilChangeEvent.php';
     $this->lng->loadLanguageModule("trac");
     $event = new ilCheckboxInputGUI($this->lng->txt('trac_repository_changes'), 'change_event_tracking');
     $event->setChecked(ilChangeEvent::_isActive());
     $form->addItem($event);
     include_once "Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php";
     ilAdministrationSettingsFormHandler::addFieldsToForm(ilAdministrationSettingsFormHandler::FORM_REPOSITORY, $form, $this);
     // object lists
     $lists = new ilFormSectionHeaderGUI();
     $lists->setTitle($this->lng->txt("rep_object_lists"));
     $form->addItem($lists);
     $sdesc = new ilCheckboxInputGUI($this->lng->txt("adm_rep_shorten_description"), "rep_shorten_description");
     $sdesc->setInfo($this->lng->txt("adm_rep_shorten_description_info"));
     $sdesc->setChecked($ilSetting->get("rep_shorten_description"));
     $form->addItem($sdesc);
     $sdesclen = new ilTextInputGUI($this->lng->txt("adm_rep_shorten_description_length"), "rep_shorten_description_length");
     $sdesclen->setValue($ilSetting->get("rep_shorten_description_length"));
     $sdesclen->setSize(3);
     $sdesc->addSubItem($sdesclen);
     // load action commands asynchronously
     $cb = new ilCheckboxInputGUI($this->lng->txt("adm_item_cmd_asynch"), "item_cmd_asynch");
     $cb->setInfo($this->lng->txt("adm_item_cmd_asynch_info"));
     $cb->setChecked($ilSetting->get("item_cmd_asynch"));
     $form->addItem($cb);
     // notes/comments/tagging
     $pl = new ilCheckboxInputGUI($this->lng->txt('adm_show_comments_tagging_in_lists'), 'comments_tagging_in_lists');
     $pl->setValue(1);
     $pl->setChecked($ilSetting->get('comments_tagging_in_lists'));
     $form->addItem($pl);
     $form->addCommandButton('saveSettings', $this->lng->txt('save'));
     return $form;
 }
 /**
  * Init filter
  */
 public function initFilter()
 {
     global $lng;
     $this->setDisableFilterHiding(true);
     // object type selection
     include_once "./Services/Form/classes/class.ilSelectInputGUI.php";
     /*
     $si = new ilSelectInputGUI($lng->txt("obj_type"), "type");
     $options = $this->getPossibleTypes(true);
     $si->setOptions($options);
     $this->addFilterItem($si);
     $si->readFromSession();
     if(!$si->getValue())
     {
     	$si->setValue("crs");
     }
     $this->filter["type"] = $si->getValue();		
      
     $this->filter_captions[] = $options[$this->filter["type"]];
     */
     $this->filter["type"] = "crs";
     // title/description
     include_once "./Services/Form/classes/class.ilTextInputGUI.php";
     $ti = new ilTextInputGUI($lng->txt("trac_title_description"), "query");
     $ti->setMaxLength(64);
     $ti->setSize(20);
     $this->addFilterItem($ti);
     $ti->readFromSession();
     $this->filter["query"] = $ti->getValue();
     // year/month
     $si = new ilSelectInputGUI($lng->txt("year") . " / " . $lng->txt("month"), "yearmonth");
     $si->setOptions($this->getMonthsFilter());
     $this->addFilterItem($si);
     $si->readFromSession();
     if (!$si->getValue()) {
         $si->setValue(date("Y-m"));
     }
     $this->filter["yearmonth"] = $si->getValue();
     if (!strpos($this->filter["yearmonth"], "-")) {
         $si = new ilSelectInputGUI($lng->txt("trac_figure"), "figure");
         $options = array("mem_cnt_max" => $lng->txt("members") . " " . $lng->txt("trac_object_stat_lp_max"), "mem_cnt_avg" => $lng->txt("members") . " &#216;", "in_progress_max" => ilLearningProgressBaseGUI::_getStatusText(ilLPStatus::LP_STATUS_IN_PROGRESS_NUM) . " " . $lng->txt("trac_object_stat_lp_max"), "in_progress_avg" => ilLearningProgressBaseGUI::_getStatusText(ilLPStatus::LP_STATUS_IN_PROGRESS_NUM) . " &#216;");
         $si->setOptions($options);
         $this->addFilterItem($si);
         $si->readFromSession();
         if (!$si->getValue()) {
             $si->setValue("mem_cnt_max");
         }
         $this->filter["measure"] = $si->getValue();
     }
     if ($this->is_details) {
         $this->filters = array();
     }
 }
 /**
  * init auth mode determinitation form
  *
  * @access protected
  */
 protected function initAuthModeDetermination()
 {
     if (is_object($this->form)) {
         return true;
     }
     // Are there any authentication methods that support automatic determination ?
     include_once 'Services/Authentication/classes/class.ilAuthModeDetermination.php';
     $det = ilAuthModeDetermination::_getInstance();
     if ($det->getCountActiveAuthModes() <= 1) {
         return false;
     }
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($this->ctrl->getFormAction($this));
     $this->form->setTableWidth('100%');
     $this->form->setTitle($this->lng->txt('auth_auth_settings'));
     $this->form->addCommandButton('updateAuthModeDetermination', $this->lng->txt('save'));
     require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php';
     $cap = new ilCheckboxInputGUI($this->lng->txt('adm_captcha_anonymous_short'), 'activate_captcha_anonym');
     $cap->setInfo($this->lng->txt('adm_captcha_anonymous_auth'));
     $cap->setValue(1);
     if (!ilCaptchaUtil::checkFreetype()) {
         $cap->setAlert(ilCaptchaUtil::getPreconditionsMessage());
     }
     $cap->setChecked(ilCaptchaUtil::isActiveForLogin());
     $this->form->addItem($cap);
     $header = new ilFormSectionHeaderGUI();
     $header->setTitle($this->lng->txt('auth_auth_mode_determination'));
     $this->form->addItem($header);
     $kind = new ilRadioGroupInputGUI($this->lng->txt('auth_kind_determination'), 'kind');
     $kind->setInfo($this->lng->txt('auth_mode_determination_info'));
     $kind->setValue($det->getKind());
     $kind->setRequired(true);
     $option_user = new ilRadioOption($this->lng->txt('auth_by_user'), 0);
     $kind->addOption($option_user);
     $option_determination = new ilRadioOption($this->lng->txt('auth_automatic'), 1);
     include_once 'Services/Authentication/classes/class.ilAuthUtils.php';
     $auth_sequenced = $det->getAuthModeSequence();
     $counter = 1;
     foreach ($auth_sequenced as $auth_mode) {
         switch ($auth_mode) {
             case AUTH_LDAP:
                 $text = $this->lng->txt('auth_ldap');
                 break;
             case AUTH_RADIUS:
                 $text = $this->lng->txt('auth_radius');
                 break;
             case AUTH_LOCAL:
                 $text = $this->lng->txt('auth_local');
                 break;
             case AUTH_SOAP:
                 $text = $this->lng->txt('auth_soap');
                 break;
             case AUTH_APACHE:
                 $text = $this->lng->txt('auth_apache');
                 break;
                 // begin-patch auth_plugin
             // begin-patch auth_plugin
             default:
                 foreach (ilAuthUtils::getAuthPlugins() as $pl) {
                     $option = $pl->getMultipleAuthModeOptions($auth_mode);
                     $text = $option[$auth_mode]['txt'];
                 }
                 break;
                 // end-patch auth_plugin
         }
         $pos = new ilTextInputGUI($text, 'position[' . $auth_mode . ']');
         $pos->setValue($counter++);
         $pos->setSize(1);
         $pos->setMaxLength(1);
         $option_determination->addSubItem($pos);
     }
     $kind->addOption($option_determination);
     $this->form->addItem($kind);
     return true;
 }
 /**
  * init edit/create category form 
  *
  * @access protected
  * @return
  */
 protected function initFormCategory($a_mode)
 {
     global $rbacsystem, $ilUser;
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     include_once './Services/Calendar/classes/class.ilCalendarCategory.php';
     include_once './Services/Calendar/classes/class.ilCalendarCategories.php';
     $cat_info = ilCalendarCategories::_getInstance()->getCategoryInfo((int) $_GET['category_id']);
     $this->form = new ilPropertyFormGUI();
     #$this->form->setTableWidth('40%');
     switch ($a_mode) {
         case 'edit':
             $category = new ilCalendarCategory((int) $_GET['category_id']);
             $this->form->setTitle($this->lng->txt('cal_edit_category'));
             $this->ctrl->saveParameter($this, array('seed', 'category_id'));
             $this->form->setFormAction($this->ctrl->getFormAction($this));
             if ($this->isEditable()) {
                 $this->form->addCommandButton('update', $this->lng->txt('save'));
                 /*
                 					if($cat_info['type'] == ilCalendarCategory::TYPE_USR)
                 					{
                 						$this->form->addCommandButton('shareSearch',$this->lng->txt('cal_share'));
                 					}
                 					$this->form->addCommandButton('confirmDelete',$this->lng->txt('delete'));
                 */
                 $this->form->addCommandButton('manage', $this->lng->txt('cancel'));
             }
             break;
         case 'create':
             $this->editable = true;
             $category = new ilCalendarCategory(0);
             $this->ctrl->saveParameter($this, array('category_id'));
             $this->form->setFormAction($this->ctrl->getFormAction($this));
             $this->form->setTitle($this->lng->txt('cal_add_category'));
             $this->form->addCommandButton('save', $this->lng->txt('save'));
             $this->form->addCommandButton('manage', $this->lng->txt('cancel'));
             break;
     }
     // Calendar name
     $title = new ilTextInputGUI($this->lng->txt('cal_calendar_name'), 'title');
     if ($a_mode == 'edit') {
         $title->setDisabled(!$this->isEditable());
     }
     $title->setRequired(true);
     $title->setMaxLength(64);
     $title->setSize(32);
     $title->setValue($category->getTitle());
     $this->form->addItem($title);
     include_once './Services/Calendar/classes/class.ilCalendarSettings.php';
     if ($a_mode == 'create' and $rbacsystem->checkAccess('edit_event', ilCalendarSettings::_getInstance()->getCalendarSettingsId())) {
         $type = new ilRadioGroupInputGUI($this->lng->txt('cal_cal_type'), 'type');
         $type->setValue($category->getType());
         $type->setRequired(true);
         $opt = new ilRadioOption($this->lng->txt('cal_type_personal'), ilCalendarCategory::TYPE_USR);
         $type->addOption($opt);
         $opt = new ilRadioOption($this->lng->txt('cal_type_system'), ilCalendarCategory::TYPE_GLOBAL);
         $type->addOption($opt);
         $type->setInfo($this->lng->txt('cal_type_info'));
         $this->form->addItem($type);
     }
     $color = new ilColorPickerInputGUI($this->lng->txt('cal_calendar_color'), 'color');
     $color->setValue($category->getColor());
     if (!$this->isEditable()) {
         $color->setDisabled(true);
     }
     $color->setRequired(true);
     $this->form->addItem($color);
     $location = new ilRadioGroupInputGUI($this->lng->txt('cal_type_rl'), 'type_rl');
     $location->setDisabled($a_mode == 'edit');
     $location_local = new ilRadioOption($this->lng->txt('cal_type_local'), ilCalendarCategory::LTYPE_LOCAL);
     $location->addOption($location_local);
     $location_remote = new ilRadioOption($this->lng->txt('cal_type_remote'), ilCalendarCategory::LTYPE_REMOTE);
     $location->addOption($location_remote);
     $location->setValue($category->getLocationType());
     $url = new ilTextInputGUI($this->lng->txt('cal_remote_url'), 'remote_url');
     $url->setDisabled($a_mode == 'edit');
     $url->setValue($category->getRemoteUrl());
     $url->setMaxLength(500);
     $url->setSize(60);
     $url->setRequired(true);
     $location_remote->addSubItem($url);
     $user = new ilTextInputGUI($this->lng->txt('username'), 'remote_user');
     $user->setDisabled($a_mode == 'edit');
     $user->setValue($category->getRemoteUser());
     $user->setMaxLength(50);
     $user->setSize(20);
     $user->setRequired(false);
     $location_remote->addSubItem($user);
     $pass = new ilPasswordInputGUI($this->lng->txt('password'), 'remote_pass');
     $pass->setDisabled($a_mode == 'edit');
     $pass->setValue($category->getRemotePass());
     $pass->setMaxLength(50);
     $pass->setSize(20);
     $pass->setRetype(false);
     $pass->setInfo($this->lng->txt('remote_pass_info'));
     $location_remote->addSubItem($pass);
     $this->form->addItem($location);
 }
 /**
  * Init form
  * @param int $a_mode
  * @return 
  */
 protected function initFormSequence($a_mode)
 {
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     include_once './Services/YUI/classes/class.ilYuiUtil.php';
     ilYuiUtil::initDomEvent();
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($this->ctrl->getFormAction($this));
     switch ($a_mode) {
         case self::MODE_CREATE:
             $this->form->setTitle($this->lng->txt('cal_ch_add_sequence'));
             $this->form->addCommandButton('saveSequence', $this->lng->txt('save'));
             $this->form->addCommandButton('appointmentList', $this->lng->txt('cancel'));
             break;
             /*
             			case self::MODE_UPDATE:
             				$this->form->setTitle($this->lng->txt('cal_ch_edit_sequence'));
             				$this->form->addCommandButton('updateSequence', $this->lng->txt('save'));
             				$this->form->addCommandButton('appointmentList', $this->lng->txt('cancel'));
             				break;
             */
         /*
         			case self::MODE_UPDATE:
         				$this->form->setTitle($this->lng->txt('cal_ch_edit_sequence'));
         				$this->form->addCommandButton('updateSequence', $this->lng->txt('save'));
         				$this->form->addCommandButton('appointmentList', $this->lng->txt('cancel'));
         				break;
         */
         case self::MODE_MULTI:
             $this->form->setTitle($this->lng->txt('cal_ch_multi_edit_sequence'));
             $this->form->addCommandButton('updateMulti', $this->lng->txt('save'));
             $this->form->addCommandButton('appointmentList', $this->lng->txt('cancel'));
             break;
     }
     // in case of existing groups show a selection
     include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroups.php';
     if (count($options = ilConsultationHourGroups::getGroupSelectOptions($this->getUserId()))) {
         $group = new ilSelectInputGUI($this->lng->txt('cal_ch_grp_selection'), 'grp');
         $group->setOptions($options);
         $group->setRequired(false);
         $this->form->addItem($group);
     }
     // Title
     $ti = new ilTextInputGUI($this->lng->txt('title'), 'ti');
     $ti->setSize(32);
     $ti->setMaxLength(128);
     $ti->setRequired(true);
     $this->form->addItem($ti);
     if ($a_mode != self::MODE_MULTI) {
         // Start
         include_once './Services/Form/classes/class.ilDateTimeInputGUI.php';
         $dur = new ilDateTimeInputGUI($this->lng->txt('cal_start'), 'st');
         $dur->setShowTime(true);
         $dur->setMinuteStepSize(5);
         $this->form->addItem($dur);
         // Duration
         $du = new ilDurationInputGUI($this->lng->txt('cal_ch_duration'), 'du');
         $du->setShowMinutes(true);
         $du->setShowHours(true);
         $this->form->addItem($du);
         // Number of appointments
         $nu = new ilNumberInputGUI($this->lng->txt('cal_ch_num_appointments'), 'ap');
         $nu->setInfo($this->lng->txt('cal_ch_num_appointments_info'));
         $nu->setSize(2);
         $nu->setMaxLength(2);
         $nu->setRequired(true);
         $nu->setMinValue(1);
         $this->form->addItem($nu);
         // Recurrence
         include_once './Services/Calendar/classes/Form/class.ilRecurrenceInputGUI.php';
         $rec = new ilRecurrenceInputGUI($this->lng->txt('cal_recurrences'), 'frequence');
         $rec->setEnabledSubForms(array(IL_CAL_FREQ_DAILY, IL_CAL_FREQ_WEEKLY, IL_CAL_FREQ_MONTHLY));
         $this->form->addItem($rec);
     }
     // Number of bookings
     $nu = new ilNumberInputGUI($this->lng->txt('cal_ch_num_bookings'), 'bo');
     $nu->setSize(2);
     $nu->setMaxLength(2);
     $nu->setMinValue(1);
     $nu->setRequired(true);
     $this->form->addItem($nu);
     // Deadline
     $dead = new ilDurationInputGUI($this->lng->txt('cal_ch_deadline'), 'dead');
     $dead->setInfo($this->lng->txt('cal_ch_deadline_info'));
     $dead->setShowMinutes(false);
     $dead->setShowHours(true);
     $dead->setShowDays(true);
     $this->form->addItem($dead);
     // Location
     $lo = new ilTextInputGUI($this->lng->txt('cal_where'), 'lo');
     $lo->setSize(32);
     $lo->setMaxLength(128);
     $this->form->addItem($lo);
     // Description
     $de = new ilTextAreaInputGUI($this->lng->txt('description'), 'de');
     $de->setRows(10);
     $de->setCols(60);
     $this->form->addItem($de);
     // Target Object
     $tgt = new ilTextInputGUI($this->lng->txt('cal_ch_target_object'), 'tgt');
     $tgt->setInfo($this->lng->txt('cal_ch_target_object_info'));
     $tgt->setSize(16);
     $tgt->setMaxLength(128);
     $this->form->addItem($tgt);
 }
 /**
  * Init category mapping form 
  * @return
  */
 protected function initCategoryMappingForm($a_mode = 'add')
 {
     global $ilDB;
     if (is_object($this->form)) {
         return true;
     }
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     include_once './Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php';
     $this->form = new ilPropertyFormGUI();
     if ($a_mode == 'add') {
         $this->form->setTitle($this->lng->txt('ecs_new_category_mapping'));
         $this->form->setFormAction($this->ctrl->getFormAction($this, 'categoryMapping'));
         $this->form->addCommandButton('addCategoryMapping', $this->lng->txt('save'));
         $this->form->addCommandButton('categoryMapping', $this->lng->txt('cancel'));
     } else {
         $this->form->setTitle($this->lng->txt('ecs_edit_category_mapping'));
         $this->form->setFormAction($this->ctrl->getFormAction($this, 'editCategoryMapping'));
         $this->form->addCommandButton('updateCategoryMapping', $this->lng->txt('save'));
         $this->form->addCommandButton('categoryMapping', $this->lng->txt('cancel'));
     }
     $imp = new ilCustomInputGUI($this->lng->txt('ecs_import_id'), 'import_id');
     $imp->setRequired(true);
     $tpl = new ilTemplate('tpl.ecs_import_id_form.html', true, true, 'Services/WebServices/ECS');
     $tpl->setVariable('SIZE', 5);
     $tpl->setVariable('MAXLENGTH', 11);
     $tpl->setVariable('POST_VAR', 'import_id');
     $tpl->setVariable('PROPERTY_VALUE', $this->rule->getContainerId());
     if ($this->settings->getImportId()) {
         $tpl->setVariable('COMPLETE_PATH', $this->buildPath($this->rule->getContainerId()));
     }
     $imp->setHTML($tpl->get());
     $imp->setInfo($this->lng->txt('ecs_import_id_info'));
     $this->form->addItem($imp);
     include_once './Services/WebServices/ECS/classes/class.ilECSCategoryMapping.php';
     $select = new ilSelectInputGUI($this->lng->txt('ecs_attribute_name'), 'field');
     $select->setValue($this->rule->getFieldName());
     $select->setRequired(true);
     $select->setOptions(ilECSCategoryMapping::getPossibleFields());
     $this->form->addItem($select);
     //	Value
     $value = new ilRadioGroupInputGUI($this->lng->txt('ecs_cat_mapping_type'), 'type');
     $value->setValue($this->rule->getMappingType());
     $value->setRequired(true);
     $fixed = new ilRadioOption($this->lng->txt('ecs_cat_mapping_fixed'), ilECSCategoryMappingRule::TYPE_FIXED);
     $fixed->setInfo($this->lng->txt('ecs_cat_mapping_fixed_info'));
     $fixed_val = new ilTextInputGUI($this->lng->txt('ecs_cat_mapping_values'), 'mapping_value');
     $fixed_val->setValue($this->rule->getMappingValue());
     $fixed_val->setMaxLength(255);
     $fixed_val->setSize(40);
     $fixed_val->setRequired(true);
     $fixed->addSubItem($fixed_val);
     $value->addOption($fixed);
     $duration = new ilRadioOption($this->lng->txt('ecs_cat_mapping_duration'), ilECSCategoryMappingRule::TYPE_DURATION);
     $duration->setInfo($this->lng->txt('ecs_cat_mapping_duration_info'));
     $dur_start = new ilDateTimeInputGUI($this->lng->txt('from'), 'dur_begin');
     $dur_start->setDate($this->rule->getDateRangeStart());
     $duration->addSubItem($dur_start);
     $dur_end = new ilDateTimeInputGUI($this->lng->txt('to'), 'dur_end');
     $dur_end->setDate($this->rule->getDateRangeEnd());
     $duration->addSubItem($dur_end);
     $value->addOption($duration);
     $type = new ilRadioOption($this->lng->txt('ecs_cat_mapping_by_type'), ilECSCategoryMappingRule::TYPE_BY_TYPE);
     $type->setInfo($this->lng->txt('ecs_cat_mapping_by_type_info'));
     $options = ilECSUtils::getPossibleRemoteTypes(true);
     $types = new ilSelectInputGUI($this->lng->txt('type'), 'by_type');
     $types->setOptions($options);
     $types->setValue($this->rule->getByType());
     $types->setRequired(true);
     $type->addSubitem($types);
     $value->addOption($type);
     $this->form->addItem($value);
 }