当前位置: 首页>>代码示例>>PHP>>正文


PHP useredit_update_user_preference函数代码示例

本文整理汇总了PHP中useredit_update_user_preference函数的典型用法代码示例。如果您正苦于以下问题:PHP useredit_update_user_preference函数的具体用法?PHP useredit_update_user_preference怎么用?PHP useredit_update_user_preference使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了useredit_update_user_preference函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_auth_plugin

 }
 $authplugin = get_auth_plugin($user->auth);
 $usernew->timemodified = time();
 // Description editor element may not exist!
 if (isset($usernew->description_editor) && isset($usernew->description_editor['format'])) {
     $usernew = file_postupdate_standard_editor($usernew, 'description', $editoroptions, $personalcontext, 'user', 'profile', 0);
 }
 // Pass a true old $user here.
 if (!$authplugin->user_update($user, $usernew)) {
     // Auth update failed.
     print_error('cannotupdateprofile');
 }
 // Update user with new profile data.
 user_update_user($usernew, false, false);
 // Update preferences.
 useredit_update_user_preference($usernew);
 // Update interests.
 if (isset($usernew->interests)) {
     useredit_update_interests($usernew, $usernew->interests);
 }
 // Update user picture.
 if (empty($CFG->disableuserimages)) {
     useredit_update_picture($usernew, $userform, $filemanageroptions);
 }
 // Update mail bounces.
 useredit_update_bounces($user, $usernew);
 // Update forum track preference.
 useredit_update_trackforums($user, $usernew);
 // Save custom profile fields data.
 profile_save_data($usernew);
 // Trigger event.
开发者ID:ket-ed,项目名称:ketmoodle-core-changes,代码行数:31,代码来源:edit.php

示例2: optional_param

// User id.
$courseid = optional_param('course', SITEID, PARAM_INT);
// Course id (defaults to Site).
$PAGE->set_url('/user/editor.php', array('id' => $userid, 'course' => $courseid));
list($user, $course) = useredit_setup_preference_page($userid, $courseid);
// Create form.
$editorform = new user_edit_editor_form();
$user->preference_htmleditor = get_user_preferences('htmleditor', '', $user->id);
$editorform->set_data($user);
$redirect = new moodle_url("/user/preferences.php", array('userid' => $user->id));
if ($editorform->is_cancelled()) {
    redirect($redirect);
} else {
    if ($data = $editorform->get_data()) {
        $user->preference_htmleditor = $data->preference_htmleditor;
        useredit_update_user_preference($user, false, false);
        // Trigger event.
        \core\event\user_updated::create_from_userid($user->id)->trigger();
        redirect($redirect);
    }
}
// Display page header.
$streditmyeditor = get_string('editorpreferences');
$userfullname = fullname($user, true);
$PAGE->navbar->includesettingsbase = true;
$PAGE->set_title("{$course->shortname}: {$streditmyeditor}");
$PAGE->set_heading($userfullname);
echo $OUTPUT->header();
echo $OUTPUT->heading($streditmyeditor);
// Finally display THE form.
$editorform->display();
开发者ID:evltuma,项目名称:moodle,代码行数:31,代码来源:editor.php


注:本文中的useredit_update_user_preference函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。