本文整理汇总了PHP中ilUserUtil::hasPersonalStartingPoint方法的典型用法代码示例。如果您正苦于以下问题:PHP ilUserUtil::hasPersonalStartingPoint方法的具体用法?PHP ilUserUtil::hasPersonalStartingPoint怎么用?PHP ilUserUtil::hasPersonalStartingPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilUserUtil
的用法示例。
在下文中一共展示了ilUserUtil::hasPersonalStartingPoint方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: saveGeneralSettings
/**
* Save general settings
*/
public function saveGeneralSettings()
{
global $tpl, $lng, $ilCtrl, $ilUser;
$this->initGeneralSettingsForm();
if ($this->form->checkInput()) {
if ($this->workWithUserSetting("skin_style")) {
//set user skin and style
if ($_POST["skin_style"] != "") {
$sknst = explode(":", $_POST["skin_style"]);
if ($ilUser->getPref("style") != $sknst[1] || $ilUser->getPref("skin") != $sknst[0]) {
$ilUser->setPref("skin", $sknst[0]);
$ilUser->setPref("style", $sknst[1]);
}
}
}
// language
if ($this->workWithUserSetting("language")) {
$ilUser->setLanguage($_POST["language"]);
}
// hits per page
if ($this->workWithUserSetting("hits_per_page")) {
if ($_POST["hits_per_page"] != "") {
$ilUser->setPref("hits_per_page", $_POST["hits_per_page"]);
}
}
// set show users online
if ($this->workWithUserSetting("show_users_online")) {
$ilUser->setPref("show_users_online", $_POST["show_users_online"]);
}
// store last visited?
global $ilNavigationHistory;
$ilUser->setPref("store_last_visited", (int) $_POST["store_last_visited"]);
if ((int) $_POST["store_last_visited"] > 0) {
$ilNavigationHistory->deleteDBEntries();
if ((int) $_POST["store_last_visited"] == 2) {
$ilNavigationHistory->deleteSessionEntries();
}
}
// set hide own online_status
if ($this->workWithUserSetting("hide_own_online_status")) {
if ($_POST["hide_own_online_status"] == 1) {
$ilUser->setPref("hide_own_online_status", "y");
} else {
$ilUser->setPref("hide_own_online_status", "n");
}
}
// set show users online
if ($this->workWithUserSetting("screen_reader_optimization")) {
$ilUser->setPref("screen_reader_optimization", $_POST["screen_reader_optimization"]);
}
// session reminder
include_once 'Services/Authentication/classes/class.ilSessionReminder.php';
if (ilSessionReminder::isGloballyActivated()) {
$ilUser->setPref('session_reminder_enabled', (int) $this->form->getInput('session_reminder_enabled'));
$ilUser->setPref('session_reminder_lead_time', $this->form->getInput('session_reminder_lead_time'));
}
// starting point
include_once "Services/User/classes/class.ilUserUtil.php";
if (ilUserUtil::hasPersonalStartingPoint()) {
ilUserUtil::setPersonalStartingPoint($this->form->getInput('usr_start'), $this->form->getInput('usr_start_ref_id'));
}
// 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->getFormValues($this->form);
$ilUser->setPref('char_selector_availability', $char_selector->getConfig()->getAvailability());
$ilUser->setPref('char_selector_definition', $char_selector->getConfig()->getDefinition());
}
$ilUser->update();
// calendar settings
include_once 'Services/Calendar/classes/class.ilCalendarUserSettings.php';
$user_settings = ilCalendarUserSettings::_getInstanceByUserId($ilUser->getId());
$user_settings->setTimeZone($this->form->getInput("timezone"));
$user_settings->setDateFormat((int) $this->form->getInput("date_format"));
$user_settings->setTimeFormat((int) $this->form->getInput("time_format"));
$user_settings->save();
ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
$ilCtrl->redirect($this, "showGeneralSettings");
}
$this->form->setValuesByPost();
$this->showGeneralSettings(true);
}
示例2: initBasicSettingsForm
/**
* Init basic settings form.
*/
public function initBasicSettingsForm()
{
/**
* @var $lng ilLanguage
* @var $ilSetting ilSetting
*/
global $lng, $ilSetting;
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$this->form = new ilPropertyFormGUI();
$lng->loadLanguageModule("pd");
// installation short title
$ti = new ilTextInputGUI($this->lng->txt("short_inst_name"), "short_inst_name");
$ti->setMaxLength(200);
$ti->setSize(40);
$ti->setValue($ilSetting->get("short_inst_name"));
$ti->setInfo($this->lng->txt("short_inst_name_info"));
$this->form->addItem($ti);
// public section
$cb = new ilCheckboxInputGUI($this->lng->txt("pub_section"), "pub_section");
$cb->setInfo($lng->txt("pub_section_info"));
if ($ilSetting->get("pub_section")) {
$cb->setChecked(true);
}
$this->form->addItem($cb);
// Enable Global Profiles
$cb_prop = new ilCheckboxInputGUI($lng->txt('pd_enable_user_publish'), 'enable_global_profiles');
$cb_prop->setInfo($lng->txt('pd_enable_user_publish_info'));
$cb_prop->setChecked($ilSetting->get('enable_global_profiles'));
$cb->addSubItem($cb_prop);
// search engine
include_once 'Services/PrivacySecurity/classes/class.ilRobotSettings.php';
$robot_settings = ilRobotSettings::_getInstance();
$cb2 = new ilCheckboxInputGUI($this->lng->txt("search_engine"), "open_google");
$cb2->setInfo($this->lng->txt("enable_search_engine"));
$this->form->addItem($cb2);
if (!$robot_settings->checkRewrite()) {
$cb2->setAlert($lng->txt("allow_override_alert"));
$cb2->setChecked(false);
$cb2->setDisabled(true);
} else {
if ($ilSetting->get("open_google")) {
$cb2->setChecked(true);
}
}
// locale
$ti = new ilTextInputGUI($this->lng->txt("adm_locale"), "locale");
$ti->setMaxLength(80);
$ti->setSize(40);
$ti->setInfo($this->lng->txt("adm_locale_info"));
$ti->setValue($ilSetting->get("locale"));
$this->form->addItem($ti);
// starting point
include_once "Services/User/classes/class.ilUserUtil.php";
$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"));
$valid = array_keys(ilUserUtil::getPossibleStartingPoints());
foreach (ilUserUtil::getPossibleStartingPoints(true) as $value => $caption) {
$opt = new ilRadioOption($caption, $value);
$si->addOption($opt);
if (!in_array($value, $valid)) {
$opt->setInfo($this->lng->txt("adm_user_starting_point_invalid_info"));
}
}
$si->setValue(ilUserUtil::getStartingPoint());
$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::getStartingObject();
$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);
// starting point: personal
$startp = new ilCheckboxInputGUI($lng->txt("adm_user_starting_point_personal"), "usr_start_pers");
$startp->setInfo($lng->txt("adm_user_starting_point_personal_info"));
$startp->setChecked(ilUserUtil::hasPersonalStartingPoint());
$si->addSubItem($startp);
// save and cancel commands
$this->form->addCommandButton("saveBasicSettings", $lng->txt("save"));
$this->form->setTitle($lng->txt("basic_settings"));
$this->form->setFormAction($this->ctrl->getFormAction($this));
}
示例3: initBasicSettingsForm
//.........这里部分代码省略.........
$sub_ti->setDisabled(true);
}
$ldsh->addSubItem($sub_ti);
// this is the max duration that can elapse between the first and the secnd
// request to the system before the session is immidietly deleted
$sub_ti = new ilTextInputGUI($this->lng->txt('session_max_idle_after_first_request'), 'session_max_idle_after_first_request');
$sub_ti->setMaxLength(5);
$sub_ti->setSize(5);
$sub_ti->setInfo($this->lng->txt('session_max_idle_after_first_request_info'));
$sub_ti->setValue($ilSetting->get("session_max_idle_after_first_request", ilSessionControl::DEFAULT_MAX_IDLE_AFTER_FIRST_REQUEST));
if (!$ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE)) {
$sub_ti->setDisabled(true);
}
$ldsh->addSubItem($sub_ti);
// add session control to radio group
$ssettings->addOption($ldsh);
// add radio group to form
if ($ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE)) {
// just shows the status wether the session
//setting maintenance is allowed by setup
$this->form->addItem($ssettings);
} else {
// just shows the status wether the session
//setting maintenance is allowed by setup
$ti = new ilNonEditableValueGUI($this->lng->txt('session_config'), "session_config");
$ti->setValue($this->lng->txt('session_config_maintenance_disabled'));
$ssettings->setDisabled(true);
$ti->addSubItem($ssettings);
$this->form->addItem($ti);
}
// END SESSION SETTINGS
// password assistance
$cb = new ilCheckboxInputGUI($this->lng->txt("enable_password_assistance"), "password_assistance");
if ($ilSetting->get("password_assistance")) {
$cb->setChecked(true);
}
$cb->setInfo($this->lng->txt("password_assistance_info"));
$this->form->addItem($cb);
// password generation
$cb = new ilCheckboxInputGUI($this->lng->txt("passwd_generation"), "passwd_auto_generate");
if ($ilSetting->get("passwd_auto_generate")) {
$cb->setChecked(true);
}
$cb->setInfo($this->lng->txt("passwd_generation_info"));
$this->form->addItem($cb);
// dynamic web links
$cb = new ilCheckboxInputGUI($this->lng->txt("links_dynamic"), "links_dynamic");
$cb->setInfo($this->lng->txt("links_dynamic_info"));
if ($ilSetting->get("links_dynamic")) {
$cb->setChecked(true);
}
$this->form->addItem($cb);
// Learners View
$pl = new ilCheckboxInputGUI($this->lng->txt('preview_learner'), 'preview_learner');
$pl->setValue(1);
$pl->setInfo($this->lng->txt('preview_learner_info'));
$pl->setChecked($ilSetting->get('preview_learner'));
$this->form->addItem($pl);
// 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'));
$this->form->addItem($pl);
// starting point
include_once "Services/User/classes/class.ilUserUtil.php";
$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::getStartingPoint());
$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::getStartingObject();
$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);
// starting point: personal
$startp = new ilCheckboxInputGUI($lng->txt("adm_user_starting_point_personal"), "usr_start_pers");
$startp->setInfo($lng->txt("adm_user_starting_point_personal_info"));
$startp->setChecked(ilUserUtil::hasPersonalStartingPoint());
$si->addSubItem($startp);
// save and cancel commands
$this->form->addCommandButton("saveBasicSettings", $lng->txt("save"));
$this->form->setTitle($lng->txt("basic_settings"));
$this->form->setFormAction($this->ctrl->getFormAction($this));
}