Merge branch 'MDL-41659_master' of https://github.com/totara/openbadges

This commit is contained in:
Damyon Wiese 2013-10-09 13:30:40 +08:00
commit 4600853128
5 changed files with 14 additions and 9 deletions

View File

@ -160,10 +160,11 @@ class award_criteria_courseset extends award_criteria {
// In courseset, print out only the ones that were already selected. // In courseset, print out only the ones that were already selected.
foreach ($this->params as $p) { foreach ($this->params as $p) {
if ($course = $DB->get_record('course', array('id' => $p['course']))) { if ($course = $DB->get_record('course', array('id' => $p['course']))) {
$coursecontext = context_course::instance($course->id);
$param = array( $param = array(
'id' => $course->id, 'id' => $course->id,
'checked' => true, 'checked' => true,
'name' => ucfirst($course->fullname), 'name' => ucfirst(format_string($course->fullname, true, array('context' => $coursecontext))),
'error' => false 'error' => false
); );

View File

@ -82,10 +82,11 @@ if ($type == BADGE_TYPE_SITE) {
navigation_node::override_active_url(new moodle_url('/badges/index.php', array('type' => BADGE_TYPE_SITE))); navigation_node::override_active_url(new moodle_url('/badges/index.php', array('type' => BADGE_TYPE_SITE)));
} else { } else {
require_login($course); require_login($course);
$coursecontext = context_course::instance($course->id);
$title = get_string('coursebadges', 'badges'); $title = get_string('coursebadges', 'badges');
$PAGE->set_context(context_course::instance($course->id)); $PAGE->set_context($coursecontext);
$PAGE->set_pagelayout('course'); $PAGE->set_pagelayout('course');
$PAGE->set_heading($course->fullname . ': ' . $hdr); $PAGE->set_heading(format_string($course->fullname, true, array('context' => $coursecontext)) . ': ' . $hdr);
navigation_node::override_active_url( navigation_node::override_active_url(
new moodle_url('/badges/index.php', array('type' => BADGE_TYPE_COURSE, 'id' => $course->id)) new moodle_url('/badges/index.php', array('type' => BADGE_TYPE_COURSE, 'id' => $course->id))
); );

View File

@ -45,11 +45,13 @@ $title = get_string('create', 'badges');
if (($type == BADGE_TYPE_COURSE) && ($course = $DB->get_record('course', array('id' => $courseid)))) { if (($type == BADGE_TYPE_COURSE) && ($course = $DB->get_record('course', array('id' => $courseid)))) {
require_login($course); require_login($course);
$PAGE->set_context(context_course::instance($course->id)); $coursecontext = context_course::instance($course->id);
$PAGE->set_context($coursecontext);
$PAGE->set_pagelayout('course'); $PAGE->set_pagelayout('course');
$PAGE->set_url('/badges/newbadge.php', array('type' => $type, 'id' => $course->id)); $PAGE->set_url('/badges/newbadge.php', array('type' => $type, 'id' => $course->id));
$PAGE->set_heading($course->fullname . ": " . $title); $heading = format_string($course->fullname, true, array('context' => $coursecontext)) . ": " . $title;
$PAGE->set_title($course->fullname . ": " . $title); $PAGE->set_heading($heading);
$PAGE->set_title($heading);
} else { } else {
$PAGE->set_context(context_system::instance()); $PAGE->set_context(context_system::instance());
$PAGE->set_pagelayout('admin'); $PAGE->set_pagelayout('admin');

View File

@ -493,8 +493,8 @@ class core_badges_renderer extends plugin_renderer_base {
// Local badges. // Local badges.
$localhtml = html_writer::start_tag('fieldset', array('id' => 'issued-badge-table', 'class' => 'generalbox')); $localhtml = html_writer::start_tag('fieldset', array('id' => 'issued-badge-table', 'class' => 'generalbox'));
$localhtml .= html_writer::tag('legend', $heading = get_string('localbadges', 'badges', format_string($SITE->fullname, true, array('context' => context_system::instance())));
$this->output->heading_with_help(get_string('localbadges', 'badges', $SITE->fullname), 'localbadgesh', 'badges')); $localhtml .= html_writer::tag('legend', $this->output->heading_with_help($heading, 'localbadgesh', 'badges'));
if ($badges->badges) { if ($badges->badges) {
$table = new html_table(); $table = new html_table();
$table->attributes['class'] = 'statustable'; $table->attributes['class'] = 'statustable';

View File

@ -68,7 +68,8 @@ if ($type == BADGE_TYPE_SITE) {
$PAGE->set_heading($title); $PAGE->set_heading($title);
} else { } else {
require_login($course); require_login($course);
$title = $course->fullname . ': ' . get_string('coursebadges', 'badges'); $coursename = format_string($course->fullname, true, array('context' => context_course::instance($course->id)));
$title = $coursename . ': ' . get_string('coursebadges', 'badges');
$PAGE->set_context(context_course::instance($course->id)); $PAGE->set_context(context_course::instance($course->id));
$PAGE->set_pagelayout('course'); $PAGE->set_pagelayout('course');
$PAGE->set_heading($title); $PAGE->set_heading($title);