Example #1
0
/// Printing groups
$isseparategroups = ($course->groupmode == SEPARATEGROUPS and $course->groupmodeforce and !has_capability('moodle/site:accessallgroups', $coursecontext));
if (!$isseparategroups) {
    if ($usergroups = groups_get_all_groups($course->id, $user->id)) {
        $groupstr = '';
        foreach ($usergroups as $group) {
            $groupstr .= ' <a href="' . $CFG->wwwroot . '/user/index.php?id=' . $course->id . '&amp;group=' . $group->id . '">' . format_string($group->name) . '</a>,';
        }
        print_row(get_string("group") . ":", rtrim($groupstr, ', '));
    }
}
/// End of printing groups
/// Printing Interests
if (!empty($CFG->usetags)) {
    $interests = get_item_tags('user', $user->id);
    $instereststr = tag_links_csv($interests);
    if ($interests) {
        print_row(get_string('interests') . ": ", rtrim($instereststr));
    }
}
/// End of Printing Interests
echo "</table>";
echo "</td></tr></table>";
$userauth = get_auth_plugin($user->auth);
$passwordchangeurl = false;
if ($currentuser and $userauth->can_change_password() and !isguestuser() and has_capability('moodle/user:changeownpassword', $systemcontext)) {
    if (!($passwordchangeurl = $userauth->change_password_url())) {
        if (empty($CFG->loginhttps)) {
            $passwordchangeurl = "{$CFG->wwwroot}/login/change_password.php";
        } else {
            $passwordchangeurl = str_replace('http:', 'https:', $CFG->wwwroot . '/login/change_password.php');
Example #2
0
/**
 * Prints a box with the description of a tag and its related tags
 *
 * @param unknown_type $tag_object
 * @param $return if true return html string
 */
function print_tag_description_box($tag_object, $return = false)
{
    global $USER, $CFG;
    $tagname = tag_display_name($tag_object);
    $related_tags = related_tags($tag_object->id);
    $content = !empty($tag_object->description) || $related_tags;
    $output = '';
    if ($content) {
        $output .= print_box_start('generalbox', 'tag-description', true);
    }
    if (!empty($tag_object->description)) {
        $options = new object();
        $options->para = false;
        $output .= format_text($tag_object->description, $tag_object->descriptionformat, $options);
    }
    if ($related_tags) {
        $output .= '<br /><br /><strong>' . get_string('relatedtags', 'tag') . ': </strong>' . tag_links_csv($related_tags);
    }
    if ($content) {
        $output .= print_box_end(true);
    }
    if ($return) {
        return $output;
    } else {
        echo $output;
    }
}