/**
  * @return ilPropertyFormGUI
  */
 protected function getSettingsForm()
 {
     require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this, 'saveSettings'));
     $form->setTitle($this->lng->txt('settings'));
     $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->setInfo($this->lng->txt('topics_overview_info'));
     $form->addItem($frm_radio);
     $check = new ilCheckboxInputGui($this->lng->txt('enable_fora_statistics'), 'fora_statistics');
     $check->setInfo($this->lng->txt('enable_fora_statistics_desc'));
     $form->addItem($check);
     $check = new ilCheckboxInputGui($this->lng->txt('enable_anonymous_fora'), 'anonymous_fora');
     $check->setInfo($this->lng->txt('enable_anonymous_fora_desc'));
     $form->addItem($check);
     require_once 'Services/Cron/classes/class.ilCronManager.php';
     if (ilCronManager::isJobActive('frm_notification')) {
         require_once 'Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php';
         ilAdministrationSettingsFormHandler::addFieldsToForm(ilAdministrationSettingsFormHandler::FORM_FORUM, $form, $this);
     } else {
         $notifications = new ilCheckboxInputGui($this->lng->txt('cron_forum_notification'), 'forum_notification');
         $notifications->setInfo($this->lng->txt('cron_forum_notification_desc'));
         $notifications->setValue(1);
         $form->addItem($notifications);
     }
     require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php';
     $cap = new ilCheckboxInputGUI($this->lng->txt('adm_captcha_anonymous_short'), 'activate_captcha_anonym');
     $cap->setInfo($this->lng->txt('adm_captcha_anonymous_frm'));
     $cap->setValue(1);
     if (!ilCaptchaUtil::checkFreetype()) {
         $cap->setAlert(ilCaptchaUtil::getPreconditionsMessage());
     }
     $form->addItem($cap);
     $form->addCommandButton('saveSettings', $this->lng->txt('save'));
     $form->addCommandButton('cancel', $this->lng->txt('cancel'));
     return $form;
 }
 /**
  * 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());
 }
 /**
  * Show Privacy settings
  *
  * @access public
  */
 public function showPrivacy()
 {
     $privacy = ilPrivacySettings::_getInstance();
     $this->tabs_gui->setTabActive('show_privacy');
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTitle($this->lng->txt('ps_privacy_protection'));
     include_once 'Services/Membership/classes/class.ilMemberAgreement.php';
     if (ilMemberAgreement::_hasAgreements()) {
         $html = new ilNonEditableValueGUI();
         $html->setValue($this->lng->txt('ps_warning_modify'));
         $form->addItem($html);
     }
     $value = array();
     if ($privacy->enabledCourseExport()) {
         $value[] = "export_course";
     }
     if ($privacy->enabledGroupExport()) {
         $value[] = "export_group";
     }
     if ($privacy->courseConfirmationRequired()) {
         $value[] = "export_confirm_course";
     }
     if ($privacy->groupConfirmationRequired()) {
         $value[] = "export_confirm_group";
     }
     if ($privacy->enabledGroupAccessTimes()) {
         $value[] = "grp_access_times";
     }
     if ($privacy->enabledCourseAccessTimes()) {
         $value[] = "crs_access_times";
     }
     $group = new ilCheckboxGroupInputGUI($this->lng->txt('ps_profile_export'), 'profile_protection');
     $group->setValue($value);
     $check = new ilCheckboxOption();
     $check->setTitle($this->lng->txt('ps_export_course'));
     $check->setValue('export_course');
     $group->addOption($check);
     $check = new ilCheckboxOption();
     $check->setTitle($this->lng->txt('ps_export_groups'));
     $check->setValue('export_group');
     $group->addOption($check);
     $check = new ilCheckboxOption();
     $check->setTitle($this->lng->txt('ps_export_confirm'));
     $check->setValue('export_confirm_course');
     $group->addOption($check);
     $check = new ilCheckboxOption();
     $check->setTitle($this->lng->txt('ps_export_confirm_group'));
     $check->setValue('export_confirm_group');
     $group->addOption($check);
     $check = new ilCheckboxOption();
     $check->setTitle($this->lng->txt('ps_show_grp_access'));
     $check->setValue('grp_access_times');
     $group->addOption($check);
     $check = new ilCheckboxOption();
     $check->setTitle($this->lng->txt('ps_show_crs_access'));
     $check->setValue('crs_access_times');
     $group->addOption($check);
     $form->addItem($group);
     $check = new ilCheckboxInputGui($this->lng->txt('enable_fora_statistics'), 'fora_statistics');
     $check->setInfo($this->lng->txt('enable_fora_statistics_desc'));
     $check->setChecked($privacy->enabledForaStatistics());
     $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($privacy->enabledAnonymousFora());
     $form->addItem($check);
     $check = new ilCheckboxInputGui($this->lng->txt('enable_sahs_protocol_data'), 'enable_sahs_pd');
     $check->setInfo($this->lng->txt('enable_sahs_protocol_data_desc'));
     $check->setChecked($privacy->enabledSahsProtocolData());
     $form->addItem($check);
     $check = new ilCheckboxInputGui($this->lng->txt('rbac_log'), 'rbac_log');
     $check->setInfo($this->lng->txt('rbac_log_info'));
     $check->setChecked($privacy->enabledRbacLog());
     $form->addItem($check);
     $age = new ilNumberInputGUI($this->lng->txt('rbac_log_age'), 'rbac_log_age');
     $age->setInfo($this->lng->txt('rbac_log_age_info'));
     $age->setValue($privacy->getRbacLogAge());
     $age->setMinValue(1);
     $age->setMaxValue(24);
     $age->setSize(2);
     $age->setMaxLength(2);
     $check->addSubItem($age);
     $form->addCommandButton('save_privacy', $this->lng->txt('save'));
     $this->tpl->setContent($form->getHTML());
 }
