function initForm($a_mode)
 {
     global $ilCtrl, $lng, $ilSetting;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form_gui = new ilPropertyFormGUI();
     $form_gui->setFormAction($ilCtrl->getFormAction($this));
     $form_gui->setTitle($lng->txt("cont_ed_pglprop"));
     // title
     $title_input = new ilTextInputGUI($lng->txt("title"), "pgl_title");
     $title_input->setSize(50);
     $title_input->setMaxLength(128);
     $title_input->setValue($this->layout_object->title);
     $title_input->setTitle($lng->txt("title"));
     $title_input->setRequired(true);
     // description
     $desc_input = new ilTextAreaInputGUI($lng->txt("description"), "pgl_desc");
     $desc_input->setValue($this->layout_object->description);
     $desc_input->setRows(3);
     $desc_input->setCols(37);
     $desc_input->setTitle($lng->txt("description"));
     $desc_input->setRequired(false);
     // modules
     $mods = new ilCheckboxGroupInputGUI($this->lng->txt("modules"), "module");
     // $mods->setRequired(true);
     $mods->setValue($this->layout_object->getModules());
     foreach (ilPageLayout::getAvailableModules() as $mod_id => $mod_caption) {
         $mod = new ilCheckboxOption($mod_caption, $mod_id);
         $mods->addOption($mod);
     }
     $form_gui->addItem($title_input);
     $form_gui->addItem($desc_input);
     $form_gui->addItem($mods);
     // style
     $fixed_style = $ilSetting->get("fixed_content_style_id");
     $style_id = $this->layout_object->getStyleId();
     if ($fixed_style > 0) {
         $st = new ilNonEditableValueGUI($lng->txt("cont_current_style"));
         $st->setValue(ilObject::_lookupTitle($fixed_style) . " (" . $this->lng->txt("global_fixed") . ")");
         $form_gui->addItem($st);
     } else {
         include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
         $st_styles = ilObjStyleSheet::_getStandardStyles(true, false);
         $st_styles[0] = $this->lng->txt("default");
         ksort($st_styles);
         $style_sel = new ilSelectInputGUI($lng->txt("obj_sty"), "style_id");
         $style_sel->setOptions($st_styles);
         $style_sel->setValue($style_id);
         $form_gui->addItem($style_sel);
     }
     $form_gui->addCommandButton("updateProperties", $lng->txt($a_mode));
     return $form_gui;
 }
 function initAddPageLayoutForm()
 {
     global $lng, $ilCtrl;
     $lng->loadLanguageModule("content");
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form_gui = new ilPropertyFormGUI();
     $form_gui->setFormAction($ilCtrl->getFormAction($this));
     $form_gui->setTitle($lng->txt("sty_create_pgl"));
     include_once "Services/Form/classes/class.ilRadioMatrixInputGUI.php";
     $title_input = new ilTextInputGUI($lng->txt("title"), "pgl_title");
     $title_input->setSize(50);
     $title_input->setMaxLength(128);
     $title_input->setValue($this->layout_object->title);
     $title_input->setTitle($lng->txt("title"));
     $title_input->setRequired(true);
     $desc_input = new ilTextAreaInputGUI($lng->txt("description"), "pgl_desc");
     $desc_input->setValue($this->layout_object->description);
     $desc_input->setRows(3);
     $desc_input->setCols(37);
     // special page?
     $options = array("0" => $lng->txt("cont_layout_template"), "1" => $lng->txt("cont_special_page"));
     $si = new ilSelectInputGUI($this->lng->txt("type"), "special_page");
     $si->setOptions($options);
     // modules
     $mods = new ilCheckboxGroupInputGUI($this->lng->txt("modules"), "module");
     // $mods->setRequired(true);
     foreach (ilPageLayout::getAvailableModules() as $mod_id => $mod_caption) {
         $mod = new ilCheckboxOption($mod_caption, $mod_id);
         $mods->addOption($mod);
     }
     $ttype_input = new ilSelectInputGUI($lng->txt("sty_based_on"), "pgl_template");
     $arr_templates = ilPageLayout::getLayouts();
     $arr_templates1 = ilPageLayout::getLayouts(false, true);
     foreach ($arr_templates1 as $v) {
         $arr_templates[] = $v;
     }
     $options = array();
     $options['-1'] = $lng->txt("none");
     foreach ($arr_templates as $templ) {
         $templ->readObject();
         $key = $templ->getId();
         $value = $templ->getTitle();
         $options[$key] = $value;
     }
     $ttype_input->setOptions($options);
     $ttype_input->setValue(-1);
     $ttype_input->setRequired(true);
     $desc_input->setTitle($lng->txt("description"));
     $desc_input->setRequired(false);
     $form_gui->addItem($title_input);
     $form_gui->addItem($desc_input);
     $form_gui->addItem($si);
     $form_gui->addItem($mods);
     $form_gui->addItem($ttype_input);
     $form_gui->addCommandButton("createPg", $lng->txt("save"));
     $form_gui->addCommandButton("cancelCreate", $lng->txt("cancel"));
     return $form_gui;
 }
 public function settings()
 {
     global $rbacreview;
     $this->tabs_gui->setSubTabActive('shib_settings');
     // set already saved data or default value for port
     $settings = $this->ilias->getAllSettings();
     // Compose role list
     $role_list = $rbacreview->getRolesByFilter(2);
     $role = array();
     if (!isset($settings["shib_user_default_role"])) {
         $settings["shib_user_default_role"] = 4;
     }
     if (!isset($settings["shib_idp_list"]) || $settings["shib_idp_list"] == '') {
         $settings["shib_idp_list"] = "urn:mace:organization1:providerID, Example Organization 1\nurn:mace:organization2:providerID, Example Organization 2, /Shibboleth.sso/WAYF/SWITCHaai";
     }
     if (!isset($settings["shib_login_button"]) || $settings["shib_login_button"] == '') {
         $settings["shib_login_button"] = "templates/default/images/shib_login_button.png";
     }
     if (!isset($settings["shib_hos_type"]) || $settings["shib_hos_type"] == '') {
         $settings["shib_hos_type"] = 'internal_wayf';
     }
     foreach ($role_list as $data) {
         $role[$data["obj_id"]] = $data["title"];
     }
     // Set text field content
     $shib_settings = array('shib_login', 'shib_title', 'shib_firstname', 'shib_lastname', 'shib_email', 'shib_gender', 'shib_institution', 'shib_department', 'shib_zipcode', 'shib_city', 'shib_country', 'shib_street', 'shib_phone_office', 'shib_phone_home', 'shib_phone_mobile', 'shib_language', 'shib_matriculation');
     //set PropertyFormGUI
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $propertys = new ilPropertyFormGUI();
     $propertys->setTitle($this->lng->txt("shib"));
     $propertys->setFormAction($this->ctrl->getFormAction($this, "save"));
     $propertys->addCommandButton("save", $this->lng->txt("save"));
     $propertys->addCommandButton("settings", $this->lng->txt("cancel"));
     //set enable shibboleth support
     $enable = new ilCheckboxInputGUI();
     $enable->setTitle($this->lng->txt("shib_active"));
     $read_me_link = "./Services/AuthShibboleth/README.SHIBBOLETH.txt";
     $info = "<a href='" . $read_me_link . "' target='_blank'>" . $this->lng->txt("auth_shib_instructions") . "</a>";
     $enable->setInfo($info);
     $enable->setPostVar("shib[active]");
     $enable->setChecked($settings["shib_active"]);
     //set allow local authentication
     $local = new ilCheckboxInputGUI();
     $local->setTitle($this->lng->txt("auth_allow_local"));
     $local->setPostVar("shib[auth_allow_local]");
     $local->setChecked($settings['shib_auth_allow_local']);
     //set user default role
     $defaultrole = new ilSelectInputGUI();
     $defaultrole->setTitle($this->lng->txt("shib_user_default_role"));
     $defaultrole->setPostVar("shib[user_default_role]");
     $defaultrole->setOptions($role);
     $defaultrole->setRequired(true);
     $defaultrole->setValue($settings["shib_user_default_role"]);
     //set name of federation
     $name = new ilTextInputGUI();
     $name->setTitle($this->lng->txt("shib_federation_name"));
     $name->setPostVar("shib[federation_name]");
     $name->setSize(40);
     $name->setMaxLength(50);
     $name->setRequired(true);
     $name->setValue(stripslashes($settings["shib_federation_name"]));
     //set Organize selection group
     include_once "./Services/Form/classes/class.ilRadioGroupInputGUI.php";
     include_once "./Services/Form/classes/class.ilRadioOption.php";
     $organize = new ilRadioGroupInputGUI();
     $organize->setTitle($this->lng->txt("shib_login_type"));
     $organize->setPostVar("shib[hos_type]");
     $organize->setRequired(true);
     $organize->setValue($settings["shib_hos_type"]);
     //set 1. option internalwayf
     $internalwayf = new ilRadioOption();
     $internalwayf->setTitle($this->lng->txt("shib_login_internal_wayf"));
     $internalwayf->setValue("internal_wayf");
     //set 1. option internalwayf textbox idplist
     $idplist = new ilTextAreaInputGUI();
     $idplist->setInfo($this->lng->txt("shib_idp_list"));
     $idplist->setPostVar("shib[idp_list]");
     $idplist->setRows(3);
     $idplist->setCols(50);
     $idplist->setValue($settings["shib_idp_list"]);
     //set 2. Option externalwayf
     $externalwayf = new ilRadioOption();
     $externalwayf->setTitle($this->lng->txt("shib_login_external_wayf"));
     $externalwayf->setValue("external_wayf");
     //set 2. Option externalwayf textfield path to login button image
     $loginbutton = new ilTextInputGUI();
     $loginbutton->setInfo($this->lng->txt("shib_login_button"));
     $loginbutton->setPostVar("shib[login_button]");
     $loginbutton->setSize(50);
     $loginbutton->setMaxLength(255);
     $loginbutton->setValue($settings["shib_login_button"]);
     //set 3. Option embeddedwayf
     $embeddedwayf = new ilRadioOption();
     $embeddedwayf->setTitle($this->lng->txt("shib_login_embedded_wayf"));
     $embeddedwayf->setInfo($this->lng->txt("shib_login_embedded_wayf_description"));
     $embeddedwayf->setValue("embedded_wayf");
     //set login instructions
     $logininstruction = new ilTextAreaInputGUI();
     $logininstruction->setTitle($this->lng->txt("auth_login_instructions"));
     $logininstruction->setPostVar("shib[login_instructions]");
     $logininstruction->setRows(3);
     $logininstruction->setCols(50);
     $logininstruction->setValue(stripslashes($settings["shib_login_instructions"]));
     //set path to data manipulation API
     $dataconv = new ilTextInputGUI();
     $dataconv->setTitle($this->lng->txt("shib_data_conv"));
     $dataconv->setPostVar("shib[data_conv]");
     $dataconv->setSize(80);
     $dataconv->setMaxLength(512);
     $dataconv->setValue($settings["shib_data_conv"]);
     //field mappings
     $fields = array();
     foreach ($shib_settings as $setting) {
         $field = ereg_replace('shib_', '', $setting);
         $textinput = new ilTextInputGUI();
         $textinput->setTitle($this->lng->txt($setting));
         $textinput->setPostVar("shib[" . $field . "]");
         $textinput->setValue($settings[$setting]);
         $textinput->setSize(40);
         $textinput->setMaxLength(50);
         $checkinput = new ilCheckboxInputGUI("");
         $checkinput->setOptionTitle($this->lng->txt("shib_update"));
         $checkinput->setPostVar("shib[update_" . $field . "]");
         $checkinput->setChecked($settings["shib_update_" . $field]);
         if ($setting == 'shib_login' || $setting == 'shib_title' || $setting == 'shib_firstname' || $setting == 'shib_lastname' || $setting == 'shib_email') {
             $textinput->setRequired(true);
         }
         $fields[$setting] = array("text" => $textinput, "check" => $checkinput);
     }
     $propertys->addItem($enable);
     $propertys->addItem($local);
     $propertys->addItem($defaultrole);
     $propertys->addItem($name);
     $internalwayf->addSubItem($idplist);
     $organize->addOption($internalwayf);
     $externalwayf->addSubItem($loginbutton);
     $organize->addOption($externalwayf);
     $organize->addOption($embeddedwayf);
     $propertys->addItem($organize);
     $propertys->addItem($logininstruction);
     $propertys->addItem($dataconv);
     foreach ($shib_settings as $setting) {
         $propertys->addItem($fields[$setting]["text"]);
         if ($setting != "shib_login") {
             $propertys->addItem($fields[$setting]["check"]);
         }
     }
     $this->tpl->setContent($propertys->getHTML());
 }