Merge branch 'MDL-10115-27' of git://github.com/xow/moodle into MOODLE_27_STABLE

This commit is contained in:
Damyon Wiese
2014-06-24 16:03:53 +08:00
2 changed files with 27 additions and 13 deletions
+14 -7
View File
@@ -38,9 +38,10 @@ require_once($CFG->dirroot . '/tag/lib.php');
require_once($CFG->dirroot . '/user/profile/lib.php');
require_once($CFG->libdir.'/filelib.php');
$userid = optional_param('id', 0, PARAM_INT);
$edit = optional_param('edit', null, PARAM_BOOL); // Turn editing on and off.
$reset = optional_param('reset', null, PARAM_BOOL);
$userid = optional_param('id', 0, PARAM_INT);
$edit = optional_param('edit', null, PARAM_BOOL); // Turn editing on and off.
$reset = optional_param('reset', null, PARAM_BOOL);
$showallcourses = optional_param('showallcourses', 0, PARAM_INT);
$PAGE->set_url('/user/profile.php', array('id' => $userid));
@@ -381,12 +382,18 @@ if (!isset($hiddenfields['mycourses'])) {
}
$class = 'class="dimmed"';
}
$courselisting .= "<a href=\"{$CFG->wwwroot}/user/view.php?id={$user->id}&amp;course={$mycourse->id}\" $class >" .
$ccontext->get_context_name(false) . "</a>, ";
$params = array('id' => $user->id, 'course' => $mycourse->id);
if ($showallcourses) {
$params['showallcourses'] = 1;
}
$url = new moodle_url('/user/view.php', $params);
$courselisting .= html_writer::link($url, $ccontext->get_context_name(false), array('class' => $class));
$courselisting .= ', ';
}
$shown++;
if ($shown == 20) {
$courselisting .= "...";
if (!$showallcourses && $shown == 20) {
$url = new moodle_url('/user/profile.php', array('id' => $user->id, 'showallcourses' => 1));
$courselisting .= html_writer::link($url, '...', array('title' => get_string('viewmore')));
break;
}
}
+13 -6
View File
@@ -28,8 +28,9 @@ require_once($CFG->dirroot.'/tag/lib.php');
require_once($CFG->libdir . '/filelib.php');
require_once($CFG->libdir . '/badgeslib.php');
$id = optional_param('id', 0, PARAM_INT); // User id.
$courseid = optional_param('course', SITEID, PARAM_INT); // course id (defaults to Site).
$id = optional_param('id', 0, PARAM_INT); // User id.
$courseid = optional_param('course', SITEID, PARAM_INT); // course id (defaults to Site).
$showallcourses = optional_param('showallcourses', 0, PARAM_INT);
// See your own profile by default.
if (empty($id)) {
@@ -325,16 +326,22 @@ if (!isset($hiddenfields['mycourses'])) {
}
$class = 'class="dimmed"';
}
$courselisting .= "<a href=\"{$CFG->wwwroot}/user/view.php?id={$user->id}&amp;course={$mycourse->id}\" $class >"
. $cfullname . "</a>, ";
$params = array('id' => $user->id, 'course' => $mycourse->id);
if ($showallcourses) {
$params['showallcourses'] = 1;
}
$url = new moodle_url('/user/view.php', $params);
$courselisting .= html_writer::link($url, $ccontext->get_context_name(false), array('class' => $class));
$courselisting .= ', ';
} else {
$courselisting .= $cfullname . ", ";
$PAGE->navbar->add($cfullname);
}
}
$shown++;
if ($shown >= 20) {
$courselisting .= "...";
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;
}
}