Browse files

MDL-7990 Undefined variable: my_course - already fixed in 1.7

  • Loading branch information...
1 parent 11e8c61 commit 7a168444050f01f4fefd43d104144e6a041900b4 skodak committed Jan 8, 2007
Showing with 13 additions and 11 deletions.
  1. +13 −11 user/index.php
View
24 user/index.php
@@ -129,17 +129,19 @@
echo '<table class="controls" cellspacing="0"><tr>';
- //print my course menus
- echo '<td class="left">';
- print_string('mycourses');
- echo ': ';
- $mycourses = get_my_courses($USER->id);
- foreach ($mycourses as $mycourse) {
- $my_course[$mycourse->id] = $mycourse->shortname;
- }
- //choose_from_menu($my_course, 'id', $course->id, '', 'courseform.submit()');
- popup_form($CFG->wwwroot.'/user/index.php?id=',$my_course,'courseform',$course->id);
- echo '</td>';
+ if ($mycourses = get_my_courses($USER->id)) {
+ //print my course menus
+ echo '<td class="left">';
+ print_string('mycourses');
+ echo ': ';
+ $my_course = array();
+ foreach ($mycourses as $mycourse) {
+ $my_course[$mycourse->id] = $mycourse->shortname;
+ }
+ //choose_from_menu($my_course, 'id', $course->id, '', 'courseform.submit()');
+ popup_form($CFG->wwwroot.'/user/index.php?id=',$my_course,'courseform',$course->id);
+ echo '</td>';
+ }
if ($groupmode == VISIBLEGROUPS or ($groupmode and isteacheredit($course->id))) {
if ($groups = get_records_menu("groups", "courseid", $course->id, "name ASC", "id,name")) {

0 comments on commit 7a16844

Please sign in to comment.