/** * Returns the path of the css-File. * * @param string $a_filename * * @return string */ protected static function getTemplatePath($a_filename) { $module_path = "Customizing/global/plugins/Services/Repository/RepositoryObject/RoomSharing/"; if (ilStyleDefinition::getCurrentSkin() != "default") { $fname = "./Customizing/global/skin/" . ilStyleDefinition::getCurrentSkin() . "/" . $module_path . basename($a_filename); } if ($fname == "" || !file_exists($fname)) { $fname = "./" . $module_path . "templates/default/" . basename($a_filename); } return $fname; }
protected static function getTemplatePath($a_filename) { $module_path = "Modules/Test/"; // use ilStyleDefinition instead of account to get the current skin include_once "Services/Style/classes/class.ilStyleDefinition.php"; if (ilStyleDefinition::getCurrentSkin() != "default") { $fname = "./Customizing/global/skin/" . ilStyleDefinition::getCurrentSkin() . "/" . $module_path . basename($a_filename); } if ($fname == "" || !file_exists($fname)) { $fname = "./" . $module_path . "templates/default/" . basename($a_filename); } return $fname; }
/** * Fill table row */ protected function fillRow($a_set) { global $lng, $ilClientIniFile, $ilCtrl; $cat_ass = ilStyleDefinition::getSystemStyleCategoryAssignments($a_set["template_id"], $a_set["style_id"]); if (is_array($a_set["substyle"])) { foreach ($a_set["substyle"] as $substyle) { reset($cat_ass); $cats = false; foreach ($cat_ass as $ca) { if ($ca["substyle"] == $substyle["id"]) { $this->tpl->setCurrentBlock("cat"); $this->tpl->setVariable("CAT", ilObject::_lookupTitle(ilObject::_lookupObjId($ca["ref_id"]))); $this->tpl->parseCurrentBlock(); $cats = true; } } if ($cats) { $this->tpl->touchBlock("cats"); } $this->tpl->setCurrentBlock("substyle"); $this->tpl->setVariable("SUB_STYLE", $substyle["name"]); $this->tpl->parseCurrentBlock(); } $this->tpl->touchBlock("substyles"); $ilCtrl->setParameter($this->parent_obj, "style_id", urlencode($a_set["id"])); $this->tpl->setCurrentBlock("cmd"); $this->tpl->setVariable("HREF_CMD", $ilCtrl->getLinkTarget($this->parent_obj, "assignStylesToCats")); $this->tpl->setVariable("TXT_CMD", $lng->txt("sty_assign_categories")); $this->tpl->parseCurrentBlock(); } $this->tpl->setVariable("TITLE", $a_set["title"]); $this->tpl->setVariable("ID", $a_set["id"]); // number of users $this->tpl->setVariable("USERS", $a_set["users"]); // activation if (ilObjStyleSettings::_lookupActivatedStyle($a_set["template_id"], $a_set["style_id"])) { $this->tpl->setVariable("CHECKED", ' checked="checked" '); } if ($ilClientIniFile->readVariable("layout", "skin") == $a_set["template_id"] && $ilClientIniFile->readVariable("layout", "style") == $a_set["style_id"]) { $this->tpl->setVariable("CHECKED_DEFAULT", ' checked="checked" '); } }
/** * create client tag * * @param ilSetting $setting */ private function __buildClient($setting) { $auth_modes = ilAuthUtils::_getActiveAuthModes(); $auth_mode_default = strtoupper(ilAuthUtils::_getAuthModeName(array_shift($auth_modes))); $auth_mode_names = array(); foreach ($auth_modes as $mode) { $auth_mode_names[] = strtoupper(ilAuthUtils::_getAuthModeName($mode)); } // determine skins/styles $skin_styles = array(); include_once "./Services/Style/classes/class.ilStyleDefinition.php"; $styleDefinition = new ilStyleDefinition(); include_once "./Services/Style/classes/class.ilObjStyleSettings.php"; $templates = $styleDefinition->getAllTemplates(); if (is_array($templates)) { 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; } $skin_styles[] = $template["id"] . ":" . $style["id"]; } } } // timezones include_once 'Services/Calendar/classes/class.ilTimeZone.php'; $this->xmlStartTag("Client", array("inst_id" => $setting->get("inst_id"), "id" => $setting->clientid, "enabled" => $setting->access == 1 ? "TRUE" : "FALSE", "default_lang" => $setting->language)); $this->xmlEndTag("Client"); return; // END here due to security reasons. $this->xmlElement("Name", null, $setting->get("inst_name")); $this->xmlElement("Description", null, $setting->description); $this->xmlElement("Institution", null, $setting->get("inst_institution")); $this->xmlStartTag("Responsible"); $this->xmlElement("Firstname", null, $setting->get("admin_firstname")); $this->xmlElement("Lastname", null, $setting->get("admin_lastname")); $this->xmlElement("Title", null, $setting->get("admin_title")); $this->xmlElement("Institution", null, $setting->get("admin_institution")); $this->xmlElement("Position", null, $setting->get("admin_position")); $this->xmlElement("Email", null, $setting->get("admin_email")); $this->xmlElement("Street ", null, $setting->get("admin_street")); $this->xmlElement("ZipCode ", null, $setting->get("admin_zipcode")); $this->xmlElement("City", null, $setting->get("admin_city")); $this->xmlElement("Country", null, $setting->get("admin_country")); $this->xmlElement("Phone", null, $setting->get("admin_phone")); $this->xmlEndTag("Responsible"); $this->xmlStartTag("Settings"); $this->xmlElement("Setting", array("key" => "error_recipient"), $setting->get("error_recipient")); $this->xmlElement("Setting", array("key" => "feedback_recipient"), $setting->get("feedback_recipient")); $this->xmlElement("Setting", array("key" => "session_expiration"), $setting->session); $this->xmlElement("Setting", array("key" => "soap_enabled"), $setting->get("soap_user_administration")); $this->xmlElement("Setting", array("key" => "authentication_methods"), join(",", $auth_mode_names)); $this->xmlElement("Setting", array("key" => "authentication_default_method"), $auth_mode_default); $this->xmlElement("Setting", array("key" => "skins"), join(",", $skin_styles)); $this->xmlElement("Setting", array("key" => "default_skin"), $setting->default_skin_style); $this->xmlElement("Setting", array("key" => "default_timezone"), ilTimeZone::_getDefaultTimeZone()); $this->xmlElement("Setting", array("key" => "default_hits_per_page"), $setting->default_hits_per_page); $this->xmlElement("Setting", array("key" => "default_show_users_online"), $setting->default_show_users_online); $this->xmlEndTag("Settings"); if ($this->exportAdvMDDefs) { // create advanced meta data record xml include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php'; include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordXMLWriter.php'; $record_ids = array(); $record_types = ilAdvancedMDRecord::_getAssignableObjectTypes(); foreach ($record_types as $type) { $records = ilAdvancedMDRecord::_getActivatedRecordsByObjectType($type); foreach ($records as $record) { $record_ids[] = $record->getRecordId(); } } $record_ids = array_unique($record_ids); $this->xmlStartTag('AdvancedMetaDataRecords'); if (count($record_ids) > 0) { foreach ($record_ids as $record_id) { $record_obj = ilAdvancedMDRecord::_getInstanceByrecordId($record_id); $record_obj->toXML($this); } } $this->xmlEndTag('AdvancedMetaDataRecords'); } if ($this->exportUDFDefs) { // create user defined fields record xml include_once "./Services/User/classes/class.ilUserDefinedFields.php"; $udf_data =& ilUserDefinedFields::_newInstance(); $udf_data->addToXML($this); } $this->xmlEndTag("Client"); }
/** * Delete system style to category assignments */ function deleteSysStyleCatAssignmentsObject() { global $ilCtrl, $lng, $rbacsystem; if (!$rbacsystem->checkAccess("write", $this->object->getRefId())) { return; } $ilCtrl->setParameter($this, "style_id", urlencode($_GET["style_id"])); $style_arr = explode(":", $_GET["style_id"]); if (is_array($_POST["id"])) { foreach ($_POST["id"] as $id) { $id_arr = explode(":", $id); ilStyleDefinition::deleteSystemStyleCategoryAssignment($style_arr[0], $style_arr[1], $id_arr[0], $id_arr[1]); } ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true); } $ilCtrl->redirect($this, "assignStylesToCats"); }
/** * Constructor * * @param string $a_xml_file xml file * @param int $a_mode IL_EXTRACT_ROLES | IL_USER_IMPORT | IL_VERIFY * @param int $a_conflict_rue IL_FAIL_ON_CONFLICT | IL_UPDATE_ON_CONFLICT | IL_IGNORE_ON_CONFLICT * * @access public */ function ilUserImportParser($a_xml_file = '', $a_mode = IL_USER_IMPORT, $a_conflict_rule = IL_FAIL_ON_CONFLICT) { global $lng, $tree, $ilias, $ilUser, $styleDefinition; $this->roles = array(); $this->mode = $a_mode; $this->conflict_rule = $a_conflict_rule; $this->error_level = IL_IMPORT_SUCCESS; $this->protocol = array(); $this->logins = array(); $this->userCount = 0; $this->localRoleCache = array(); $this->parentRolesCache = array(); $this->ilincdata = array(); $this->send_mail = false; $this->mapping_mode = IL_USER_MAPPING_LOGIN; // get all active style instead of only assigned ones -> cannot transfer all to another otherwise $this->userStyles = array(); include_once "./Services/Style/classes/class.ilObjStyleSettings.php"; include_once './Services/Style/classes/class.ilStyleDefinition.php'; $templates = ilStyleDefinition::_getAllTemplates(); if (is_array($templates)) { 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; } $this->userStyles[] = $template["id"] . ":" . $style["id"]; } } } $settings = $ilias->getAllSettings(); if ($settings["usr_settings_hide_skin_style"] == 1) { $this->hideSkin = TRUE; } else { $this->hideSkin = FALSE; } if ($settings["usr_settings_disable_skin_style"] == 1) { $this->disableSkin = TRUE; } else { $this->disableSkin = FALSE; } include_once "Services/Mail/classes/class.ilAccountMail.php"; $this->acc_mail = new ilAccountMail(); $this->acc_mail->useLangVariablesAsFallback(true); parent::ilSaxParser($a_xml_file); }
/** * builds a full template path with template and module name * * @param string $a_tplname template name * @param boolean $in_module should be set to true, if template file is in module subdirectory * * @return string full template path */ function getTemplatePath($a_tplname, $a_in_module = false, $a_plugin = false) { global $ilias, $ilCtrl; $fname = ""; // if baseClass functionality is used (ilias.php): // get template directory from ilCtrl if (!empty($_GET["baseClass"]) && $a_in_module === true) { $a_in_module = $ilCtrl->getModuleDir(); } if (strpos($a_tplname, "/") === false) { $module_path = ""; //$fname = $ilias->tplPath; if ($a_in_module) { if ($a_in_module === true) { $module_path = ILIAS_MODULE . "/"; } else { $module_path = $a_in_module . "/"; } } // use ilStyleDefinition instead of account to get the current skin include_once "Services/Style/classes/class.ilStyleDefinition.php"; if (ilStyleDefinition::getCurrentSkin() != "default") { $fname = "./Customizing/global/skin/" . ilStyleDefinition::getCurrentSkin() . "/" . $module_path . basename($a_tplname); } if ($fname == "" || !file_exists($fname)) { $fname = "./" . $module_path . "templates/default/" . basename($a_tplname); } } else { $fname = $a_tplname; } return $fname; }
/** * get full style sheet file name (path inclusive) of current user * * @access public * @static * */ public static function getNewContentStyleSheetLocation($mode = "output") { global $ilias; // add version as parameter to force reload for new releases if ($mode != "filesystem") { $vers = str_replace(" ", "-", $ilias->getSetting("ilias_version")); $vers = "?vers=" . str_replace(".", "-", $vers); } // use ilStyleDefinition instead of account to get the current skin and style require_once "./Services/Style/classes/class.ilStyleDefinition.php"; if (ilStyleDefinition::getCurrentSkin() == "default") { $in_style = "./templates/" . ilStyleDefinition::getCurrentSkin() . "/" . ilStyleDefinition::getCurrentStyle() . "_cont.css"; } else { $in_style = "./Customizing/global/skin/" . ilStyleDefinition::getCurrentSkin() . "/" . ilStyleDefinition::getCurrentStyle() . "_cont.css"; } if (is_file("./" . $in_style)) { return $in_style . $vers; } else { return "templates/default/delos_cont.css" . $vers; } }
/** * 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)); }
/** * Get all skins/styles * * @param * @return */ public static function getAllSkinStyles() { global $styleDefinition; $all_styles = array(); $templates = $styleDefinition->getAllTemplates(); foreach ($templates as $template) { // get styles definition for template $styleDef = new ilStyleDefinition($template["id"]); $styleDef->startParsing(); $styles = $styleDef->getStyles(); foreach ($styles as $style) { $num_users = ilObjUser::_getNumberOfUsersForStyle($template["id"], $style["id"]); // default selection list $all_styles[$template["id"] . ":" . $style["id"]] = array("title" => $styleDef->getTemplateName() . " / " . $style["name"], "id" => $template["id"] . ":" . $style["id"], "template_id" => $template["id"], "style_id" => $style["id"], "template_name" => $styleDef->getTemplateName(), "substyle" => $style["substyle"], "style_name" => $style["name"], "users" => $num_users); } } return $all_styles; }
/** * loads a record "user" from database * @access private */ function read() { global $ilErr, $ilDB; // Alex: I have removed the JOIN to rbac_ua, since there seems to be no // use (3.11.0 alpha) /*$q = "SELECT * FROM usr_data ". "LEFT JOIN rbac_ua ON usr_data.usr_id=rbac_ua.usr_id ". "WHERE usr_data.usr_id= ".$ilDB->quote($this->id); */ $r = $ilDB->queryF("SELECT * FROM usr_data " . "WHERE usr_id= %s", array("integer"), array($this->id)); if ($data = $ilDB->fetchAssoc($r)) { // convert password storage layout used by table usr_data into // storage layout used by class ilObjUser if ($data["passwd"] == "" && $data["i2passwd"] != "") { $data["passwd_type"] = IL_PASSWD_CRYPT; $data["passwd"] = $data["i2passwd"]; } else { $data["passwd_type"] = IL_PASSWD_MD5; //$data["passwd"] = $data["passwd"]; (implicit) } unset($data["i2passw"]); // this assign must not be set via $this->assignData($data) // because this method will be called on profile updates and // would set this values to 0, because they arent posted from form $this->setLastPasswordChangeTS($data['last_password_change']); $this->setLoginAttempts($data['login_attempts']); // fill member vars in one shot $this->assignData($data); //get userpreferences from usr_pref table $this->readPrefs(); //set language to default if not set if ($this->prefs["language"] == "") { $this->prefs["language"] = $this->oldPrefs["language"]; } //check skin-setting include_once "./Services/Style/classes/class.ilStyleDefinition.php"; if ($this->prefs["skin"] == "" || !ilStyleDefinition::skinExists($this->prefs["skin"])) { $this->prefs["skin"] = $this->oldPrefs["skin"]; } $this->skin = $this->prefs["skin"]; //check style-setting (skins could have more than one stylesheet if ($this->prefs["style"] == "" || !ilStyleDefinition::skinExists($this->skin, $this->prefs["style"])) { //load default (css) $this->prefs["style"] = $this->ilias->ini->readVariable("layout", "style"); } if (empty($this->prefs["hits_per_page"])) { $this->prefs["hits_per_page"] = 10; } } else { $ilErr->raiseError("<b>Error: There is no dataset with id " . $this->id . "!</b><br />class: " . get_class($this) . "<br />Script: " . __FILE__ . "<br />Line: " . __LINE__, $ilErr->FATAL); } $this->readUserDefinedFields(); parent::read(); }
protected function initForm() { $this->setTitle($this->pl->txt('form_title')); $te = new ilTextInputGUI($this->txt(self::F_TITLE), self::F_TITLE); $te->setRequired(true); $this->addItem($te); $this->setTitle($this->pl->txt('form_title')); $te = new ilTextAreaInputGUI($this->txt(self::F_DESCRIPTION), self::F_DESCRIPTION); $this->addItem($te); $cb = new ilCheckboxInputGUI($this->txt(self::F_STATUS), self::F_STATUS); // $this->addItem($cb); $se = new ilSelectInputGUI($this->txt(self::F_GLOBAL_ROLE), self::F_GLOBAL_ROLE); $se->setRequired(true); $global_roles = self::getRoles(ilRbacReview::FILTER_ALL_GLOBAL); $se->setOptions($global_roles); $this->addItem($se); $ilCourseMultiSelectInputGUI = new ilContainerMultiSelectInputGUI('crs', $this->txt(self::F_ASSIGNED_COURSES), self::F_ASSIGNED_COURSES); $ilCourseMultiSelectInputGUI->setAjaxLink($this->ctrl->getLinkTarget($this->parent_gui, ilUserSettingsGUI::CMD_SEARCH_COURSES)); $this->addItem($ilCourseMultiSelectInputGUI); $ilCourseMultiSelectInputGUI = new ilContainerMultiSelectInputGUI('grp', $this->txt(self::F_ASSIGNED_GROUPS), self::F_ASSIGNED_GROUPS); $ilCourseMultiSelectInputGUI->setAjaxLink($this->ctrl->getLinkTarget($this->parent_gui, ilUserSettingsGUI::CMD_SEARCH_COURSES)); $this->addItem($ilCourseMultiSelectInputGUI); $se = new ilSelectInputGUI($this->txt(self::F_PORTFOLIO_TEMPLATE_ID), self::F_PORTFOLIO_TEMPLATE_ID); $options = ilObjPortfolioTemplate::getAvailablePortfolioTemplates(); // $options[0] = $this->pl->txt('crs_no_template'); $options[1] = '--'; asort($options); $se->setOptions($options); $this->addItem($se); $te = new ilTextInputGUI($this->txt(self::F_PORTFOLIO_NAME), self::F_PORTFOLIO_NAME); $te->setInfo(ilUserSetting::getAvailablePlaceholdersAsString()); // $te->setRequired(true); $this->addItem($te); $se = new ilSelectInputGUI($this->txt(self::F_SKIN), self::F_SKIN); $options = []; foreach (ilStyleDefinition::getAllSkinStyles() as $skin) { $options[$skin["id"]] = $skin["title"]; } asort($options); $se->setOptions($options); $this->addItem($se); // $te = new ilTextInputGUI($this->txt(self::F_SKIN), self::F_SKIN); // $this->addItem($te); $te = new ilTextInputGUI($this->txt(self::F_BLOG_NAME), self::F_BLOG_NAME); $this->addItem($te); $ilCourseMultiSelectInputGUI = new ilContainerMultiSelectInputGUI('grp', $this->txt(self::F_PORTFOLIO_ASSIGNED_TO_GROUPS), self::F_PORTFOLIO_ASSIGNED_TO_GROUPS); $ilCourseMultiSelectInputGUI->setAjaxLink($this->ctrl->getLinkTarget($this->parent_gui, ilUserSettingsGUI::CMD_SEARCH_COURSES)); $this->addItem($ilCourseMultiSelectInputGUI); $ilOrgUnitMultiSelectInputGUI = new ilContainerMultiSelectInputGUI('orgu', $this->txt(self::F_ASSIGNED_ORGUS), self::F_ASSIGNED_ORGUS); $ilOrgUnitMultiSelectInputGUI->setAjaxLink($this->ctrl->getLinkTarget($this->parent_gui, ilUserSettingsGUI::CMD_SEARCH_COURSES)); $this->addItem($ilOrgUnitMultiSelectInputGUI); include_once "Services/User/classes/class.ilUserUtil.php"; $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)); } $this->addItem($si); // starting point: repository object $repobj = new ilRadioOption($this->lng->txt("adm_user_starting_point_object"), ilUserUtil::START_REPOSITORY_OBJ); $repobj_id = new ilTextInputGUI($this->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($this->lng->txt("obj_" . ilObject::_lookupType($start_obj_id)) . ": " . ilObject::_lookupTitle($start_obj_id)); } } } $repobj->addSubItem($repobj_id); $si->addOption($repobj); if ($this->pl->is51()) { $ilStudyProgramMultiSelectInputGUI = new ilContainerMultiSelectInputGUI('prg', $this->txt(self::F_ASSIGNED_STUDYPROGRAMS), self::F_ASSIGNED_STUDYPROGRAMS); $ilStudyProgramMultiSelectInputGUI->setAjaxLink($this->ctrl->getLinkTarget($this->parent_gui, ilUserSettingsGUI::CMD_SEARCH_COURSES)); $this->addItem($ilStudyProgramMultiSelectInputGUI); } $this->addCommandButtons(); }
/** * Get style assignments * * @param * @return */ function getStyleCatAssignments() { $this->setData(ilStyleDefinition::getSystemStyleCategoryAssignments($this->skin_id, $this->style_id)); }