/**
  * add the configuration elements to a property form
  * @param object	property form
  */
 public function addFormProperties(ilPropertyFormGUI $a_form)
 {
     global $lng;
     $lng->loadLanguageModule('adve');
     $availability = new ilRadioGroupInputGUI($lng->txt('char_selector'), 'char_selector_availability');
     $inactive = new ilRadioOption($lng->txt('char_selector_inactive'), ilCharSelectorConfig::INACTIVE);
     $inactive->setInfo($lng->txt('char_selector_inactive_info_' . $this->config->getContext()));
     $inherit = new ilRadioOption($lng->txt('char_selector_inherit'), ilCharSelectorConfig::INHERIT);
     $inherit->setInfo($lng->txt('char_selector_inherit_info_' . $this->config->getContext()));
     $enabled = new ilRadioOption($lng->txt('char_selector_enabled'), ilCharSelectorConfig::ENABLED);
     $enabled->setInfo($lng->txt('char_selector_enabled_info_' . $this->config->getContext()));
     $disabled = new ilRadioOption($lng->txt('char_selector_disabled'), ilCharSelectorConfig::DISABLED);
     $disabled->setInfo($lng->txt('char_selector_disabled_info_' . $this->config->getContext()));
     $blocks = new ilSelectInputGUI($lng->txt('char_selector_blocks'), 'char_selector_blocks');
     $blocks->setInfo($lng->txt('char_selector_blocks_info'));
     $blocks->setOptions($this->config->getBlockOptions());
     $blocks->setMulti(true);
     $enabled->addSubItem($blocks);
     $custom_items = new ilTextAreaInputGUI($lng->txt('char_selector_custom_items'), 'char_selector_custom_items');
     $tpl = new ilTemplate("tpl.char_selector_custom_info.html", true, true, "Services/UIComponent/CharSelector");
     $tpl->setVariable('1', $lng->txt('char_selector_custom_items_info1'));
     $tpl->setVariable('2a', $lng->txt('char_selector_custom_items_info2a'));
     $tpl->setVariable('2b', $lng->txt('char_selector_custom_items_info2b'));
     $tpl->setVariable('3a', $lng->txt('char_selector_custom_items_info3a'));
     $tpl->setVariable('3b', $lng->txt('char_selector_custom_items_info3b'));
     $tpl->setVariable('4a', $lng->txt('char_selector_custom_items_info4a'));
     $tpl->setVariable('4b', $lng->txt('char_selector_custom_items_info4b'));
     $tpl->setVariable('5a', $lng->txt('char_selector_custom_items_info5a'));
     $tpl->setVariable('5b', $lng->txt('char_selector_custom_items_info5b'));
     $tpl->setVariable('6a', $lng->txt('char_selector_custom_items_info6a'));
     $tpl->setVariable('6b', $lng->txt('char_selector_custom_items_info6b'));
     $custom_items->setInfo($tpl->get());
     $enabled->addSubItem($custom_items);
     switch ($this->config->getContext()) {
         case ilCharSelectorConfig::CONTEXT_ADMIN:
             $availability->addOption($inactive);
             $availability->addOption($enabled);
             $availability->addOption($disabled);
             $a_form->addItem($availability);
             break;
         case ilCharSelectorConfig::CONTEXT_USER:
         case ilCharSelectorConfig::CONTEXT_TEST:
             $availability->addOption($inherit);
             $availability->addOption($enabled);
             $availability->addOption($disabled);
             $a_form->addItem($availability);
             break;
     }
 }
 public function initSettingsForm($a_mode = 'edit')
 {
     $this->settings_form = new ilPropertyFormGUI();
     $this->settings_form->setTitle($this->lng->txt('payment_news_settings'));
     $oSelectBox = new ilSelectInputGUI($this->lng->txt('payment_news_archive_period'), 'archive_period');
     $oSelectBox->setInfo($this->lng->txt('payment_news_archive_period_info'));
     $options = array();
     for ($i = 5; $i <= 100; $i += 5) {
         $options[$i] = $i;
     }
     $oSelectBox->setOptions($options);
     $this->settings_form->addItem($oSelectBox);
     $this->settings_form->addCommandButton('saveSettings', $this->lng->txt('save'));
     $this->settings_form->addCommandButton('showNews', $this->lng->txt('cancel'));
     $this->settings_form->setFormAction($this->ctrl->getFormaction($this, 'saveSettings'));
 }
 /**
  * Init configuration form.
  *
  * @return object form object
  */
 public function initConfigurationForm()
 {
     global $lng, $ilCtrl;
     $pl = $this->getPluginObject();
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     // Setting for the ephorus logging
     $ephorus_logging = new ilCheckboxInputGUI($pl->txt("ephorus_logging"), "ephorus_logging");
     $ephorus_logging->setValue(1);
     $ephorus_logging->setInfo($pl->txt("ephorus_logging_description"));
     $form->addItem($ephorus_logging);
     // Setting for the hand-in code
     $handin_code = new ilTextInputGUI($pl->txt("handin_code"), "handin_code");
     $handin_code->setRequired(true);
     $form->addItem($handin_code);
     // Setting for the hand-in address
     $handin_address = new ilTextInputGUI($pl->txt("handin_address"), "handin_address");
     $handin_address->setSize(80);
     $handin_address->setRequired(true);
     $form->addItem($handin_address);
     // Setting for the index address
     $index_address = new ilTextInputGUI($pl->txt("index_address"), "index_address");
     $index_address->setSize(80);
     $index_address->setRequired(true);
     $form->addItem($index_address);
     // Setting for the processtype
     $processtype = new ilSelectInputGUI($pl->txt("default_processtype"), "processtype");
     $processtype->setOptions(array(1 => $pl->txt("default"), 3 => $pl->txt("private")));
     $processtype->setInfo($pl->txt("default_processtype_description"));
     $form->addItem($processtype);
     // Setting for the disclosure
     $disclosure = new ilTextAreaInputGUI($pl->txt("disclosure"), "disclosure");
     $disclosure->setCols(79);
     $disclosure->setRows(4);
     $form->addItem($disclosure);
     $form->addCommandButton("save", $lng->txt("save") . " / " . $pl->txt("check_connection"));
     $form->setTitle($pl->txt("ephorus_plugin_configuration"));
     $form->setFormAction($ilCtrl->getFormAction($this));
     return $form;
 }
 public function generalSettingsObject()
 {
     global $rbacsystem, $ilSetting;
     /**
      * @var $this->object ilObject
      */
     // MINIMUM ACCESS LEVEL = 'read'
     if (!$rbacsystem->checkAccess('read', $this->object->getRefId())) {
         $this->ilErr->raiseError($this->lng->txt('msg_no_perm_read'), $this->ilErr->MESSAGE);
     }
     $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment');
     $genSet = ilPaymentSettings::_getInstance();
     $genSetData = $genSet->getAll();
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this, 'saveGeneralSettings'));
     $form->setTitle($this->lng->txt('pays_general_settings'));
     $form->addCommandButton('saveGeneralSettings', $this->lng->txt('save'));
     // enable webshop
     $formItem = new ilCheckboxInputGUI($this->lng->txt('pay_enable_shop'), 'shop_enabled');
     $formItem->setChecked((int) $genSetData['shop_enabled']);
     $formItem->setInfo($this->lng->txt('pay_enable_shop_info'));
     $form->addItem($formItem);
     $formItem = new ilTextInputGUI($this->lng->txt('pays_currency_unit'), 'currency_unit');
     $formItem->setSize(5);
     $formItem->setValue($this->error != '' && isset($_POST['currency_unit']) ? ilUtil::prepareFormOutput($_POST['currency_unit'], true) : ilUtil::prepareFormOutput($genSetData['currency_unit'], true));
     $formItem->setRequired(true);
     $form->addItem($formItem);
     $formItem = new ilTextAreaInputGUI($this->lng->txt('pays_address'), 'address');
     $formItem->setRows(7);
     $formItem->setCols(35);
     $formItem->setRequired(true);
     $formItem->setValue($this->error != '' && isset($_POST['address']) ? ilUtil::prepareFormOutput($_POST['address'], true) : $genSetData['address']);
     $form->addItem($formItem);
     $formItem = new ilTextAreaInputGUI($this->lng->txt('pays_bank_data'), 'bank_data');
     $formItem->setRows(7);
     $formItem->setCols(35);
     $formItem->setRequired(true);
     $formItem->setValue($this->error != '' && isset($_POST['bank_data']) ? ilUtil::prepareFormOutput($_POST['bank_data'], true) : $genSetData['bank_data']);
     $form->addItem($formItem);
     $formItem = new ilTextAreaInputGUI($this->lng->txt('pays_add_info'), 'add_info');
     $formItem->setRows(7);
     $formItem->setCols(35);
     $formItem->setValue($this->error != '' && isset($_POST['add_info']) ? ilUtil::prepareFormOutput($_POST['add_info'], true) : $genSetData['add_info']);
     $form->addItem($formItem);
     $formItem = new ilTextInputGUI($this->lng->txt('pays_pdf_path'), 'pdf_path');
     $formItem->setValue($this->error != "" && isset($_POST['pdf_path']) ? ilUtil::prepareFormOutput($_POST['pdf_path'], true) : ilUtil::prepareFormOutput($genSetData['pdf_path'], true));
     $formItem->setRequired(true);
     $form->addItem($formItem);
     // max hits
     $formItem = new ilSelectInputGUI($this->lng->txt('pay_max_hits'), 'max_hits');
     $formItem->setValue($genSetData['max_hits']);
     $options = array();
     for ($i = 10; $i <= 100; $i += 10) {
         $options[$i] = $i;
     }
     $formItem->setOptions($options);
     $formItem->setInfo($this->lng->txt('pay_max_hits_info'));
     $form->addItem($formItem);
     // hide advanced search
     $formItem = new ilCheckboxInputGUI($this->lng->txt('pay_hide_advanced_search'), 'hide_advanced_search');
     $formItem->setChecked((int) $genSetData['hide_advanced_search']);
     $formItem->setInfo($this->lng->txt('pay_hide_advanced_search_info'));
     $form->addItem($formItem);
     // hide shop news
     $formItem = new ilCheckboxInputGUI($this->lng->txt('pay_hide_news'), 'hide_news');
     $formItem->setChecked((int) $genSetData['hide_news']);
     $formItem->setInfo($this->lng->txt('pay_hide_news_info'));
     $form->addItem($formItem);
     // Hide coupons
     $formItem = new ilCheckboxInputGUI($this->lng->txt('pay_hide_coupons'), 'hide_coupons');
     $formItem->setChecked((int) $genSetData['hide_coupons']);
     $formItem->setInfo($this->lng->txt('pay_hide_coupons'));
     $form->addItem($formItem);
     // hide shop news
     $formItem = new ilCheckboxInputGUI($this->lng->txt('pay_hide_shop_info'), 'hide_shop_info');
     $formItem->setChecked((int) $genSetData['hide_shop_info']);
     $formItem->setInfo($this->lng->txt('pay_hide_shop_info_info'));
     $form->addItem($formItem);
     // use shop specials
     $formItem = new ilCheckboxInputGUI($this->lng->txt('use_shop_specials'), 'use_shop_specials');
     $formItem->setChecked((int) $genSetData['use_shop_specials']);
     $formItem->setInfo($this->lng->txt('use_shop_specials_info'));
     $form->addItem($formItem);
     // show general filter
     $formItem = new ilCheckboxInputGUI($this->lng->txt('show_general_filter'), 'show_general_filter');
     $formItem->setChecked((int) $genSetData['show_general_filter']);
     $formItem->setInfo($this->lng->txt('show_general_filter_info'));
     $form->addItem($formItem);
     // show shop explorer
     $formItem = new ilCheckboxInputGUI($this->lng->txt('show_shop_explorer'), 'show_shop_explorer');
     $formItem->setChecked((int) $genSetData['show_shop_explorer']);
     $formItem->setInfo($this->lng->txt('show_shop_explorer_info'));
     $form->addItem($formItem);
     /**/
     // Enable payment notifications
     $payment_noti = new ilCheckboxInputGUI($this->lng->txt("payment_notification"), "payment_notification");
     $payment_noti->setValue(1);
     $payment_noti->setChecked((int) $ilSetting->get('payment_notification', 0) == 1);
     $payment_noti->setInfo($this->lng->txt('payment_notification_desc'));
     $num_days = new ilNumberInputGUI($this->lng->txt('payment_notification_days'), 'payment_notification_days');
     $num_days->setSize(3);
     $num_days->setMinValue(0);
     $num_days->setMaxValue(120);
     $num_days->setRequired(true);
     $num_days->setValue($ilSetting->get('payment_notification_days'));
     $num_days->setInfo($this->lng->txt('payment_notification_days_desc'));
     $payment_noti->addSubItem($num_days);
     $form->addItem($payment_noti);
     /**/
     $this->tpl->setVariable('FORM', $form->getHTML());
     return true;
 }
 protected function initSettingsForm()
 {
     global $ilSetting;
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setTitle($this->lng->txt("settings"));
     $form->setFormAction($this->ctrl->getFormAction($this, 'saveSettings'));
     // default repository view
     $options = array("flat" => $this->lng->txt("flatview"), "tree" => $this->lng->txt("treeview"));
     $si = new ilSelectInputGUI($this->lng->txt("def_repository_view"), "default_rep_view");
     $si->setOptions($options);
     $si->setInfo($this->lng->txt(""));
     if ($ilSetting->get("default_repository_view") == "tree") {
         $si->setValue("tree");
     } else {
         $si->setValue("flat");
     }
     $form->addItem($si);
     //
     $options = array("" => $this->lng->txt("adm_rep_tree_only_container"), "tree" => $this->lng->txt("adm_all_resource_types"));
     // repository tree
     $radg = new ilRadioGroupInputGUI($this->lng->txt("adm_rep_tree_presentation"), "tree_pres");
     $radg->setValue($ilSetting->get("repository_tree_pres"));
     $op1 = new ilRadioOption($this->lng->txt("adm_rep_tree_only_cntr"), "", $this->lng->txt("adm_rep_tree_only_cntr_info"));
     $radg->addOption($op1);
     $op2 = new ilRadioOption($this->lng->txt("adm_rep_tree_all_types"), "all_types", $this->lng->txt("adm_rep_tree_all_types_info"));
     // limit tree in courses and groups
     $cb = new ilCheckboxInputGUI($this->lng->txt("adm_rep_tree_limit_grp_crs"), "rep_tree_limit_grp_crs");
     $cb->setChecked($ilSetting->get("rep_tree_limit_grp_crs"));
     $cb->setInfo($this->lng->txt("adm_rep_tree_limit_grp_crs_info"));
     $op2->addSubItem($cb);
     $radg->addOption($op2);
     $form->addItem($radg);
     /* OBSOLETE
     		// synchronize repository tree with main view
     		$cb = new ilCheckboxInputGUI($this->lng->txt("adm_synchronize_rep_tree"), "rep_tree_synchronize");
     		$cb->setInfo($this->lng->txt("adm_synchronize_rep_tree_info"));
     		$cb->setChecked($ilSetting->get("rep_tree_synchronize"));
     		$form->addItem($cb);
     		*/
     /* DISABLED
     		// repository access check
     		$options = array(
     			0 => "0",
     			10 => "10",
     			30 => "30",
     			60 => "60",
     			120 => "120"
     			);
     		$si = new ilSelectInputGUI($this->lng->txt("adm_repository_cache_time"), "rep_cache");
     		$si->setOptions($options);
     		$si->setValue($ilSetting->get("rep_cache"));
     		$si->setInfo($this->lng->txt("adm_repository_cache_time_info")." ".
     			$this->lng->txt("adm_repository_cache_time_info2"));
     		$form->addItem($si);
     		*/
     // trash
     $cb = new ilCheckboxInputGUI($this->lng->txt("enable_trash"), "enable_trash");
     $cb->setInfo($this->lng->txt("enable_trash_info"));
     if ($ilSetting->get("enable_trash")) {
         $cb->setChecked(true);
     }
     $form->addItem($cb);
     // change event
     require_once 'Services/Tracking/classes/class.ilChangeEvent.php';
     $this->lng->loadLanguageModule("trac");
     $event = new ilCheckboxInputGUI($this->lng->txt('trac_repository_changes'), 'change_event_tracking');
     $event->setChecked(ilChangeEvent::_isActive());
     $form->addItem($event);
     include_once "Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php";
     ilAdministrationSettingsFormHandler::addFieldsToForm(ilAdministrationSettingsFormHandler::FORM_REPOSITORY, $form, $this);
     // object lists
     $lists = new ilFormSectionHeaderGUI();
     $lists->setTitle($this->lng->txt("rep_object_lists"));
     $form->addItem($lists);
     $sdesc = new ilCheckboxInputGUI($this->lng->txt("adm_rep_shorten_description"), "rep_shorten_description");
     $sdesc->setInfo($this->lng->txt("adm_rep_shorten_description_info"));
     $sdesc->setChecked($ilSetting->get("rep_shorten_description"));
     $form->addItem($sdesc);
     $sdesclen = new ilNumberInputGUI($this->lng->txt("adm_rep_shorten_description_length"), "rep_shorten_description_length");
     $sdesclen->setValue($ilSetting->get("rep_shorten_description_length"));
     $sdesclen->setSize(3);
     $sdesc->addSubItem($sdesclen);
     // load action commands asynchronously
     $cb = new ilCheckboxInputGUI($this->lng->txt("adm_item_cmd_asynch"), "item_cmd_asynch");
     $cb->setInfo($this->lng->txt("adm_item_cmd_asynch_info"));
     $cb->setChecked($ilSetting->get("item_cmd_asynch"));
     $form->addItem($cb);
     // notes/comments/tagging
     $pl = new ilCheckboxInputGUI($this->lng->txt('adm_show_comments_tagging_in_lists'), 'comments_tagging_in_lists');
     $pl->setValue(1);
     $pl->setChecked($ilSetting->get('comments_tagging_in_lists'));
     $form->addItem($pl);
     $pltags = new ilCheckboxInputGUI($this->lng->txt('adm_show_comments_tagging_in_lists_tags'), 'comments_tagging_in_lists_tags');
     $pltags->setValue(1);
     $pltags->setChecked($ilSetting->get('comments_tagging_in_lists_tags'));
     $pl->addSubItem($pltags);
     $form->addCommandButton('saveSettings', $this->lng->txt('save'));
     return $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);
 }
 private function initForm()
 {
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form_gui = new ilPropertyFormGUI();
     $this->form_gui->setFormAction($this->ctrl->getFormAction($this, 'save'));
     $this->form_gui->setTitle($this->lng->txt('ldap_configure'));
     $active = new ilCheckboxInputGUI($this->lng->txt('auth_ldap_enable'), 'active');
     $active->setValue(1);
     $this->form_gui->addItem($active);
     $ds = new ilCheckboxInputGUI($this->lng->txt('ldap_as_ds'), 'ds');
     $ds->setValue(1);
     $ds->setInfo($this->lng->txt('ldap_as_ds_info'));
     $this->form_gui->addItem($ds);
     $servername = new ilTextInputGUI($this->lng->txt('ldap_server_name'), 'server_name');
     $servername->setRequired(true);
     $servername->setInfo($this->lng->txt('ldap_server_name_info'));
     $servername->setSize(32);
     $servername->setMaxLength(32);
     $this->form_gui->addItem($servername);
     $serverurl = new ilTextInputGUI($this->lng->txt('ldap_server'), 'server_url');
     $serverurl->setRequired(true);
     $serverurl->setInfo($this->lng->txt('ldap_server_url_info'));
     $serverurl->setSize(64);
     $serverurl->setMaxLength(255);
     $this->form_gui->addItem($serverurl);
     $version = new ilSelectInputGUI($this->lng->txt('ldap_version'), 'version');
     $version->setOptions(array(2 => 2, 3 => 3));
     $version->setInfo($this->lng->txt('ldap_server_version_info'));
     $this->form_gui->addItem($version);
     $basedsn = new ilTextInputGUI($this->lng->txt('basedn'), 'base_dn');
     $basedsn->setRequired(true);
     $basedsn->setSize(64);
     $basedsn->setMaxLength(255);
     $this->form_gui->addItem($basedsn);
     $referrals = new ilCheckboxInputGUI($this->lng->txt('ldap_referrals'), 'referrals');
     $referrals->setValue(1);
     $referrals->setInfo($this->lng->txt('ldap_referrals_info'));
     $this->form_gui->addItem($referrals);
     $section_security = new ilFormSectionHeaderGUI();
     $section_security->setTitle($this->lng->txt('ldap_server_security_settings'));
     $this->form_gui->addItem($section_security);
     $tls = new ilCheckboxInputGUI($this->lng->txt('ldap_tls'), 'tls');
     $tls->setValue(1);
     $this->form_gui->addItem($tls);
     $binding = new ilRadioGroupInputGUI($this->lng->txt('ldap_server_binding'), 'binding_type');
     $anonymous = new ilRadioOption($this->lng->txt('ldap_bind_anonymous'), IL_LDAP_BIND_ANONYMOUS);
     $binding->addOption($anonymous);
     $user = new ilRadioOption($this->lng->txt('ldap_bind_user'), IL_LDAP_BIND_USER);
     $dn = new ilTextInputGUI($this->lng->txt('ldap_server_bind_dn'), 'bind_dn');
     $dn->setSize(64);
     $dn->setMaxLength(255);
     $user->addSubItem($dn);
     $pass = new ilPasswordInputGUI($this->lng->txt('ldap_server_bind_pass'), 'bind_pass');
     $pass->setSkipSyntaxCheck(true);
     $pass->setSize(12);
     $pass->setMaxLength(36);
     $user->addSubItem($pass);
     $binding->addOption($user);
     $this->form_gui->addItem($binding);
     $section_auth = new ilFormSectionHeaderGUI();
     $section_auth->setTitle($this->lng->txt('ldap_authentication_settings'));
     $this->form_gui->addItem($section_auth);
     $search_base = new ilTextInputGUI($this->lng->txt('ldap_user_dn'), 'search_base');
     $search_base->setInfo($this->lng->txt('ldap_search_base_info'));
     $search_base->setSize(64);
     $search_base->setMaxLength(255);
     $this->form_gui->addItem($search_base);
     $user_scope = new ilSelectInputGUI($this->lng->txt('ldap_user_scope'), 'user_scope');
     $user_scope->setOptions(array(IL_LDAP_SCOPE_ONE => $this->lng->txt('ldap_scope_one'), IL_LDAP_SCOPE_SUB => $this->lng->txt('ldap_scope_sub')));
     $user_scope->setInfo($this->lng->txt('ldap_user_scope_info'));
     $this->form_gui->addItem($user_scope);
     $user_attribute = new ilTextInputGUI($this->lng->txt('ldap_user_attribute'), 'user_attribute');
     $user_attribute->setSize(16);
     $user_attribute->setMaxLength(64);
     $user_attribute->setRequired(true);
     $this->form_gui->addItem($user_attribute);
     $filter = new ilTextInputGUI($this->lng->txt('ldap_search_filter'), 'filter');
     $filter->setInfo($this->lng->txt('ldap_filter_info'));
     $filter->setSize(64);
     $filter->setMaxLength(512);
     $this->form_gui->addItem($filter);
     $section_restrictions = new ilFormSectionHeaderGUI();
     $section_restrictions->setTitle($this->lng->txt('ldap_group_restrictions'));
     $this->form_gui->addItem($section_restrictions);
     $group_dn = new ilTextInputGUI($this->lng->txt('ldap_group_search_base'), 'group_dn');
     $group_dn->setInfo($this->lng->txt('ldap_group_dn_info'));
     $group_dn->setSize(64);
     $group_dn->setMaxLength(255);
     $this->form_gui->addItem($group_dn);
     $group_scope = new ilSelectInputGUI($this->lng->txt('ldap_group_scope'), 'group_scope');
     $group_scope->setOptions(array(IL_LDAP_SCOPE_ONE => $this->lng->txt('ldap_scope_one'), IL_LDAP_SCOPE_SUB => $this->lng->txt('ldap_scope_sub')));
     $group_scope->setInfo($this->lng->txt('ldap_group_scope_info'));
     $this->form_gui->addItem($group_scope);
     $group_filter = new ilTextInputGUI($this->lng->txt('ldap_group_filter'), 'group_filter');
     $group_filter->setInfo($this->lng->txt('ldap_group_filter_info'));
     $group_filter->setSize(64);
     $group_filter->setMaxLength(255);
     $this->form_gui->addItem($group_filter);
     $group_member = new ilTextInputGUI($this->lng->txt('ldap_group_member'), 'group_member');
     $group_member->setInfo($this->lng->txt('ldap_group_member_info'));
     $group_member->setSize(32);
     $group_member->setMaxLength(255);
     $this->form_gui->addItem($group_member);
     $group_member_isdn = new ilCheckboxInputGUI($this->lng->txt('ldap_memberisdn'), 'memberisdn');
     #$group_member_isdn->setInfo($this->lng->txt('ldap_group_member_info'));
     $this->form_gui->addItem($group_member_isdn);
     #$group_member->addSubItem($group_member_isdn);
     $group = new ilTextInputGUI($this->lng->txt('ldap_group_name'), 'group');
     $group->setInfo($this->lng->txt('ldap_group_name_info'));
     $group->setSize(32);
     $group->setMaxLength(255);
     $this->form_gui->addItem($group);
     $group_atrr = new ilTextInputGUI($this->lng->txt('ldap_group_attribute'), 'group_attribute');
     $group_atrr->setInfo($this->lng->txt('ldap_group_attribute_info'));
     $group_atrr->setSize(16);
     $group_atrr->setMaxLength(64);
     $this->form_gui->addItem($group_atrr);
     $group_optional = new ilCheckboxInputGUI($this->lng->txt('ldap_group_membership'), 'group_optional');
     $group_optional->setOptionTitle($this->lng->txt('ldap_group_member_optional'));
     $group_optional->setInfo($this->lng->txt('ldap_group_optional_info'));
     $group_optional->setValue(1);
     $group_user_filter = new ilTextInputGUI($this->lng->txt('ldap_group_user_filter'), 'group_user_filter');
     $group_user_filter->setSize(64);
     $group_user_filter->setMaxLength(255);
     $group_optional->addSubItem($group_user_filter);
     $this->form_gui->addItem($group_optional);
     $section_sync = new ilFormSectionHeaderGUI();
     $section_sync->setTitle($this->lng->txt('ldap_user_sync'));
     $this->form_gui->addItem($section_sync);
     $ci_gui = new ilCustomInputGUI($this->lng->txt('ldap_moment_sync'));
     $sync_on_login = new ilCheckboxInputGUI($this->lng->txt('ldap_sync_login'), 'sync_on_login');
     $sync_on_login->setValue(1);
     $ci_gui->addSubItem($sync_on_login);
     $sync_per_cron = new ilCheckboxInputGUI($this->lng->txt('ldap_sync_cron'), 'sync_per_cron');
     $sync_per_cron->setValue(1);
     $ci_gui->addSubItem($sync_per_cron);
     $ci_gui->setInfo($this->lng->txt('ldap_user_sync_info'));
     $this->form_gui->addItem($ci_gui);
     $global_role = new ilSelectInputGUI($this->lng->txt('ldap_global_role_assignment'), 'global_role');
     $global_role->setOptions($this->prepareRoleSelect(false));
     $global_role->setInfo($this->lng->txt('ldap_global_role_info'));
     $this->form_gui->addItem($global_role);
     $migr = new ilCheckboxInputGUI($this->lng->txt('auth_ldap_migration'), 'migration');
     $migr->setInfo($this->lng->txt('auth_ldap_migration_info'));
     $migr->setValue(1);
     $this->form_gui->addItem($migr);
     include_once "Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php";
     ilAdministrationSettingsFormHandler::addFieldsToForm(ilAdministrationSettingsFormHandler::FORM_LDAP, $this->form_gui, ilAdministrationSettingsFormHandler::getSettingsGUIInstance("auth"));
     $this->form_gui->addCommandButton('save', $this->lng->txt('save'));
 }
 /**
  * Init  form.
  *
  * @param        int        $a_mode        Edit Mode
  */
 public function initSettingsForm()
 {
     global $ilCtrl;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     // title
     $title = new ilTextInputGUI($this->txt("title"), "title");
     $title->setRequired(true);
     $this->form->addItem($title);
     // description
     $description = new ilTextAreaInputGUI($this->txt("description"), "description");
     $description->setCols(39);
     $description->setRows(4);
     $this->form->addItem($description);
     // show submissions
     $show_submissions = new ilCheckboxInputGUI($this->txt("show_submissions"), "show_submissions");
     $show_submissions->setInfo($this->txt("show_submissions_info"));
     $this->form->addItem($show_submissions);
     // pass mode
     $pass_mode = new ilRadioGroupInputGUI($this->txt("pass_mode"), "pass_mode");
     $pass_all = new ilRadioOption($this->txt("pass_all"), "all", $this->txt("pass_all_info"));
     $pass_mode->addOption($pass_all);
     $pass_min = new ilRadioOption($this->txt("pass_minimum_nr"), "pass_min", $this->txt("pass_minimum_nr_info"));
     $pass_mode->addOption($pass_min);
     // minimum number of assignments to pass
     $min_number = new ilNumberInputGUI($this->txt("min_nr"), "min_number");
     $min_number->setSize(4);
     $min_number->setMaxLength(4);
     $min_number->setRequired(true);
     include_once "./Customizing/global/plugins/Services/Repository/RepositoryObject/Ephorus/classes/class.ilEphAssignment.php";
     $mand = ilEphAssignment::countMandatory($this->object->getId());
     $min = max($mand, 1);
     $min_number->setMinValue($min);
     $pass_min->addSubItem($min_number);
     $this->form->addItem($pass_mode);
     $notification = new ilCheckboxInputGUI($this->txt("submission_notification"), "notification");
     $notification->setInfo($this->txt("submission_notification_info"));
     $this->form->addItem($notification);
     $copletion_by_submission = new ilCheckboxInputGUI($this->txt('completion_by_submission'), 'completion_by_submission');
     $copletion_by_submission->setInfo($this->txt('completion_by_submission_info'));
     $copletion_by_submission->setValue(1);
     $this->form->addItem($copletion_by_submission);
     $processtype = new ilSelectInputGUI($this->txt("processtype"), "processtype");
     $processtype->setOptions(array(1 => $this->txt("default"), 2 => $this->txt("reference"), 3 => $this->txt("private")));
     $processtype->setInfo($this->txt("processtype_description"));
     $this->form->addItem($processtype);
     $this->form->addCommandButton("updateSettings", $this->txt("save"));
     $this->form->setTitle($this->txt("edit_ephorus_exercise"));
     $this->form->setFormAction($ilCtrl->getFormAction($this));
 }
 /**
  * Edit news settings.
  */
 public function editSettings()
 {
     global $ilCtrl, $lng, $ilSetting;
     $news_set = new ilSetting("news");
     $feed_set = new ilSetting("feed");
     $enable_internal_news = $ilSetting->get("block_activated_news");
     $enable_internal_rss = $news_set->get("enable_rss_for_internal");
     $rss_title_format = $news_set->get("rss_title_format");
     $enable_private_feed = $news_set->get("enable_private_feed");
     $news_default_visibility = $news_set->get("default_visibility") != "" ? $news_set->get("default_visibility") : "users";
     $disable_repository_feeds = $feed_set->get("disable_rep_feeds");
     $nr_personal_desktop_feeds = $ilSetting->get("block_limit_pdfeed");
     $allow_shorter_periods = $news_set->get("allow_shorter_periods");
     $allow_longer_periods = $news_set->get("allow_longer_periods");
     include_once "./Services/News/classes/class.ilNewsItem.php";
     $rss_period = ilNewsItem::_lookupRSSPeriod();
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($ilCtrl->getFormAction($this));
     $form->setTitle($lng->txt("news_settings"));
     // Enable internal news
     $cb_prop = new ilCheckboxInputGUI($lng->txt("news_enable_internal_news"), "enable_internal_news");
     $cb_prop->setValue("1");
     $cb_prop->setInfo($lng->txt("news_enable_internal_news_info"));
     $cb_prop->setChecked($enable_internal_news);
     $form->addItem($cb_prop);
     // Default Visibility
     $radio_group = new ilRadioGroupInputGUI($lng->txt("news_default_visibility"), "news_default_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($news_default_visibility);
     $form->addItem($radio_group);
     // Number of news items per object
     $nr_opts = array(50 => 50, 100 => 100, 200 => 200);
     $nr_sel = new ilSelectInputGUI($lng->txt("news_nr_of_items"), "news_max_items");
     $nr_sel->setInfo($lng->txt("news_nr_of_items_info"));
     $nr_sel->setOptions($nr_opts);
     $nr_sel->setValue($news_set->get("max_items"));
     $form->addItem($nr_sel);
     // Access Cache
     $min_opts = array(0 => 0, 1 => 1, 2 => 2, 5 => 5, 10 => 10, 20 => 20, 30 => 30, 60 => 60);
     $min_sel = new ilSelectInputGUI($lng->txt("news_cache"), "news_acc_cache_mins");
     $min_sel->setInfo($lng->txt("news_cache_info"));
     $min_sel->setOptions($min_opts);
     $min_sel->setValue($news_set->get("acc_cache_mins"));
     $form->addItem($min_sel);
     // PD News Period
     $per_opts = array(2 => "2 " . $lng->txt("days"), 3 => "3 " . $lng->txt("days"), 5 => "5 " . $lng->txt("days"), 7 => "1 " . $lng->txt("week"), 14 => "2 " . $lng->txt("weeks"), 30 => "1 " . $lng->txt("month"), 60 => "2 " . $lng->txt("months"), 120 => "4 " . $lng->txt("months"), 180 => "6 " . $lng->txt("months"), 366 => "1 " . $lng->txt("year"));
     $per_sel = new ilSelectInputGUI($lng->txt("news_pd_period"), "news_pd_period");
     $per_sel->setInfo($lng->txt("news_pd_period_info"));
     $per_sel->setOptions($per_opts);
     $per_sel->setValue((int) ilNewsItem::_lookupDefaultPDPeriod());
     $form->addItem($per_sel);
     // Allow user to choose lower values
     $sp_prop = new ilCheckboxInputGUI($lng->txt("news_allow_shorter_periods"), "allow_shorter_periods");
     $sp_prop->setValue("1");
     $sp_prop->setInfo($lng->txt("news_allow_shorter_periods_info"));
     $sp_prop->setChecked($allow_shorter_periods);
     $form->addItem($sp_prop);
     // Allow user to choose higher values
     $lp_prop = new ilCheckboxInputGUI($lng->txt("news_allow_longer_periods"), "allow_longer_periods");
     $lp_prop->setValue("1");
     $lp_prop->setInfo($lng->txt("news_allow_longer_periods_info"));
     $lp_prop->setChecked($allow_longer_periods);
     $form->addItem($lp_prop);
     // Enable rss for internal news
     $cb_prop = new ilCheckboxInputGUI($lng->txt("news_enable_internal_rss"), "enable_internal_rss");
     $cb_prop->setValue("1");
     $cb_prop->setInfo($lng->txt("news_enable_internal_rss_info"));
     $cb_prop->setChecked($enable_internal_rss);
     // RSS News Period
     $rssp_opts = array(2 => "2 " . $lng->txt("days"), 3 => "3 " . $lng->txt("days"), 5 => "5 " . $lng->txt("days"), 7 => "1 " . $lng->txt("week"), 14 => "2 " . $lng->txt("weeks"), 30 => "1 " . $lng->txt("month"), 60 => "2 " . $lng->txt("months"), 120 => "4 " . $lng->txt("months"), 180 => "6 " . $lng->txt("months"), 365 => "1 " . $lng->txt("year"));
     $rssp_sel = new ilSelectInputGUI($lng->txt("news_rss_period"), "news_rss_period");
     $rssp_sel->setOptions($rssp_opts);
     $rssp_sel->setValue((int) $rss_period);
     $cb_prop->addSubItem($rssp_sel);
     // Section Header: RSS
     $sh = new ilFormSectionHeaderGUI();
     $sh->setTitle($lng->txt("news_rss"));
     $form->addItem($sh);
     // title format for rss entries
     $options = array("" => $lng->txt("news_rss_title_format_obj_news"), "news_obj" => $lng->txt("news_rss_title_format_news_obj"));
     $si = new ilSelectInputGUI($lng->txt("news_rss_title_format"), "rss_title_format");
     $si->setOptions($options);
     $si->setValue($rss_title_format);
     $cb_prop->addSubItem($si);
     $form->addItem($cb_prop);
     // Enable private news feed
     $cb_prop = new ilCheckboxInputGUI($lng->txt("news_enable_private_feed"), "enable_private_feed");
     $cb_prop->setValue("1");
     $cb_prop->setInfo($lng->txt("news_enable_private_feed_info"));
     $cb_prop->setChecked($enable_private_feed);
     $form->addItem($cb_prop);
     // Section Header: External Web Feeds Settings
     $sh = new ilFormSectionHeaderGUI();
     $sh->setTitle($lng->txt("feed_settings"));
     $form->addItem($sh);
     // Number of External Feeds on personal desktop
     $sel = new ilSelectInputGUI($lng->txt("feed_nr_pd_feeds"), "nr_pd_feeds");
     $sel->setInfo($lng->txt("feed_nr_pd_feeds_info"));
     $sel->setOptions(array(0 => "0", 1 => "1", 2 => "2", 3 => "3", 4 => "4", 5 => "5"));
     $sel->setValue($nr_personal_desktop_feeds);
     $form->addItem($sel);
     // Disable External Web Feeds in catetegories
     $cb_prop = new ilCheckboxInputGUI($lng->txt("feed_disable_rep_feeds"), "disable_repository_feeds");
     $cb_prop->setValue("1");
     $cb_prop->setInfo($lng->txt("feed_disable_rep_feeds_info"));
     $cb_prop->setChecked($disable_repository_feeds);
     $form->addItem($cb_prop);
     // command buttons
     $form->addCommandButton("saveSettings", $lng->txt("save"));
     $form->addCommandButton("view", $lng->txt("cancel"));
     $this->tpl->setContent($form->getHTML());
 }
 /**
  * Edit settings.
  */
 public function settings()
 {
     global $lng, $ilAccess;
     $this->tabs_gui->setTabActive('settings');
     $form_settings = new ilSetting("certificate");
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTitle($this->lng->txt('certificate_settings'));
     $active = new ilCheckboxInputGUI($this->lng->txt("active"), "active");
     $active->setChecked($form_settings->get("active"));
     $form->addItem($active);
     $info = new ilNonEditableValueGUI($this->lng->txt("info"), "info");
     $info->setValue($this->lng->txt("certificate_usage"));
     $form->addItem($info);
     $bgimage = new ilImageFileInputGUI($this->lng->txt("certificate_background_image"), "background");
     $bgimage->setRequired(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 (strlen($this->object->hasBackgroundImage())) {
         $bgimage->setImage($this->object->getBackgroundImageThumbPathWeb());
     }
     $bgimage->setInfo($this->lng->txt("default_background_info"));
     $form->addItem($bgimage);
     $format = new ilSelectInputGUI($this->lng->txt("certificate_page_format"), "pageformat");
     $defaultformats = array("a4" => $this->lng->txt("certificate_a4"), "a4landscape" => $this->lng->txt("certificate_a4_landscape"), "a5" => $this->lng->txt("certificate_a5"), "a5landscape" => $this->lng->txt("certificate_a5_landscape"), "letter" => $this->lng->txt("certificate_letter"), "letterlandscape" => $this->lng->txt("certificate_letter_landscape"));
     $format->setOptions($defaultformats);
     $format->setValue($form_settings->get("pageformat"));
     $format->setInfo($this->lng->txt("certificate_page_format_info"));
     $form->addItem($format);
     if ($ilAccess->checkAccess('write', '', $this->object->getRefId())) {
         $form->addCommandButton('save', $this->lng->txt('save'));
     }
     $this->tpl->setContent($form->getHTML());
     if (strcmp($this->ctrl->getCmd(), "save") == 0) {
         if ($_POST["background_delete"]) {
             $this->object->deleteBackgroundImage();
         }
     }
 }
 /**
  * show settings table
  *
  * @access public
  * @return
  */
 public function initSettingsForm()
 {
     if (is_object($this->form)) {
         return true;
     }
     include_once 'Services/Calendar/classes/class.ilCalendarUtil.php';
     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('cal_user_settings'));
     $this->form->addCommandButton('save', $this->lng->txt('save'));
     $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
     $select = new ilSelectInputGUI($this->lng->txt('cal_user_timezone'), 'timezone');
     $select->setOptions(ilCalendarUtil::_getShortTimeZoneList());
     $select->setInfo($this->lng->txt('cal_timezone_info'));
     $select->setValue($this->user_settings->getTimeZone());
     $this->form->addItem($select);
     $export_type = new ilRadioGroupInputGUI($this->lng->txt('cal_export_timezone'), 'export_tz');
     $export_type->setValue($this->user_settings->getExportTimeZoneType());
     $export_tz = new ilRadioOption($this->lng->txt('cal_export_timezone_tz'), ilCalendarUserSettings::CAL_EXPORT_TZ_TZ);
     $export_type->addOption($export_tz);
     $export_utc = new ilRadioOption($this->lng->txt('cal_export_timezone_utc'), ilCalendarUserSettings::CAL_EXPORT_TZ_UTC);
     $export_type->addOption($export_utc);
     $this->form->addItem($export_type);
     $year = date("Y");
     $select = new ilSelectInputGUI($this->lng->txt('cal_user_date_format'), 'date_format');
     $select->setOptions(array(ilCalendarSettings::DATE_FORMAT_DMY => '31.10.' . $year, ilCalendarSettings::DATE_FORMAT_YMD => $year . "-10-31", ilCalendarSettings::DATE_FORMAT_MDY => "10/31/" . $year));
     $select->setInfo($this->lng->txt('cal_date_format_info'));
     $select->setValue($this->user_settings->getDateFormat());
     $this->form->addItem($select);
     $select = new ilSelectInputGUI($this->lng->txt('cal_user_time_format'), 'time_format');
     $select->setOptions(array(ilCalendarSettings::TIME_FORMAT_24 => '13:00', ilCalendarSettings::TIME_FORMAT_12 => '1:00pm'));
     $select->setInfo($this->lng->txt('cal_time_format_info'));
     $select->setValue($this->user_settings->getTimeFormat());
     $this->form->addItem($select);
     // Week/Month View
     $week_month = new ilFormSectionHeaderGUI();
     $week_month->setTitle($this->lng->txt('cal_week_month_view'));
     $this->form->addItem($week_month);
     $radio = new ilRadioGroupInputGUI($this->lng->txt('cal_week_start'), 'weekstart');
     $radio->setValue($this->user_settings->getWeekStart());
     $option = new ilRadioOption($this->lng->txt('l_su'), 0);
     $radio->addOption($option);
     $option = new ilRadioOption($this->lng->txt('l_mo'), 1);
     $radio->addOption($option);
     $this->form->addItem($radio);
     // Day/Week View
     $week_month = new ilFormSectionHeaderGUI();
     $week_month->setTitle($this->lng->txt('cal_day_week_view'));
     $this->form->addItem($week_month);
     $day_start = new ilSelectInputGUI($this->lng->txt('cal_day_start'), 'dst');
     $day_start->setOptions(ilCalendarUtil::getHourSelection($this->user_settings->getTimeFormat()));
     $day_start->setValue($this->user_settings->getDayStart());
     $this->form->addItem($day_start);
     $day_end = new ilSelectInputGUI($this->lng->txt('cal_day_end'), 'den');
     $day_end->setOptions(ilCalendarUtil::getHourSelection($this->user_settings->getTimeFormat()));
     $day_end->setValue($this->user_settings->getDayEnd());
     $this->form->addItem($day_end);
 }
 /**
  * Init general settings form.
  *
  */
 public function initGeneralSettingsForm()
 {
     global $lng, $ilUser, $styleDefinition, $ilSetting;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     // language
     if ($this->userSettingVisible("language")) {
         $languages = $this->lng->getInstalledLanguages();
         $options = array();
         foreach ($languages as $lang_key) {
             $options[$lang_key] = ilLanguage::_lookupEntry($lang_key, "meta", "meta_l_" . $lang_key);
         }
         $si = new ilSelectInputGUI($this->lng->txt("language"), "language");
         $si->setOptions($options);
         $si->setValue($ilUser->getLanguage());
         $si->setDisabled($ilSetting->get("usr_settings_disable_language"));
         $this->form->addItem($si);
     }
     // skin/style
     include_once "./Services/Style/classes/class.ilObjStyleSettings.php";
     if ($this->userSettingVisible("skin_style")) {
         $templates = $styleDefinition->getAllTemplates();
         if (is_array($templates)) {
             $si = new ilSelectInputGUI($this->lng->txt("skin_style"), "skin_style");
             $options = array();
             foreach ($templates as $template) {
                 // get styles information of template
                 $styleDef = new ilStyleDefinition($template["id"]);
                 $styleDef->startParsing();
                 $styles = $styleDef->getStyles();
                 foreach ($styles as $style) {
                     if (!ilObjStyleSettings::_lookupActivatedStyle($template["id"], $style["id"])) {
                         continue;
                     }
                     $options[$template["id"] . ":" . $style["id"]] = $styleDef->getTemplateName() . " / " . $style["name"];
                 }
             }
             $si->setOptions($options);
             $si->setValue($ilUser->skin . ":" . $ilUser->prefs["style"]);
             $si->setDisabled($ilSetting->get("usr_settings_disable_skin_style"));
             $this->form->addItem($si);
         }
     }
     // screen reader optimization
     if ($this->userSettingVisible("screen_reader_optimization")) {
         $cb = new ilCheckboxInputGUI($this->lng->txt("user_screen_reader_optimization"), "screen_reader_optimization");
         $cb->setChecked($ilUser->prefs["screen_reader_optimization"]);
         $cb->setDisabled($ilSetting->get("usr_settings_disable_screen_reader_optimization"));
         $cb->setInfo($this->lng->txt("user_screen_reader_optimization_info"));
         $this->form->addItem($cb);
     }
     // hits per page
     if ($this->userSettingVisible("hits_per_page")) {
         $si = new ilSelectInputGUI($this->lng->txt("hits_per_page"), "hits_per_page");
         $hits_options = array(10, 15, 20, 30, 40, 50, 100, 9999);
         $options = array();
         foreach ($hits_options as $hits_option) {
             $hstr = $hits_option == 9999 ? $this->lng->txt("no_limit") : $hits_option;
             $options[$hits_option] = $hstr;
         }
         $si->setOptions($options);
         $si->setValue($ilUser->prefs["hits_per_page"]);
         $si->setDisabled($ilSetting->get("usr_settings_disable_hits_per_page"));
         $this->form->addItem($si);
     }
     // Users Online
     if ($this->userSettingVisible("show_users_online")) {
         $si = new ilSelectInputGUI($this->lng->txt("show_users_online"), "show_users_online");
         $options = array("y" => $this->lng->txt("users_online_show_y"), "associated" => $this->lng->txt("users_online_show_associated"), "n" => $this->lng->txt("users_online_show_n"));
         $si->setOptions($options);
         $si->setValue($ilUser->prefs["show_users_online"]);
         $si->setDisabled($ilSetting->get("usr_settings_disable_show_users_online"));
         $this->form->addItem($si);
     }
     // Store last visited
     $lv = new ilSelectInputGUI($this->lng->txt("user_store_last_visited"), "store_last_visited");
     $options = array(0 => $this->lng->txt("user_lv_keep_entries"), 1 => $this->lng->txt("user_lv_keep_only_for_session"), 2 => $this->lng->txt("user_lv_do_not_store"));
     $lv->setOptions($options);
     $lv->setValue((int) $ilUser->prefs["store_last_visited"]);
     $this->form->addItem($lv);
     // hide_own_online_status
     if ($this->userSettingVisible("hide_own_online_status")) {
         $cb = new ilCheckboxInputGUI($this->lng->txt("hide_own_online_status"), "hide_own_online_status");
         $cb->setChecked($ilUser->prefs["hide_own_online_status"] == "y");
         $cb->setDisabled($ilSetting->get("usr_settings_disable_hide_own_online_status"));
         $this->form->addItem($cb);
     }
     include_once 'Services/Authentication/classes/class.ilSessionReminder.php';
     if (ilSessionReminder::isGloballyActivated()) {
         $cb = new ilCheckboxInputGUI($this->lng->txt('session_reminder'), 'session_reminder_enabled');
         $cb->setInfo($this->lng->txt('session_reminder_info'));
         $cb->setValue(1);
         $cb->setChecked((int) $ilUser->getPref('session_reminder_enabled'));
         $expires = ilSession::getSessionExpireValue();
         $lead_time_gui = new ilNumberInputGUI($this->lng->txt('session_reminder_lead_time'), 'session_reminder_lead_time');
         $lead_time_gui->setInfo(sprintf($this->lng->txt('session_reminder_lead_time_info'), ilFormat::_secondsToString($expires, true)));
         $min_value = ilSessionReminder::MIN_LEAD_TIME;
         $max_value = max($min_value, (int) $expires / 60 - 1);
         $current_user_value = $ilUser->getPref('session_reminder_lead_time');
         if ($current_user_value < $min_value || $current_user_value > $max_value) {
             $current_user_value = ilSessionReminder::SUGGESTED_LEAD_TIME;
         }
         $value = min(max($min_value, $current_user_value), $max_value);
         $lead_time_gui->setValue($value);
         $lead_time_gui->setSize(3);
         $lead_time_gui->setMinValue($min_value);
         $lead_time_gui->setMaxValue($max_value);
         $cb->addSubItem($lead_time_gui);
         $this->form->addItem($cb);
     }
     // calendar settings (copied here to be reachable when calendar is inactive)
     // they cannot be hidden/deactivated
     include_once 'Services/Calendar/classes/class.ilCalendarUserSettings.php';
     include_once 'Services/Calendar/classes/class.ilCalendarUtil.php';
     $lng->loadLanguageModule("dateplaner");
     $user_settings = ilCalendarUserSettings::_getInstanceByUserId($ilUser->getId());
     $select = new ilSelectInputGUI($lng->txt('cal_user_timezone'), 'timezone');
     $select->setOptions(ilCalendarUtil::_getShortTimeZoneList());
     $select->setInfo($lng->txt('cal_timezone_info'));
     $select->setValue($user_settings->getTimeZone());
     $this->form->addItem($select);
     $year = date("Y");
     $select = new ilSelectInputGUI($lng->txt('cal_user_date_format'), 'date_format');
     $select->setOptions(array(ilCalendarSettings::DATE_FORMAT_DMY => '31.10.' . $year, ilCalendarSettings::DATE_FORMAT_YMD => $year . "-10-31", ilCalendarSettings::DATE_FORMAT_MDY => "10/31/" . $year));
     $select->setInfo($lng->txt('cal_date_format_info'));
     $select->setValue($user_settings->getDateFormat());
     $this->form->addItem($select);
     $select = new ilSelectInputGUI($lng->txt('cal_user_time_format'), 'time_format');
     $select->setOptions(array(ilCalendarSettings::TIME_FORMAT_24 => '13:00', ilCalendarSettings::TIME_FORMAT_12 => '1:00pm'));
     $select->setInfo($lng->txt('cal_time_format_info'));
     $select->setValue($user_settings->getTimeFormat());
     $this->form->addItem($select);
     // starting point
     include_once "Services/User/classes/class.ilUserUtil.php";
     if (ilUserUtil::hasPersonalStartingPoint()) {
         $this->lng->loadLanguageModule("administration");
         $si = new ilRadioGroupInputGUI($this->lng->txt("adm_user_starting_point"), "usr_start");
         $si->setRequired(true);
         $si->setInfo($this->lng->txt("adm_user_starting_point_info"));
         foreach (ilUserUtil::getPossibleStartingPoints() as $value => $caption) {
             $si->addOption(new ilRadioOption($caption, $value));
         }
         $si->setValue(ilUserUtil::getPersonalStartingPoint());
         $this->form->addItem($si);
         // starting point: repository object
         $repobj = new ilRadioOption($lng->txt("adm_user_starting_point_object"), ilUserUtil::START_REPOSITORY_OBJ);
         $repobj_id = new ilTextInputGUI($lng->txt("adm_user_starting_point_ref_id"), "usr_start_ref_id");
         $repobj_id->setRequired(true);
         $repobj_id->setSize(5);
         if ($si->getValue() == ilUserUtil::START_REPOSITORY_OBJ) {
             $start_ref_id = ilUserUtil::getPersonalStartingObject();
             $repobj_id->setValue($start_ref_id);
             if ($start_ref_id) {
                 $start_obj_id = ilObject::_lookupObjId($start_ref_id);
                 if ($start_obj_id) {
                     $repobj_id->setInfo($lng->txt("obj_" . ilObject::_lookupType($start_obj_id)) . ": " . ilObject::_lookupTitle($start_obj_id));
                 }
             }
         }
         $repobj->addSubItem($repobj_id);
         $si->addOption($repobj);
     }
     // 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_USER);
         $char_selector->getConfig()->setAvailability($ilUser->getPref('char_selector_availability'));
         $char_selector->getConfig()->setDefinition($ilUser->getPref('char_selector_definition'));
         $char_selector->addFormProperties($this->form);
         $char_selector->setFormValues($this->form);
     }
     $this->form->addCommandButton("saveGeneralSettings", $lng->txt("save"));
     $this->form->setTitle($lng->txt("general_settings"));
     $this->form->setFormAction($this->ctrl->getFormAction($this));
 }
 /**
  * Edit cell styles
  */
 function editCellAlignment()
 {
     global $ilCtrl, $tpl, $lng, $ilTabs;
     $this->displayValidationError();
     $this->setTabs();
     $this->setCellPropertiesSubTabs();
     $ilTabs->setSubTabActive("cont_alignment");
     $ilTabs->setTabActive("cont_table_cell_properties");
     // edit form
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($ilCtrl->getFormAction($this));
     $form->setTitle($this->lng->txt("cont_table_cell_properties"));
     // alignment
     $options = array("" => $lng->txt("default"), "Left" => $lng->txt("cont_left"), "Center" => $lng->txt("cont_center"), "Right" => $lng->txt("cont_right"));
     $si = new ilSelectInputGUI($lng->txt("cont_alignment"), "alignment");
     $si->setOptions($options);
     $si->setInfo($lng->txt(""));
     $form->addItem($si);
     $form->setKeepOpen(true);
     $form->addCommandButton("setAlignment", $lng->txt("cont_set_alignment"));
     $html = $form->getHTML();
     $html .= "<br />" . $this->renderTable("table_edit", "alignment") . "</form>";
     $tpl->setContent($html);
 }
 /**
  * Init the form to edit the type settings
  * 
  * @param	array	values to set
  */
 private function initFormSettings($a_values = array())
 {
     global $lng, $ilCtrl;
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($ilCtrl->getFormAction($this));
     $form->setTitle($lng->txt('settings'));
     $item = new ilTextInputGUI($this->txt('type_name'), 'name');
     $item->setValue($a_values['name']);
     $item->setInfo($this->txt('type_name_info'));
     $item->setRequired(true);
     $item->setMaxLength(32);
     $form->addItem($item);
     $item = new ilTextInputGUI($lng->txt('title'), 'title');
     $item->setValue($a_values['title']);
     $item->setInfo($this->txt('type_title_info'));
     $item->setRequired(true);
     $item->setMaxLength(255);
     $form->addItem($item);
     $item = new ilTextInputGUI($lng->txt('description'), 'description');
     $item->setValue($a_values['description']);
     $item->setInfo($this->txt('type_description_info'));
     $form->addItem($item);
     $item = new ilSelectInputGUI($this->txt('type_availability'), 'availability');
     $item->setOptions(array(ilExternalContentType::AVAILABILITY_CREATE => $this->txt('availability_' . ilExternalContentType::AVAILABILITY_CREATE), ilExternalContentType::AVAILABILITY_EXISTING => $this->txt('availability_' . ilExternalContentType::AVAILABILITY_EXISTING), ilExternalContentType::AVAILABILITY_NONE => $this->txt('availability_' . ilExternalContentType::AVAILABILITY_NONE)));
     $item->setValue($a_values['availability']);
     $item->setInfo($this->txt('type_availability_info'));
     $item->setRequired(true);
     $form->addItem($item);
     $item = new ilTextAreaInputGUI($this->txt('type_remarks'), 'remarks');
     $item->setInfo($this->txt('type_remarks_info'));
     $item->setValue($a_values['remarks']);
     $item->setRows(5);
     $item->setCols(80);
     $form->addItem($item);
     // add the type specific fields
     $this->type->addFormElements($form, $a_values, "type");
     /* 
     		
     		// TOKEN MANAGEMENT
             $item5 = new ilTextInputGUI($this->txt('type_time_to_delete'), 'time_to_delete');
             $item5->setInfo($this->txt('type_time_to_delete_info'));
             if(!$type->getTimeToDelete()){
                 $item5->setValue(10);
             }else{
                 $item5->setValue($this->type->getTimeToDelete());
             }
             $item5->setRequired(true);
             $item5->setMaxLength(32);
             $form->addItem($item5);
             
             
            //LOG MANAGEMENT
             $item9 = new ilSelectInputGUI($this->txt('log_set'), 'use_logs');
             $item9->setOptions(
                     array(
                         "ON" => $this->txt('log_on'),
                         "OFF" => $this->txt('log_off')
                     )
             );
             $item9->setInfo($this->txt('logs_info'));
             $item9->setRequired(true);
             $item9->setValue($this->type->getUseLogs());
             $form->addItem($item9);
             
             
             //LEARNING PROGRESS MANAGEMENT
             $item10 = new ilSelectInputGUI($this->txt('learning_progress_set'), 'use_learning_progress');
             $item10->setOptions(
                     array(
                         "ON" => $this->txt('lp_on'),
                         "OFF" => $this->txt('lp_off')
                     )
             );
             $item10->setInfo($this->txt('lp_info'));
             $item10->setRequired(true);
             $item10->setValue($this->type->getUseLearningProgress());
             $form->addItem($item10);
     */
     $form->addCommandButton('submitFormSettings', $lng->txt('save'));
     $this->form = $form;
 }
 /**
  * scorm module properties
  */
 function properties()
 {
     global $rbacsystem, $tree, $tpl, $lng, $ilToolbar, $ilCtrl, $ilSetting, $ilTabs;
     $lng->loadLanguageModule("style");
     ilObjSAHSLearningModuleGUI::setSettingsSubTabs();
     $ilTabs->setSubTabActive('cont_settings');
     // view
     $ilToolbar->addButton($this->lng->txt("view"), "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=" . $this->object->getRefID(), "_blank");
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($ilCtrl->getFormAction($this));
     $this->form->setTitle($this->lng->txt("cont_lm_properties"));
     // SCORM-type
     $ne = new ilNonEditableValueGUI($this->lng->txt("type"), "");
     $ne->setValue($this->lng->txt("lm_type_" . ilObjSAHSLearningModule::_lookupSubType($this->object->getID())));
     $this->form->addItem($ne);
     // version
     $ne = new ilNonEditableValueGUI($this->lng->txt("cont_sc_version"), "");
     $ne->setValue($this->object->getModuleVersion());
     $this->form->addItem($ne);
     // online
     $cb = new ilCheckboxInputGUI($this->lng->txt("cont_online"), "cobj_online");
     $cb->setValue("y");
     if ($this->object->getOnline()) {
         $cb->setChecked(true);
     }
     $this->form->addItem($cb);
     // offline Mode
     $cb = new ilCheckboxInputGUI($this->lng->txt("cont_offline_mode_allow"), "cobj_offline_mode");
     $cb->setValue("y");
     $cb->setChecked($this->object->getOfflineMode());
     include_once "./Modules/ScormAicc/classes/class.ilSCORMOfflineMode.php";
     if ($this->object->getOfflineMode() == true && ilSCORMOfflineMode::checkIfAnyoneIsInOfflineMode($this->object->getID()) == true) {
         $cb->setDisabled(true);
         $cb->setInfo($this->lng->txt("cont_offline_mode_disable_not_allowed_info"));
     } else {
         $cb->setInfo($this->lng->txt("cont_offline_mode_allow_info"));
     }
     $this->form->addItem($cb);
     //
     // presentation
     //
     $sh = new ilFormSectionHeaderGUI();
     $sh->setTitle($this->lng->txt("cont_presentation"));
     $this->form->addItem($sh);
     // display mode (open)
     $options = array("0" => $this->lng->txt("cont_open_normal"), "1" => $this->lng->txt("cont_open_iframe_max"), "2" => $this->lng->txt("cont_open_iframe_defined"), "5" => $this->lng->txt("cont_open_window_undefined"), "6" => $this->lng->txt("cont_open_window_defined"));
     $si = new ilSelectInputGUI($this->lng->txt("cont_open"), "open_mode");
     $si->setOptions($options);
     $si->setValue($this->object->getOpenMode());
     $this->form->addItem($si);
     // width
     $ni = new ilNumberInputGUI($this->lng->txt("cont_width"), "width");
     $ni->setMaxLength(4);
     $ni->setSize(4);
     $ni->setValue($this->object->getWidth());
     $this->form->addItem($ni);
     // height
     $ni = new ilNumberInputGUI($this->lng->txt("cont_height"), "height");
     $ni->setMaxLength(4);
     $ni->setSize(4);
     $ni->setValue($this->object->getHeight());
     $this->form->addItem($ni);
     // auto navigation to last visited item
     $cb = new ilCheckboxInputGUI($this->lng->txt("cont_auto_last_visited"), "cobj_auto_last_visited");
     $cb->setValue("y");
     $cb->setChecked($this->object->getAuto_last_visited());
     $cb->setInfo($this->lng->txt("cont_auto_last_visited_info"));
     $this->form->addItem($cb);
     // auto continue
     $cb = new ilCheckboxInputGUI($this->lng->txt("cont_sc_auto_continue"), "auto_continue");
     $cb->setValue("y");
     $cb->setChecked($this->object->getAutoContinue());
     $this->form->addItem($cb);
     //
     // scorm options
     //
     $sh = new ilFormSectionHeaderGUI();
     $sh->setTitle($this->lng->txt("cont_scorm_options"));
     $this->form->addItem($sh);
     // max attempts
     $ni = new ilNumberInputGUI($this->lng->txt("cont_sc_max_attempt"), "max_attempt");
     $ni->setMaxLength(3);
     $ni->setSize(3);
     $ni->setValue($this->object->getMaxAttempt());
     $this->form->addItem($ni);
     // lesson mode
     $options = array("normal" => $this->lng->txt("cont_sc_less_mode_normal"), "browse" => $this->lng->txt("cont_sc_less_mode_browse"));
     $si = new ilSelectInputGUI($this->lng->txt("cont_def_lesson_mode"), "lesson_mode");
     $si->setOptions($options);
     $si->setValue($this->object->getDefaultLessonMode());
     $this->form->addItem($si);
     // credit mode
     $options = array("credit" => $this->lng->txt("cont_credit_on"), "no_credit" => $this->lng->txt("cont_credit_off"));
     $si = new ilSelectInputGUI($this->lng->txt("cont_credit_mode"), "credit_mode");
     $si->setOptions($options);
     $si->setValue($this->object->getCreditMode());
     $si->setInfo($this->lng->txt("cont_credit_mode_info"));
     $this->form->addItem($si);
     // set lesson mode review when completed
     $options = array("n" => $this->lng->txt("cont_sc_auto_review_no"), "y" => $this->lng->txt("cont_sc_auto_review_completed_or_passed"));
     $si = new ilSelectInputGUI($this->lng->txt("cont_sc_auto_review_2004"), "auto_review");
     $si->setOptions($options);
     $si->setValue($this->object->getAutoReviewChar());
     $si->setInfo($this->lng->txt("cont_sc_auto_review_info_12"));
     $this->form->addItem($si);
     //
     // rte settings
     //
     $sh = new ilFormSectionHeaderGUI();
     $sh->setTitle($this->lng->txt("cont_rte_settings"));
     $this->form->addItem($sh);
     // unlimited session timeout
     $cb = new ilCheckboxInputGUI($this->lng->txt("cont_sc_usession"), "cobj_session");
     $cb->setValue("y");
     $cb->setChecked($this->object->getSession());
     $cb->setInfo($this->lng->txt("cont_sc_usession_info"));
     $this->form->addItem($cb);
     // storage of interactions
     $cb = new ilCheckboxInputGUI($this->lng->txt("cont_interactions"), "cobj_interactions");
     $cb->setValue("y");
     $cb->setChecked($this->object->getInteractions());
     $this->form->addItem($cb);
     // objectives
     $cb = new ilCheckboxInputGUI($this->lng->txt("cont_objectives"), "cobj_objectives");
     $cb->setValue("y");
     $cb->setChecked($this->object->getObjectives());
     $this->form->addItem($cb);
     // time from lms
     $cb = new ilCheckboxInputGUI($this->lng->txt("cont_time_from_lms"), "cobj_time_from_lms");
     $cb->setValue("y");
     $cb->setChecked($this->object->getTime_from_lms());
     $cb->setInfo($this->lng->txt("cont_time_from_lms_info"));
     $this->form->addItem($cb);
     // check values
     $cb = new ilCheckboxInputGUI($this->lng->txt("cont_check_values"), "cobj_check_values");
     $cb->setValue("y");
     $cb->setChecked($this->object->getCheck_values());
     $this->form->addItem($cb);
     // api adapter name
     // $this->tpl->setVariable("TXT_API_ADAPTER", $this->lng->txt("cont_api_adapter"));
     // $this->tpl->setVariable("VAL_API_ADAPTER", $this->object->getAPIAdapterName());
     // api functions prefix
     // $this->tpl->setVariable("TXT_API_PREFIX", $this->lng->txt("cont_api_func_prefix"));
     // $this->tpl->setVariable("VAL_API_PREFIX", $this->object->getAPIFunctionsPrefix());
     //
     // debugging
     //
     $sh = new ilFormSectionHeaderGUI();
     $sh->setTitle($this->lng->txt("cont_debugging"));
     $this->form->addItem($sh);
     // test tool
     $cb = new ilCheckboxInputGUI($this->lng->txt("cont_debug"), "cobj_debug");
     $cb->setValue("y");
     $cb->setChecked($this->object->getDebug());
     if ($this->object->getDebugActivated() == false) {
         $cb->setDisabled(true);
         $cb->setInfo($this->lng->txt("cont_debug_deactivated"));
     } else {
         $cb->setInfo($this->lng->txt("cont_debug_deactivate"));
     }
     $this->form->addItem($cb);
     $this->form->addCommandButton("saveProperties", $lng->txt("save"));
     $tpl->setContent($this->form->getHTML());
 }
 /**
  * Init add cast item form.
  */
 function initAddCastItemForm($a_mode = "create")
 {
     global $lng, $ilCtrl, $ilTabs;
     $this->checkPermission("write");
     $ilTabs->activateTab("edit_content");
     $lng->loadLanguageModule("mcst");
     $news_set = new ilSetting("news");
     $enable_internal_rss = $news_set->get("enable_rss_for_internal");
     include "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form_gui = new ilPropertyFormGUI();
     $this->form_gui->setMultipart(true);
     // Property Title
     $text_input = new ilTextInputGUI($lng->txt("title"), "title");
     $text_input->setMaxLength(200);
     $this->form_gui->addItem($text_input);
     // Property Content
     $text_area = new ilTextAreaInputGUI($lng->txt("description"), "description");
     $text_area->setRequired(false);
     $this->form_gui->addItem($text_area);
     // Property Visibility
     if ($enable_internal_rss) {
         $radio_group = new ilRadioGroupInputGUI($lng->txt("access_scope"), "visibility");
         $radio_option = new ilRadioOption($lng->txt("access_users"), "users");
         $radio_group->addOption($radio_option);
         $radio_option = new ilRadioOption($lng->txt("access_public"), "public");
         $radio_group->addOption($radio_option);
         $radio_group->setInfo($lng->txt("mcst_visibility_info"));
         $radio_group->setRequired(true);
         $radio_group->setValue($this->object->getDefaultAccess() == 0 ? "users" : "public");
         $this->form_gui->addItem($radio_group);
     }
     // Duration
     $dur = new ilDurationInputGUI($lng->txt("mcst_duration"), "duration");
     $dur->setInfo($lng->txt("mcst_duration_info"));
     $dur->setShowDays(false);
     $dur->setShowHours(true);
     $dur->setShowSeconds(true);
     $this->form_gui->addItem($dur);
     foreach (ilObjMediaCast::$purposes as $purpose) {
         if ($purpose == "VideoAlternative" && $a_mode == "create") {
             continue;
         }
         $section = new ilFormSectionHeaderGUI();
         $section->setTitle($lng->txt("mcst_" . strtolower($purpose) . "_title"));
         $this->form_gui->addItem($section);
         if ($a_mode != "create") {
             $value = new ilHiddenInputGUI("value_" . $purpose);
             $label = new ilNonEditableValueGUI($lng->txt("value"));
             $label->setPostVar("label_value_" . $purpose);
             $label->setInfo($lng->txt("mcst_current_value_info"));
             $this->form_gui->addItem($label);
             $this->form_gui->addItem($value);
         }
         $file = new ilFileInputGUI($lng->txt("file"), "file_" . $purpose);
         $file->setSuffixes($this->purposeSuffixes[$purpose]);
         $this->form_gui->addItem($file);
         $text_input = new ilRegExpInputGUI($lng->txt("url"), "url_" . $purpose);
         $text_input->setPattern("/https?\\:\\/\\/.+/i");
         $text_input->setInfo($lng->txt("mcst_reference_info"));
         $this->form_gui->addItem($text_input);
         if ($purpose != "Standard") {
             $clearCheckBox = new ilCheckboxInputGUI();
             $clearCheckBox->setPostVar("delete_" . $purpose);
             $clearCheckBox->setTitle($lng->txt("mcst_clear_purpose_title"));
             $this->form_gui->addItem($clearCheckBox);
         } else {
             // mime type selection
             $mimeTypeSelection = new ilSelectInputGUI();
             $mimeTypeSelection->setPostVar("mimetype_" . $purpose);
             $mimeTypeSelection->setTitle($lng->txt("mcst_mimetype"));
             $mimeTypeSelection->setInfo($lng->txt("mcst_mimetype_info"));
             $options = array("" => $lng->txt("mcst_automatic_detection"));
             $options = array_merge($options, $this->mimeTypes);
             $mimeTypeSelection->setOptions($options);
             $this->form_gui->addItem($mimeTypeSelection);
             // preview picure
             $pp = new ilImageFileInputGUI($lng->txt("mcst_preview_picture"), "preview_pic");
             $pp->setSuffixes(array("png", "jpeg", "jpg"));
             $pp->setInfo($lng->txt("mcst_preview_picture_info") . " mp4, mp3, png, jp(e)g, gif");
             $this->form_gui->addItem($pp);
         }
     }
     // save/cancel button
     if ($a_mode == "create") {
         $this->form_gui->setTitle($lng->txt("mcst_add_new_item"));
         $this->form_gui->addCommandButton("saveCastItem", $lng->txt("save"));
     } else {
         $this->form_gui->setTitle($lng->txt("mcst_edit_item"));
         $this->form_gui->addCommandButton("updateCastItem", $lng->txt("save"));
     }
     $this->form_gui->addCommandButton("listItems", $lng->txt("cancel"));
     $this->form_gui->setFormAction($ilCtrl->getFormAction($this, "saveCastItem"));
 }
 /**
  * Init settings form 
  * @return void
  */
 protected function initFormSettings()
 {
     global $lng, $ilDB;
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     include_once './Services/Search/classes/class.ilSearchSettings.php';
     $settings = new ilSearchSettings();
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($this->ctrl->getFormAction($this, 'updateSettings'));
     $this->form->addCommandButton('updateSettings', $this->lng->txt('save'));
     $this->form->setTitle($this->lng->txt('seas_settings'));
     // Max hits
     $hits = new ilSelectInputGUI($this->lng->txt('seas_max_hits'), 'max_hits');
     $hits->setValue($settings->getMaxHits());
     $hits->setRequired(true);
     for ($value = 5; $value <= 15; $value += 5) {
         $values[$value] = $value;
     }
     $hits->setOptions($values);
     $hits->setInfo($this->lng->txt('seas_max_hits_info'));
     $this->form->addItem($hits);
     // Search type
     $type = new ilRadioGroupInputGUI($this->lng->txt('search_type'), 'search_type');
     if ($settings->enabledLucene()) {
         $type->setValue(ilSearchSettings::LUCENE_SEARCH);
     } elseif ($settings->enabledIndex()) {
         $type->setValue(ilSearchSettings::INDEX_SEARCH);
     } else {
         $type->setValue(ilSearchSettings::LIKE_SEARCH);
     }
     $type->setRequired(true);
     $this->form->addItem($type);
     // Default operator
     $operator = new ilRadioGroupInputGUI($this->lng->txt('lucene_default_operator'), 'operator');
     $operator->setRequired(true);
     $operator->setInfo($this->lng->txt('lucene_default_operator_info'));
     $operator->setValue($settings->getDefaultOperator());
     $and = new ilRadioOption($this->lng->txt('lucene_and'), ilSearchSettings::OPERATOR_AND);
     $operator->addOption($and);
     $or = new ilRadioOption($this->lng->txt('lucene_or'), ilSearchSettings::OPERATOR_OR);
     $operator->addOption($or);
     $this->form->addItem($operator);
     // Item filter
     $if = new ilCheckboxInputGUI($this->lng->txt('search_item_filter_form'), 'if');
     $if->setValue(1);
     $if->setChecked($settings->isLuceneItemFilterEnabled());
     $if->setInfo($this->lng->txt('search_item_filter_form_info'));
     $this->form->addItem($if);
     $filter = $settings->getLuceneItemFilter();
     foreach (ilSearchSettings::getLuceneItemFilterDefinitions() as $obj => $def) {
         $ch = new ilCheckboxInputGUI($this->lng->txt($def['trans']), 'filter[' . $obj . ']');
         if (isset($filter[$obj]) and $filter[$obj]) {
             $ch->setChecked(true);
         }
         $ch->setValue(1);
         $if->addSubItem($ch);
     }
     // hide advanced search
     $cb = new ilCheckboxInputGUI($lng->txt("search_hide_adv_search"), "hide_adv_search");
     $cb->setChecked($settings->getHideAdvancedSearch());
     $this->form->addItem($cb);
     // number of auto complete entries
     $options = array(5 => 5, 10 => 10, 20 => 20, 30 => 30);
     $si = new ilSelectInputGUI($lng->txt("search_auto_complete_length"), "auto_complete_length");
     $si->setOptions($options);
     $val = $settings->getAutoCompleteLength() > 0 ? $settings->getAutoCompleteLength() : 10;
     $si->setValue($val);
     $this->form->addItem($si);
     $direct = new ilRadioOption($this->lng->txt('search_direct'), ilSearchSettings::LIKE_SEARCH, $this->lng->txt('search_like_info'));
     $type->addOption($direct);
     if ($ilDB->getDBType() == 'mysql') {
         $index = new ilRadioOption($this->lng->txt('search_index'), ilSearchSettings::INDEX_SEARCH, $this->lng->txt('search_full_info'));
         $type->addOption($index);
     }
     $lucene = new ilRadioOption($this->lng->txt('search_lucene'), ilSearchSettings::LUCENE_SEARCH, $this->lng->txt('java_server_info'));
     $type->addOption($lucene);
 }
 /**
  * Init settings property form
  *
  * @access protected
  */
 protected function initFormSettings()
 {
     global $lng, $ilSetting;
     $this->tabs_gui->setTabActive('settings');
     $frma_set = new ilSetting("frma");
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTitle($this->lng->txt('settings'));
     $form->addCommandButton('saveSettings', $this->lng->txt('save'));
     $form->addCommandButton('cancel', $this->lng->txt('cancel'));
     // forum overview
     $frm_radio = new ilRadioGroupInputGUI($this->lng->txt('show_topics_overview'), 'forum_overview');
     $frm_radio->addOption(new ilRadioOption($this->lng->txt('new') . ', ' . $this->lng->txt('is_read') . ', ' . $this->lng->txt('unread'), '0'));
     $frm_radio->addOption(new ilRadioOption($this->lng->txt('is_read') . ', ' . $this->lng->txt('unread'), '1'));
     $frm_radio->setValue($frma_set->get('forum_overview'));
     $frm_radio->setInfo($this->lng->txt('topics_overview_info'));
     $form->addItem($frm_radio);
     $this->fora_statistics = (bool) $ilSetting->get('enable_fora_statistics', false);
     $this->anonymous_fora = (bool) $ilSetting->get('enable_anonymous_fora', false);
     $check = new ilCheckboxInputGui($this->lng->txt('enable_fora_statistics'), 'fora_statistics');
     $check->setInfo($this->lng->txt('enable_fora_statistics_desc'));
     $check->setChecked($this->fora_statistics);
     $form->addItem($check);
     $check = new ilCheckboxInputGui($this->lng->txt('enable_anonymous_fora'), 'anonymous_fora');
     $check->setInfo($this->lng->txt('enable_anonymous_fora_desc'));
     $check->setChecked($this->anonymous_fora);
     $form->addItem($check);
     $frm_sel = new ilSelectInputGUI($this->lng->txt('cron_forum_notification'), 'forum_notification');
     $notification_options = array(0 => $this->lng->txt('cron_forum_notification_never'), 1 => $this->lng->txt('cron_forum_notification_directly'), 2 => $this->lng->txt('cron_forum_notification_cron'));
     $frm_sel->setOptions($notification_options);
     $frm_sel->setValue($ilSetting->get('forum_notification'));
     $frm_sel->setInfo($this->lng->txt('cron_forum_notification_desc'));
     $form->addItem($frm_sel);
     $this->tpl->setContent($form->getHTML());
 }
 protected function initDidacticTemplate(ilPropertyFormGUI $a_form)
 {
     global $ilUser;
     include_once "Modules/Portfolio/classes/class.ilObjPortfolio.php";
     $all = ilObjPortfolio::getPortfoliosOfUser($ilUser->getId());
     if (sizeof($all)) {
         $opts = array("" => $this->lng->txt("please_select"));
         foreach ($all as $item) {
             $opts[$item["id"]] = $item["title"];
         }
         $prtf = new ilSelectInputGUI($this->lng->txt("prtf_create_template_from_portfolio"), "prtf");
         $prtf->setInfo($this->lng->txt("prtf_create_template_from_portfolio_info"));
         $prtf->setOptions($opts);
         $a_form->addItem($prtf);
     }
     // yeah, I know.
     return $a_form;
 }
 /**
  * Insert tabs form.
  */
 function initForm($a_mode = "edit")
 {
     global $ilCtrl, $tpl, $lng;
     include_once "./Services/Accordion/classes/class.ilAccordionGUI.php";
     ilAccordionGUI::addCss();
     // edit form
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($ilCtrl->getFormAction($this));
     if ($a_mode != "edit") {
         $this->form->setTitle($lng->txt("cont_ed_insert_tabs"));
     } else {
         $this->form->setTitle($lng->txt("cont_edit_tabs"));
     }
     // tabs type
     /*$type_prop = new ilSelectInputGUI($lng->txt("cont_type"),
     			"type");
     		$types = array(ilPCTabs::ACCORDION_VER => $lng->txt("cont_tabs_acc_ver"),
     			ilPCTabs::ACCORDION_HOR => $lng->txt("cont_tabs_acc_hor"));
     		$type_prop->setOptions($types);
     		$this->form->addItem($type_prop);*/
     $templ = $this->getTemplateOptions("vaccordion");
     require_once "./Services/Form/classes/class.ilAdvSelectInputGUI.php";
     $vchar_prop = new ilAdvSelectInputGUI($this->lng->txt("cont_characteristic"), "vaccord_templ");
     $vchars = array();
     foreach ($templ as $k => $te) {
         $t = explode(":", $k);
         $html = $this->style->lookupTemplatePreview($t[1]) . '<div style="clear:both" class="small">' . $te . "</div>";
         $vchar_prop->addOption($k, $te, $html);
         if ($t[2] == "VerticalAccordion") {
             $vchar_prop->setValue($k);
         }
     }
     $templ = $this->getTemplateOptions("haccordion");
     $hchar_prop = new ilAdvSelectInputGUI($this->lng->txt("cont_characteristic"), "haccord_templ");
     $hchars = array();
     foreach ($templ as $k => $te) {
         $t = explode(":", $k);
         $html = $this->style->lookupTemplatePreview($t[1]) . '<div style="clear:both" class="small">' . $te . "</div>";
         $hchar_prop->addOption($k, $te, $html);
         if ($t[2] == "HorizontalAccordion") {
             $hchar_prop->setValue($k);
         }
     }
     $radg = new ilRadioGroupInputGUI($lng->txt("cont_type"), "type");
     $radg->setValue(ilPCTabs::ACCORDION_VER);
     $op1 = new ilRadioOption($lng->txt("cont_tabs_acc_ver"), ilPCTabs::ACCORDION_VER);
     $op1->addSubItem($vchar_prop);
     $radg->addOption($op1);
     $op2 = new ilRadioOption($lng->txt("cont_tabs_acc_hor"), ilPCTabs::ACCORDION_HOR);
     $op2->addSubItem($hchar_prop);
     $radg->addOption($op2);
     $this->form->addItem($radg);
     // number of initial tabs
     if ($a_mode == "create") {
         $nr_prop = new ilSelectInputGUI($lng->txt("cont_number_of_tabs"), "nr");
         $nrs = array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10);
         $nr_prop->setOptions($nrs);
         $this->form->addItem($nr_prop);
     }
     $ni = new ilNumberInputGUI($this->lng->txt("cont_tab_cont_width"), "content_width");
     $ni->setMaxLength(4);
     $ni->setSize(4);
     $this->form->addItem($ni);
     $ni = new ilNumberInputGUI($this->lng->txt("cont_tab_cont_height"), "content_height");
     $ni->setMaxLength(4);
     $ni->setSize(4);
     $this->form->addItem($ni);
     // behaviour
     $options = array("AllClosed" => $lng->txt("cont_all_closed"), "FirstOpen" => $lng->txt("cont_first_open"), "ForceAllOpen" => $lng->txt("cont_force_all_open"));
     $si = new ilSelectInputGUI($this->lng->txt("cont_behavior"), "behavior");
     $si->setOptions($options);
     $this->form->addItem($si);
     // alignment
     $align_opts = array("Left" => $lng->txt("cont_left"), "Right" => $lng->txt("cont_right"), "Center" => $lng->txt("cont_center"), "LeftFloat" => $lng->txt("cont_left_float"), "RightFloat" => $lng->txt("cont_right_float"));
     $align = new ilSelectInputGUI($this->lng->txt("cont_align"), "align");
     $align->setOptions($align_opts);
     $align->setValue("Center");
     $align->setInfo($lng->txt("cont_tabs_hor_align_info"));
     $this->form->addItem($align);
     // save/cancel buttons
     if ($a_mode == "create") {
         $this->form->addCommandButton("create_section", $lng->txt("save"));
         $this->form->addCommandButton("cancelCreate", $lng->txt("cancel"));
     } else {
         $this->form->addCommandButton("update", $lng->txt("save"));
         $this->form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
     }
 }
 /**
  * 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());
 }
 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->setTitle($this->lng->txt('qpl_form_general_settings'));
     $form->setId('properties');
     // online
     $online = new ilCheckboxInputGUI($this->lng->txt('qpl_settings_general_form_property_online'), 'online');
     $online->setInfo($this->lng->txt('qpl_settings_general_form_property_online_description'));
     $online->setChecked($this->poolOBJ->getOnline());
     $form->addItem($online);
     // show taxonomies
     $showTax = new ilCheckboxInputGUI($this->lng->txt('qpl_settings_general_form_property_show_taxonomies'), 'show_taxonomies');
     $showTax->setInfo($this->lng->txt('qpl_settings_general_form_prop_show_tax_desc'));
     $showTax->setChecked($this->poolOBJ->getShowTaxonomies());
     $form->addItem($showTax);
     $taxSelectOptions = $this->getTaxonomySelectInputOptions();
     // pool navigation taxonomy
     $navTax = new ilSelectInputGUI($this->lng->txt('qpl_settings_general_form_property_nav_taxonomy'), 'nav_taxonomy');
     $navTax->setInfo($this->lng->txt('qpl_settings_general_form_property_nav_taxonomy_description'));
     $navTax->setValue($this->poolOBJ->getNavTaxonomyId());
     $navTax->setOptions($taxSelectOptions);
     $showTax->addSubItem($navTax);
     // skill service activation
     if (ilObjQuestionPool::isSkillManagementGloballyActivated()) {
         $skillService = new ilCheckboxInputGUI($this->lng->txt('tst_activate_skill_service'), 'skill_service');
         $skillService->setChecked($this->poolOBJ->isSkillServiceEnabled());
         $form->addItem($skillService);
     }
     return $form;
 }
 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'));
 }
 /**
  * Configure MathJax settings
  */
 function editMathJaxObject()
 {
     global $ilAccess, $rbacreview, $lng, $ilCtrl, $tpl;
     $mathJaxSetting = new ilSetting("MathJax");
     $path_to_mathjax = $mathJaxSetting->get("path_to_mathjax");
     $this->__initSubTabs("editMathJax");
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($ilCtrl->getFormAction($this));
     $form->setTitle($lng->txt("mathjax_settings"));
     // Enable MathJax
     $enable = new ilCheckboxInputGUI($lng->txt("mathjax_enable_mathjax"), "enable");
     $enable->setChecked($mathJaxSetting->get("enable"));
     $enable->setInfo($lng->txt("mathjax_enable_mathjax_info") . " <a target='blank' href='http://www.mathjax.org/'>MathJax</a>");
     $form->addItem($enable);
     // Path to mathjax
     $text_prop = new ilTextInputGUI($lng->txt("mathjax_path_to_mathjax"), "path_to_mathjax");
     $text_prop->setInfo($lng->txt("mathjax_path_to_mathjax_desc"));
     $text_prop->setValue($path_to_mathjax);
     $text_prop->setRequired(true);
     $text_prop->setMaxLength(400);
     $text_prop->setSize(100);
     $enable->addSubItem($text_prop);
     // mathjax limiter
     $options = array(0 => '\\(...\\)', 1 => '[tex]...[/tex]', 2 => '&lt;span class="math"&gt;...&lt;/span&gt;');
     $si = new ilSelectInputGUI($this->lng->txt("mathjax_limiter"), "limiter");
     $si->setOptions($options);
     $si->setValue($mathJaxSetting->get("limiter"));
     $si->setInfo($this->lng->txt("mathjax_limiter_info"));
     $enable->addSubItem($si);
     if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
         $form->addCommandButton("saveMathJax", $lng->txt("save"));
     }
     $tpl->setVariable("ADM_CONTENT", $form->getHTML());
 }
 /**
  * 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'));
 }
 /**
  * Init properties (editable) form.
  */
 public function initPropertiesEditableForm()
 {
     global $lng, $ilCtrl, $tree, $rbacsystem, $ilSetting;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     // localization
     $options = array("" => $lng->txt("please_select"));
     $langs = $lng->getInstalledLanguages();
     $lng->loadLanguageModule("meta");
     foreach ($langs as $l) {
         $options[$l] = $lng->txt("meta_l_" . $l);
     }
     $loc = new ilSelectInputGUI($this->lng->txt("cont_localization"), "localization");
     $loc->setOptions($options);
     $loc->setInfo($this->lng->txt("cont_localization_info"));
     $this->form->addItem($loc);
     // glossary
     $ne = new ilNonEditableValueGUI($lng->txt("obj_glo"), "glossary");
     $this->form->addItem($ne);
     // style
     $lng->loadLanguageModule("style");
     $fixed_style = $ilSetting->get("fixed_content_style_id");
     $style_id = $this->object->getStyleSheetId();
     if ($fixed_style > 0) {
         $st = new ilNonEditableValueGUI($lng->txt("cont_current_style"));
         $st->setValue(ilObject::_lookupTitle($fixed_style) . " (" . $this->lng->txt("global_fixed") . ")");
         $this->form->addItem($st);
     } else {
         $st_styles = ilObjStyleSheet::_getStandardStyles(true, false, $_GET["ref_id"]);
         $st_styles[0] = $this->lng->txt("default");
         ksort($st_styles);
         if ($style_id > 0) {
             // individual style
             if (!ilObjStyleSheet::_lookupStandard($style_id)) {
                 $st = new ilNonEditableValueGUI($lng->txt("cont_current_style"));
                 $st->setValue(ilObject::_lookupTitle($style_id));
                 $this->form->addItem($st);
             }
         }
         if ($style_id <= 0 || ilObjStyleSheet::_lookupStandard($style_id)) {
             $style_sel = ilUtil::formSelect($style_id, "style_id", $st_styles, false, true);
             $style_sel = new ilSelectInputGUI($lng->txt("cont_current_style"), "style_id");
             $style_sel->setOptions($st_styles);
             $style_sel->setValue($style_id);
             $this->form->addItem($style_sel);
         }
     }
     // number of tries
     $ni = new ilNumberInputGUI($lng->txt("cont_qtries"), "q_tries");
     $ni->setMaxLength(3);
     $ni->setSize(3);
     $this->form->addItem($ni);
     $this->form->addCommandButton("saveProperties", $lng->txt("save"));
     $this->form->setTitle($lng->txt("cont_scorm_ed_properties"));
     $this->form->setFormAction($ilCtrl->getFormAction($this));
 }
 /**
  * Init settings property form
  *
  * @access protected
  */
 protected function initFormSettings()
 {
     if (is_object($this->form)) {
         return true;
     }
     include_once 'Services/Calendar/classes/class.ilCalendarUtil.php';
     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_global_settings'));
     $this->form->addCommandButton('save', $this->lng->txt('save'));
     #$this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
     $check = new ilCheckboxInputGUI($this->lng->txt('enable_calendar'), 'enable');
     $check->setValue(1);
     $check->setChecked($this->settings->isEnabled() ? true : false);
     $this->form->addItem($check);
     $server_tz = new ilNonEditableValueGUI($this->lng->txt('cal_server_tz'));
     $server_tz->setValue(ilTimeZone::_getDefaultTimeZone());
     $this->form->addItem($server_tz);
     $select = new ilSelectInputGUI($this->lng->txt('cal_def_timezone'), 'default_timezone');
     $select->setOptions(ilCalendarUtil::_getShortTimeZoneList());
     $select->setInfo($this->lng->txt('cal_def_timezone_info'));
     $select->setValue($this->settings->getDefaultTimeZone());
     $this->form->addItem($select);
     $year = date("Y");
     $select = new ilSelectInputGUI($this->lng->txt('cal_def_date_format'), 'default_date_format');
     $select->setOptions(array(ilCalendarSettings::DATE_FORMAT_DMY => '31.10.' . $year, ilCalendarSettings::DATE_FORMAT_YMD => $year . "-10-31", ilCalendarSettings::DATE_FORMAT_MDY => "10/31/" . $year));
     $select->setInfo($this->lng->txt('cal_def_date_format_info'));
     $select->setValue($this->settings->getDefaultDateFormat());
     $this->form->addItem($select);
     $select = new ilSelectInputGUI($this->lng->txt('cal_def_time_format'), 'default_time_format');
     $select->setOptions(array(ilCalendarSettings::TIME_FORMAT_24 => '13:00', ilCalendarSettings::TIME_FORMAT_12 => '1:00pm'));
     $select->setInfo($this->lng->txt('cal_def_time_format_info'));
     $select->setValue($this->settings->getDefaultTimeFormat());
     $this->form->addItem($select);
     // Weekstart
     $radio = new ilRadioGroupInputGUI($this->lng->txt('cal_def_week_start'), 'default_week_start');
     $radio->setValue($this->settings->getDefaultWeekStart());
     $option = new ilRadioOption($this->lng->txt('l_su'), 0);
     $radio->addOption($option);
     $option = new ilRadioOption($this->lng->txt('l_mo'), 1);
     $radio->addOption($option);
     $this->form->addItem($radio);
     // Day start
     $day_start = new ilSelectInputGUI($this->lng->txt('cal_day_start'), 'dst');
     $day_start->setOptions(ilCalendarUtil::getHourSelection($this->settings->getDefaultTimeFormat()));
     $day_start->setValue($this->settings->getDefaultDayStart());
     $this->form->addItem($day_start);
     $day_end = new ilSelectInputGUI($this->lng->txt('cal_day_end'), 'den');
     $day_end->setOptions(ilCalendarUtil::getHourSelection($this->settings->getDefaultTimeFormat()));
     $day_end->setValue($this->settings->getDefaultDayEnd());
     $this->form->addItem($day_end);
     $sync = new ilCheckboxInputGUI($this->lng->txt('cal_webcal_sync'), 'webcal');
     $sync->setValue(1);
     $sync->setChecked($this->settings->isWebCalSyncEnabled());
     $sync->setInfo($this->lng->txt('cal_webcal_sync_info'));
     $sync_min = new ilNumberInputGUI('', 'webcal_hours');
     $sync_min->setSize(2);
     $sync_min->setMaxLength(3);
     $sync_min->setValue($this->settings->getWebCalSyncHours());
     $sync_min->setSuffix($this->lng->txt('hours'));
     $sync->addSubItem($sync_min);
     $this->form->addItem($sync);
     // enable milestone planning in groups
     $mil = new ilFormSectionHeaderGUI();
     $mil->setTitle($this->lng->txt('cal_milestone_settings'));
     $this->form->addItem($mil);
     $checkm = new ilCheckboxInputGUI($this->lng->txt('cal_enable_group_milestones'), 'enable_grp_milestones');
     $checkm->setValue(1);
     $checkm->setChecked($this->settings->getEnableGroupMilestones() ? true : false);
     $checkm->setInfo($this->lng->txt('cal_enable_group_milestones_desc'));
     $this->form->addItem($checkm);
     // Consultation hours
     $con = new ilFormSectionHeaderGUI();
     $con->setTitle($this->lng->txt('cal_ch_form_header'));
     $this->form->addItem($con);
     $ch = new ilCheckboxInputGUI($this->lng->txt('cal_ch_form'), 'ch');
     $ch->setInfo($this->lng->txt('cal_ch_form_info'));
     $ch->setValue(1);
     $ch->setChecked($this->settings->areConsultationHoursEnabled());
     $this->form->addItem($ch);
     // repository visibility default
     $rep = new ilFormSectionHeaderGUI();
     $rep->setTitle($GLOBALS['lng']->txt('cal_setting_global_vis_repos'));
     $this->form->addItem($rep);
     $crs = new ilCheckboxInputGUI($GLOBALS['lng']->txt('cal_setting_global_crs_vis'), 'visible_crs');
     $crs->setInfo($GLOBALS['lng']->txt('cal_setting_global_crs_vis_info'));
     $crs->setValue(1);
     $crs->setInfo($GLOBALS['lng']->txt('cal_setting_global_crs_vis_info'));
     $crs->setChecked($this->settings->isCourseCalendarEnabled());
     $this->form->addItem($crs);
     $grp = new ilCheckboxInputGUI($GLOBALS['lng']->txt('cal_setting_global_grp_vis'), 'visible_grp');
     $grp->setInfo($GLOBALS['lng']->txt('cal_setting_global_grp_vis_info'));
     $grp->setValue(1);
     $grp->setInfo($GLOBALS['lng']->txt('cal_setting_global_grp_vis_info'));
     $grp->setChecked($this->settings->isGroupCalendarEnabled());
     $this->form->addItem($grp);
     // Notifications
     $not = new ilFormSectionHeaderGUI();
     $not->setTitle($this->lng->txt('notifications'));
     $this->form->addItem($not);
     $cgn = new ilCheckboxInputGUI($this->lng->txt('cal_notification'), 'cn');
     $cgn->setOptionTitle($this->lng->txt('cal_notification_crsgrp'));
     $cgn->setValue(1);
     $cgn->setChecked($this->settings->isNotificationEnabled());
     $cgn->setInfo($this->lng->txt('cal_adm_notification_info'));
     $this->form->addItem($cgn);
     $cnu = new ilCheckboxInputGUI('', 'cnu');
     $cnu->setOptionTitle($this->lng->txt('cal_notification_users'));
     $cnu->setValue(1);
     $cnu->setChecked($this->settings->isUserNotificationEnabled());
     $cnu->setInfo($this->lng->txt('cal_adm_notification_user_info'));
     $this->form->addItem($cnu);
     // Registration
     $book = new ilFormSectionHeaderGUI();
     $book->setTitle($this->lng->txt('cal_registrations'));
     $this->form->addItem($book);
     $cgn = new ilCheckboxInputGUI($this->lng->txt('cal_cg_registrations'), 'cgr');
     $cgn->setValue(1);
     $cgn->setChecked($this->settings->isCGRegistrationEnabled());
     $cgn->setInfo($this->lng->txt('cal_cg_registration_info'));
     $this->form->addItem($cgn);
     // Synchronisation cache
     $sec = new ilFormSectionHeaderGUI();
     $sec->setTitle($this->lng->txt('cal_cache_settings'));
     $this->form->addItem($sec);
     $cache = new ilRadioGroupInputGUI($this->lng->txt('cal_sync_cache'), 'sync_cache');
     $cache->setValue((int) $this->settings->isSynchronisationCacheEnabled());
     $cache->setInfo($this->lng->txt('cal_sync_cache_info'));
     $cache->setRequired(true);
     $sync_cache = new ilRadioOption($this->lng->txt('cal_sync_disabled'), 0);
     $cache->addOption($sync_cache);
     $sync_cache = new ilRadioOption($this->lng->txt('cal_sync_enabled'), 1);
     $cache->addOption($sync_cache);
     $cache_t = new ilNumberInputGUI('', 'sync_cache_time');
     $cache_t->setValue($this->settings->getSynchronisationCacheMinutes());
     $cache_t->setMinValue(0);
     $cache_t->setSize(3);
     $cache_t->setMaxLength(3);
     $cache_t->setSuffix($this->lng->txt('form_minutes'));
     $sync_cache->addSubItem($cache_t);
     $this->form->addItem($cache);
     // Calendar cache
     $cache = new ilRadioGroupInputGUI($this->lng->txt('cal_cache'), 'cache');
     $cache->setValue((int) $this->settings->isCacheUsed());
     $cache->setInfo($this->lng->txt('cal_cache_info'));
     $cache->setRequired(true);
     $sync_cache = new ilRadioOption($this->lng->txt('cal_cache_disabled'), 0);
     $cache->addOption($sync_cache);
     $sync_cache = new ilRadioOption($this->lng->txt('cal_cache_enabled'), 1);
     $cache->addOption($sync_cache);
     $cache_t = new ilNumberInputGUI('', 'cache_time');
     $cache_t->setValue($this->settings->getCacheMinutes());
     $cache_t->setMinValue(0);
     $cache_t->setSize(3);
     $cache_t->setMaxLength(3);
     $cache_t->setSuffix($this->lng->txt('form_minutes'));
     $sync_cache->addSubItem($cache_t);
     $this->form->addItem($cache);
 }
 private function buildSettingsForm()
 {
     /**
      * @var $ilAccess ilAccessHandler
      */
     global $ilAccess;
     include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTableWidth("100%");
     $form->setId("settings");
     $header = new ilFormSectionHeaderGUI();
     $header->setTitle($this->lng->txt('settings'));
     $form->addItem($header);
     // question process locking behaviour (e.g. on saving users working data)
     $chb = new ilCheckboxInputGUI($this->lng->txt('ass_process_lock'), 'ass_process_lock');
     $chb->setChecked($this->object->getAssessmentProcessLockMode() != ilObjAssessmentFolder::ASS_PROC_LOCK_MODE_NONE);
     $chb->setInfo($this->lng->txt('ass_process_lock_desc'));
     $form->addItem($chb);
     $rg = new ilRadioGroupInputGUI($this->lng->txt('ass_process_lock_mode'), 'ass_process_lock_mode');
     $rg->setRequired(true);
     $opt = new ilRadioOption($this->lng->txt('ass_process_lock_mode_file'), ilObjAssessmentFolder::ASS_PROC_LOCK_MODE_FILE);
     $opt->setInfo($this->lng->txt('ass_process_lock_mode_file_desc'));
     $rg->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt('ass_process_lock_mode_db'), ilObjAssessmentFolder::ASS_PROC_LOCK_MODE_DB);
     $opt->setInfo($this->lng->txt('ass_process_lock_mode_db_desc'));
     $rg->addOption($opt);
     if ($this->object->getAssessmentProcessLockMode() != ilObjAssessmentFolder::ASS_PROC_LOCK_MODE_NONE) {
         $rg->setValue($this->object->getAssessmentProcessLockMode());
     }
     $chb->addSubItem($rg);
     $assessmentSetting = new ilSetting('assessment');
     $imap_line_color = array_key_exists('imap_line_color', $_GET) ? $_GET['imap_line_color'] : $assessmentSetting->get('imap_line_color');
     if (strlen($imap_line_color) == 0) {
         $imap_line_color = 'FF0000';
     }
     $linepicker = new ilColorPickerInputGUI($this->lng->txt('assessment_imap_line_color'), 'imap_line_color');
     $linepicker->setValue($imap_line_color);
     $form->addItem($linepicker);
     $user_criteria = array_key_exists('user_criteria', $_GET) ? $_GET['user_criteria'] : $assessmentSetting->get('user_criteria');
     $userCriteria = new ilSelectInputGUI($this->lng->txt('user_criteria'), 'user_criteria');
     $userCriteria->setInfo($this->lng->txt('user_criteria_desc'));
     $userCriteria->setRequired(true);
     $fields = array('usr_id', 'login', 'email', 'matriculation', 'ext_account');
     $usr_fields = array();
     foreach ($fields as $field) {
         $usr_fields[$field] = $field;
     }
     $userCriteria->setOptions($usr_fields);
     $userCriteria->setValue($user_criteria);
     $form->addItem($userCriteria);
     // question settings
     $header = new ilFormSectionHeaderGUI();
     $header->setTitle($this->lng->txt("assf_questiontypes"));
     $form->addItem($header);
     // available question types
     $allowed = new ilCheckboxGroupInputGUI($this->lng->txt('assf_allowed_questiontypes'), "chb_allowed_questiontypes");
     $questiontypes =& ilObjQuestionPool::_getQuestionTypes(TRUE);
     $forbidden_types = $this->object->_getForbiddenQuestionTypes();
     $allowedtypes = array();
     foreach ($questiontypes as $qt) {
         if (!in_array($qt['question_type_id'], $forbidden_types)) {
             array_push($allowedtypes, $qt['question_type_id']);
         }
     }
     $allowed->setValue($allowedtypes);
     foreach ($questiontypes as $type_name => $qtype) {
         $allowed->addOption(new ilCheckboxOption($type_name, $qtype["question_type_id"]));
     }
     $allowed->setInfo($this->lng->txt('assf_allowed_questiontypes_desc'));
     $form->addItem($allowed);
     // manual scoring
     $manual = new ilCheckboxGroupInputGUI($this->lng->txt('assessment_log_manual_scoring_activate'), "chb_manual_scoring");
     $manscoring = $this->object->_getManualScoring();
     $manual->setValue($manscoring);
     foreach ($questiontypes as $type_name => $qtype) {
         $manual->addOption(new ilCheckboxOption($type_name, $qtype["question_type_id"]));
     }
     $manual->setInfo($this->lng->txt('assessment_log_manual_scoring_desc'));
     $form->addItem($manual);
     // scoring adjustment active
     $scoring_activation = new ilCheckboxInputGUI($this->lng->txt('assessment_scoring_adjust'), 'chb_scoring_adjust');
     $scoring_activation->setChecked($this->object->getScoringAdjustmentEnabled());
     $scoring_activation->setInfo($this->lng->txt('assessment_scoring_adjust_desc'));
     $form->addItem($scoring_activation);
     // scoring adjustment
     $scoring = new ilCheckboxGroupInputGUI($this->lng->txt('assessment_log_scoring_adjustment_activate'), "chb_scoring_adjustment");
     $scoring_active = $this->object->getScoringAdjustableQuestions();
     $scoring->setValue($scoring_active);
     foreach ($questiontypes as $type_name => $qtype) {
         $scoring->addOption(new ilCheckboxOption($type_name, $qtype["question_type_id"]));
     }
     $scoring->setInfo($this->lng->txt('assessment_log_scoring_adjustment_desc'));
     $form->addItem($scoring);
     if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
         $form->addCommandButton("saveSettings", $this->lng->txt("save"));
     }
     return $form;
 }
 /**
  * Init login form
  */
 protected function initLoginForm()
 {
     global $rbacsystem, $lng, $ilSetting;
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($this->ctrl->getFormAction($this, 'saveLoginInfo'));
     $this->form->setTableWidth('80%');
     $this->form->setTitle($this->lng->txt('login_information'));
     $this->form->addCommandButton('saveLoginInfo', $this->lng->txt('save'));
     include_once 'Services/LDAP/classes/class.ilLDAPServer.php';
     include_once 'Services/Radius/classes/class.ilRadiusSettings.php';
     $rad_settings = ilRadiusSettings::_getInstance();
     if ($ldap_id = ilLDAPServer::_getFirstActiveServer() or $rad_settings->isActive()) {
         $select = new ilSelectInputGUI($this->lng->txt('default_auth_mode'), 'default_auth_mode');
         $select->setValue($ilSetting->get('default_auth_mode', AUTH_LOCAL));
         $select->setInfo($this->lng->txt('default_auth_mode_info'));
         $options[AUTH_LOCAL] = $this->lng->txt('auth_local');
         if ($ldap_id) {
             $options[AUTH_LDAP] = $this->lng->txt('auth_ldap');
         }
         if ($rad_settings->isActive()) {
             $options[AUTH_RADIUS] = $this->lng->txt('auth_radius');
         }
         $select->setOptions($options);
         $this->form->addItem($select);
     }
     if (!is_object($this->loginSettings)) {
         $this->loginSettings = new ilSetting("login_settings");
     }
     $login_settings = $this->loginSettings->getAll();
     $languages = $lng->getInstalledLanguages();
     $def_language = $lng->getDefaultLanguage();
     foreach ($this->setDefLangFirst($def_language, $languages) as $lang_key) {
         $add = "";
         if ($lang_key == $def_language) {
             $add = " (" . $lng->txt("default") . ")";
         }
         $textarea = new ilTextAreaInputGUI($lng->txt("meta_l_" . $lang_key) . $add, 'login_message_' . $lang_key);
         $textarea->setRows(10);
         $textarea->setValue($login_settings["login_message_" . $lang_key]);
         $textarea->setUseRte(true);
         $textarea->setRteTagSet("extended");
         $this->form->addItem($textarea);
         unset($login_settings["login_message_" . $lang_key]);
     }
     foreach ($login_settings as $key => $message) {
         $lang_key = substr($key, strrpos($key, "_") + 1, strlen($key) - strrpos($key, "_"));
         $textarea = new ilTextAreaInputGUI($lng->txt("meta_l_" . $lang_key) . $add, 'login_message_' . $lang_key);
         $textarea->setRows(10);
         $textarea->setValue($message);
         $textarea->setUseRte(true);
         $textarea->setRteTagSet("extended");
         if (!in_array($lang_key, $languages)) {
             $textarea->setAlert($lng->txt("not_installed"));
         }
         $this->form->addItem($textarea);
     }
 }
 /**
  * Init client db form.
  */
 public function initClientDbForm($a_install = true, $dbupdate = null, $db_status = false, $hotfix_available = false, $custom_updates_available = false)
 {
     global $lng, $ilCtrl;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     // type
     $ne = new ilNonEditableValueGUI($lng->txt("db_type"), "db_type");
     $this->form->addItem($ne);
     // version
     if ($this->setup->getClient()->getDBType() == "mysql" || $this->setup->getClient()->getDBType() == "innodb") {
         $ne = new ilNonEditableValueGUI($lng->txt("version"), "db_version");
         $ilDB = $this->setup->getClient()->db;
         $ne->setValue($ilDB->getDBVersion());
         $this->form->addItem($ne);
     }
     // host
     $ne = new ilNonEditableValueGUI($lng->txt("host"), "db_host");
     $this->form->addItem($ne);
     // name
     $ne = new ilNonEditableValueGUI($lng->txt("name"), "db_name");
     $this->form->addItem($ne);
     // user
     $ne = new ilNonEditableValueGUI($lng->txt("user"), "db_user");
     $this->form->addItem($ne);
     // port
     $ne = new ilNonEditableValueGUI($lng->txt("port"), "db_port");
     $this->form->addItem($ne);
     // creation / collation for mysql
     if (($this->setup->getClient()->getDBType() == "mysql" || $this->setup->getClient()->getDBType() == "innodb") && $a_install) {
         // create database
         $cb = new ilCheckboxInputGUI($lng->txt("database_create"), "chk_db_create");
         // collation
         $collations = array("utf8_unicode_ci", "utf8_general_ci", "utf8_czech_ci", "utf8_danish_ci", "utf8_estonian_ci", "utf8_icelandic_ci", "utf8_latvian_ci", "utf8_lithuanian_ci", "utf8_persian_ci", "utf8_polish_ci", "utf8_roman_ci", "utf8_romanian_ci", "utf8_slovak_ci", "utf8_slovenian_ci", "utf8_spanish2_ci", "utf8_spanish_ci", "utf8_swedish_ci", "utf8_turkish_ci");
         foreach ($collations as $collation) {
             $options[$collation] = $collation;
         }
         $si = new ilSelectInputGUI($lng->txt("collation"), "collation");
         $si->setOptions($options);
         $si->setInfo($this->lng->txt("info_text_db_collation2") . " " . "<a target=\"_new\" href=\"http://dev.mysql.com/doc/mysql/en/charset-unicode-sets.html\">" . " MySQL Reference Manual :: 10.11.1 Unicode Character Sets</a>");
         $cb->addSubItem($si);
         $this->form->addItem($cb);
     }
     if ($a_install) {
         $this->form->addCommandButton("installDatabase", $lng->txt("database_install"));
     } else {
         $ilDB = $this->setup->getClient()->db;
         $this->lng->setDbHandler($ilDB);
         $dbupdate = new ilDBUpdate($ilDB);
         // database version
         $ne = new ilNonEditableValueGUI($lng->txt("database_version"), "curv");
         $ne->setValue($dbupdate->currentVersion);
         $this->form->addItem($ne);
         // file version
         $ne = new ilNonEditableValueGUI($lng->txt("file_version"), "filev");
         $ne->setValue($dbupdate->fileVersion);
         $this->form->addItem($ne);
         if (!($db_status = $dbupdate->getDBVersionStatus())) {
             // next update step
             $options = array();
             for ($i = $dbupdate->currentVersion + 1; $i <= $dbupdate->fileVersion; $i++) {
                 $options[$i] = $i;
             }
             if (count($options) > 1) {
                 $si = new ilSelectInputGUI($lng->txt("next_update_break"), "update_break");
                 $si->setOptions($options);
                 $si->setInfo($lng->txt("next_update_break_info"));
                 $this->form->addItem($si);
             }
             if ($dbupdate->getRunningStatus() > 0) {
                 ilUtil::sendFailure($this->lng->txt("db_update_interrupted") . "<br /><br />" . $this->lng->txt("db_update_interrupted_avoid"));
             } else {
                 ilUtil::sendInfo($this->lng->txt("database_needs_update"));
             }
             $this->form->addCommandButton("updateDatabase", $lng->txt("database_update"));
             $this->form->addCommandButton("showUpdateSteps", $lng->txt("show_update_steps"));
         } else {
             if ($hotfix_available) {
                 // hotfix current version
                 $ne = new ilNonEditableValueGUI($lng->txt("applied_hotfixes"), "curhf");
                 $ne->setValue($dbupdate->getHotfixCurrentVersion());
                 $this->form->addItem($ne);
                 // hotfix file version
                 $ne = new ilNonEditableValueGUI($lng->txt("available_hotfixes"), "filehf");
                 $ne->setValue($dbupdate->getHotfixFileVersion());
                 $this->form->addItem($ne);
                 $this->form->addCommandButton("applyHotfix", $lng->txt("apply_hotfixes"));
                 $this->form->addCommandButton("showHotfixSteps", $lng->txt("show_update_steps"));
                 ilUtil::sendInfo($this->lng->txt("database_needs_update"));
             } elseif ($custom_updates_available) {
                 // custom updates current version
                 $ne = new ilNonEditableValueGUI($lng->txt("applied_custom_updates"), "curcu");
                 $ne->setValue($dbupdate->getCustomUpdatesCurrentVersion());
                 $this->form->addItem($ne);
                 // custom updates file version
                 $ne = new ilNonEditableValueGUI($lng->txt("available_custom_updates"), "filecu");
                 $ne->setValue($dbupdate->getCustomUpdatesFileVersion());
                 $this->form->addItem($ne);
                 $this->form->addCommandButton("applyCustomUpdates", $lng->txt("apply_custom_updates"));
                 ilUtil::sendInfo($this->lng->txt("database_needs_update"));
             } else {
                 if ($dbupdate->getHotfixFileVersion() > 0) {
                     // hotfix current version
                     $ne = new ilNonEditableValueGUI($lng->txt("applied_hotfixes"), "curhf");
                     $ne->setValue($dbupdate->getHotfixCurrentVersion());
                     $this->form->addItem($ne);
                     // hotfix file version
                     $ne = new ilNonEditableValueGUI($lng->txt("available_hotfixes"), "filehf");
                     $ne->setValue($dbupdate->getHotfixFileVersion());
                     $this->form->addItem($ne);
                 }
                 if ($dbupdate->getCustomUpdatesFileVersion() > 0) {
                     // custom updates current version
                     $ne = new ilNonEditableValueGUI($lng->txt("applied_custom_updates"), "curcu");
                     $ne->setValue($dbupdate->getCustomUpdatesCurrentVersion());
                     $this->form->addItem($ne);
                     // custom updates file version
                     $ne = new ilNonEditableValueGUI($lng->txt("available_custom_updates"), "filecu");
                     $ne->setValue($dbupdate->getCustomUpdatesFileVersion());
                     $this->form->addItem($ne);
                 }
                 ilUtil::sendSuccess($this->lng->txt("database_is_uptodate"));
             }
         }
     }
     $this->form->setTitle($lng->txt("database"));
     $this->form->setFormAction("setup.php?cmd=gateway");
 }