本文整理汇总了PHP中ilUserUtil::getPersonalStartingObject方法的典型用法代码示例。如果您正苦于以下问题:PHP ilUserUtil::getPersonalStartingObject方法的具体用法?PHP ilUserUtil::getPersonalStartingObject怎么用?PHP ilUserUtil::getPersonalStartingObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilUserUtil
的用法示例。
在下文中一共展示了ilUserUtil::getPersonalStartingObject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initGeneralSettingsForm
//.........这里部分代码省略.........
$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));
}
示例2: initForm
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();
}