コード例 #1
0
ファイル: profile.php プロジェクト: abhilash1994/moodle
}
// Printing tagged interests.
if (!empty($CFG->usetags)) {
    if ($interests = tag_get_tags_csv('user', $user->id)) {
        echo html_writer::tag('dt', get_string('interests'));
        echo html_writer::tag('dd', $interests);
    }
}
if (!isset($hiddenfields['suspended'])) {
    if ($user->suspended) {
        echo html_writer::tag('dt', ' ');
        echo html_writer::tag('dd', get_string('suspended', 'auth'));
    }
}
require_once $CFG->libdir . '/badgeslib.php';
if (!empty($CFG->enablebadges)) {
    profile_display_badges($user->id);
}
echo html_writer::end_tag('dl');
echo "</div></div>";
// Closing desriptionbox and userprofilebox.
echo $OUTPUT->custom_block_region('content');
// Print messaging link if allowed.
if (isloggedin() && has_capability('moodle/site:sendmessage', $context) && !empty($CFG->messaging) && !isguestuser() && !isguestuser($user) && $USER->id != $user->id) {
    echo '<div class="messagebox">';
    echo '<a href="' . $CFG->wwwroot . '/message/index.php?id=' . $user->id . '">' . get_string('messageselectadd') . '</a>';
    echo '</div>';
}
echo '</div>';
// Userprofile class.
echo $OUTPUT->footer();
コード例 #2
0
ファイル: view.php プロジェクト: nikitskynikita/moodle
                    $PAGE->navbar->add($cfullname);
                }
            }
            $shown++;
            if (!$showallcourses && $shown >= 20) {
                $url = new moodle_url('/user/view.php', array('id' => $user->id, 'course' => $courseid, 'showallcourses' => 1));
                $courselisting .= html_writer::link($url, '...', array('title' => get_string('viewmore')));
                break;
            }
        }
        echo html_writer::tag('dt', get_string('courseprofiles'));
        echo html_writer::tag('dd', rtrim($courselisting, ', '));
    }
}
if (!empty($CFG->enablebadges) && !empty($CFG->badges_allowcoursebadges)) {
    profile_display_badges($user->id, $courseid);
}
if (!isset($hiddenfields['suspended'])) {
    if ($user->suspended) {
        echo html_writer::tag('dt', "&nbsp;");
        echo html_writer::tag('dd', get_string('suspended', 'auth'));
    }
}
if (has_capability('moodle/user:viewlastip', $usercontext) && !isset($hiddenfields['lastip'])) {
    if ($user->lastip) {
        $iplookupurl = new moodle_url('/iplookup/index.php', array('ip' => $user->lastip, 'user' => $USER->id));
        $ipstring = html_writer::link($iplookupurl, $user->lastip);
    } else {
        $ipstring = get_string("none");
    }
    echo html_writer::tag('dt', get_string('lastip'));