public function __construct($title, $post_var)
 {
     global $lng;
     parent::__construct($title, $post_var);
     $this->title_input = new ilTextInputGUI($this->getTitle(), "display_" . $this->getPostVar());
     $this->title_input->setDisabled(true);
     $this->title_input->setInfo($lng->txt("dcl_ilias_refere\tnce_info"));
     $this->search_input = new ilTextInputGUI($this->getTitle(), "search_" . $this->getPostVar());
     $this->search_input->setDisabled(false);
     $this->search_input->setInfo($lng->txt('dcl_ilias_reference_info'));
     $this->hidden_input = new ilHiddenInputGUI($this->getPostVar());
 }
 protected function initForm()
 {
     $this->setTitle($this->lng->txt('admin_form_title'));
     $te = new ilTextInputGUI($this->lng->txt('admin_origins_path'), 'path');
     $te->setInfo($this->lng->txt('admin_origins_path_info'));
     $this->addItem($te);
     $this->addCommandButtons();
 }
 public function showSettings($item)
 {
     global $lng;
     $txt = new ilTextInputGUI($lng->txt('polling_intervall'), 'osd_polling_intervall');
     $txt->setRequired(true);
     $txt->setInfo($lng->txt('polling_in_seconds'));
     $txt->setValue('300');
     $item->addSubItem($txt);
     return array('osd_polling_intervall');
 }
 /**
  * @param string $title
  * @param string $post_var
  */
 public function __construct($title, $post_var)
 {
     global $lng, $tpl;
     /**
      * @var $tpl iltemplate
      */
     parent::__construct($title, $post_var);
     $tpl->addJavaScript('./Modules/DataCollection/js/ilDclTreeSearch.js');
     $this->title_input = new ilTextInputGUI($this->getTitle(), "display_" . $this->getPostVar());
     $this->title_input->setDisabled(true);
     $this->title_input->setInfo($lng->txt("dcl_ilias_refere\tnce_info"));
     $this->title_input->setInlineStyle('width: 98%; display:inline-block;');
     $this->search_input = new ilTextInputGUI($this->getTitle(), "search_" . $this->getPostVar());
     $this->search_input->setDisabled(false);
     $this->search_input->setInfo($lng->txt('dcl_ilias_reference_info'));
     $this->search_input->setInlineStyle('width: 98%; margin-top: 5px;');
     $this->hidden_input = new ilHiddenInputGUI($this->getPostVar());
     $this->lng = $lng;
 }
 /**
  * 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());
 }
 /**
  * @param ilRadioOption $option
  */
 public function initPluginCreationFormSection(ilRadioOption $option)
 {
     //		$option->setInfo($this->txt('create_info1') . '</br>' . $this->txt('create_info2') . $this->getAdminConfigObject()->getAppName()
     //			. $this->txt('create_info3'));
     $sub_selection = new ilRadioGroupInputGUI($this->txt(self::F_BASE_FOLDER), self::F_BASE_FOLDER);
     $sub_selection->setRequired(true);
     $option_default = new ilRadioOption($this->txt(self::F_DEFAULT_BASE_FOLDER), self::F_DEFAULT_BASE_FOLDER);
     $option_custom = new ilRadioOption($this->txt('custom_base_folder'), self::F_CUSTOM_FOLDER_SELECTION);
     $custom_base_folder_input = new ilTextInputGUI($this->txt(self::F_CUSTOM_BASE_FOLDER_INPUT), self::F_CUSTOM_BASE_FOLDER_INPUT);
     $custom_base_folder_input->setRequired(true);
     $custom_base_folder_input->setInfo($this->txt('custom_base_folder_input_info'));
     $option_custom->addSubItem($custom_base_folder_input);
     $sub_selection->addOption($option_default);
     $sub_selection->addOption($option_custom);
     $sub_selection->setValue(self::F_DEFAULT_BASE_FOLDER);
     $option->addSubItem($sub_selection);
 }
 /**
  * @param ilRadioOption $option
  * @throws ilCloudPluginConfigException
  */
 public function initPluginCreationFormSection(ilRadioOption $option)
 {
     $option->setInfo($this->txt("create_info1") . "</br>" . $this->txt("create_info2") . $this->getAdminConfigObject()->getAppName() . $this->txt("create_info3"));
     $sub_selection = new ilRadioGroupInputGUI($this->txt(self::F_BASE_FOLDER), "dropbox_base_folder");
     $sub_selection->setRequired(true);
     $option_default = new ilRadioOption($this->txt("default_base_folder"), self::F_DROPBOX_DEFAULT_BASE_FOLDER);
     $option_custom = new ilRadioOption($this->txt("custom_base_folder"), self::F_DROPBOX_CUSTOM_FOLDER_SELECTION);
     $custom_base_folder_input = new ilTextInputGUI($this->txt("custom_base_folder_input"), self::F_DROPBOX_CUSTOM_BASE_FOLDER_INPUT);
     $custom_base_folder_input->setRequired(true);
     $custom_base_folder_input->setInfo($this->txt("custom_base_folder_input_info"));
     $option_custom->addSubItem($custom_base_folder_input);
     $sub_selection->addOption($option_default);
     $sub_selection->addOption($option_custom);
     $sub_selection->setValue(self::F_DROPBOX_DEFAULT_BASE_FOLDER);
     $option->addSubItem($sub_selection);
     $sub_selection2 = new ilCheckboxInputGUI($this->txt(self::F_ONLINE), self::F_ONLINE);
     if ($this->getAdminConfigObject()->getValue('config_default_online')) {
         $sub_selection2->setChecked(true);
     }
     $option->addSubItem($sub_selection2);
 }
 /**
  * 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);
 }
 public function addCustomSettingsToForm(ilPropertyFormGUI $a_form)
 {
     global $lng;
     $lng->loadLanguageModule("file");
     require_once 'Services/WebDAV/classes/class.ilObjDiskQuotaSettings.php';
     $disk_quota_obj = ilObjDiskQuotaSettings::getInstance();
     // Enable disk quota reminder mail
     $cb_prop_reminder = new ilCheckboxInputGUI($lng->txt("enable_disk_quota_reminder_mail"), "enable_disk_quota_reminder_mail");
     $cb_prop_reminder->setValue('1');
     $cb_prop_reminder->setChecked($disk_quota_obj->isDiskQuotaReminderMailEnabled());
     $cb_prop_reminder->setInfo($lng->txt('disk_quota_reminder_mail_desc'));
     $a_form->addItem($cb_prop_reminder);
     // Enable summary mail for certain users
     $cb_prop_summary = new ilCheckboxInputGUI($lng->txt("enable_disk_quota_summary_mail"), "enable_disk_quota_summary_mail");
     $cb_prop_summary->setValue(1);
     $cb_prop_summary->setChecked($disk_quota_obj->isDiskQuotaSummaryMailEnabled());
     $cb_prop_summary->setInfo($lng->txt('enable_disk_quota_summary_mail_desc'));
     $a_form->addItem($cb_prop_summary);
     // Edit disk quota recipients
     $summary_rcpt = new ilTextInputGUI($lng->txt("disk_quota_summary_rctp"), "disk_quota_summary_rctp");
     $summary_rcpt->setValue($disk_quota_obj->getSummaryRecipients());
     $summary_rcpt->setInfo($lng->txt('disk_quota_summary_rctp_desc'));
     $cb_prop_summary->addSubItem($summary_rcpt);
 }
 /**
  * init propertyformgui for Assignment of LDAP Attributes to ILIAS User Profile
  * @param string $command command methode
  * @return \ilPropertyFormGUI 
  */
 private function initRoleMappingForm($command)
 {
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->setSubTabs();
     $this->tabs_gui->setSubTabActive('ldap_role_mapping');
     if (isset($_GET["mapping_id"])) {
         $this->ctrl->setParameter($this, 'mapping_id', $_GET["mapping_id"]);
     }
     $propertie_form = new ilPropertyFormGUI();
     $propertie_form->setFormAction($this->ctrl->getFormAction($this, $command));
     $propertie_form->addCommandButton($command, $this->lng->txt('save'));
     $propertie_form->addCommandButton("roleMapping", $this->lng->txt('cancel'));
     $url = new ilTextInputGUI($this->lng->txt('ldap_server'));
     $url->setPostVar("url");
     $url->setSize(50);
     $url->setMaxLength(255);
     $url->setRequired(true);
     $group_dn = new ilTextInputGUI($this->lng->txt('ldap_group_dn'));
     $group_dn->setPostVar("dn");
     $group_dn->setSize(50);
     $group_dn->setMaxLength(255);
     $group_dn->setInfo($this->lng->txt('ldap_dn_info'));
     $group_dn->setRequired(true);
     $member = new ilTextInputGUI($this->lng->txt('ldap_group_member'));
     $member->setPostVar("member");
     $member->setSize(32);
     $member->setMaxLength(255);
     $member->setInfo($this->lng->txt('ldap_member_info'));
     $member->setRequired(true);
     $member_isdn = new ilCheckboxInputGUI("");
     $member_isdn->setPostVar("memberisdn");
     $member_isdn->setOptionTitle($this->lng->txt('ldap_memberisdn'));
     $role = new ilTextInputGUI($this->lng->txt('ldap_ilias_role'));
     $role->setPostVar("role");
     $role->setSize(32);
     $role->setMaxLength(255);
     $role->setInfo($this->lng->txt('ldap_role_info'));
     $role->setRequired(true);
     $info = new ilTextAreaInputGUI($this->lng->txt('ldap_info_text'));
     $info->setPostVar("info");
     $info->setCols(50);
     $info->setRows(3);
     $info->setInfo($this->lng->txt('ldap_info_text_info'));
     $info_type = new ilCheckboxInputGUI("");
     $info_type->setPostVar("info_type");
     $info_type->setOptionTitle($this->lng->txt('ldap_mapping_info_type'));
     $propertie_form->addItem($url);
     $propertie_form->addItem($group_dn);
     $propertie_form->addItem($member);
     $propertie_form->addItem($member_isdn);
     $propertie_form->addItem($role);
     $propertie_form->addItem($info);
     $propertie_form->addItem($info_type);
     return $propertie_form;
 }
 /**
  * Configure soap settings
  * 
  * @access	public
  */
 function editSOAPObject()
 {
     global $rbacsystem, $rbacreview, $ilSetting, $ilCtrl, $lng;
     if (!$rbacsystem->checkAccess("read", $this->object->getRefId())) {
         $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
     }
     $this->tabs_gui->setTabActive('auth_soap');
     //set Template
     $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.auth_soap.html', 'Services/Authentication');
     // compose role list
     $role_list = $rbacreview->getRolesByFilter(2, $this->object->getId());
     $roles = array();
     foreach ($role_list as $role) {
         $roles[$role['obj_id']] = $role['title'];
     }
     //set property form gui
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $soap_config = new ilPropertyFormGUI();
     $soap_config->setTitle($this->lng->txt("auth_soap_auth"));
     $soap_config->setDescription($this->lng->txt("auth_soap_auth_desc"));
     $soap_config->setFormAction($this->ctrl->getFormAction($this, "editSOAP"));
     $soap_config->addCommandButton("saveSOAP", $this->lng->txt("save"));
     $soap_config->addCommandButton("editSOAP", $this->lng->txt("cancel"));
     //set activ
     $active = new ilCheckboxInputGUI();
     $active->setTitle($this->lng->txt("active"));
     $active->setPostVar("soap[active]");
     //set server
     $server = new ilTextInputGUI();
     $server->setTitle($this->lng->txt("server"));
     $server->setInfo($this->lng->txt("auth_soap_server_desc"));
     $server->setPostVar("soap[server]");
     $server->setSize(50);
     $server->setMaxLength(256);
     $server->setRequired(true);
     //set port
     $port = new ilTextInputGUI();
     $port->setTitle($this->lng->txt("port"));
     $port->setInfo($this->lng->txt("auth_soap_port_desc"));
     $port->setPostVar("soap[port]");
     $port->setSize(7);
     $port->setMaxLength(5);
     //set https
     $https = new ilCheckboxInputGUI();
     $https->setTitle($this->lng->txt("auth_soap_use_https"));
     $https->setPostVar("soap[use_https]");
     //set uri
     $uri = new ilTextInputGUI();
     $uri->setTitle($this->lng->txt("uri"));
     $uri->setInfo($this->lng->txt("auth_soap_uri_desc"));
     $uri->setPostVar("soap[uri]");
     $uri->setSize(50);
     $uri->setMaxLength(256);
     //set namespace
     $namespace = new ilTextInputGUI();
     $namespace->setTitle($this->lng->txt("auth_soap_namespace"));
     $namespace->setInfo($this->lng->txt("auth_soap_namespace_desc"));
     $namespace->setPostVar("soap[namespace]");
     $namespace->setSize(50);
     $namespace->setMaxLength(256);
     //set dotnet
     $dotnet = new ilCheckboxInputGUI();
     $dotnet->setTitle($this->lng->txt("auth_soap_use_dotnet"));
     $dotnet->setPostVar("soap[use_dotnet]");
     //set create users
     $createuser = new ilCheckboxInputGUI();
     $createuser->setTitle($this->lng->txt("auth_create_users"));
     $createuser->setInfo($this->lng->txt("auth_soap_create_users_desc"));
     $createuser->setPostVar("soap[create_users]");
     //set account mail
     $sendmail = new ilCheckboxInputGUI();
     $sendmail->setTitle($this->lng->txt("user_send_new_account_mail"));
     $sendmail->setInfo($this->lng->txt("auth_new_account_mail_desc"));
     $sendmail->setPostVar("soap[account_mail]");
     //set user default role
     $defaultrole = new ilSelectInputGUI();
     $defaultrole->setTitle($this->lng->txt("auth_user_default_role"));
     $defaultrole->setInfo($this->lng->txt("auth_soap_user_default_role_desc"));
     $defaultrole->setPostVar("soap[user_default_role]");
     $defaultrole->setOptions($roles);
     //set allow local authentication
     $allowlocal = new ilCheckboxInputGUI();
     $allowlocal->setTitle($this->lng->txt("auth_allow_local"));
     $allowlocal->setInfo($this->lng->txt("auth_soap_allow_local_desc"));
     $allowlocal->setPostVar("soap[allow_local]");
     // get all settings
     $settings = $ilSetting->getAll();
     // get values in error case
     if ($_SESSION["error_post_vars"]) {
         $active->setChecked($_SESSION["error_post_vars"]["soap"]["active"]);
         $server->setValue($_SESSION["error_post_vars"]["soap"]["server"]);
         $port->setValue($_SESSION["error_post_vars"]["soap"]["port"]);
         $https->setChecked($_SESSION["error_post_vars"]["soap"]["use_https"]);
         $uri->setValue($_SESSION["error_post_vars"]["soap"]["uri"]);
         $namespace->setValue($_SESSION["error_post_vars"]["soap"]["namespace"]);
         $dotnet->setChecked($_SESSION["error_post_vars"]["soap"]["use_dotnet"]);
         $createuser->setChecked($_SESSION["error_post_vars"]["soap"]["create_users"]);
         $allowlocal->setChecked($_SESSION["error_post_vars"]["soap"]["allow_local"]);
         $defaultrole->setValue($_SESSION["error_post_vars"]["soap"]["user_default_role"]);
         $sendmail->setChecked($_SESSION["error_post_vars"]["soap"]["account_mail"]);
     } else {
         $active->setChecked($settings["soap_auth_active"]);
         $server->setValue($settings["soap_auth_server"]);
         $port->setValue($settings["soap_auth_port"]);
         $https->setChecked($settings["soap_auth_use_https"]);
         $uri->setValue($settings["soap_auth_uri"]);
         $namespace->setValue($settings["soap_auth_namespace"]);
         $dotnet->setChecked($settings["soap_auth_use_dotnet"]);
         $createuser->setChecked($settings["soap_auth_create_users"]);
         $allowlocal->setChecked($settings["soap_auth_allow_local"]);
         $defaultrole->setValue($settings["soap_auth_user_default_role"]);
         $sendmail->setChecked($settings["soap_auth_account_mail"]);
     }
     if (!$defaultrole->getValue()) {
         $defaultrole->setValue(4);
     }
     //add Items to property gui
     $soap_config->addItem($active);
     $soap_config->addItem($server);
     $soap_config->addItem($port);
     $soap_config->addItem($https);
     $soap_config->addItem($uri);
     $soap_config->addItem($namespace);
     $soap_config->addItem($dotnet);
     $soap_config->addItem($createuser);
     $soap_config->addItem($sendmail);
     $soap_config->addItem($defaultrole);
     $soap_config->addItem($allowlocal);
     $this->tpl->setVariable("CONFIG_FORM", $soap_config->getHTML());
     // test form
     $form = new ilPropertyFormGUI();
     $form->setFormAction($ilCtrl->getFormAction($this));
     $form->setTitle("Test Request");
     $text_prop = new ilTextInputGUI("ext_uid", "ext_uid");
     $form->addItem($text_prop);
     $text_prop2 = new ilTextInputGUI("soap_pw", "soap_pw");
     $form->addItem($text_prop2);
     $cb = new ilCheckboxInputGUI("new_user", "new_user");
     $form->addItem($cb);
     $form->addCommandButton("testSoapAuthConnection", "Send");
     if ($ilCtrl->getCmd() == "testSoapAuthConnection") {
         include_once "./Services/SOAPAuth/classes/class.ilSOAPAuth.php";
         $ret = "<br />" . ilSOAPAuth::testConnection(ilUtil::stripSlashes($_POST["ext_uid"]), ilUtil::stripSlashes($_POST["soap_pw"]), (bool) $_POST["new_user"]);
     }
     $this->tpl->setVariable("TEST_FORM", $form->getHTML() . $ret);
 }