Ejemplo n.º 4
0
 /**
  * Shoew add role
  * @global type $rbacreview
  * @global type $objDefinition
  * @return ilPropertyFormGUI 
  */
 protected function initRoleForm()
 {
     global $rbacreview, $objDefinition;
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTitle($this->lng->txt('role_new'));
     $form->addCommandButton('addrole', $this->lng->txt('role_new'));
     $form->addCommandButton('perm', $this->lng->txt('cancel'));
     $title = new ilTextInputGUI($this->lng->txt('title'), 'title');
     $title->setValidationRegexp('/^(?!il_).*$/');
     $title->setValidationFailureMessage($this->lng->txt('msg_role_reserved_prefix'));
     $title->setSize(40);
     $title->setMaxLength(70);
     $title->setRequired(true);
     $form->addItem($title);
     $desc = new ilTextAreaInputGUI($this->lng->txt('description'), 'desc');
     $desc->setCols(40);
     $desc->setRows(3);
     $form->addItem($desc);
     $pro = new ilCheckboxInputGUI($this->lng->txt('role_protect_permissions'), 'pro');
     $pro->setInfo($this->lng->txt('role_protect_permissions_desc'));
     $pro->setValue(1);
     $form->addItem($pro);
     $pd = new ilCheckboxInputGUI($this->lng->txt('rbac_role_add_to_desktop'), 'desktop');
     $pd->setInfo($this->lng->txt('rbac_role_add_to_desktop_info'));
     $pd->setValue(1);
     $form->addItem($pd);
     if (!$this->isInAdministration()) {
         $rights = new ilRadioGroupInputGUI($this->lng->txt("rbac_role_rights_copy"), 'rights');
         $option = new ilRadioOption($this->lng->txt("rbac_role_rights_copy_empty"), 0);
         $rights->addOption($option);
         $parent_role_ids = $rbacreview->getParentRoleIds($this->gui_obj->object->getRefId(), true);
         $ids = array();
         foreach ($parent_role_ids as $id => $tmp) {
             $ids[] = $id;
         }
         // Sort ids
         $sorted_ids = ilUtil::_sortIds($ids, 'object_data', 'type DESC,title', 'obj_id');
         // Sort roles by title
         $sorted_roles = ilUtil::sortArray(array_values($parent_role_ids), 'title', ASC);
         $key = 0;
         foreach ($sorted_ids as $id) {
             $par = $parent_role_ids[$id];
             if ($par["obj_id"] != SYSTEM_ROLE_ID) {
                 include_once './Services/AccessControl/classes/class.ilObjRole.php';
                 $option = new ilRadioOption(($par["type"] == 'role' ? $this->lng->txt('obj_role') : $this->lng->txt('obj_rolt')) . ": " . ilObjRole::_getTranslation($par["title"]), $par["obj_id"]);
                 $option->setInfo($par["desc"]);
                 $rights->addOption($option);
             }
             $key++;
         }
         $form->addItem($rights);
     }
     // Local policy only for containers
     if ($objDefinition->isContainer($this->getCurrentObject()->getType())) {
         $check = new ilCheckboxInputGui($this->lng->txt("rbac_role_rights_copy_change_existing"), 'existing');
         $check->setInfo($this->lng->txt('rbac_change_existing_objects_desc_new_role'));
         $form->addItem($check);
     }
     return $form;
 }
 /**
  * Edit learning resources settings.
  */
 public function editSettings()
 {
     global $ilCtrl, $lng, $ilSetting;
     $lm_set = new ilSetting("lm");
     $lic_set = new ilSetting("license");
     $lng->loadLanguageModule("license");
     $lng->loadLanguageModule("scormdebug");
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($ilCtrl->getFormAction($this));
     $form->setTitle($lng->txt("cont_lrs_settings"));
     // Page History
     $cb_prop = new ilCheckboxInputGUI($lng->txt("cont_enable_page_history"), "page_history");
     $cb_prop->setInfo($lng->txt("cont_enable_page_history_info"));
     $cb_prop->setChecked($lm_set->get("page_history", 1));
     $form->addItem($cb_prop);
     // Time scheduled page activation
     $cb_prop = new ilCheckboxInputGUI($lng->txt("cont_enable_time_scheduled_page_activation"), "time_scheduled_page_activation");
     $cb_prop->setInfo($lng->txt("cont_enable_time_scheduled_page_activation_info"));
     $cb_prop->setChecked($lm_set->get("time_scheduled_page_activation"));
     $form->addItem($cb_prop);
     // Activate replace media object function
     $cb_prop = new ilCheckboxInputGUI($lng->txt("cont_replace_mob_feature"), "replace_mob_feature");
     $cb_prop->setInfo($lng->txt("cont_replace_mob_feature_info"));
     $cb_prop->setChecked($lm_set->get("replace_mob_feature"));
     $form->addItem($cb_prop);
     // Activate HTML export IDs
     $cb_prop = new ilCheckboxInputGUI($lng->txt("cont_html_export_ids"), "html_export_ids");
     $cb_prop->setInfo($lng->txt("cont_html_export_ids_info"));
     $cb_prop->setChecked($lm_set->get("html_export_ids"));
     $form->addItem($cb_prop);
     // Upload dir for learning resources
     $tx_prop = new ilTextInputGUI($lng->txt("cont_upload_dir"), "cont_upload_dir");
     $tx_prop->setInfo($lng->txt("cont_upload_dir_info"));
     $tx_prop->setValue($lm_set->get("cont_upload_dir"));
     $form->addItem($tx_prop);
     // license activation
     $cb_prop = new ilCheckboxInputGUI($lng->txt("license_counter"), "license_counter");
     $cb_prop->setInfo($lng->txt("license_counter_info"));
     $cb_prop->setChecked($lic_set->get("license_counter"));
     $form->addItem($cb_prop);
     // license warning
     $tx_prop = new ilTextInputGUI($lng->txt("license_warning"), "license_warning");
     $tx_prop->setSize(5);
     $tx_prop->setInfo($lng->txt("license_warning_info"));
     $tx_prop->setValue($lic_set->get("license_warning"));
     $form->addItem($tx_prop);
     // scormDebugger activation
     $cb_prop = new ilCheckboxInputGUI($lng->txt("scormdebug_global_activate"), "scormdebug_global_activate");
     $cb_prop->setInfo($lng->txt("scormdebug_global_activate_info"));
     $cb_prop->setChecked($lm_set->get("scormdebug_global_activate"));
     $form->addItem($cb_prop);
     // scorm2004 login instead of userId for cmi.learner_id
     $cb_prop = new ilCheckboxInputGUI($lng->txt("scorm_login_as_learner_id"), "scorm_login_as_learner_id");
     $cb_prop->setInfo($lng->txt("scorm_login_as_learner_id_info"));
     $cb_prop->setChecked($lm_set->get("scorm_login_as_learner_id"));
     $form->addItem($cb_prop);
     // scorm2004 disableRTECaching
     $cb_prop = new ilCheckboxInputGUI($lng->txt("scormdebug_disable_cache"), "scormdebug_disable_cache");
     $cb_prop->setInfo($lng->txt("scormdebug_disable_cache_info"));
     $cb_prop->setChecked($lm_set->get("scormdebug_disable_cache"));
     $form->addItem($cb_prop);
     // scorm2004 without session
     $cb_prop = new ilCheckboxInputGUI($lng->txt("scorm_without_session"), "scorm_without_session");
     $cb_prop->setInfo($lng->txt("scorm_without_session_info"));
     $cb_prop->setChecked($lm_set->get("scorm_without_session"));
     $form->addItem($cb_prop);
     $privacy = ilPrivacySettings::_getInstance();
     $check = new ilCheckboxInputGui($lng->txt('enable_sahs_protocol_data'), 'enable_sahs_pd');
     $check->setInfo($this->lng->txt('enable_sahs_protocol_data_desc'));
     $check->setChecked($privacy->enabledSahsProtocolData());
     $form->addItem($check);
     // command buttons
     $form->addCommandButton("saveSettings", $lng->txt("save"));
     $form->addCommandButton("view", $lng->txt("cancel"));
     $this->tpl->setContent($form->getHTML());
 }
