• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP user_login_string函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: print_header

 function print_header($title)
 {
     global $USER;
     $replacements = array('%fullname%' => get_string('mymoodle', 'my'));
     foreach ($replacements as $search => $replace) {
         $title = str_replace($search, $replace, $title);
     }
     $site = get_site();
     $button = update_mymoodle_icon($USER->id);
     $nav = get_string('mymoodle', 'my');
     $header = $site->shortname . ': ' . $nav;
     $loggedinas = user_login_string($site);
     print_header($title, $header, $nav, '', '', true, $button, $loggedinas);
 }
开发者ID:veritech,项目名称:pare-project,代码行数:14,代码来源:pagelib.php


示例2: print_header

 function print_header($title)
 {
     global $USER, $CFG;
     $replacements = array('%fullname%' => get_string('mymoodle', 'my'));
     foreach ($replacements as $search => $replace) {
         $title = str_replace($search, $replace, $title);
     }
     $site = get_site();
     $button = update_mymoodle_icon($USER->id);
     $nav = get_string('mymoodle', 'my');
     $header = $site->shortname . ': ' . $nav;
     $navlinks = array(array('name' => $nav, 'link' => '', 'type' => 'misc'));
     $navigation = build_navigation($navlinks);
     $loggedinas = user_login_string($site);
     if (empty($CFG->langmenu)) {
         $langmenu = '';
     } else {
         $currlang = current_language();
         $langs = get_list_of_languages();
         $langlabel = get_accesshide(get_string('language'));
         $langmenu = popup_form($CFG->wwwroot . '/my/index.php?lang=', $langs, 'chooselang', $currlang, '', '', '', true, 'self', $langlabel);
     }
     print_header($title, $header, $navigation, '', '', true, $button, $loggedinas . $langmenu);
 }
开发者ID:JackCanada,项目名称:moodle-hacks,代码行数:24,代码来源:pagelib.php


示例3: set_user_preference

                    set_user_preference('calendar_lookahead', $value);
                }
                break;
            case 'persistflt':
                set_user_preference('calendar_persistflt', intval($value));
                break;
        }
    }
    redirect('view.php?course=' . $course->id, get_string('changessaved'), 1);
    exit;
}
$site = get_site();
$strcalendar = get_string('calendar', 'calendar');
$strpreferences = get_string('preferences', 'calendar');
$navlinks = array();
if ($course->id != SITEID) {
    $navlinks[] = array('name' => $course->shortname, 'link' => "{$CFG->wwwroot}/course/view.php?id={$course->id}", 'type' => 'misc');
}
$navlinks[] = array('name' => $strpreferences, 'link' => 'view.php', 'type' => 'misc');
$navigation = build_navigation($navlinks);
print_header("{$site->shortname}: {$strcalendar}: {$strpreferences}", $strcalendar, $navigation, '', '', true, '', user_login_string($site));
print_heading($strpreferences);
print_simple_box_start("center");
$prefs->timeformat = get_user_preferences('calendar_timeformat', '');
$prefs->startwday = get_user_preferences('calendar_startwday', CALENDAR_STARTING_WEEKDAY);
$prefs->maxevents = get_user_preferences('calendar_maxevents', CALENDAR_UPCOMING_MAXEVENTS);
$prefs->lookahead = get_user_preferences('calendar_lookahead', CALENDAR_UPCOMING_DAYS);
$prefs->persistflt = get_user_preferences('calendar_persistflt', 0);
include './preferences.html';
print_simple_box_end();
print_footer($course);
开发者ID:r007,项目名称:PMoodle,代码行数:31,代码来源:preferences.php


示例4: groups_get_user_displayname

            $nonmembers[$userid] = groups_get_user_displayname($userid, $courseid);
            $potentialmemberscount++;
        }
        natcasesort($nonmembers);
        // Print out the HTML
        foreach ($nonmembers as $id => $name) {
            $potentialmembersoptions .= "<option value=\"{$id}\">{$name}</option>\n";
        }
    } else {
        $potentialmembersoptions .= '<option>&nbsp;</option>';
    }
    // Print the page and form
    $strgroups = get_string('groups');
    $strparticipants = get_string('participants');
    $groupname = groups_get_group_displayname($groupid);
    print_header("{$course->shortname}: {$strgroups}", $course->fullname, "<a href=\"{$CFG->wwwroot}/course/view.php?id={$courseid}\">{$course->shortname}</a> " . "-> <a href=\"{$CFG->wwwroot}/user/index.php?id={$courseid}\">{$strparticipants}</a> " . '-> <a href="' . format_string(groups_home_url($courseid, $groupid, $groupingid, false)) . "\">{$strgroups}</a>" . '-> ' . get_string('adduserstogroup', 'group'), '', '', true, '', user_login_string($course, $USER));
    ?>