Example #13
0
 /**
  * Init survey settings form
  * 
  * @return ilPropertyFormGUI
  */
 function initPropertiesForm()
 {
     $template_settings = $hide_rte_switch = null;
     $template = $this->object->getTemplate();
     if ($template) {
         include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
         $template = new ilSettingsTemplate($template);
         $template_settings = $template->getSettings();
         $hide_rte_switch = $template_settings["rte_switch"]["hide"];
     }
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTableWidth("100%");
     $form->setId("survey_properties");
     // general properties
     $header = new ilFormSectionHeaderGUI();
     $header->setTitle($this->lng->txt("settings"));
     $form->addItem($header);
     // title & description (meta data)
     include_once 'Services/MetaData/classes/class.ilMD.php';
     $md_obj = new ilMD($this->object->getId(), 0, "svy");
     $md_section = $md_obj->getGeneral();
     $title = new ilTextInputGUI($this->lng->txt("title"), "title");
     $title->setRequired(true);
     $title->setValue($md_section->getTitle());
     $form->addItem($title);
     $ids = $md_section->getDescriptionIds();
     if ($ids) {
         $desc_obj = $md_section->getDescription(array_pop($ids));
         $desc = new ilTextAreaInputGUI($this->lng->txt("description"), "description");
         $desc->setCols(50);
         $desc->setRows(4);
         $desc->setValue($desc_obj->getDescription());
         $form->addItem($desc);
     }
     // pool usage
     $pool_usage = new ilRadioGroupInputGUI($this->lng->txt("survey_question_pool_usage"), "use_pool");
     $opt = new ilRadioOption($this->lng->txt("survey_question_pool_usage_active"), 1);
     $opt->setInfo($this->lng->txt("survey_question_pool_usage_active_info"));
     $pool_usage->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt("survey_question_pool_usage_inactive"), 0);
     $opt->setInfo($this->lng->txt("survey_question_pool_usage_inactive_info"));
     $pool_usage->addOption($opt);
     $pool_usage->setValue($this->object->getPoolUsage());
     $form->addItem($pool_usage);
     // 360°: appraisees
     if ($this->object->get360Mode()) {
         $self_eval = new ilCheckboxInputGUI($this->lng->txt("survey_360_self_evaluation"), "self_eval");
         $self_eval->setInfo($this->lng->txt("survey_360_self_evaluation_info"));
         $self_eval->setChecked($this->object->get360SelfEvaluation());
         $form->addItem($self_eval);
         $self_rate = new ilCheckboxInputGUI($this->lng->txt("survey_360_self_raters"), "self_rate");
         $self_rate->setInfo($this->lng->txt("survey_360_self_raters_info"));
         $self_rate->setChecked($this->object->get360SelfRaters());
         $form->addItem($self_rate);
         $self_appr = new ilCheckboxInputGUI($this->lng->txt("survey_360_self_appraisee"), "self_appr");
         $self_appr->setInfo($this->lng->txt("survey_360_self_appraisee_info"));
         $self_appr->setChecked($this->object->get360SelfAppraisee());
         $form->addItem($self_appr);
     }
     // activation
     include_once "Services/Object/classes/class.ilObjectActivation.php";
     $this->lng->loadLanguageModule('rep');
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('rep_activation_availability'));
     $form->addItem($section);
     // additional info only with multiple references
     $act_obj_info = $act_ref_info = "";
     if (sizeof(ilObject::_getAllReferences($this->object->getId())) > 1) {
         $act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info');
         $act_ref_info = $this->lng->txt('rep_activation_access_ref_info');
     }
     $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online');
     $online->setInfo($this->lng->txt('svy_activation_online_info') . $act_obj_info);
     $online->setChecked($this->object->isOnline());
     $form->addItem($online);
     $act_type = new ilCheckboxInputGUI($this->lng->txt('rep_visibility_until'), 'access_type');
     // $act_type->setInfo($this->lng->txt('svy_availability_until_info'));
     $act_type->setChecked($this->object->isActivationLimited());
     $this->tpl->addJavaScript('./Services/Form/js/date_duration.js');
     include_once "Services/Form/classes/class.ilDateDurationInputGUI.php";
     $dur = new ilDateDurationInputGUI($this->lng->txt('rep_time_period'), "access_period");
     $dur->setShowTime(true);
     $date = $this->object->getActivationStartDate();
     $dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
     $dur->setStartText($this->lng->txt('rep_activation_limited_start'));
     $date = $this->object->getActivationEndDate();
     $dur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
     $dur->setEndText($this->lng->txt('rep_activation_limited_end'));
     $act_type->addSubItem($dur);
     $visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'access_visiblity');
     $visible->setInfo($this->lng->txt('svy_activation_limited_visibility_info'));
     $visible->setChecked($this->object->getActivationVisibility());
     $act_type->addSubItem($visible);
     $form->addItem($act_type);
     // before start
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('svy_settings_section_before_start'));
     $form->addItem($section);
     // introduction
     $intro = new ilTextAreaInputGUI($this->lng->txt("introduction"), "introduction");
     $intro->setValue($this->object->prepareTextareaOutput($this->object->getIntroduction()));
     $intro->setRows(10);
     $intro->setCols(80);
     $intro->setUseRte(TRUE);
     $intro->setInfo($this->lng->txt("survey_introduction_info"));
     include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
     $intro->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("survey"));
     $intro->addPlugin("latex");
     $intro->addButton("latex");
     $intro->addButton("pastelatex");
     $intro->setRTESupport($this->object->getId(), "svy", "survey", null, $hide_rte_switch);
     $form->addItem($intro);
     // access
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('svy_settings_section_access'));
     $form->addItem($section);
     // enable start date
     $start = $this->object->getStartDate();
     $enablestartingtime = new ilCheckboxInputGUI($this->lng->txt("start_date"), "enabled_start_date");
     $enablestartingtime->setValue(1);
     // $enablestartingtime->setOptionTitle($this->lng->txt("enabled"));
     $enablestartingtime->setChecked($start);
     // start date
     $startingtime = new ilDateTimeInputGUI('', 'start_date');
     $startingtime->setShowTime(true);
     if ($start) {
         $startingtime->setDate(new ilDate($start, IL_CAL_TIMESTAMP));
     }
     $enablestartingtime->addSubItem($startingtime);
     $form->addItem($enablestartingtime);
     // enable end date
     $end = $this->object->getEndDate();
     $enableendingtime = new ilCheckboxInputGUI($this->lng->txt("end_date"), "enabled_end_date");
     $enableendingtime->setValue(1);
     // $enableendingtime->setOptionTitle($this->lng->txt("enabled"));
     $enableendingtime->setChecked($end);
     // end date
     $endingtime = new ilDateTimeInputGUI('', 'end_date');
     $endingtime->setShowTime(true);
     if ($end) {
         $endingtime->setDate(new ilDate($end, IL_CAL_TIMESTAMP));
     }
     $enableendingtime->addSubItem($endingtime);
     $form->addItem($enableendingtime);
     // anonymization
     if (!$this->object->get360Mode()) {
         $codes = new ilCheckboxInputGUI($this->lng->txt("survey_access_codes"), "acc_codes");
         $codes->setInfo($this->lng->txt("survey_access_codes_info"));
         $codes->setChecked(!$this->object->isAccessibleWithoutCode());
         $form->addItem($codes);
         if ($this->object->_hasDatasets($this->object->getSurveyId())) {
             $codes->setDisabled(true);
         }
     }
     // question behaviour
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('svy_settings_section_question_behaviour'));
     $form->addItem($section);
     // show question titles
     $show_question_titles = new ilCheckboxInputGUI($this->lng->txt("svy_show_questiontitles"), "show_question_titles");
     $show_question_titles->setValue(1);
     $show_question_titles->setChecked($this->object->getShowQuestionTitles());
     $form->addItem($show_question_titles);
     // finishing
     $info = new ilFormSectionHeaderGUI();
     $info->setTitle($this->lng->txt("svy_settings_section_finishing"));
     $form->addItem($info);
     $view_own = new ilCheckboxInputGUI($this->lng->txt("svy_results_view_own"), "view_own");
     $view_own->setInfo($this->lng->txt("svy_results_view_own_info"));
     $view_own->setChecked($this->object->hasViewOwnResults());
     $form->addItem($view_own);
     $mail_own = new ilCheckboxInputGUI($this->lng->txt("svy_results_mail_own"), "mail_own");
     $mail_own->setInfo($this->lng->txt("svy_results_mail_own_info"));
     $mail_own->setChecked($this->object->hasMailOwnResults());
     $form->addItem($mail_own);
     // final statement
     $finalstatement = new ilTextAreaInputGUI($this->lng->txt("outro"), "outro");
     $finalstatement->setValue($this->object->prepareTextareaOutput($this->object->getOutro()));
     $finalstatement->setRows(10);
     $finalstatement->setCols(80);
     $finalstatement->setUseRte(TRUE);
     $finalstatement->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("survey"));
     $finalstatement->addPlugin("latex");
     $finalstatement->addButton("latex");
     $finalstatement->addButton("pastelatex");
     $finalstatement->setRTESupport($this->object->getId(), "svy", "survey", null, $hide_rte_switch);
     $form->addItem($finalstatement);
     // mail notification
     $mailnotification = new ilCheckboxInputGUI($this->lng->txt("mailnotification"), "mailnotification");
     // $mailnotification->setOptionTitle($this->lng->txt("activate"));
     $mailnotification->setInfo($this->lng->txt("svy_result_mail_notification_info"));
     // #11762
     $mailnotification->setValue(1);
     $mailnotification->setChecked($this->object->getMailNotification());
     // addresses
     $mailaddresses = new ilTextInputGUI($this->lng->txt("mailaddresses"), "mailaddresses");
     $mailaddresses->setValue($this->object->getMailAddresses());
     $mailaddresses->setSize(80);
     $mailaddresses->setInfo($this->lng->txt('mailaddresses_info'));
     $mailaddresses->setRequired(true);
     // participant data
     $participantdata = new ilTextAreaInputGUI($this->lng->txt("mailparticipantdata"), "mailparticipantdata");
     $participantdata->setValue($this->object->getMailParticipantData());
     $participantdata->setRows(6);
     $participantdata->setCols(80);
     $participantdata->setUseRte(false);
     $participantdata->setInfo($this->lng->txt("mailparticipantdata_info"));
     // #12755 - because of privacy concerns we restrict user data to a minimum
     $placeholders = array("FIRST_NAME" => "firstname", "LAST_NAME" => "lastname", "LOGIN" => "login");
     $txt = array();
     foreach ($placeholders as $placeholder => $caption) {
         $txt[] = "[" . strtoupper($placeholder) . "]: " . $this->lng->txt($caption);
     }
     $txt = implode("<br />", $txt);
     $participantdatainfo = new ilNonEditableValueGUI($this->lng->txt("mailparticipantdata_placeholder"), "", true);
     $participantdatainfo->setValue($txt);
     $mailnotification->addSubItem($mailaddresses);
     $mailnotification->addSubItem($participantdata);
     $mailnotification->addSubItem($participantdatainfo);
     $form->addItem($mailnotification);
     // tutor notification - currently not available for 360°
     if (!$this->object->get360Mode()) {
         // parent course?
         global $tree;
         $has_parent = $tree->checkForParentType($this->object->getRefId(), "grp");
         if (!$has_parent) {
             $has_parent = $tree->checkForParentType($this->object->getRefId(), "crs");
         }
         $num_inv = sizeof($this->object->getInvitedUsers());
         // notification
         $tut = new ilCheckboxInputGUI($this->lng->txt("survey_notification_tutor_setting"), "tut");
         $tut->setChecked($this->object->getTutorNotificationStatus());
         $form->addItem($tut);
         $tut_logins = array();
         $tuts = $this->object->getTutorNotificationRecipients();
         if ($tuts) {
             foreach ($tuts as $tut_id) {
                 $tmp = ilObjUser::_lookupName($tut_id);
                 if ($tmp["login"]) {
                     $tut_logins[] = $tmp["login"];
                 }
             }
         }
         $tut_ids = new ilTextInputGUI($this->lng->txt("survey_notification_tutor_recipients"), "tut_ids");
         $tut_ids->setDataSource($this->ctrl->getLinkTarget($this, "doAutoComplete", "", true));
         $tut_ids->setRequired(true);
         $tut_ids->setMulti(true);
         $tut_ids->setMultiValues($tut_logins);
         $tut_ids->setValue(array_shift($tut_logins));
         $tut->addSubItem($tut_ids);
         $tut_grp = new ilRadioGroupInputGUI($this->lng->txt("survey_notification_target_group"), "tut_grp");
         $tut_grp->setRequired(true);
         $tut_grp->setValue($this->object->getTutorNotificationTarget());
         $tut->addSubItem($tut_grp);
         $tut_grp_crs = new ilRadioOption($this->lng->txt("survey_notification_target_group_parent_course"), ilObjSurvey::NOTIFICATION_PARENT_COURSE);
         if (!$has_parent) {
             $tut_grp_crs->setInfo($this->lng->txt("survey_notification_target_group_parent_course_inactive"));
         }
         $tut_grp->addOption($tut_grp_crs);
         $tut_grp_inv = new ilRadioOption($this->lng->txt("survey_notification_target_group_invited"), ilObjSurvey::NOTIFICATION_INVITED_USERS);
         $tut_grp_inv->setInfo(sprintf($this->lng->txt("survey_notification_target_group_invited_info"), $num_inv));
         $tut_grp->addOption($tut_grp_inv);
     }
     // reminders
     // reminder - currently not available for 360°
     if (!$this->object->get360Mode()) {
         $info = new ilFormSectionHeaderGUI();
         $info->setTitle($this->lng->txt("svy_settings_section_reminders"));
         $form->addItem($info);
         $rmd = new ilCheckboxInputGUI($this->lng->txt("survey_reminder_setting"), "rmd");
         $rmd->setChecked($this->object->getReminderStatus());
         $form->addItem($rmd);
         $rmd_start = new ilDateTimeInputGUI($this->lng->txt("survey_reminder_start"), "rmd_start");
         $rmd_start->setRequired(true);
         $start = $this->object->getReminderStart();
         if ($start) {
             $rmd_start->setDate($start);
         }
         $rmd->addSubItem($rmd_start);
         $end = $this->object->getReminderEnd();
         $rmd_end = new ilDateTimeInputGUI($this->lng->txt("survey_reminder_end"), "rmd_end");
         $rmd_end->enableDateActivation("", "rmd_end_tgl", (bool) $end);
         if ($end) {
             $rmd_end->setDate($end);
         }
         $rmd->addSubItem($rmd_end);
         $rmd_freq = new ilNumberInputGUI($this->lng->txt("survey_reminder_frequency"), "rmd_freq");
         $rmd_freq->setRequired(true);
         $rmd_freq->setSize(3);
         $rmd_freq->setSuffix($this->lng->txt("survey_reminder_frequency_days"));
         $rmd_freq->setValue($this->object->getReminderFrequency());
         $rmd_freq->setMinValue(1);
         $rmd->addSubItem($rmd_freq);
         $rmd_grp = new ilRadioGroupInputGUI($this->lng->txt("survey_notification_target_group"), "rmd_grp");
         $rmd_grp->setRequired(true);
         $rmd_grp->setValue($this->object->getReminderTarget());
         $rmd->addSubItem($rmd_grp);
         $rmd_grp_crs = new ilRadioOption($this->lng->txt("survey_notification_target_group_parent_course"), ilObjSurvey::NOTIFICATION_PARENT_COURSE);
         if (!$has_parent) {
             $rmd_grp_crs->setInfo($this->lng->txt("survey_notification_target_group_parent_course_inactive"));
         }
         $rmd_grp->addOption($rmd_grp_crs);
         $rmd_grp_inv = new ilRadioOption($this->lng->txt("survey_notification_target_group_invited"), ilObjSurvey::NOTIFICATION_INVITED_USERS);
         $rmd_grp_inv->setInfo(sprintf($this->lng->txt("survey_notification_target_group_invited_info"), $num_inv));
         $rmd_grp->addOption($rmd_grp_inv);
     }
     // results
     $results = new ilFormSectionHeaderGUI();
     $results->setTitle($this->lng->txt("results"));
     $form->addItem($results);
     // evaluation access
     if (!$this->object->get360Mode()) {
         $evaluation_access = new ilRadioGroupInputGUI($this->lng->txt('evaluation_access'), "evaluation_access");
         $option = new ilCheckboxOption($this->lng->txt("evaluation_access_off"), ilObjSurvey::EVALUATION_ACCESS_OFF, '');
         $option->setInfo($this->lng->txt("svy_evaluation_access_off_info"));
         $evaluation_access->addOption($option);
         $option = new ilCheckboxOption($this->lng->txt("evaluation_access_all"), ilObjSurvey::EVALUATION_ACCESS_ALL, '');
         $option->setInfo($this->lng->txt("svy_evaluation_access_all_info"));
         $evaluation_access->addOption($option);
         $option = new ilCheckboxOption($this->lng->txt("evaluation_access_participants"), ilObjSurvey::EVALUATION_ACCESS_PARTICIPANTS, '');
         $option->setInfo($this->lng->txt("svy_evaluation_access_participants_info"));
         $evaluation_access->addOption($option);
         $evaluation_access->setValue($this->object->getEvaluationAccess());
         $form->addItem($evaluation_access);
         $anonymization_options = new ilRadioGroupInputGUI($this->lng->txt("survey_results_anonymization"), "anonymization_options");
         $option = new ilCheckboxOption($this->lng->txt("survey_results_personalized"), "statpers");
         $option->setInfo($this->lng->txt("survey_results_personalized_info"));
         $anonymization_options->addOption($option);
         $option = new ilCheckboxOption($this->lng->txt("survey_results_anonymized"), "statanon");
         $option->setInfo($this->lng->txt("survey_results_anonymized_info"));
         $anonymization_options->addOption($option);
         $anonymization_options->setValue($this->object->hasAnonymizedResults() ? "statanon" : "statpers");
         $form->addItem($anonymization_options);
         if ($this->object->_hasDatasets($this->object->getSurveyId())) {
             $anonymization_options->setDisabled(true);
         }
     } else {
         $ts_results = new ilRadioGroupInputGUI($this->lng->txt("survey_360_results"), "ts_res");
         $ts_results->setValue($this->object->get360Results());
         $option = new ilRadioOption($this->lng->txt("survey_360_results_none"), ilObjSurvey::RESULTS_360_NONE);
         $option->setInfo($this->lng->txt("survey_360_results_none_info"));
         $ts_results->addOption($option);
         $option = new ilRadioOption($this->lng->txt("survey_360_results_own"), ilObjSurvey::RESULTS_360_OWN);
         $option->setInfo($this->lng->txt("survey_360_results_own_info"));
         $ts_results->addOption($option);
         $option = new ilRadioOption($this->lng->txt("survey_360_results_all"), ilObjSurvey::RESULTS_360_ALL);
         $option->setInfo($this->lng->txt("survey_360_results_all_info"));
         $ts_results->addOption($option);
         $form->addItem($ts_results);
     }
     // competence service activation for 360 mode
     include_once "./Services/Skill/classes/class.ilSkillManagementSettings.php";
     $skmg_set = new ilSkillManagementSettings();
     if ($this->object->get360Mode() && $skmg_set->isActivated()) {
         $other = new ilFormSectionHeaderGUI();
         $other->setTitle($this->lng->txt("other"));
         $form->addItem($other);
         $skill_service = new ilCheckboxInputGUI($this->lng->txt("survey_activate_skill_service"), "skill_service");
         $skill_service->setInfo($this->lng->txt("survey_activate_skill_service_info"));
         $skill_service->setChecked($this->object->get360SkillService());
         $form->addItem($skill_service);
     }
     $form->addCommandButton("saveProperties", $this->lng->txt("save"));
     // remove items when using template
     if ($template_settings) {
         foreach ($template_settings as $id => $item) {
             if ($item["hide"]) {
                 $form->removeItemByPostVar($id);
             }
         }
     }
     return $form;
 }
 /**
  * Edit disk quota settings.
  */
 public function editDiskQuotaSettings()
 {
     global $rbacsystem, $ilErr, $ilSetting, $tpl, $lng, $ilCtrl;
     if (!$rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
         $ilErr->raiseError($lng->txt("no_permission"), $ilErr->WARNING);
     }
     $this->tabs_gui->setTabActive('disk_quota');
     $this->addDiskQuotaSubtabs('settings');
     require_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     require_once "./Services/Form/classes/class.ilCheckboxInputGUI.php";
     require_once "./Services/Form/classes/class.ilRadioGroupInputGUI.php";
     require_once "./Services/Form/classes/class.ilRadioOption.php";
     require_once "./Services/Form/classes/class.ilTextAreaInputGUI.php";
     require_once "./Services/WebDAV/classes/class.ilDAVServer.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($ilCtrl->getFormAction($this));
     $form->setTitle($lng->txt("settings"));
     // Enable disk quota
     $cb_prop = new ilCheckboxInputGUI($lng->txt("enable_disk_quota"), "enable_disk_quota");
     $cb_prop->setValue('1');
     $cb_prop->setChecked($this->disk_quota_obj->isDiskQuotaEnabled());
     $cb_prop->setInfo($lng->txt('enable_disk_quota_info'));
     $form->addItem($cb_prop);
     // Enable disk quota reminder mail
     $cb_prop_reminder = new ilCheckboxInputGUI($lng->txt("enable_disk_quota_reminder_mail"), "enable_disk_quota_reminder_mail");
     $cb_prop_reminder->setValue('1');
     $cb_prop_reminder->setChecked($this->disk_quota_obj->isDiskQuotaReminderMailEnabled());
     $cb_prop_reminder->setInfo($lng->txt('disk_quota_reminder_mail_desc'));
     $cb_prop->addSubItem($cb_prop_reminder);
     // Enable summary mail for certain users
     $cb_prop_summary = new ilCheckboxInputGUI($lng->txt("enable_disk_quota_summary_mail"), "enable_disk_quota_summary_mail");
     $cb_prop_summary->setValue(1);
     $cb_prop_summary->setChecked($this->disk_quota_obj->isDiskQuotaSummaryMailEnabled());
     $cb_prop_summary->setInfo($lng->txt('enable_disk_quota_summary_mail_desc'));
     $cb_prop->addSubItem($cb_prop_summary);
     // Edit disk quota recipients
     $summary_rcpt = new ilTextInputGUI($lng->txt("disk_quota_summary_rctp"), "disk_quota_summary_rctp");
     $summary_rcpt->setValue($this->disk_quota_obj->getSummaryRecipients());
     $summary_rcpt->setInfo($lng->txt('disk_quota_summary_rctp_desc'));
     $cb_prop_summary->addSubItem($summary_rcpt);
     // command buttons
     $form->addCommandButton('saveDiskQuotaSettings', $lng->txt('save'));
     $form->addCommandButton('editDiskQuotaSettings', $lng->txt('cancel'));
     $tpl->setContent($form->getHTML());
 }
Example #15
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'));
 }
 private function buildForm()
 {
     require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->addCommandButton(self::CMD_SAVE_FORM, $this->lng->txt("save"));
     $form->setTableWidth("100%");
     $form->setId("test_properties");
     if (!$this->settingsTemplate || $this->formShowGeneralSection($this->settingsTemplate->getSettings())) {
         // general properties
         $header = new ilFormSectionHeaderGUI();
         $header->setTitle($this->lng->txt("tst_general_properties"));
         $form->addItem($header);
     }
     // title & description (meta data)
     include_once 'Services/MetaData/classes/class.ilMD.php';
     $md_obj = new ilMD($this->testOBJ->getId(), 0, "tst");
     $md_section = $md_obj->getGeneral();
     $title = new ilTextInputGUI($this->lng->txt("title"), "title");
     $title->setRequired(true);
     $title->setValue($md_section->getTitle());
     $form->addItem($title);
     $ids = $md_section->getDescriptionIds();
     if ($ids) {
         $desc_obj = $md_section->getDescription(array_pop($ids));
         $desc = new ilTextAreaInputGUI($this->lng->txt("description"), "description");
         $desc->setCols(50);
         $desc->setRows(4);
         $desc->setValue($desc_obj->getDescription());
         $form->addItem($desc);
     }
     // anonymity
     $anonymity = new ilRadioGroupInputGUI($this->lng->txt('tst_anonymity'), 'anonymity');
     if ($this->testOBJ->participantDataExist()) {
         $anonymity->setDisabled(true);
     }
     $rb = new ilRadioOption($this->lng->txt('tst_anonymity_no_anonymization'), 0);
     $anonymity->addOption($rb);
     $rb = new ilRadioOption($this->lng->txt('tst_anonymity_anonymous_test'), 1);
     $anonymity->addOption($rb);
     $anonymity->setValue((int) $this->testOBJ->getAnonymity());
     $form->addItem($anonymity);
     // test mode (question set type)
     $questSetType = new ilRadioGroupInputGUI($this->lng->txt("tst_question_set_type"), 'question_set_type');
     $questSetTypeFixed = new ilRadioOption($this->lng->txt("tst_question_set_type_fixed"), ilObjTest::QUESTION_SET_TYPE_FIXED, $this->lng->txt("tst_question_set_type_fixed_desc"));
     $questSetType->addOption($questSetTypeFixed);
     $questSetTypeRandom = new ilRadioOption($this->lng->txt("tst_question_set_type_random"), ilObjTest::QUESTION_SET_TYPE_RANDOM, $this->lng->txt("tst_question_set_type_random_desc"));
     $questSetType->addOption($questSetTypeRandom);
     $questSetTypeContinues = new ilRadioOption($this->lng->txt("tst_question_set_type_dynamic"), ilObjTest::QUESTION_SET_TYPE_DYNAMIC, $this->lng->txt("tst_question_set_type_dynamic_desc"));
     $questSetType->addOption($questSetTypeContinues);
     $questSetType->setValue($this->testOBJ->getQuestionSetType());
     if ($this->testOBJ->participantDataExist()) {
         $questSetType->setDisabled(true);
     }
     $form->addItem($questSetType);
     // pool usage
     $pool_usage = new ilCheckboxInputGUI($this->lng->txt("test_question_pool_usage"), "use_pool");
     $pool_usage->setValue(1);
     $pool_usage->setChecked($this->testOBJ->getPoolUsage());
     $form->addItem($pool_usage);
     // enable_archiving
     $enable_archiving = new ilCheckboxInputGUI($this->lng->txt('test_enable_archiving'), 'enable_archiving');
     $enable_archiving->setValue(1);
     $enable_archiving->setChecked($this->testOBJ->getEnableArchiving());
     $form->addItem($enable_archiving);
     // activation/availability  (no template support yet)
     include_once "Services/Object/classes/class.ilObjectActivation.php";
     $this->lng->loadLanguageModule('rep');
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('rep_activation_availability'));
     $form->addItem($section);
     // additional info only with multiple references
     $act_obj_info = $act_ref_info = "";
     if (sizeof(ilObject::_getAllReferences($this->testOBJ->getId())) > 1) {
         $act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info');
         $act_ref_info = $this->lng->txt('rep_activation_access_ref_info');
     }
     $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online');
     $online->setChecked($this->testOBJ->isOnline());
     $online->setInfo($this->lng->txt('tst_activation_online_info') . $act_obj_info);
     $form->addItem($online);
     $act_type = new ilRadioGroupInputGUI($this->lng->txt('rep_activation_access'), 'activation_type');
     $act_type->setInfo($act_ref_info);
     $act_type->setValue($this->testOBJ->isActivationLimited() ? ilObjectActivation::TIMINGS_ACTIVATION : ilObjectActivation::TIMINGS_DEACTIVATED);
     $opt = new ilRadioOption($this->lng->txt('rep_visibility_limitless'), ilObjectActivation::TIMINGS_DEACTIVATED);
     $opt->setInfo($this->lng->txt('tst_availability_limitless_info'));
     $act_type->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt('rep_visibility_until'), ilObjectActivation::TIMINGS_ACTIVATION);
     $opt->setInfo($this->lng->txt('tst_availability_until_info'));
     $this->tpl->addJavaScript('./Services/Form/js/date_duration.js');
     include_once "Services/Form/classes/class.ilDateDurationInputGUI.php";
     $dur = new ilDateDurationInputGUI("", "access_period");
     $dur->setShowTime(true);
     $date = $this->testOBJ->getActivationStartingTime();
     $dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
     $dur->setStartText($this->lng->txt('rep_activation_limited_start'));
     $date = $this->testOBJ->getActivationEndingTime();
     $dur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
     $dur->setEndText($this->lng->txt('rep_activation_limited_end'));
     $opt->addSubItem($dur);
     $visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'activation_visibility');
     $visible->setInfo($this->lng->txt('tst_activation_limited_visibility_info'));
     $visible->setChecked($this->testOBJ->getActivationVisibility());
     $opt->addSubItem($visible);
     $act_type->addOption($opt);
     $form->addItem($act_type);
     if (!$this->settingsTemplate || $this->formShowBeginningEndingInformation($this->settingsTemplate->getSettings())) {
         // general properties
         $header = new ilFormSectionHeaderGUI();
         $header->setTitle($this->lng->txt("tst_beginning_ending_information"));
         $form->addItem($header);
     }
     // introduction
     $intro = new ilTextAreaInputGUI($this->lng->txt("tst_introduction"), "introduction");
     $intro->setValue($this->testOBJ->prepareTextareaOutput($this->testOBJ->getIntroduction()));
     $intro->setRows(10);
     $intro->setCols(80);
     $intro->setUseRte(TRUE);
     $intro->addPlugin("latex");
     $intro->addButton("latex");
     $intro->setRTESupport($this->testOBJ->getId(), "tst", "assessment");
     $intro->setRteTagSet('full');
     $intro->setInfo($this->lng->txt('intro_desc'));
     // showinfo
     $showinfo = new ilCheckboxInputGUI('', "showinfo");
     $showinfo->setValue(1);
     $showinfo->setChecked($this->testOBJ->getShowInfo());
     $showinfo->setOptionTitle($this->lng->txt("showinfo"));
     $showinfo->setInfo($this->lng->txt("showinfo_desc"));
     $intro->addSubItem($showinfo);
     $form->addItem($intro);
     // final statement
     $finalstatement = new ilTextAreaInputGUI($this->lng->txt("final_statement"), "finalstatement");
     $finalstatement->setValue($this->testOBJ->prepareTextareaOutput($this->testOBJ->getFinalStatement()));
     $finalstatement->setRows(10);
     $finalstatement->setCols(80);
     $finalstatement->setUseRte(TRUE);
     $finalstatement->addPlugin("latex");
     $finalstatement->addButton("latex");
     $finalstatement->setRTESupport($this->testOBJ->getId(), "tst", "assessment");
     $finalstatement->setRteTagSet('full');
     // show final statement
     $showfinal = new ilCheckboxInputGUI('', "showfinalstatement");
     $showfinal->setValue(1);
     $showfinal->setChecked($this->testOBJ->getShowFinalStatement());
     $showfinal->setOptionTitle($this->lng->txt("final_statement_show"));
     $showfinal->setInfo($this->lng->txt("final_statement_show_desc"));
     $finalstatement->addSubItem($showfinal);
     $form->addItem($finalstatement);
     // examview
     $enable_examview = new ilCheckboxInputGUI($this->lng->txt("enable_examview"), 'enable_examview');
     $enable_examview->setValue(1);
     $enable_examview->setChecked($this->testOBJ->getEnableExamview());
     $enable_examview->setInfo($this->lng->txt("enable_examview_desc"));
     $show_examview_html = new ilCheckboxInputGUI('', 'show_examview_html');
     $show_examview_html->setValue(1);
     $show_examview_html->setChecked($this->testOBJ->getShowExamviewHtml());
     $show_examview_html->setOptionTitle($this->lng->txt("show_examview_html"));
     $show_examview_html->setInfo($this->lng->txt("show_examview_html_desc"));
     $enable_examview->addSubItem($show_examview_html);
     $show_examview_pdf = new ilCheckboxInputGUI('', 'show_examview_pdf');
     $show_examview_pdf->setValue(1);
     $show_examview_pdf->setChecked($this->testOBJ->getShowExamviewPdf());
     $show_examview_pdf->setOptionTitle($this->lng->txt("show_examview_pdf"));
     $show_examview_pdf->setInfo($this->lng->txt("show_examview_pdf_desc"));
     $enable_examview->addSubItem($show_examview_pdf);
     $form->addItem($enable_examview);
     if (!$this->settingsTemplate || $this->formShowSessionSection($this->settingsTemplate->getSettings())) {
         // session properties
         $sessionheader = new ilFormSectionHeaderGUI();
         $sessionheader->setTitle($this->lng->txt("tst_session_settings"));
         $form->addItem($sessionheader);
     }
     // max. number of passes
     $nr_of_tries = new ilTextInputGUI($this->lng->txt("tst_nr_of_tries"), "nr_of_tries");
     $nr_of_tries->setSize(3);
     $nr_of_tries->setValue($this->testOBJ->getNrOfTries());
     $nr_of_tries->setRequired(true);
     $nr_of_tries->setSuffix($this->lng->txt("0_unlimited"));
     $total = $this->testOBJ->evalTotalPersons();
     if ($total) {
         $nr_of_tries->setDisabled(true);
     }
     $form->addItem($nr_of_tries);
     // enable max. processing time
     $processing = new ilCheckboxInputGUI($this->lng->txt("tst_processing_time"), "chb_processing_time");
     $processing->setValue(1);
     //$processing->setOptionTitle($this->lng->txt("enabled"));
     if ($this->settingsTemplate && $this->getTemplateSettingValue('chb_processing_time')) {
         $processing->setChecked(true);
     } else {
         $processing->setChecked($this->testOBJ->getEnableProcessingTime());
     }
     // max. processing time
     $processingtime = new ilDurationInputGUI('', 'processing_time');
     $ptime = $this->testOBJ->getProcessingTimeAsArray();
     $processingtime->setHours($ptime['hh']);
     $processingtime->setMinutes($ptime['mm']);
     $processingtime->setSeconds($ptime['ss']);
     $processingtime->setShowMonths(false);
     $processingtime->setShowDays(false);
     $processingtime->setShowHours(true);
     $processingtime->setShowMinutes(true);
     $processingtime->setShowSeconds(true);
     $processingtime->setInfo($this->lng->txt("tst_processing_time_desc"));
     $processing->addSubItem($processingtime);
     // reset max. processing time
     $resetprocessing = new ilCheckboxInputGUI('', "chb_reset_processing_time");
     $resetprocessing->setValue(1);
     $resetprocessing->setOptionTitle($this->lng->txt("tst_reset_processing_time"));
     $resetprocessing->setChecked($this->testOBJ->getResetProcessingTime());
     $resetprocessing->setInfo($this->lng->txt("tst_reset_processing_time_desc"));
     $processing->addSubItem($resetprocessing);
     $form->addItem($processing);
     // enable starting time
     $enablestartingtime = new ilCheckboxInputGUI($this->lng->txt("tst_starting_time"), "chb_starting_time");
     $enablestartingtime->setValue(1);
     //$enablestartingtime->setOptionTitle($this->lng->txt("enabled"));
     if ($this->settingsTemplate && $this->getTemplateSettingValue('chb_starting_time')) {
         $enablestartingtime->setChecked(true);
     } else {
         $enablestartingtime->setChecked(strlen($this->testOBJ->getStartingTime()));
     }
     // starting time
     $startingtime = new ilDateTimeInputGUI('', 'starting_time');
     $startingtime->setShowDate(true);
     $startingtime->setShowTime(true);
     if (strlen($this->testOBJ->getStartingTime())) {
         $startingtime->setDate(new ilDateTime($this->testOBJ->getStartingTime(), IL_CAL_TIMESTAMP));
     } else {
         $startingtime->setDate(new ilDateTime(time(), IL_CAL_UNIX));
     }
     $enablestartingtime->addSubItem($startingtime);
     $form->addItem($enablestartingtime);
     if ($this->testOBJ->participantDataExist()) {
         $enablestartingtime->setDisabled(true);
         $startingtime->setDisabled(true);
     }
     // enable ending time
     $enableendingtime = new ilCheckboxInputGUI($this->lng->txt("tst_ending_time"), "chb_ending_time");
     $enableendingtime->setValue(1);
     //$enableendingtime->setOptionTitle($this->lng->txt("enabled"));
     if ($this->settingsTemplate && $this->getTemplateSettingValue('chb_ending_time')) {
         $enableendingtime->setChecked(true);
     } else {
         $enableendingtime->setChecked(strlen($this->testOBJ->getEndingTime()));
     }
     // ending time
     $endingtime = new ilDateTimeInputGUI('', 'ending_time');
     $endingtime->setShowDate(true);
     $endingtime->setShowTime(true);
     if (strlen($this->testOBJ->getEndingTime())) {
         $endingtime->setDate(new ilDateTime($this->testOBJ->getEndingTime(), IL_CAL_TIMESTAMP));
     } else {
         $endingtime->setDate(new ilDateTime(time(), IL_CAL_UNIX));
     }
     $enableendingtime->addSubItem($endingtime);
     $form->addItem($enableendingtime);
     // test password
     $password = new ilTextInputGUI($this->lng->txt("tst_password"), "password");
     $password->setSize(20);
     $password->setValue($this->testOBJ->getPassword());
     $password->setInfo($this->lng->txt("tst_password_details"));
     $form->addItem($password);
     if (!$this->settingsTemplate || $this->formShowPresentationSection($this->settingsTemplate->getSettings())) {
         // sequence properties
         $seqheader = new ilFormSectionHeaderGUI();
         $seqheader->setTitle($this->lng->txt("tst_presentation_properties"));
         $form->addItem($seqheader);
     }
     // use previous answers
     $prevanswers = new ilCheckboxInputGUI($this->lng->txt("tst_use_previous_answers"), "chb_use_previous_answers");
     $prevanswers->setValue(1);
     $prevanswers->setChecked($this->testOBJ->getUsePreviousAnswers());
     $prevanswers->setInfo($this->lng->txt("tst_use_previous_answers_description"));
     $form->addItem($prevanswers);
     // force js
     $forcejs = new ilCheckboxInputGUI($this->lng->txt("forcejs_short"), "forcejs");
     $forcejs->setValue(1);
     $forcejs->setChecked($this->testOBJ->getForceJS());
     $forcejs->setOptionTitle($this->lng->txt("forcejs"));
     $forcejs->setInfo($this->lng->txt("forcejs_desc"));
     $form->addItem($forcejs);
     // question title output
     $title_output = new ilRadioGroupInputGUI($this->lng->txt("tst_title_output"), "title_output");
     $title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_full"), 0, ''));
     $title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_hide_points"), 1, ''));
     $title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_no_title"), 2, ''));
     $title_output->setValue($this->testOBJ->getTitleOutput());
     $title_output->setInfo($this->lng->txt("tst_title_output_description"));
     $form->addItem($title_output);
     // selector for unicode characters
     global $ilSetting;
     if ($ilSetting->get('char_selector_availability') > 0) {
         require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
         $char_selector = new ilCharSelectorGUI(ilCharSelectorConfig::CONTEXT_TEST);
         $char_selector->getConfig()->setAvailability($this->testOBJ->getCharSelectorAvailability());
         $char_selector->getConfig()->setDefinition($this->testOBJ->getCharSelectorDefinition());
         $char_selector->addFormProperties($form);
         $char_selector->setFormValues($form);
     }
     // Autosave
     $autosave_output = new ilCheckboxInputGUI($this->lng->txt('autosave'), 'autosave');
     $autosave_output->setValue(1);
     $autosave_output->setChecked($this->testOBJ->getAutosave());
     $autosave_output->setInfo($this->lng->txt('autosave_info'));
     $autosave_interval = new ilTextInputGUI($this->lng->txt('autosave_ival'), 'autosave_ival');
     $autosave_interval->setSize(10);
     $autosave_interval->setValue($this->testOBJ->getAutosaveIval() / 1000);
     $autosave_interval->setInfo($this->lng->txt('autosave_ival_info'));
     $autosave_output->addSubItem($autosave_interval);
     $form->addItem($autosave_output);
     if (!$this->settingsTemplate || $this->formShowSequenceSection($this->settingsTemplate->getSettings())) {
         // sequence properties
         $seqheader = new ilFormSectionHeaderGUI();
         $seqheader->setTitle($this->lng->txt("tst_sequence_properties"));
         $form->addItem($seqheader);
     }
     // postpone questions
     $postpone = new ilCheckboxInputGUI($this->lng->txt("tst_postpone"), "chb_postpone");
     $postpone->setValue(1);
     $postpone->setChecked($this->testOBJ->getSequenceSettings());
     $postpone->setInfo($this->lng->txt("tst_postpone_description"));
     $form->addItem($postpone);
     // shuffle questions
     $shuffle = new ilCheckboxInputGUI($this->lng->txt("tst_shuffle_questions"), "chb_shuffle_questions");
     $shuffle->setValue(1);
     $shuffle->setChecked($this->testOBJ->getShuffleQuestions());
     $shuffle->setInfo($this->lng->txt("tst_shuffle_questions_description"));
     $form->addItem($shuffle);
     // show list of questions
     $list_of_questions = new ilCheckboxInputGUI($this->lng->txt("tst_show_summary"), "list_of_questions");
     //$list_of_questions->setOptionTitle($this->lng->txt("tst_show_summary"));
     $list_of_questions->setValue(1);
     $list_of_questions->setChecked($this->testOBJ->getListOfQuestions());
     $list_of_questions->setInfo($this->lng->txt("tst_show_summary_description"));
     $list_of_questions_options = new ilCheckboxGroupInputGUI('', "list_of_questions_options");
     $list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_start"), 'chb_list_of_questions_start', ''));
     $list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_end"), 'chb_list_of_questions_end', ''));
     $list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_with_description"), 'chb_list_of_questions_with_description', ''));
     $values = array();
     if ($this->testOBJ->getListOfQuestionsStart()) {
         array_push($values, 'chb_list_of_questions_start');
     }
     if ($this->testOBJ->getListOfQuestionsEnd()) {
         array_push($values, 'chb_list_of_questions_end');
     }
     if ($this->testOBJ->getListOfQuestionsDescription()) {
         array_push($values, 'chb_list_of_questions_with_description');
     }
     $list_of_questions_options->setValue($values);
     $list_of_questions->addSubItem($list_of_questions_options);
     $form->addItem($list_of_questions);
     // show question marking
     $marking = new ilCheckboxInputGUI($this->lng->txt("question_marking"), "chb_show_marker");
     $marking->setValue(1);
     $marking->setChecked($this->testOBJ->getShowMarker());
     $marking->setInfo($this->lng->txt("question_marking_description"));
     $form->addItem($marking);
     // show suspend test
     $cancel = new ilCheckboxInputGUI($this->lng->txt("tst_show_cancel"), "chb_show_cancel");
     $cancel->setValue(1);
     $cancel->setChecked($this->testOBJ->getShowCancel());
     $cancel->setInfo($this->lng->txt("tst_show_cancel_description"));
     $form->addItem($cancel);
     if (!$this->settingsTemplate || $this->formShowNotificationSection($this->settingsTemplate->getSettings())) {
         // notifications
         $notifications = new ilFormSectionHeaderGUI();
         $notifications->setTitle($this->lng->txt("tst_mail_notification"));
         $form->addItem($notifications);
     }
     // mail notification
     $mailnotification = new ilRadioGroupInputGUI($this->lng->txt("tst_finish_notification"), "mailnotification");
     $mailnotification->addOption(new ilRadioOption($this->lng->txt("tst_finish_notification_no"), 0, ''));
     $mailnotification->addOption(new ilRadioOption($this->lng->txt("tst_finish_notification_simple"), 1, ''));
     $mailnotification->addOption(new ilRadioOption($this->lng->txt("tst_finish_notification_advanced"), 2, ''));
     $mailnotification->setValue($this->testOBJ->getMailNotification());
     $form->addItem($mailnotification);
     $mailnottype = new ilCheckboxInputGUI('', "mailnottype");
     $mailnottype->setValue(1);
     $mailnottype->setOptionTitle($this->lng->txt("mailnottype"));
     $mailnottype->setChecked($this->testOBJ->getMailNotificationType());
     $form->addItem($mailnottype);
     /* This options always active (?) */
     $highscore_head = new ilFormSectionHeaderGUI();
     $highscore_head->setTitle($this->lng->txt("tst_highscore_options"));
     $form->addItem($highscore_head);
     $highscore = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_enabled"), "highscore_enabled");
     $highscore->setValue(1);
     $highscore->setChecked($this->testOBJ->getHighscoreEnabled());
     $highscore->setInfo($this->lng->txt("tst_highscore_description"));
     $form->addItem($highscore);
     $highscore_anon = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_anon"), "highscore_anon");
     $highscore_anon->setValue(1);
     $highscore_anon->setChecked($this->testOBJ->getHighscoreAnon());
     $highscore_anon->setInfo($this->lng->txt("tst_highscore_anon_description"));
     $highscore->addSubItem($highscore_anon);
     $highscore_achieved_ts = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_achieved_ts"), "highscore_achieved_ts");
     $highscore_achieved_ts->setValue(1);
     $highscore_achieved_ts->setChecked($this->testOBJ->getHighscoreAchievedTS());
     $highscore_achieved_ts->setInfo($this->lng->txt("tst_highscore_achieved_ts_description"));
     $highscore->addSubItem($highscore_achieved_ts);
     $highscore_score = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_score"), "highscore_score");
     $highscore_score->setValue(1);
     $highscore_score->setChecked($this->testOBJ->getHighscoreScore());
     $highscore_score->setInfo($this->lng->txt("tst_highscore_score_description"));
     $highscore->addSubItem($highscore_score);
     $highscore_percentage = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_percentage"), "highscore_percentage");
     $highscore_percentage->setValue(1);
     $highscore_percentage->setChecked($this->testOBJ->getHighscorePercentage());
     $highscore_percentage->setInfo($this->lng->txt("tst_highscore_percentage_description"));
     $highscore->addSubItem($highscore_percentage);
     $highscore_hints = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_hints"), "highscore_hints");
     $highscore_hints->setValue(1);
     $highscore_hints->setChecked($this->testOBJ->getHighscoreHints());
     $highscore_hints->setInfo($this->lng->txt("tst_highscore_hints_description"));
     $highscore->addSubItem($highscore_hints);
     $highscore_wtime = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_wtime"), "highscore_wtime");
     $highscore_wtime->setValue(1);
     $highscore_wtime->setChecked($this->testOBJ->getHighscoreWTime());
     $highscore_wtime->setInfo($this->lng->txt("tst_highscore_wtime_description"));
     $highscore->addSubItem($highscore_wtime);
     $highscore_own_table = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_own_table"), "highscore_own_table");
     $highscore_own_table->setValue(1);
     $highscore_own_table->setChecked($this->testOBJ->getHighscoreOwnTable());
     $highscore_own_table->setInfo($this->lng->txt("tst_highscore_own_table_description"));
     $highscore->addSubItem($highscore_own_table);
     $highscore_top_table = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_top_table"), "highscore_top_table");
     $highscore_top_table->setValue(1);
     $highscore_top_table->setChecked($this->testOBJ->getHighscoreTopTable());
     $highscore_top_table->setInfo($this->lng->txt("tst_highscore_top_table_description"));
     $highscore->addSubItem($highscore_top_table);
     $highscore_top_num = new ilTextInputGUI($this->lng->txt("tst_highscore_top_num"), "highscore_top_num");
     $highscore_top_num->setSize(4);
     $highscore_top_num->setSuffix($this->lng->txt("tst_highscore_top_num_unit"));
     $highscore_top_num->setValue($this->testOBJ->getHighscoreTopNum());
     $highscore_top_num->setInfo($this->lng->txt("tst_highscore_top_num_description"));
     $highscore->addSubItem($highscore_top_num);
     if (!$this->settingsTemplate || $this->formShowTestExecutionSection($this->settingsTemplate->getSettings())) {
         $testExecution = new ilFormSectionHeaderGUI();
         $testExecution->setTitle($this->lng->txt("tst_test_execution"));
         $form->addItem($testExecution);
     }
     // kiosk mode
     $kiosk = new ilCheckboxInputGUI($this->lng->txt("kiosk"), "kiosk");
     $kiosk->setValue(1);
     $kiosk->setChecked($this->testOBJ->getKioskMode());
     $kiosk->setInfo($this->lng->txt("kiosk_description"));
     // kiosk mode options
     $kiosktitle = new ilCheckboxGroupInputGUI($this->lng->txt("kiosk_options"), "kiosk_options");
     $kiosktitle->addOption(new ilCheckboxOption($this->lng->txt("kiosk_show_title"), 'kiosk_title', ''));
     $kiosktitle->addOption(new ilCheckboxOption($this->lng->txt("kiosk_show_participant"), 'kiosk_participant', ''));
     $kiosktitle->addOption(new ilCheckboxOption($this->lng->txt('examid_in_kiosk'), 'examid_in_kiosk'));
     $values = array();
     if ($this->testOBJ->getShowKioskModeTitle()) {
         array_push($values, 'kiosk_title');
     }
     if ($this->testOBJ->getShowKioskModeParticipant()) {
         array_push($values, 'kiosk_participant');
     }
     if ($this->testOBJ->getExamidInKiosk()) {
         array_push($values, 'examid_in_kiosk');
     }
     $kiosktitle->setValue($values);
     $kiosktitle->setInfo($this->lng->txt("kiosk_options_desc"));
     $kiosk->addSubItem($kiosktitle);
     $form->addItem($kiosk);
     $redirection_mode = $this->testOBJ->getRedirectionMode();
     $rm_enabled = new ilCheckboxInputGUI($this->lng->txt('redirect_after_finishing_tst'), 'redirection_enabled');
     $rm_enabled->setChecked($redirection_mode == '0' ? false : true);
     $radio_rm = new ilRadioGroupInputGUI($this->lng->txt('redirect_after_finishing_tst'), 'redirection_mode');
     $always = new ilRadioOption($this->lng->txt('tst_results_access_always'), REDIRECT_ALWAYS);
     $radio_rm->addOption($always);
     $kiosk = new ilRadioOption($this->lng->txt('redirect_in_kiosk_mode'), REDIRECT_KIOSK);
     $radio_rm->addOption($kiosk);
     $radio_rm->setValue(in_array($redirection_mode, array(REDIRECT_ALWAYS, REDIRECT_KIOSK)) ? $redirection_mode : REDIRECT_ALWAYS);
     $rm_enabled->addSubItem($radio_rm);
     $redirection_url = new ilTextInputGUI($this->lng->txt('redirection_url'), 'redirection_url');
     $redirection_url->setValue((string) $this->testOBJ->getRedirectionUrl());
     $redirection_url->setRequired(true);
     $rm_enabled->addSubItem($redirection_url);
     $form->addItem($rm_enabled);
     // Sign submission
     $sign_submission = $this->testOBJ->getSignSubmission();
     $sign_submission_enabled = new ilCheckboxInputGUI($this->lng->txt('sign_submission'), 'sign_submission');
     $sign_submission_enabled->setChecked($sign_submission);
     $sign_submission_enabled->setInfo($this->lng->txt('sign_submission_info'));
     $form->addItem($sign_submission_enabled);
     if (!$this->settingsTemplate || $this->formShowParticipantSection($this->settingsTemplate->getSettings())) {
         // participants properties
         $restrictions = new ilFormSectionHeaderGUI();
         $restrictions->setTitle($this->lng->txt("tst_max_allowed_users"));
         $form->addItem($restrictions);
     }
     $fixedparticipants = new ilCheckboxInputGUI($this->lng->txt('participants_invitation'), "fixedparticipants");
     $fixedparticipants->setValue(1);
     $fixedparticipants->setChecked($this->testOBJ->getFixedParticipants());
     $fixedparticipants->setOptionTitle($this->lng->txt("tst_allow_fixed_participants"));
     $fixedparticipants->setInfo($this->lng->txt("participants_invitation_description"));
     $invited_users = $this->testOBJ->getInvitedUsers();
     if ($total && count($invited_users) == 0) {
         $fixedparticipants->setDisabled(true);
     }
     $form->addItem($fixedparticipants);
     // simultaneous users
     $simul = new ilTextInputGUI($this->lng->txt("tst_allowed_users"), "allowedUsers");
     $simul->setSize(3);
     $simul->setValue($this->testOBJ->getAllowedUsers() ? $this->testOBJ->getAllowedUsers() : '');
     $form->addItem($simul);
     // idle time
     $idle = new ilTextInputGUI($this->lng->txt("tst_allowed_users_time_gap"), "allowedUsersTimeGap");
     $idle->setSize(4);
     $idle->setSuffix($this->lng->txt("seconds"));
     $idle->setValue($this->testOBJ->getAllowedUsersTimeGap() ? $this->testOBJ->getAllowedUsersTimeGap() : '');
     $form->addItem($idle);
     // Edit ecs export settings
     include_once 'Modules/Test/classes/class.ilECSTestSettings.php';
     $ecs = new ilECSTestSettings($this->testOBJ);
     $ecs->addSettingsToForm($form, 'tst');
     // remove items when using template
     if ($this->settingsTemplate) {
         foreach ($this->settingsTemplate->getSettings() as $id => $item) {
             if ($item["hide"]) {
                 $form->removeItemByPostVar($id);
             }
         }
     }
     return $form;
 }
 /**
  * init form search
  *
  * @access protected
  * @param
  * @return
  */
 protected function initFormSearch()
 {
     global $lng;
     $lng->loadLanguageModule('search');
     if (!is_object($this->form)) {
         include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
         $this->form = new ilPropertyFormGUI();
         $this->form->setFormAction($this->ctrl->getFormAction($this));
         $this->form->setTitle($this->lng->txt('cal_share_search_header'));
     }
     $type = new ilRadioGroupInputGUI($this->lng->txt('search_type'), 'query_type');
     $type->setValue($_POST['query_type'] ? $_POST['query_type'] : self::SEARCH_USER);
     $type->setRequired(true);
     $user = new ilRadioOption($this->lng->txt('obj_user'), self::SEARCH_USER);
     $type->addOption($user);
     $role = new ilRadioOption($this->lng->txt('obj_role'), self::SEARCH_ROLE);
     $type->addOption($role);
     $this->form->addItem($type);
     $search = new ilTextInputGUI($this->lng->txt('cal_search'), 'query');
     $search->setValue($_POST['query']);
     $search->setSize(16);
     $search->setMaxLength(128);
     $search->setRequired(true);
     $search->setInfo($this->lng->txt('cal_search_info_share'));
     $this->form->addItem($search);
     $this->form->addCommandButton('sharePerformSearch', $this->lng->txt('search'));
     // $this->form->addCommandButton('manage',$this->lng->txt('cancel'));
 }
 /**
  * FORM NewsItem: Init form.
  *
  * @param	int	$a_mode	Form Edit Mode (IL_FORM_EDIT | IL_FORM_CREATE)
  */
 public function initFormNewsItem($a_mode)
 {
     global $lng, $ilTabs;
     $ilTabs->clearTargets();
     //$this->setTabs();
     $lng->loadLanguageModule("news");
     include "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form_gui = new ilPropertyFormGUI();
     // Property Title
     $text_input = new ilTextInputGUI($lng->txt("news_news_item_title"), "news_title");
     $text_input->setInfo("");
     $text_input->setRequired(true);
     $text_input->setMaxLength(200);
     $this->form_gui->addItem($text_input);
     // Property Content
     $text_area = new ilTextAreaInputGUI($lng->txt("news_news_item_content"), "news_content");
     $text_area->setInfo("");
     $text_area->setRequired(false);
     $this->form_gui->addItem($text_area);
     // Property Visibility
     $radio_group = new ilRadioGroupInputGUI($lng->txt("news_news_item_visibility"), "news_visibility");
     $radio_option = new ilRadioOption($lng->txt("news_visibility_users"), "users");
     $radio_group->addOption($radio_option);
     $radio_option = new ilRadioOption($lng->txt("news_visibility_public"), "public");
     $radio_group->addOption($radio_option);
     $radio_group->setInfo($lng->txt("news_news_item_visibility_info"));
     $radio_group->setRequired(false);
     $radio_group->setValue("users");
     $this->form_gui->addItem($radio_group);
     // Property ContentLong
     $text_area = new ilTextAreaInputGUI($lng->txt("news_news_item_content_long"), "news_content_long");
     $text_area->setInfo($lng->txt("news_news_item_content_long_info"));
     $text_area->setRequired(false);
     $text_area->setCols("40");
     $text_area->setRows("8");
     $text_area->setUseRte(true);
     $this->form_gui->addItem($text_area);
     // save and cancel commands
     if (in_array($a_mode, array(IL_FORM_CREATE, IL_FORM_RE_CREATE))) {
         $this->form_gui->addCommandButton("saveNewsItem", $lng->txt("save"));
         $this->form_gui->addCommandButton("cancelSaveNewsItem", $lng->txt("cancel"));
     } else {
         $this->form_gui->addCommandButton("updateNewsItem", $lng->txt("save"));
         $this->form_gui->addCommandButton("cancelUpdateNewsItem", $lng->txt("cancel"));
     }
     $this->form_gui->setTitle($lng->txt("news_news_item_head"));
     $this->form_gui->setFormAction($this->ctrl->getFormAction($this));
     $this->form_gui->setTitleIcon(ilUtil::getImagePath("icon_news.png"));
     $news_set = new ilSetting("news");
     if (!$news_set->get("enable_rss_for_internal")) {
         $this->form_gui->removeItemByPostVar("news_visibility");
     } else {
         $nv = $this->form_gui->getItemByPostVar("news_visibility");
         if (is_object($nv)) {
             $nv->setValue(ilNewsItem::_getDefaultVisibilityForRefId($_GET["ref_id"]));
         }
     }
 }
 protected function initNewItemGroupForm($a_grp_id = false)
 {
     $this->setModuleSubTabs("new_item_groups");
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $this->lng->loadLanguageModule("meta");
     $def_lng = $this->lng->getDefaultLanguage();
     $title = new ilTextInputGUI($this->lng->txt("title"), "title_" . $def_lng);
     $title->setInfo($this->lng->txt("meta_l_" . $def_lng) . " (" . $this->lng->txt("default_language") . ")");
     $title->setRequired(true);
     $form->addItem($title);
     foreach ($this->lng->getInstalledLanguages() as $lang_id) {
         if ($lang_id != $def_lng) {
             $title = new ilTextInputGUI($this->lng->txt("translation"), "title_" . $lang_id);
             $title->setInfo($this->lng->txt("meta_l_" . $lang_id));
             $form->addItem($title);
         }
     }
     if (!$a_grp_id) {
         $form->setTitle($this->lng->txt("rep_new_item_group_add"));
         $form->setFormAction($this->ctrl->getFormAction($this, "saveNewItemGroup"));
         $form->addCommandButton("saveNewItemGroup", $this->lng->txt("save"));
     } else {
         $form->setTitle($this->lng->txt("rep_new_item_group_edit"));
         $form->setFormAction($this->ctrl->getFormAction($this, "updateNewItemGroup"));
         include_once "Services/Repository/classes/class.ilObjRepositorySettings.php";
         $grp = ilObjRepositorySettings::getNewItemGroups();
         $grp = $grp[$a_grp_id];
         foreach ($grp["titles"] as $id => $value) {
             $field = $form->getItemByPostVar("title_" . $id);
             if ($field) {
                 $field->setValue($value);
             }
         }
         $form->addCommandButton("updateNewItemGroup", $this->lng->txt("save"));
     }
     $form->addCommandButton("listNewItemGroups", $this->lng->txt("cancel"));
     return $form;
 }
 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;
 }
 /**
  * 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());
 }
 /**
  * Init tag style editing form
  *
  * @param        int        $a_mode        Form Edit Mode (IL_FORM_EDIT | IL_FORM_CREATE)
  */
 public function initTagStyleForm($a_mode, $a_cur_tag)
 {
     global $lng, $ilCtrl;
     $ilCtrl->saveParameter($this, array("mq_id"));
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form_gui = new ilPropertyFormGUI();
     $avail_pars = $this->object->getAvailableParameters();
     $groups = $this->object->getStyleParameterGroups();
     // output select lists
     foreach ($groups as $k => $group) {
         // filter groups of properties that should only be
         // displayed with matching tag
         $filtered_groups = ilObjStyleSheet::_getFilteredGroups();
         if (is_array($filtered_groups[$k]) && !in_array($a_cur_tag, $filtered_groups[$k])) {
             continue;
         }
         $sh = new ilFormSectionHeaderGUI();
         $sh->setTitle($lng->txt("sty_" . $k));
         $this->form_gui->addItem($sh);
         foreach ($group as $par) {
             $basepar = explode(".", $par);
             $basepar = $basepar[0];
             $var = str_replace("-", "_", $basepar);
             $up_par = strtoupper($var);
             switch (ilObjStyleSheet::_getStyleParameterInputType($par)) {
                 case "select":
                     $sel_input = new ilSelectInputGUI($lng->txt("sty_" . $var), $basepar);
                     $options = array("" => "");
                     foreach ($avail_pars[$par] as $p) {
                         $options[$p] = $p;
                     }
                     $sel_input->setOptions($options);
                     $this->form_gui->addItem($sel_input);
                     break;
                 case "text":
                     $text_input = new ilTextInputGUI($lng->txt("sty_" . $var), $basepar);
                     $text_input->setMaxLength(200);
                     $text_input->setSize(20);
                     $this->form_gui->addItem($text_input);
                     break;
                 case "fontsize":
                     include_once "./Services/Style/classes/class.ilFontSizeInputGUI.php";
                     $fs_input = new ilFontSizeInputGUI($lng->txt("sty_" . $var), $basepar);
                     $this->form_gui->addItem($fs_input);
                     break;
                 case "numeric_no_perc":
                 case "numeric":
                     include_once "./Services/Style/classes/class.ilNumericStyleValueInputGUI.php";
                     $num_input = new ilNumericStyleValueInputGUI($lng->txt("sty_" . $var), $basepar);
                     if (ilObjStyleSheet::_getStyleParameterInputType($par) == "numeric_no_perc") {
                         $num_input->setAllowPercentage(false);
                     }
                     $this->form_gui->addItem($num_input);
                     break;
                 case "percentage":
                     $per_input = new ilNumberInputGUI($lng->txt("sty_" . $var), $basepar);
                     $per_input->setMinValue(0);
                     $per_input->setMaxValue(100);
                     $per_input->setMaxLength(3);
                     $per_input->setSize(3);
                     $this->form_gui->addItem($per_input);
                     break;
                 case "color":
                     //include_once("./Services/Style/classes/class.ilNumericStyleValueInputGUI.php");
                     $col_input = new ilColorPickerInputGUI($lng->txt("sty_" . $var), $basepar);
                     $col_input->setDefaultColor("");
                     $col_input->setAcceptNamedColors(true);
                     $this->form_gui->addItem($col_input);
                     break;
                 case "trbl_numeric":
                     include_once "./Services/Style/classes/class.ilTRBLNumericStyleValueInputGUI.php";
                     $num_input = new ilTRBLNumericStyleValueInputGUI($lng->txt("sty_" . $var), $basepar);
                     if (ilObjStyleSheet::_getStyleParameterInputType($par) == "trbl_numeric_no_perc") {
                         $num_input->setAllowPercentage(false);
                     }
                     $this->form_gui->addItem($num_input);
                     break;
                 case "border_width":
                     include_once "./Services/Style/classes/class.ilTRBLBorderWidthInputGUI.php";
                     $bw_input = new ilTRBLBorderWidthInputGUI($lng->txt("sty_" . $var), $basepar);
                     $this->form_gui->addItem($bw_input);
                     break;
                 case "border_style":
                     include_once "./Services/Style/classes/class.ilTRBLBorderStyleInputGUI.php";
                     $bw_input = new ilTRBLBorderStyleInputGUI($lng->txt("sty_" . $var), $basepar);
                     $this->form_gui->addItem($bw_input);
                     break;
                 case "trbl_color":
                     include_once "./Services/Style/classes/class.ilTRBLColorPickerInputGUI.php";
                     $col_input = new ilTRBLColorPickerInputGUI($lng->txt("sty_" . $var), $basepar);
                     $col_input->setAcceptNamedColors(true);
                     $this->form_gui->addItem($col_input);
                     break;
                 case "background_image":
                     include_once "./Services/Style/classes/class.ilBackgroundImageInputGUI.php";
                     $im_input = new ilBackgroundImageInputGUI($lng->txt("sty_" . $var), $basepar);
                     $imgs = array();
                     foreach ($this->object->getImages() as $entry) {
                         $imgs[] = $entry["entry"];
                     }
                     $im_input->setImages($imgs);
                     $this->form_gui->addItem($im_input);
                     break;
                 case "background_position":
                     include_once "./Services/Style/classes/class.ilBackgroundPositionInputGUI.php";
                     $im_input = new ilBackgroundPositionInputGUI($lng->txt("sty_" . $var), $basepar);
                     $this->form_gui->addItem($im_input);
                     break;
             }
         }
     }
     // custom parameters
     $sh = new ilFormSectionHeaderGUI();
     $sh->setTitle($lng->txt("sty_custom"));
     $this->form_gui->addItem($sh);
     // custom parameters
     $ti = new ilTextInputGUI($this->lng->txt("sty_custom_par"), "custom_par");
     $ti->setMaxLength(300);
     $ti->setSize(80);
     $ti->setMulti(true);
     $ti->setInfo($this->lng->txt("sty_custom_par_info"));
     $this->form_gui->addItem($ti);
     // save and cancel commands
     $this->form_gui->addCommandButton("updateTagStyle", $lng->txt("save_return"));
     $this->form_gui->addCommandButton("refreshTagStyle", $lng->txt("save_refresh"));
     //		$this->form_gui->setTitle($lng->txt("edit"));
     $this->form_gui->setFormAction($this->ctrl->getFormAction($this));
 }
 /**
  * init settings form
  *
  * @access protected
  */
 protected function initSettingsForm($a_mode = 'update')
 {
     if (is_object($this->form)) {
         return true;
     }
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($this->ctrl->getFormAction($this, 'settings'));
     $this->form->setTitle($this->lng->txt('ecs_connection_settings'));
     $ena = new ilCheckboxInputGUI($this->lng->txt('ecs_active'), 'active');
     $ena->setChecked($this->settings->isEnabled());
     $ena->setValue(1);
     $this->form->addItem($ena);
     $ser = new ilTextInputGUI($this->lng->txt('ecs_server_url'), 'server');
     $ser->setValue((string) $this->settings->getServer());
     $ser->setRequired(true);
     $this->form->addItem($ser);
     $pro = new ilSelectInputGUI($this->lng->txt('ecs_protocol'), 'protocol');
     // fixed to https
     #$pro->setOptions(array(ilECSSetting::PROTOCOL_HTTP => $this->lng->txt('http'),
     #		ilECSSetting::PROTOCOL_HTTPS => $this->lng->txt('https')));
     $pro->setOptions(array(ilECSSetting::PROTOCOL_HTTPS => 'HTTPS'));
     $pro->setValue($this->settings->getProtocol());
     $pro->setRequired(true);
     $this->form->addItem($pro);
     $por = new ilTextInputGUI($this->lng->txt('ecs_port'), 'port');
     $por->setSize(5);
     $por->setMaxLength(5);
     $por->setValue((string) $this->settings->getPort());
     $por->setRequired(true);
     $this->form->addItem($por);
     $tcer = new ilRadioGroupInputGUI($this->lng->txt('ecs_auth_type'), 'auth_type');
     $tcer->setValue($this->settings->getAuthType());
     $this->form->addItem($tcer);
     // Certificate based authentication
     $cert_based = new ilRadioOption($this->lng->txt('ecs_auth_type_cert'), ilECSSetting::AUTH_CERTIFICATE);
     $tcer->addOption($cert_based);
     $cli = new ilTextInputGUI($this->lng->txt('ecs_client_cert'), 'client_cert');
     $cli->setSize(60);
     $cli->setValue((string) $this->settings->getClientCertPath());
     $cli->setRequired(true);
     $cert_based->addSubItem($cli);
     $key = new ilTextInputGUI($this->lng->txt('ecs_cert_key'), 'key_path');
     $key->setSize(60);
     $key->setValue((string) $this->settings->getKeyPath());
     $key->setRequired(true);
     $cert_based->addSubItem($key);
     $cerp = new ilTextInputGUI($this->lng->txt('ecs_key_password'), 'key_password');
     $cerp->setSize(12);
     $cerp->setValue((string) $this->settings->getKeyPassword());
     $cerp->setInputType('password');
     $cerp->setRequired(true);
     $cert_based->addSubItem($cerp);
     $cer = new ilTextInputGUI($this->lng->txt('ecs_ca_cert'), 'ca_cert');
     $cer->setSize(60);
     $cer->setValue((string) $this->settings->getCACertPath());
     $cer->setRequired(true);
     $cert_based->addSubItem($cer);
     // Apache auth
     $apa_based = new ilRadioOption($this->lng->txt('ecs_auth_type_apache'), ilECSSetting::AUTH_APACHE);
     $tcer->addOption($apa_based);
     $user = new ilTextInputGUI($this->lng->txt('ecs_apache_user'), 'auth_user');
     $user->setSize(32);
     $user->setValue((string) $this->settings->getAuthUser());
     $user->setRequired(true);
     $apa_based->addSubItem($user);
     $pass = new ilPasswordInputGUI($this->lng->txt('ecs_apache_pass'), 'auth_pass');
     $pass->setRetype(false);
     $pass->setSize(16);
     $pass->setMaxLength(32);
     $pass->setValue((string) $this->settings->getAuthPass());
     $pass->setRequired(true);
     $apa_based->addSubItem($pass);
     $ser = new ilNonEditableValueGUI($this->lng->txt('cert_serial'));
     $ser->setValue($this->settings->getCertSerialNumber() ? $this->settings->getCertSerialNumber() : $this->lng->txt('ecs_no_value'));
     $cert_based->addSubItem($ser);
     $loc = new ilFormSectionHeaderGUI();
     $loc->setTitle($this->lng->txt('ecs_local_settings'));
     $this->form->addItem($loc);
     $pol = new ilDurationInputGUI($this->lng->txt('ecs_polling'), 'polling');
     $pol->setShowDays(false);
     $pol->setShowHours(false);
     $pol->setShowMinutes(true);
     $pol->setShowSeconds(true);
     $pol->setSeconds($this->settings->getPollingTimeSeconds());
     $pol->setMinutes($this->settings->getPollingTimeMinutes());
     $pol->setRequired(true);
     $pol->setInfo($this->lng->txt('ecs_polling_info'));
     $this->form->addItem($pol);
     $imp = new ilCustomInputGUI($this->lng->txt('ecs_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->settings->getImportId());
     if ($this->settings->getImportId()) {
         $tpl->setVariable('COMPLETE_PATH', $this->buildPath($this->settings->getImportId()));
     }
     $imp->setHTML($tpl->get());
     $imp->setInfo($this->lng->txt('ecs_import_id_info'));
     $this->form->addItem($imp);
     $loc = new ilFormSectionHeaderGUI();
     $loc->setTitle($this->lng->txt('ecs_remote_user_settings'));
     $this->form->addItem($loc);
     $role = new ilSelectInputGUI($this->lng->txt('ecs_role'), 'global_role');
     $role->setOptions($this->prepareRoleSelect());
     $role->setValue($this->settings->getGlobalRole());
     $role->setInfo($this->lng->txt('ecs_global_role_info'));
     $role->setRequired(true);
     $this->form->addItem($role);
     $duration = new ilDurationInputGUI($this->lng->txt('ecs_account_duration'), 'duration');
     $duration->setInfo($this->lng->txt('ecs_account_duration_info'));
     $duration->setMonths($this->settings->getDuration());
     $duration->setShowSeconds(false);
     $duration->setShowMinutes(false);
     $duration->setShowHours(false);
     $duration->setShowDays(false);
     $duration->setShowMonths(true);
     $duration->setRequired(true);
     $this->form->addItem($duration);
     // Email recipients
     $loc = new ilFormSectionHeaderGUI();
     $loc->setTitle($this->lng->txt('ecs_notifications'));
     $this->form->addItem($loc);
     $rcp_user = new ilTextInputGUI($this->lng->txt('ecs_user_rcp'), 'user_recipients');
     $rcp_user->setValue((string) $this->settings->getUserRecipientsAsString());
     $rcp_user->setInfo($this->lng->txt('ecs_user_rcp_info'));
     $this->form->addItem($rcp_user);
     $rcp_econ = new ilTextInputGUI($this->lng->txt('ecs_econ_rcp'), 'econtent_recipients');
     $rcp_econ->setValue((string) $this->settings->getEContentRecipientsAsString());
     $rcp_econ->setInfo($this->lng->txt('ecs_econ_rcp_info'));
     $this->form->addItem($rcp_econ);
     $rcp_app = new ilTextInputGUI($this->lng->txt('ecs_approval_rcp'), 'approval_recipients');
     $rcp_app->setValue((string) $this->settings->getApprovalRecipientsAsString());
     $rcp_app->setInfo($this->lng->txt('ecs_approval_rcp_info'));
     $this->form->addItem($rcp_app);
     if ($a_mode == 'update') {
         $this->form->addCommandButton('update', $this->lng->txt('save'));
     } else {
         $this->form->addCommandButton('save', $this->lng->txt('save'));
     }
     $this->form->addCommandButton('overview', $this->lng->txt('cancel'));
 }
 /**
  * Shows the certificate editor for ILIAS tests
  */
 public function certificateEditor()
 {
     global $ilAccess;
     $form_fields = array();
     if (strcmp($this->ctrl->getCmd(), "certificateSave") == 0) {
         $form_fields = $this->getFormFieldsFromPOST();
     } else {
         $form_fields = $this->getFormFieldsFromFO();
     }
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setPreventDoubleSubmission(false);
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTitle($this->lng->txt("certificate_edit"));
     $form->setMultipart(TRUE);
     $form->setTableWidth("100%");
     $form->setId("certificate");
     $active = new ilCheckboxInputGUI($this->lng->txt("active"), "active");
     $active->setChecked($form_fields["active"]);
     $form->addItem($active);
     $import = new ilFileInputGUI($this->lng->txt("import"), "certificate_import");
     $import->setRequired(FALSE);
     $import->setSuffixes(array("zip"));
     // handle the certificate import
     if (strlen($_FILES["certificate_import"]["tmp_name"])) {
         if ($import->checkInput()) {
             $result = $this->object->importCertificate($_FILES["certificate_import"]["tmp_name"], $_FILES["certificate_import"]["name"]);
             if ($result == FALSE) {
                 $import->setAlert($this->lng->txt("certificate_error_import"));
             } else {
                 $this->ctrl->redirect($this, "certificateEditor");
             }
         }
     }
     $form->addItem($import);
     $pageformat = new ilRadioGroupInputGUI($this->lng->txt("certificate_page_format"), "pageformat");
     $pageformats = $this->object->getPageFormats();
     $pageformat->setValue($form_fields["pageformat"]);
     foreach ($pageformats as $format) {
         $option = new ilRadioOption($format["name"], $format["value"]);
         if (strcmp($format["value"], "custom") == 0) {
             $pageheight = new ilTextInputGUI($this->lng->txt("certificate_pageheight"), "pageheight");
             $pageheight->setValue($form_fields["pageheight"]);
             $pageheight->setSize(6);
             $pageheight->setValidationRegexp("/[0123456789\\.](cm|mm|in|pt|pc|px|em)/is");
             $pageheight->setInfo($this->lng->txt("certificate_unit_description"));
             $pageheight->setRequired(true);
             $option->addSubitem($pageheight);
             $pagewidth = new ilTextInputGUI($this->lng->txt("certificate_pagewidth"), "pagewidth");
             $pagewidth->setValue($form_fields["pagewidth"]);
             $pagewidth->setSize(6);
             $pagewidth->setValidationRegexp("/[0123456789\\.](cm|mm|in|pt|pc|px|em)/is");
             $pagewidth->setInfo($this->lng->txt("certificate_unit_description"));
             $pagewidth->setRequired(true);
             $option->addSubitem($pagewidth);
         }
         $pageformat->addOption($option);
     }
     $pageformat->setRequired(true);
     if (strcmp($this->ctrl->getCmd(), "certificateSave") == 0) {
         $pageformat->checkInput();
     }
     $form->addItem($pageformat);
     $bgimage = new ilImageFileInputGUI($this->lng->txt("certificate_background_image"), "background");
     $bgimage->setRequired(FALSE);
     $bgimage->setUseCache(false);
     if (count($_POST)) {
         // handle the background upload
         if (strlen($_FILES["background"]["tmp_name"])) {
             if ($bgimage->checkInput()) {
                 $result = $this->object->uploadBackgroundImage($_FILES["background"]["tmp_name"]);
                 if ($result == FALSE) {
                     $bgimage->setAlert($this->lng->txt("certificate_error_upload_bgimage"));
                 }
             }
         }
     }
     if (!$this->object->hasBackgroundImage()) {
         include_once "./Services/Certificate/classes/class.ilObjCertificateSettingsAccess.php";
         if (ilObjCertificateSettingsAccess::hasBackgroundImage()) {
             $bgimage->setImage(ilObjCertificateSettingsAccess::getBackgroundImageThumbPathWeb());
         }
     } else {
         $bgimage->setImage($this->object->getBackgroundImageThumbPathWeb());
     }
     $form->addItem($bgimage);
     $padding_top = new ilTextInputGUI($this->lng->txt("certificate_padding_top"), "padding_top");
     $padding_top->setRequired(TRUE);
     $padding_top->setValue($form_fields["padding_top"]);
     $padding_top->setSize(6);
     $padding_top->setValidationRegexp("/[0123456789\\.](cm|mm|in|pt|pc|px|em)/is");
     $padding_top->setInfo($this->lng->txt("certificate_unit_description"));
     if (strcmp($this->ctrl->getCmd(), "certificateSave") == 0) {
         $padding_top->checkInput();
     }
     $form->addItem($padding_top);
     $rect = new ilCSSRectInputGUI($this->lng->txt("certificate_margin_body"), "margin_body");
     $rect->setRequired(TRUE);
     $rect->setUseUnits(TRUE);
     $rect->setTop($form_fields["margin_body_top"]);
     $rect->setBottom($form_fields["margin_body_bottom"]);
     $rect->setLeft($form_fields["margin_body_left"]);
     $rect->setRight($form_fields["margin_body_right"]);
     $rect->setInfo($this->lng->txt("certificate_unit_description"));
     if (strcmp($this->ctrl->getCmd(), "certificateSave") == 0) {
         $rect->checkInput();
     }
     $form->addItem($rect);
     $certificate = new ilTextAreaInputGUI($this->lng->txt("certificate_text"), "certificate_text");
     $certificate->removePlugin('ilimgupload');
     $certificate->setValue($form_fields["certificate_text"]);
     $certificate->setRequired(TRUE);
     $certificate->setRows(20);
     $certificate->setCols(80);
     // fraunhpatch start
     $common_desc_tpl = new ilTemplate("tpl.common_desc.html", true, true, "Services/Certificate");
     foreach (ilCertificate::getCustomCertificateFields() as $f) {
         $common_desc_tpl->setCurrentBlock("cert_field");
         $common_desc_tpl->setVariable("PH", $f["ph"]);
         $common_desc_tpl->setVariable("PH_TXT", $f["name"]);
         $common_desc_tpl->parseCurrentBlock();
     }
     $common_desc = $common_desc_tpl->get();
     // fraunhpatch start
     $certificate->setInfo($this->object->getAdapter()->getCertificateVariablesDescription() . $common_desc);
     $certificate->setUseRte(TRUE, '3.4.7');
     $tags = array("br", "em", "font", "li", "ol", "p", "span", "strong", "u", "ul");
     $certificate->setRteTags($tags);
     if (strcmp($this->ctrl->getCmd(), "certificateSave") == 0) {
         $certificate->checkInput();
     }
     $form->addItem($certificate);
     $this->object->getAdapter()->addAdditionalFormElements($form, $form_fields);
     if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
         if ($this->object->isComplete() || $this->object->hasBackgroundImage()) {
             $form->addCommandButton("certificatePreview", $this->lng->txt("certificate_preview"));
             $form->addCommandButton("certificateExportFO", $this->lng->txt("certificate_export"));
             $form->addCommandButton("certificateDelete", $this->lng->txt("delete"));
         }
         $form->addCommandButton("certificateSave", $this->lng->txt("save"));
     }
     $this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
     if (strcmp($this->ctrl->getCmd(), "certificateSave") == 0) {
         if ($_POST["background_delete"]) {
             $this->object->deleteBackgroundImage();
         }
         if ($form->checkInput()) {
             try {
                 $xslfo = $this->object->processXHTML2FO($form_fields);
                 $this->object->getAdapter()->saveFormFields($form_fields);
                 $this->object->saveCertificate($xslfo);
                 $this->object->writeActive($form_fields["active"]);
                 ilUtil::sendSuccess($this->lng->txt("saved_successfully"), TRUE);
                 $this->ctrl->redirect($this, "certificateEditor");
             } catch (Exception $e) {
                 ilUtil::sendFailure($e->getMessage());
             }
         }
     }
 }
 /**
  * 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'));
 }
 private function createAndSetParticipantsMultiTextInput($a_bookingData)
 {
     global $rssPermission;
     $participants_input = new ilTextInputGUI($this->lng->txt("rep_robj_xrs_participants_list"), "participants");
     $participants_input->setMulti(true);
     $ajax_datasource = $this->ctrl->getLinkTarget($this, 'doUserAutoComplete', '', true);
     $participants_input->setDataSource($ajax_datasource);
     $participants_input->setInfo($this->getMaxRoomAllocationInfo());
     if (!empty($a_bookingData[0])) {
         $participants_input->setValue($a_bookingData[0]);
     }
     $participants_input->setMultiValues($a_bookingData);
     if ($this->mode == 'show' || !$rssPermission->checkPrivilege(ilRoomSharingPrivilegesConstants::ADD_PARTICIPANTS)) {
         $participants_input->setDisabled(true);
     }
     return $participants_input;
 }
 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'));
 }
 /**
  * 
  * Initialize proxy settings form
  * 
  * @access	public
  * 
  */
 private function initProxyForm()
 {
     global $lng, $ilCtrl;
     $this->setServerInfoSubTabs('proxy');
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($ilCtrl->getFormAction($this, 'saveProxy'));
     // Proxy status
     $proxs = new ilCheckboxInputGUI($lng->txt('proxy_status'), 'proxy_status');
     $proxs->setInfo($lng->txt('proxy_status_info'));
     $proxs->setValue(1);
     $this->form->addItem($proxs);
     // Proxy availability
     $proxa = new ilCustomInputGUI('', 'proxy_availability');
     $proxs->addSubItem($proxa);
     // Proxy
     $prox = new ilTextInputGUI($lng->txt('proxy_host'), 'proxy_host');
     $prox->setInfo($lng->txt('proxy_host_info'));
     $proxs->addSubItem($prox);
     // Proxy Port
     $proxp = new ilTextInputGUI($lng->txt('proxy_port'), 'proxy_port');
     $proxp->setInfo($lng->txt('proxy_port_info'));
     $proxp->setSize(10);
     $proxp->setMaxLength(10);
     $proxs->addSubItem($proxp);
     // save and cancel commands
     $this->form->addCommandButton('saveProxy', $lng->txt('save'));
 }
 /**
  * build settings form
  * @return object
  */
 protected function initSettingsForm()
 {
     global $ilDB, $ilUser;
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $mng = new ilTextInputGUI($this->lng->txt('cal_ch_manager'), 'mng');
     $mng->setInfo($this->lng->txt('cal_ch_manager_info'));
     $form->addItem($mng);
     $mng->setValue(ilConsultationHourAppointments::getManager(true));
     $form->setTitle($this->lng->txt('settings'));
     $form->addCommandButton('updateSettings', $this->lng->txt('save'));
     // $form->addCommandButton('appointmentList', $this->lng->txt('cancel'));
     return $form;
 }
 /**
  * Init the mapping form
  */
 protected function cInitMappingForm($current_node, $current_attribute)
 {
     include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributes.php';
     $attributes_obj = ilECSCourseAttributes::getInstance($this->getServer()->getServerId(), $this->getMid());
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setTableWidth("100%");
     $this->ctrl->setParameter($this, 'ecs_ca', $current_attribute);
     $form->setFormAction($this->ctrl->getFormAction($this));
     $this->ctrl->setParameter($this, 'ecs_ca', '');
     $form->setTitle($this->lng->txt('ecs_cmap_mapping_form_title') . ' ' . ilObject::_lookupTitle(ilObject::_lookupObjId($current_node)));
     // Iterate through all current attributes
     $attributes = $attributes_obj->getAttributeSequence($current_attribute);
     foreach ($attributes as $att_name) {
         include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseMappingRule.php';
         $rule = ilECSCourseMappingRule::getInstanceByAttribute($this->getServer()->getServerId(), $this->getMid(), $current_node, $att_name);
         $section = new ilFormSectionHeaderGUI();
         $section->setTitle($this->lng->txt('ecs_cmap_att_' . $att_name));
         // Filter
         $form->addItem($section);
         $isfilter = new ilRadioGroupInputGUI($this->lng->txt('ecs_cmap_form_filter'), $att_name . '_is_filter');
         $isfilter->setValue($rule->isFilterEnabled() ? 1 : 0);
         $all_values = new ilRadioOption($this->lng->txt('ecs_cmap_form_all_values'), 0);
         $isfilter->addOption($all_values);
         $use_filter = new ilRadioOption($this->lng->txt('ecs_cmap_form_filter_by_values'), 1);
         $filter = new ilTextInputGUI('', $att_name . '_filter');
         $filter->setInfo($this->lng->txt('ecs_cmap_form_filter_info'));
         $filter->setSize(50);
         $filter->setMaxLength(512);
         $filter->setRequired(true);
         $filter->setValue($rule->getFilter());
         $use_filter->addSubItem($filter);
         $isfilter->addOption($use_filter);
         $form->addItem($isfilter);
         // Create subdirs
         $subdirs = new ilCheckboxInputGUI($this->lng->txt('ecs_cmap_form_create_subdirs'), $att_name . '_subdirs');
         $subdirs->setChecked($rule->isSubdirCreationEnabled());
         $subdirs->setValue(1);
         // Subdir types (disabled in spec)
         /*
         $subdir_type = new ilRadioGroupInputGUI($this->lng->txt('ecs_cmap_form_subdir_type'), $att_name.'_subdir_type');
         $subdir_type->setValue($rule->getSubDirectoryType());
         
         $value = new ilRadioOption($this->lng->txt('ecs_cmap_form_subdir_value'),  ilECSCourseMappingRule::SUBDIR_VALUE);
         $subdir_type->addOption($value);
         
         $name = new ilRadioOption($this->lng->txt('ecs_cmap_form_subdir_name'),  ilECSCourseMappingRule::SUBDIR_ATTRIBUTE_NAME);
         $subdir_type->addOption($name);
         
         $subdirs->addSubItem($subdir_type);
         */
         $form->addItem($subdirs);
         // Directory relations
         /*
         $upper_attributes = ilECSCourseAttributes::getInstance(
         		$this->getServer()->getServerId(),
         		$this->getMid())->getUpperAttributes($att_name);
         
         if($upper_attributes)
         {
         	$dir_relation = new ilRadioGroupInputGUI($this->lng->txt('ecs_cmap_form_dir_relation'),$att_name.'_dir_relation');
         
         	$current_dir = new ilRadioOption($this->lng->txt('ecs_cmap_form_current_dir'),'');
         	$dir_relation->addOption($current_dir);
         }
         foreach($upper_attributes as $subdir_name)
         {
         	$subdir = new ilRadioOption($this->lng->txt('ecs_cmap_att_'.$subdir_name),$subdir_name);
         	$dir_relation->addOption($subdir);
         }
         if($upper_attributes)
         {
         	$dir_relation->setValue((string) $rule->getDirectory());
         	$form->addItem($dir_relation);
         }
         */
     }
     // add list of attributes
     $hidden_atts = new ilHiddenInputGUI('attributes');
     $hidden_atts->setValue(implode(',', $attributes));
     $form->addItem($hidden_atts);
     if ($current_attribute) {
         $form->addCommandButton('cSaveOverview', $this->lng->txt('save'));
     }
     if ($attributes_obj->getNextAttributeName($current_attribute)) {
         $form->addCommandButton('cAddAttribute', $this->lng->txt('ecs_cmap_add_attribute_btn'));
     }
     if ($attributes_obj->getPreviousAttributeName($current_attribute)) {
         $form->addCommandButton('cDeleteAttribute', $this->lng->txt('ecs_cmap_delete_attribute_btn'));
     }
     if (ilECSCourseMappingRule::hasRules($this->getServer()->getServerId(), $this->getMid(), $current_node)) {
         $form->addCommandButton('cDeleteRulesOfNode', $this->lng->txt('ecs_cmap_delete_rule'));
     }
     #$form->addCommandButton('cInitOverview', $this->lng->txt('cancel'));
     $form->setShowTopButtons(false);
     return $form;
 }