Example #1
0
/**
* returns all courses the given user is 'editing', which is determined by the Head Editor role given at course context
*
* @param int $user
*
* @return array course records
*/
function tao_get_editing_learning_paths($user)
{
    return tao_get_learning_paths_by_role_of_user($user, ROLE_HEADEDITOR);
}
Example #2
0
function tao_print_my_learning_paths_raflmode()
{
    global $USER, $CFG;
    if (isguest()) {
        //don't print anything if this is a guest user.
        return;
    }
    echo '<h2>' . get_string('mylearningpaths', 'local') . '</h2>';
    echo '<p>' . get_string('mylearningpathsdescription', 'local') . '</p>';
    echo '<table id="my_learning_paths_raflmode" border=0><tr>';
    echo '<td>';
    echo '<h4>' . get_string('myownlearningpaths', 'local') . '</h4>';
    // print learning paths i created
    $courses = tao_get_authored_learning_paths($USER);
    tao_print_mylearningpath_list($courses);
    echo '<p><a href="' . $CFG->wwwroot . '/course/addlearningpath.php?category=' . $CFG->lpdefaultcategory . '">' . get_string('addnewlearningpath', 'local') . '...</a></p>';
    echo '</td>';
    echo '<td>';
    // print learning paths I am contributing to
    echo '<h4>' . get_string('mylearningpathcontributions', 'local') . '</h4>';
    $courses = tao_get_learning_paths_by_role_of_user($USER, ROLE_LPCONTRIBUTOR);
    tao_print_mylearningpath_list($courses);
    echo '</td>';
    echo '<td>';
    // print the learning paths i am enrolled in
    echo '<h4>' . get_string('mylearningpathbookmarks', 'local') . '</h4>';
    $courses = get_my_courses($USER->id, 'visible DESC,sortorder ASC', '*', false, 21);
    tao_print_mylearningpath_list($courses);
    echo '</td>';
    echo '</tr></table>';
}