<div id="addmembersform">
    <h3 class="main"><?php 
    print_string('adduserstogroup', 'group');
    echo " {$groupname}";
    ?>
</h3>

    <form id="assignform" method="post" action="">
    <div>
    <input type="hidden" name="sesskey" value="<?php 
    p(sesskey());
    ?>
" />
    <input type="hidden" name="courseid" value="<?php 
开发者ID:veritech,项目名称:pare-project,代码行数:31,代码来源:assign.php


示例5: calendar_set_filters

    calendar_set_filters($courses, $groups, $users);
}
// Let's see if we are supposed to provide a referring course link
// but NOT for the "main page" course
if ($SESSION->cal_course_referer != SITEID && ($shortname = get_field('course', 'shortname', 'id', $SESSION->cal_course_referer)) !== false) {
    require_login();
    if (empty($course)) {
        $course = get_record('course', 'id', $SESSION->cal_course_referer);
        // Useful to have around
    }
}
$strcalendar = get_string('calendar', 'calendar');
$prefsbutton = calendar_preferences_button();
// Print title and header
$navigation = build_navigation($navlinks);
print_header("{$site->shortname}: {$strcalendar}: {$pagetitle}", $strcalendar, $navigation, '', '', true, $prefsbutton, user_login_string($site));
echo calendar_overlib_html();
// Layout the whole page as three big columns.
echo '<table id="calendar" style="height:100%;">';
echo '<tr>';
// START: Main column
echo '<td class="maincalendar">';
echo '<div class="heightcontainer">';
switch ($view) {
    case 'day':
        calendar_show_day($day, $mon, $yr, $courses, $groups, $users, $courseid);
        break;
    case 'month':
        calendar_show_month_detailed($mon, $yr, $courses, $groups, $users, $courseid);
        break;
    case 'upcoming':
开发者ID:nadavkav,项目名称:MoodleTAO,代码行数:31,代码来源:view.php


示例6: optional_param

}
$edit = optional_param('edit', -1, PARAM_BOOL);
$blockaction = optional_param('blockaction', '', PARAM_ALPHA);
$PAGE->set_context(get_context_instance(CONTEXT_USER, $USER->id));
$PAGE->set_url('my/index.php');
$PAGE->set_blocks_editing_capability('moodle/my:manageblocks');
// Note: MDL-19010 there will be further changes to printing header and blocks.
// The code will be much nicer than this eventually.
$pageblocks = blocks_setup($PAGE, BLOCKS_PINNED_BOTH);
if ($edit != -1 and $PAGE->user_allowed_editing()) {
    $USER->editing = $edit;
}
$button = update_mymoodle_icon($USER->id);
$header = $SITE->shortname . ': ' . $strmymoodle;
$navigation = build_navigation($strmymoodle);
$loggedinas = user_login_string();
if (empty($CFG->langmenu)) {
    $langmenu = '';
} else {
    $currlang = current_language();
    $langs = get_list_of_languages();
    $langlabel = get_accesshide(get_string('language'));
    $langmenu = popup_form($CFG->wwwroot . '/my/index.php?lang=', $langs, 'chooselang', $currlang, '', '', '', true, 'self', $langlabel);
}
print_header($strmymoodle, $header, $navigation, '', '', true, $button, $loggedinas . $langmenu);
echo '<table id="layout-table">';
echo '<tr valign="top">';
$lt = empty($THEME->layouttable) ? array('left', 'middle', 'right') : $THEME->layouttable;
foreach ($lt as $column) {
    switch ($column) {
        case 'left':
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:31,代码来源:index.php


示例7: setVisibility

function setVisibility(id, visibility) {
document.getElemenotById(id).style.display = visibility;
}
</script>
</head>
<body>


<?php 
require_once '../../config.php';
$navlinks[] = array('name' => 'Sell Books', 'link' => null, 'type' => 'activityinstance');
$navigation = build_navigation($navlinks);
require_login();
//	echo $OUTPUT->heading();
if (!$export) {
    print_header('Sell Books Form', 'Sell Books Form', $navigation, '', '', true, '', user_login_string($SITE) . $langmenu);
}
require_once 'breadcrumb.php';
global $USER;
$action = optional_param('action', "", PARAM_ALPHANUM);
//get action
$book_id = optional_param('bookid', "", PARAM_ALPHANUM);
//get book id
require_once "tabs.php";
?>
	<html>
<head>

<div
	style="width: 600px; align: center; margin-left: 300px; margin-right: 100px;">
	<?php 
开发者ID:nustlms,项目名称:moodle-block_books,代码行数:31,代码来源:postBook.php


示例8: error

if (!($context = get_context_instance_by_id($contextid))) {
    error('Incorrect context id');
}
if (!($course = $DB->get_record('course', array('id' => $courseid_1)))) {
    echo "No course found for id=" . $courseid_1 . ".";
    print_error('nocourseid');
}
require_login($courseid_1);
$pagename = get_string('letters', 'grades');
//
$navigation = grade_build_nav(__FILE__, $pagename, $courseid_1);
$navlinks[] = array('name' => "Graph", 'link' => null, 'type' => 'activityinstance');
$navigation = build_navigation($navlinks);
//print_header('Grader Report', 'Grader Report', $navigation, '', '', true, '', user_login_string($SITE).$langmenu);
//print_grade_plugin_selector($courseid_1, 'edit', 'graph');
print_header('Grade: Graph', 'Grade: Graph', $navigation, '', '', true, '', user_login_string($SITE) . $langmenu);
//print_grade_plugin_selector($courseid_1, 'edit', 'graph');
/*if ($context->contextlevel == CONTEXT_SYSTEM or $context->contextlevel == CONTEXT_COURSECAT) {
    require_once $CFG->libdir.'/adminlib.php';
    require_login();
    admin_externalpage_setup('letters');
    $admin = true;


} else if ($context->contextlevel == CONTEXT_COURSE) {
    require_login($context->instanceid);
    $admin = false;

} else {
    error('Incorrect context level');
}
开发者ID:nustlms,项目名称:moodle-gradebook,代码行数:31,代码来源:update_grades.php


示例9: optional_param

$modname = optional_param('modname', '', PARAM_ALPHA);
// not used??
$modid = optional_param('modid', 'activity/All', PARAM_FILE);
// not a file, but looks like it anyway
$modaction = optional_param('modaction', '', PARAM_ALPHA);
// not used??
$chooserecent = optional_param('chooserecent', 0, PARAM_INT);
if (!($course = get_record("course", "id", $id))) {
    error("That's an invalid course id");
}
require_login($course->id);
add_to_log($course->id, "course", "recent", "recent.php?id={$course->id}", "{$course->id}");
$strrecentactivity = get_string("recentactivity");
$meta = '<meta name="robots" content="none" />';
// prevent duplicate content in search engines MDL-7299
$loggedinas = user_login_string($course, $USER);
if (!empty($chooserecent)) {
    $userinfo = get_string("allparticipants");
    $dateinfo = get_string("alldays");
    if ($user) {
        if (!($u = get_record("user", "id", $user))) {
            error("That's an invalid user!");
        }
        $userinfo = fullname($u);
    }
    if ($date) {
        $dateinfo = userdate($date, get_string("strftimedaydate"));
    }
    if ($course->id != SITEID) {
        print_header("{$course->shortname}: {$strrecentactivity}", $course->fullname, "<a href=\"view.php?id={$course->id}\">{$course->shortname}</a> ->\n                          <a href=\"recent.php?id={$course->id}\">{$strrecentactivity}</a> -> {$userinfo}, {$dateinfo}", "", $meta);
    } else {
开发者ID:veritech,项目名称:pare-project,代码行数:31,代码来源:recent.php


示例10: add_to_log

    add_to_log(SITEID, 'course', 'view', 'view.php?id=' . SITEID, SITEID);
}
if (empty($CFG->langmenu)) {
    $langmenu = '';
} else {
    $currlang = current_language();
    $langs = get_list_of_languages();
    $langlabel = get_accesshide(get_string('language'));
    $langmenu = popup_form($CFG->wwwroot . '/index.php?lang=', $langs, 'chooselang', $currlang, '', '', '', true, 'self', $langlabel);
}
$PAGE = page_create_object(PAGE_COURSE_VIEW, SITEID);
$pageblocks = blocks_setup($PAGE);
$editing = $PAGE->user_is_editing();
$preferred_width_left = bounded_number(BLOCK_L_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]), BLOCK_L_MAX_WIDTH);
$preferred_width_right = bounded_number(BLOCK_R_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]), BLOCK_R_MAX_WIDTH);
print_header($SITE->fullname, $SITE->fullname, 'home', '', '<meta name="description" content="' . s(strip_tags($SITE->summary)) . '" />', true, '', user_login_string($SITE) . $langmenu);
?>


<table id="layout-table" summary="layout">
  <tr>
  <?php 
$lt = empty($THEME->layouttable) ? array('left', 'middle', 'right') : $THEME->layouttable;
foreach ($lt as $column) {
    switch ($column) {
        case 'left':
            if (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing) {
                echo '<td style="width: ' . $preferred_width_left . 'px;" id="left-column">';
                print_container_start();
                blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
                print_container_end();
开发者ID:r007,项目名称:PMoodle,代码行数:31,代码来源:index.php


示例11: print_footer

/**
 * Can provide a course object to make the footer contain a link to
 * to the course home page, otherwise the link will go to the site home
 * @uses $USER
 * @param mixed $course course object, used for course link button or
 *                      'none' means no user link, only docs link
 *                      'empty' means nothing printed in footer
 *                      'home' special frontpage footer
 * @param object $usercourse course used in user link
 * @param boolean $return output as string
 * @return mixed string or void
 */
function print_footer($course = NULL, $usercourse = NULL, $return = false)
{
    global $USER, $CFG, $THEME, $COURSE, $SITE, $PAGE;
    if (defined('ADMIN_EXT_HEADER_PRINTED') and !defined('ADMIN_EXT_FOOTER_PRINTED')) {
        admin_externalpage_print_footer();
        return;
    }
    $PAGE->set_state(moodle_page::STATE_PRINTING_FOOTER);
    /// Course links or special footer
    if ($course) {
        if ($course === 'empty') {
            // special hack - sometimes we do not want even the docs link in footer
            $output = '';
            if (!empty($THEME->open_header_containers)) {
                for ($i = 0; $i < $THEME->open_header_containers; $i++) {
                    $output .= print_container_end_all();
                    // containers opened from header
                }
            } else {
                //1.8 theme compatibility
                $output .= "\n</div>";
                // content div
            }
            $output .= "\n</div>\n</body>\n</html>";
            // close page div started in header
            if ($return) {
                return $output;
            } else {
                echo $output;
                return;
            }
        } else {
            if ($course === 'none') {
                // Don't print any links etc
                $homelink = '';
                $loggedinas = '';
                $home = false;
            } else {
                if ($course === 'home') {
                    // special case for site home page - please do not remove
                    $course = $SITE;
                    $homelink = '<div class="sitelink">' . '<a title="Moodle ' . $CFG->release . '" href="http://moodle.org/">' . '<img style="width:100px;height:30px" src="' . $CFG->wwwroot . '/pix/moodlelogo.gif" alt="moodlelogo" /></a></div>';
                    $home = true;
                } else {
                    if ($course === 'upgrade') {
                        $home = false;
                        $loggedinas = '';
                        $homelink = '<div class="sitelink">' . '<a title="Moodle ' . $CFG->target_release . '" href="http://docs.moodle.org/en/Administrator_documentation" onclick="this.target=\'_blank\'">' . '<img style="width:100px;height:30px" src="' . $CFG->wwwroot . '/pix/moodlelogo.gif" alt="moodlelogo" /></a></div>';
                    } else {
                        $homelink = '<div class="homelink"><a ' . $CFG->frametarget . ' href="' . $CFG->wwwroot . '/course/view.php?id=' . $course->id . '">' . format_string($course->shortname) . '</a></div>';
                        $home = false;
                    }
                }
            }
        }
    } else {
        $course = $SITE;
        // Set course as site course by default
        $homelink = '<div class="homelink"><a ' . $CFG->frametarget . ' href="' . $CFG->wwwroot . '/">' . get_string('home') . '</a></div>';
        $home = false;
    }
    /// Set up some other navigation links (passed from print_header by ugly hack)
    $menu = isset($THEME->menu) ? str_replace('navmenu', 'navmenufooter', $THEME->menu) : '';
    $title = isset($THEME->title) ? $THEME->title : '';
    $button = isset($THEME->button) ? $THEME->button : '';
    $heading = isset($THEME->heading) ? $THEME->heading : '';
    $navigation = isset($THEME->navigation) ? $THEME->navigation : '';
    $navmenulist = isset($THEME->navmenulist) ? $THEME->navmenulist : '';
    /// Set the user link if necessary
    if (!$usercourse and is_object($course)) {
        $usercourse = $course;
    }
    if (!isset($loggedinas)) {
        $loggedinas = user_login_string($usercourse, $USER);
    }
    if ($loggedinas == $menu) {
        $menu = '';
    }
    /// there should be exactly the same number of open containers as after the header
    if ($THEME->open_header_containers != open_containers()) {
        debugging('Unexpected number of open containers: ' . open_containers() . ', expecting ' . $THEME->open_header_containers, DEBUG_DEVELOPER);
    }
    /// Provide some performance info if required
    $performanceinfo = '';
    if (defined('MDL_PERF') || (!empty($CFG->perfdebug) and $CFG->perfdebug > 7)) {
        $perf = get_performance_info();
        if (defined('MDL_PERFTOLOG') && !function_exists('register_shutdown_function')) {
            error_log("PERF: " . $perf['txt']);
//.........这里部分代码省略.........
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:101,代码来源:weblib.php


示例12: get_string

    }
}
// Print the page and form
$strgroups = get_string('groups');
$strparticipants = get_string('participants');
$stradduserstogroup = get_string('adduserstogroup', 'group');
$strusergroupmembership = get_string('usergroupmembership', 'group');
$groupname = format_string($group->name);
$navlinks = array();
$navlinks[] = array('name' => $strparticipants, 'link' => "{$CFG->wwwroot}/user/index.php?id={$courseid}", 'type' => 'misc');
$navlinks[] = array('name' => $strgroups, 'link' => "{$CFG->wwwroot}/group/index.php?id={$courseid}", 'type' => 'misc');
$navlinks[] = array('name' => $stradduserstogroup, 'link' => null, 'type' => 'misc');
$navigation = build_navigation($navlinks);
$PAGE->requires->js('group/clientlib.js');
$PAGE->requires->js_function_call('init_add_remove_members_page');
print_header("{$course->shortname}: {$strgroups}", $course->fullname, $navigation, '', '', true, '', user_login_string($course, $USER));
check_theme_arrows();
?>

<div id="addmembersform">
    <h3 class="main"><?php 
print_string('adduserstogroup', 'group');
echo ": {$groupname}";
?>
</h3>

    <form id="assignform" method="post" action="<?php 
echo $CFG->wwwroot;
?>
/group/members.php?group=<?php 
echo $groupid;
开发者ID:ajv,项目名称:Offline-Caching,代码行数:31,代码来源:members.php


示例13: stripslashes_recursive

        // no action
        $title = '';
        break;
}
$form = stripslashes_recursive($form);
if (!empty($SESSION->cal_course_referer)) {
    // TODO: This is part of the Great $course Hack in Moodle. Replace it at some point.
    $course = get_record('course', 'id', $SESSION->cal_course_referer);
} else {
    $course = $site;
}
require_login($course, false);
$navlinks[] = $calendar_navlink;
$navlinks[] = array('name' => $title, 'link' => null, 'type' => 'misc');
$navigation = build_navigation($navlinks);
print_header($site->shortname . ': ' . $strcalendar . ': ' . $title, $strcalendar, $navigation, 'eventform.name', '', true, '', user_login_string($site));
echo calendar_overlib_html();
echo '<table id="calendar">';
echo '<tr><td class="maincalendar">';
switch ($action) {
    case 'delete':
        $confirm = optional_param('confirm', 0, PARAM_INT);
        $repeats = optional_param('repeats', 0, PARAM_INT);
        if ($confirm and confirm_sesskey()) {
            // Kill it and redirect to day view
            if (($event = get_record('event', 'id', $eventid)) !== false) {
                if ($event->repeatid && $repeats) {
                    delete_records('event', 'repeatid', $event->repeatid);
                    add_to_log($event->courseid, 'calendar', 'delete all', '', $event->name);
                } else {
                    delete_records('event', 'id', $eventid);
开发者ID:NextEinstein,项目名称:riverhills,代码行数:31,代码来源:event.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP user_logout函数代码示例发布时间:2022-05-23
下一篇:
PHP user_login_finalize函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap