Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-29189 course Minor fixups after code review

  • Loading branch information...
commit eb38d45b4e4840f17852c59acbbc2af1376b4536 1 parent efd9c8e
@samhemelryk samhemelryk authored
View
4 enrol/authorize/locallib.php
@@ -54,7 +54,7 @@ function authorize_print_orders($courseid, $userid) {
$searchtype = optional_param('searchtype', 'orderid', PARAM_ALPHA);
$status = optional_param('status', AN_STATUS_NONE, PARAM_INT);
- $coursecontext = get_context_instance(CONTEXT_USER, $USER->id);
+ $coursecontext = get_context_instance(CONTEXT_COURSE, $courseid);
$searchmenu = array('orderid' => $authstrs->orderid, 'transid' => $authstrs->transid, 'cclastfour' => $authstrs->cclastfour);
$buttons = "<form method='post' action='index.php' autocomplete='off'><div>";
@@ -63,7 +63,7 @@ function authorize_print_orders($courseid, $userid) {
$buttons .= "<input type='submit' value='$strs->search' />";
$buttons .= "</div></form>";
- if (has_capability('enrol/authorize:uploadcsv', $coursecontext)) {
+ if (has_capability('enrol/authorize:uploadcsv', get_context_instance(CONTEXT_USER, $USER->id))) {
$buttons .= "<form method='get' action='uploadcsv.php'><div><input type='submit' value='".get_string('uploadcsv', 'enrol_authorize')."' /></div></form>";
}
View
2  lib/db/upgrade.php
@@ -6698,7 +6698,7 @@ function xmldb_main_upgrade($oldversion) {
if ($oldversion < 2011090800) {
// Increase the length of the of the course shortname field as it is now going
- // to be consistently filtered and 100 characters if practically useless for
+ // to be consistently filtered and 100 characters is practically useless for
// things like the multilang filter.
$table = new xmldb_table('course');
View
2  mod/assignment/lib.php
@@ -122,7 +122,7 @@ function assignment_base($cmid='staticonly', $assignment=NULL, $cm=NULL, $course
print_error('invalidid', 'assignment');
}
$this->coursecontext = get_context_instance(CONTEXT_COURSE, $this->course->id);
- $courseshortname = format_text($this->course->shortname, true, array('context' => $coursecontext));
+ $courseshortname = format_text($this->course->shortname, true, array('context' => $this->coursecontext));
if ($assignment) {
$this->assignment = $assignment;
View
2  mod/chat/gui_header_js/index.php
@@ -67,7 +67,7 @@
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>
- <?php echo "$strchat: " . $courseshortname . ": ".format_string($chat->name, true, array('context' => $context)) . "$groupname" ?>
+ <?php echo "$strchat: " . $courseshortname . ": " . format_string($chat->name, true, array('context' => $context)) . "$groupname" ?>
</title>
</head>
<frameset cols="*,200" border="5" framespacing="no" frameborder="yes" marginwidth="2" marginheight="1">
View
2  mod/chat/gui_sockets/index.php
@@ -60,7 +60,7 @@
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>
- <?php echo "$strchat: " . $courseshortname . ": ".format_string($chat->name, true, array('context' => $context)) . "$groupname" ?>
+ <?php echo "$strchat: " . $courseshortname . ": " . format_string($chat->name, true, array('context' => $context)) . "$groupname" ?>
</title>
</head>
<frameset cols="*,200" border="5" framespacing="no" frameborder="yes" marginwidth="2" marginheight="1">
View
2  mod/feedback/analysis_course.php
@@ -128,7 +128,7 @@
$sep_thous = get_string('separator_thousand', 'feedback');
foreach ($courses as $c) {
- $shortname = format_string($course->shortname, true, array('context' => get_context_instance(CONTEXT_COURSE, $c->course_id)));
+ $shortname = format_string($c->shortname, true, array('context' => get_context_instance(CONTEXT_COURSE, $c->course_id)));
echo '<tr><td>'.$shortname.'</td><td align="right">'.number_format(($c->avgvalue), 2, $sep_dec, $sep_thous).'</td></tr>';
}
echo '</table></td></tr>';
View
2  mod/feedback/mapcourse.php
@@ -116,7 +116,7 @@
$unmapurl = new moodle_url('/mod/feedback/unmapcourse.php');
foreach ($coursemap as $cmap) {
$cmapcontext = get_context_instance(CONTEXT_COURSE, $cmap->id);
- $cmapshortname = format_string($cmap->shortname, true, array('context' => $coursecontext));
+ $cmapshortname = format_string($cmap->shortname, true, array('context' => $cmapcontext));
$unmapurl->params(array('id'=>$id, 'cmapid'=>$cmap->id));
$table->add_data(array('<a href="'.$unmapurl->out().'"><img src="'.$OUTPUT->pix_url('t/delete') . '" alt="Delete" /></a> ('.$cmapshortname.') '.$cmap->fullname));
}
Please sign in to comment.
Something went wrong with that request. Please try again.