added a comment - - edited
from moodle/user/view.php
if ($mycourses = get_my_courses($user->id,'visible DESC,sortorder ASC', '*', false, 21)) {
$shown=0;
$courselisting = '';
foreach ($mycourses as $mycourse) {
if ($mycourse->visible and $mycourse->category) {
$courselisting .=
if ($mycourse->id != $course->id){
$courselisting .= "<option value='$mycourse->id'>$mycourse->fullname</option>";
$courselisting .= "<a href=\"$CFG->wwwroot/user/view.php?id=$user->id&course=$mycourse->id\">"
. format_string($mycourse->fullname) . "</a>, ";
}
else {
$courselisting .= format_string($mycourse->fullname) . ", ";
}
}
$shown++;
if($shown==20) {
$courselisting.= "...";
break;
}
}
print_row(get_string('courses').':', rtrim($courselisting,', '));
}
if ($mycourses = get_my_courses($user->id,'visible DESC,fullname ASC,sortorder ASC', '*', false, 0)) {
$courselisting = '<select id="courseselector">';
foreach ($mycourses as $mycourse) {
if ($mycourse->visible and $mycourse->category) {
$courselisting .= "<option value=\"".$mycourse->id."\">".$mycourse->fullname."</option>";
}
}
$courselisting .= '</select><input type="button" value="Go" onClick="Javascript:window.location=\''."$CFG->wwwroot/user/view.php?id=$user->id&course=".'\'+document.getElementById(\'courseselector\').value;">';
print_row(get_string('courses').':', rtrim($courselisting,', '));
}
NOTE: This should only be used if the improved get_my_courses() function is implemented. But my users really like this setup better than the text based course output currently used.
from moodle/user/view.php
if ($mycourses = get_my_courses($user->id,'visible DESC,sortorder ASC', '*', false, 21)) {
$shown=0;
$courselisting = '';
foreach ($mycourses as $mycourse) {
if ($mycourse->visible and $mycourse->category) {
$courselisting .=
if ($mycourse->id != $course->id){ $courselisting .= "<option value='$mycourse->id'>$mycourse->fullname</option>"; $courselisting .= "<a href=\"$CFG->wwwroot/user/view.php?id=$user->id&course=$mycourse->id\">" . format_string($mycourse->fullname) . "</a>, "; }
else { $courselisting .= format_string($mycourse->fullname) . ", "; }
}
$shown++;
if($shown==20) { $courselisting.= "..."; break; }
}
print_row(get_string('courses').':', rtrim($courselisting,', '));
}
if ($mycourses = get_my_courses($user->id,'visible DESC,fullname ASC,sortorder ASC', '*', false, 0)) {
$courselisting = '<select id="courseselector">';
foreach ($mycourses as $mycourse) {
if ($mycourse->visible and $mycourse->category) { $courselisting .= "<option value=\"".$mycourse->id."\">".$mycourse->fullname."</option>"; }
}
$courselisting .= '</select><input type="button" value="Go" onClick="Javascript:window.location=\''."$CFG->wwwroot/user/view.php?id=$user->id&course=".'\'+document.getElementById(\'courseselector\').value;">';
print_row(get_string('courses').':', rtrim($courselisting,', '));
}
NOTE: This should only be used if the improved get_my_courses() function is implemented. But my users really like this setup better than the text based course output currently used.
-
-
-
- Replace *******
if ($mycourses = get_my_courses($user->id,'visible DESC,sortorder ASC', '*', false, 21)) { $shown=0; $courselisting = ''; foreach ($mycourses as $mycourse) { if ($mycourse->visible and $mycourse->category) { $courselisting .= if ($mycourse->id != $course->id){ $courselisting .= "<option value='$mycourse->id'>$mycourse->fullname</option>"; $courselisting .= "<a href=\"$CFG->wwwroot/user/view.php?id=$user->id&course=$mycourse->id\">" . format_string($mycourse->fullname) . "</a>, "; } else { $courselisting .= format_string($mycourse->fullname) . ", "; } } $shown++; if($shown==20) { $courselisting.= "..."; break; } } print_row(get_string('courses').':', rtrim($courselisting,', ')); }-
-
-
- With*******
if ($mycourses = get_my_courses($user->id,'visible DESC,fullname ASC,sortorder ASC', '*', false, 0)) { $courselisting = '<select id="courseselector">'; foreach ($mycourses as $mycourse) { if ($mycourse->visible and $mycourse->category) { $courselisting .= "<option value=\"".$mycourse->id."\">".$mycourse->fullname."</option>"; } } $courselisting .= '</select><input type="button" value="Go" onClick="Javascript:window.location=\''."$CFG->wwwroot/user/view.php?id=$user->id&course=".'\'+document.getElementById(\'courseselector\').value;">'; print_row(get_string('courses').':', rtrim($courselisting,', ')); } NOTE: This should only be used if the improved get_my_courses() function is implemented. But my users really like this setup better than the text based course output currently used.