Ejemplo n.º 6
0
 protected function initSettingsForm()
 {
     global $rbacreview, $ilUser;
     $this->lng->loadLanguageModule('ps');
     include_once './Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
     include_once './Services/PrivacySecurity/classes/class.ilSecuritySettings.php';
     $privacy = ilPrivacySettings::_getInstance();
     $security = ilSecuritySettings::_getInstance();
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this, "saveSettings"));
     $form->setTitle($this->lng->txt('settings'));
     // protected admin
     $admin = new ilCheckboxInputGUI($GLOBALS['lng']->txt('adm_adm_role_protect'), 'admin_role');
     $admin->setDisabled(!$rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID));
     $admin->setInfo($this->lng->txt('adm_adm_role_protect_info'));
     $admin->setChecked((int) $security->isAdminRoleProtected());
     $admin->setValue(1);
     $form->addItem($admin);
     $check = new ilCheckboxInputGui($this->lng->txt('rbac_log'), 'rbac_log');
     $check->setInfo($this->lng->txt('rbac_log_info'));
     $check->setChecked($privacy->enabledRbacLog());
     $form->addItem($check);
     $age = new ilNumberInputGUI($this->lng->txt('rbac_log_age'), 'rbac_log_age');
     $age->setInfo($this->lng->txt('rbac_log_age_info'));
     $age->setValue($privacy->getRbacLogAge());
     $age->setMinValue(1);
     $age->setMaxValue(24);
     $age->setSize(2);
     $age->setMaxLength(2);
     $check->addSubItem($age);
     $form->addCommandButton('saveSettings', $this->lng->txt('save'));
     return $form;
 }