mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 12:32:08 +02:00
MDL-29186 multilang Reviewed the uses of course fullname and ensured things were being formatted consistently
This commit is contained in:
parent
5d2db8acc8
commit
91d284c145
@ -39,13 +39,17 @@ while(!feof($fd)) {
|
||||
$action = clam_handle_infected_file($file,$log->userid,true);
|
||||
clam_replace_infected_file($file);
|
||||
|
||||
list($ctxselect, $ctxjoin) = context_instance_preload_sql('c.id', CONTEXT_COURSE, 'ctx');
|
||||
$sql = "SELECT c.id, c.fullname $ctxselect FROM {course} c $ctxjoin WHERE c.id = :courseid";
|
||||
$course = $DB->get_record_sql($sql, array('courseid' => $log->course));
|
||||
context_instance_preload($course);
|
||||
|
||||
$user = $DB->get_record("user", array("id"=>$log->userid));
|
||||
$course = $DB->get_record("course", array("id"=>$log->course));
|
||||
$subject = get_string('virusfoundsubject','moodle',format_string($site->fullname));
|
||||
$a->date = userdate($log->time);
|
||||
|
||||
$a->action = $action;
|
||||
$a->course = $course->fullname;
|
||||
$a->course = format_string($course->fullname, true, array('context' => get_context_instance(CONTEXT_COURSE, $course->id)));
|
||||
$a->user = fullname($user);
|
||||
|
||||
notify_user($user,$subject,$a);
|
||||
|
@ -42,12 +42,20 @@ function online_assignment_cleanup($output=false) {
|
||||
|
||||
|
||||
/// get a list of all courses on this site
|
||||
$courses = $DB->get_records('course');
|
||||
list($ctxselect, $ctxjoin) = context_instance_preload_sql('c.id', CONTEXT_COURSE, 'ctx');
|
||||
$sql = "SELECT c.* $ctxselect FROM {course} c $ctxjoin";
|
||||
$courses = $DB->get_records_sql($sql);
|
||||
|
||||
/// cycle through each course
|
||||
foreach ($courses as $course) {
|
||||
context_instance_preload($course);
|
||||
$context = get_context_instance(CONTEXT_COURSE, $course->id);
|
||||
|
||||
$fullname = empty($course->fullname) ? 'Course: '.$course->id : $course->fullname;
|
||||
if (empty($course->fullname)) {
|
||||
$fullname = get_string('course').': '.$course->id;
|
||||
} else {
|
||||
$fullname = format_string($course->fullname, true, array('context' => $context));
|
||||
}
|
||||
if ($output) echo $OUTPUT->heading($fullname);
|
||||
|
||||
/// retrieve a list of sections beyond what is currently being shown
|
||||
@ -96,7 +104,9 @@ function online_assignment_cleanup($output=false) {
|
||||
|
||||
/// grab the section record
|
||||
if (!($section = $DB->get_record('course_sections', array('id'=>$newsection)))) {
|
||||
if ($output) echo 'Serious error: Cannot retrieve section: '.$newsection.' for course: '. format_string($course->fullname) .'<br />';
|
||||
if ($output) {
|
||||
echo 'Serious error: Cannot retrieve section: '.$newsection.' for course: '. $fullname .'<br />';
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -117,7 +127,7 @@ function online_assignment_cleanup($output=false) {
|
||||
|
||||
/// grab the old section record
|
||||
if (!($section = $DB->get_record('course_sections', array('id'=>$xsection->id)))) {
|
||||
if ($output) echo 'Serious error: Cannot retrieve old section: '.$xsection->id.' for course: '.$course->fullname.'<br />';
|
||||
if ($output) echo 'Serious error: Cannot retrieve old section: '.$xsection->id.' for course: '.$fullname.'<br />';
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -203,7 +203,7 @@ class site_registration_form extends moodleform {
|
||||
$cleanhuburl = clean_param($huburl, PARAM_ALPHANUMEXT);
|
||||
$sitename = get_config('hub', 'site_name_' . $cleanhuburl);
|
||||
if ($sitename === false) {
|
||||
$sitename = $site->fullname;
|
||||
$sitename = format_string($site->fullname, true, array('context' => get_context_instance(CONTEXT_COURSE, SITEID)));
|
||||
}
|
||||
$sitedescription = get_config('hub', 'site_description_' . $cleanhuburl);
|
||||
if ($sitedescription === false) {
|
||||
|
@ -524,7 +524,7 @@ class core_backup_renderer extends plugin_renderer_base {
|
||||
$row->cells = array(
|
||||
html_writer::empty_tag('input', array('type'=>'radio', 'name'=>'targetid', 'value'=>$course->id)),
|
||||
$course->shortname,
|
||||
$course->fullname
|
||||
format_string($course->fullname, true, array('context' => get_context_instance(CONTEXT_COURSE, $course->id)))
|
||||
);
|
||||
$table->data[] = $row;
|
||||
}
|
||||
@ -588,7 +588,7 @@ class core_backup_renderer extends plugin_renderer_base {
|
||||
$row->cells = array(
|
||||
html_writer::empty_tag('input', array('type'=>'radio', 'name'=>'importid', 'value'=>$course->id)),
|
||||
$course->shortname,
|
||||
$course->fullname
|
||||
format_string($course->fullname, true, array('context' => get_context_instance(CONTEXT_COURSE, $course->id)))
|
||||
);
|
||||
$table->data[] = $row;
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ class blog_edit_form extends moodleform {
|
||||
$mform->addElement('header', 'assochdr', get_string('associations', 'blog'));
|
||||
$context = get_context_instance(CONTEXT_COURSE, $courseid);
|
||||
$a = new stdClass();
|
||||
$a->coursename = $course->fullname;
|
||||
$a->coursename = format_string($course->fullname, true, array('context' => $context));
|
||||
$contextid = $context->id;
|
||||
} else {
|
||||
$sql = 'SELECT fullname FROM {course} cr LEFT JOIN {context} ct ON ct.instanceid = cr.id WHERE ct.id = ?';
|
||||
|
@ -838,7 +838,7 @@ function blog_get_headers($courseid=null, $groupid=null, $userid=null, $tagid=nu
|
||||
|
||||
$a = new stdClass();
|
||||
$a->user = fullname($user);
|
||||
$a->course = $course->fullname;
|
||||
$a->course = format_string($course->fullname, true, array('context' => get_context_instance(CONTEXT_COURSE, $courseid)));
|
||||
$a->type = get_string('course');
|
||||
$headers['heading'] = get_string('blogentriesbyuseraboutcourse', 'blog', $a);
|
||||
$headers['stradd'] = get_string('blogaboutthis', 'blog', $a);
|
||||
@ -862,7 +862,7 @@ function blog_get_headers($courseid=null, $groupid=null, $userid=null, $tagid=nu
|
||||
|
||||
$a = new stdClass();
|
||||
$a->group = $group->name;
|
||||
$a->course = $course->fullname;
|
||||
$a->course = format_string($course->fullname, true, array('context' => get_context_instance(CONTEXT_COURSE, $courseid)));
|
||||
$a->type = get_string('course');
|
||||
$headers['heading'] = get_string('blogentriesbygroupaboutcourse', 'blog', $a);
|
||||
$headers['stradd'] = get_string('blogaboutthis', 'blog', $a);
|
||||
@ -913,7 +913,7 @@ function blog_get_headers($courseid=null, $groupid=null, $userid=null, $tagid=nu
|
||||
$PAGE->set_heading("$site->shortname: $course->shortname: " . get_string('blogentries', 'blog'));
|
||||
$a = new stdClass();
|
||||
$a->type = get_string('course');
|
||||
$headers['heading'] = get_string('blogentriesabout', 'blog', $course->fullname);
|
||||
$headers['heading'] = get_string('blogentriesabout', 'blog', format_string($course->fullname, true, array('context' => get_context_instance(CONTEXT_COURSE, $courseid))));
|
||||
$headers['stradd'] = get_string('blogaboutthis', 'blog', $a);
|
||||
$headers['strview'] = get_string('viewblogentries', 'blog', $a);
|
||||
$blogurl->remove_params(array('userid'));
|
||||
|
@ -186,9 +186,10 @@ function blog_rss_get_feed($context, $args) {
|
||||
break;
|
||||
case 'course':
|
||||
$info = $DB->get_field('course', 'fullname', array('id'=>$id));
|
||||
$info = format_string($info, true, array('context' => get_context_instance(CONTEXT_COURSE, $id)));
|
||||
break;
|
||||
case 'site':
|
||||
$info = $SITE->fullname;
|
||||
$info = format_string($SITE->fullname, true, array('context' => get_context_instance(CONTEXT_COURSE, SITEID)));
|
||||
break;
|
||||
case 'group':
|
||||
$group = groups_get_group($id);
|
||||
|
@ -537,9 +537,12 @@ function calendar_add_event_metadata($event) {
|
||||
}
|
||||
$icon = $OUTPUT->pix_url('icon', $event->modulename) . '';
|
||||
|
||||
$context = get_context_instance(CONTEXT_COURSE, $module->course);
|
||||
$fullname = format_string($coursecache[$module->course]->fullname, true, array('context' => $context));
|
||||
|
||||
$event->icon = '<img height="16" width="16" src="'.$icon.'" alt="'.$eventtype.'" title="'.$modulename.'" style="vertical-align: middle;" />';
|
||||
$event->referer = '<a href="'.$CFG->wwwroot.'/mod/'.$event->modulename.'/view.php?id='.$module->id.'">'.$event->name.'</a>';
|
||||
$event->courselink = '<a href="'.$CFG->wwwroot.'/course/view.php?id='.$module->course.'">'.$coursecache[$module->course]->fullname.'</a>';
|
||||
$event->courselink = '<a href="'.$CFG->wwwroot.'/course/view.php?id='.$module->course.'">'.$fullname.'</a>';
|
||||
$event->cmid = $module->id;
|
||||
|
||||
|
||||
@ -548,8 +551,12 @@ function calendar_add_event_metadata($event) {
|
||||
$event->cssclass = 'calendar_event_global';
|
||||
} else if($event->courseid != 0 && $event->courseid != SITEID && $event->groupid == 0) { // Course event
|
||||
calendar_get_course_cached($coursecache, $event->courseid);
|
||||
|
||||
$context = get_context_instance(CONTEXT_COURSE, $event->courseid);
|
||||
$fullname = format_string($coursecache[$event->courseid]->fullname, true, array('context' => $context));
|
||||
|
||||
$event->icon = '<img height="16" width="16" src="'.$OUTPUT->pix_url('c/course') . '" alt="'.get_string('courseevent', 'calendar').'" style="vertical-align: middle;" />';
|
||||
$event->courselink = '<a href="'.$CFG->wwwroot.'/course/view.php?id='.$event->courseid.'">'.$coursecache[$event->courseid]->fullname.'</a>';
|
||||
$event->courselink = '<a href="'.$CFG->wwwroot.'/course/view.php?id='.$event->courseid.'">'.$fullname.'</a>';
|
||||
$event->cssclass = 'calendar_event_course';
|
||||
} else if ($event->groupid) { // Group event
|
||||
$event->icon = '<img height="16" width="16" src="'.$OUTPUT->pix_url('c/group') . '" alt="'.get_string('groupevent', 'calendar').'" style="vertical-align: middle;" />';
|
||||
|
@ -105,7 +105,7 @@ class course_completion_form extends moodleform {
|
||||
$selectbox = array();
|
||||
$selected = array();
|
||||
foreach ($courses as $c) {
|
||||
$selectbox[$c->id] = $list[$c->category] . ' / ' . s($c->fullname);
|
||||
$selectbox[$c->id] = $list[$c->category] . ' / ' . format_string($c->fullname, true, array('context' => get_context_instance(CONTEXT_COURSE, $c->id)));
|
||||
|
||||
// If already selected
|
||||
if ($c->selected) {
|
||||
|
@ -25,6 +25,8 @@
|
||||
print_error("invalidcourseid", 'error', '', $id);
|
||||
}
|
||||
|
||||
$coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);
|
||||
|
||||
if (!can_delete_course($id)) {
|
||||
print_error('cannotdeletecourse');
|
||||
}
|
||||
@ -43,7 +45,7 @@
|
||||
$PAGE->set_heading($site->fullname);
|
||||
echo $OUTPUT->header();
|
||||
|
||||
$message = "$strdeletecoursecheck<br /><br />" . format_string($course->fullname) . " (" . format_string($course->shortname) . ")";
|
||||
$message = "$strdeletecoursecheck<br /><br />" . format_string($course->fullname, true, array('context' => $coursecontext)) . " (" . format_string($course->shortname) . ")";
|
||||
echo $OUTPUT->confirm($message, "delete.php?id=$course->id&delete=".md5($course->timemodified), "category.php?id=$course->category");
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
|
@ -855,13 +855,14 @@ function print_overview($courses, array $remote_courses=array()) {
|
||||
}
|
||||
}
|
||||
foreach ($courses as $course) {
|
||||
$fullname = format_string($course->fullname, true, array('context' => get_context_instance(CONTEXT_COURSE, $course->id)));
|
||||
echo $OUTPUT->box_start('coursebox');
|
||||
$attributes = array('title' => s($course->fullname));
|
||||
$attributes = array('title' => s($fullname));
|
||||
if (empty($course->visible)) {
|
||||
$attributes['class'] = 'dimmed';
|
||||
}
|
||||
echo $OUTPUT->heading(html_writer::link(
|
||||
new moodle_url('/course/view.php', array('id' => $course->id)), format_string($course->fullname), $attributes), 3);
|
||||
new moodle_url('/course/view.php', array('id' => $course->id)), $fullname, $attributes), 3);
|
||||
if (array_key_exists($course->id,$htmlarray)) {
|
||||
foreach ($htmlarray[$course->id] as $modname => $html) {
|
||||
echo $html;
|
||||
@ -3253,13 +3254,13 @@ function make_editing_buttons(stdClass $mod, $absolute = true, $moveselect = tru
|
||||
* truncate the the number of chars allowed and add ... if it was too long
|
||||
*/
|
||||
function course_format_name ($course,$max=100) {
|
||||
|
||||
$str = $course->shortname.': '. $course->fullname;
|
||||
if (strlen($str) <= $max) {
|
||||
$fullname = format_string($course->fullname, true, array('context' => get_context_instance(CONTEXT_COURSE, $course->id)));
|
||||
$str = $course->shortname.': '. $fullname;
|
||||
$textlib = textlib_get_instance();
|
||||
if ($textlib->strlen($str) <= $max) {
|
||||
return $str;
|
||||
}
|
||||
else {
|
||||
return substr($str,0,$max-3).'...';
|
||||
} else {
|
||||
return $textlib->substr($str, 0, $max-3).'...';
|
||||
}
|
||||
}
|
||||
|
||||
@ -4224,7 +4225,7 @@ class course_request {
|
||||
$this->delete();
|
||||
|
||||
$a = new stdClass();
|
||||
$a->name = $course->fullname;
|
||||
$a->name = format_string($course->fullname, true, array('context' => get_context_instance(CONTEXT_COURSE, $course->id)));
|
||||
$a->url = $CFG->wwwroot.'/course/view.php?id=' . $course->id;
|
||||
$this->notify($user, $USER, 'courserequestapproved', get_string('courseapprovedsubject'), get_string('courseapprovedemail2', 'moodle', $a));
|
||||
|
||||
|
@ -485,7 +485,7 @@ if(!$csv) {
|
||||
|
||||
// Display icon
|
||||
$iconlink = $CFG->wwwroot.'/course/view.php?id='.$criterion->courseinstance;
|
||||
$icontitle = $crs->fullname;
|
||||
$icontitle = format_string($crs->fullname, true, array('context' => get_context_instance(CONTEXT_COURSE, $crs->id, MUST_EXIST)));
|
||||
$iconalt = $crs->shortname;
|
||||
break;
|
||||
|
||||
|
@ -467,7 +467,8 @@ switch ($mode) {
|
||||
|
||||
// Get course info
|
||||
$c_course = $DB->get_record('course', array('id' => $c_info->course_id));
|
||||
$course_name = $c_course->fullname;
|
||||
$course_context = get_context_instance(CONTEXT_COURSE, $c_course->id, MUST_EXIST);
|
||||
$course_name = format_string($c_course->fullname, true, array('context' => $course_context));
|
||||
|
||||
// Get completions
|
||||
$completions = $c_info->get_completions($user->id);
|
||||
@ -541,7 +542,7 @@ switch ($mode) {
|
||||
|
||||
// Display course name on first row
|
||||
if ($first_row) {
|
||||
echo '<tr><td class="c0"><a href="'.$CFG->wwwroot.'/course/view.php?id='.$c_course->id.'">'.format_string($course_name).'</a></td>';
|
||||
echo '<tr><td class="c0"><a href="'.$CFG->wwwroot.'/course/view.php?id='.$c_course->id.'">'.$course_name.'</a></td>';
|
||||
} else {
|
||||
echo '<tr><td class="c0"></td>';
|
||||
}
|
||||
|
@ -217,7 +217,8 @@ function send_welcome_messages($orderdata) {
|
||||
$lastuserid = $ei->userid;
|
||||
|
||||
while ($ei && $ei->userid == $lastuserid) {
|
||||
$usercourses[] = $ei->fullname;
|
||||
$context = get_context_instance(CONTEXT_COURSE, $ei->courseid);
|
||||
$usercourses[] = format_string($ei->fullname, true, array('context' => $context));
|
||||
if (!$rs->valid()) {
|
||||
break;
|
||||
}
|
||||
|
@ -248,7 +248,7 @@ function authorize_process_csv($filename) {
|
||||
$eventdata->name = 'authorize_enrolment';
|
||||
$eventdata->userfrom = $admin;
|
||||
$eventdata->userto = $admin;
|
||||
$eventdata->subject = "$SITE->fullname: Authorize.net CSV ERROR LOG";
|
||||
$eventdata->subject = format_string($SITE->fullname, true, array('context' => get_context_instance(CONTEXT_COURSE, SITEID))).": Authorize.net CSV ERROR LOG";
|
||||
$eventdata->fullmessage = $ignoredlines;
|
||||
$eventdata->fullmessageformat = FORMAT_PLAIN;
|
||||
$eventdata->fullmessagehtml = '';
|
||||
|
@ -274,7 +274,7 @@ class enrol_flatfile_plugin extends enrol_plugin {
|
||||
if (!empty($mailstudents)) {
|
||||
// Send mail to students
|
||||
$a = new stdClass();
|
||||
$a->coursename = "$course->fullname";
|
||||
$a->coursename = format_string($course->fullname, true, array('context' => $context));
|
||||
$a->profileurl = "$CFG->wwwroot/user/view.php?id=$user->id&course=$course->id";
|
||||
|
||||
$eventdata = new stdClass();
|
||||
@ -296,7 +296,7 @@ class enrol_flatfile_plugin extends enrol_plugin {
|
||||
// Send mail to teachers
|
||||
foreach($teachers as $teacher) {
|
||||
$a = new stdClass();
|
||||
$a->course = "$course->fullname";
|
||||
$a->course = format_string($course->fullname, true, array('context' => $context));
|
||||
$a->user = fullname($user);
|
||||
|
||||
$eventdata = new stdClass();
|
||||
|
@ -187,6 +187,8 @@ while (!feof($fp)) {
|
||||
die;
|
||||
}
|
||||
|
||||
$coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);
|
||||
|
||||
// Check that amount paid is the correct amount
|
||||
if ( (float) $plugin_instance->cost <= 0 ) {
|
||||
$cost = (float) $plugin->get_config('cost');
|
||||
@ -230,7 +232,7 @@ while (!feof($fp)) {
|
||||
$mailadmins = $plugin->get_config('mailadmins');
|
||||
|
||||
if (!empty($mailstudents)) {
|
||||
$a->coursename = $course->fullname;
|
||||
$a->coursename = format_string($course->fullname, true, array('context' => $coursecontext));
|
||||
$a->profileurl = "$CFG->wwwroot/user/view.php?id=$user->id";
|
||||
|
||||
$eventdata = new stdClass();
|
||||
@ -249,7 +251,7 @@ while (!feof($fp)) {
|
||||
}
|
||||
|
||||
if (!empty($mailteachers)) {
|
||||
$a->course = $course->fullname;
|
||||
$a->course = format_string($course->fullname, true, array('context' => $coursecontext));
|
||||
$a->user = fullname($user);
|
||||
|
||||
$eventdata = new stdClass();
|
||||
@ -267,7 +269,7 @@ while (!feof($fp)) {
|
||||
}
|
||||
|
||||
if (!empty($mailadmins)) {
|
||||
$a->course = $course->fullname;
|
||||
$a->course = format_string($course->fullname, true, array('context' => $coursecontext));
|
||||
$a->user = fullname($user);
|
||||
$admins = get_admins();
|
||||
foreach ($admins as $admin) {
|
||||
|
@ -48,15 +48,17 @@ if ($SESSION->wantsurl) {
|
||||
$destination = "$CFG->wwwroot/course/view.php?id=$course->id";
|
||||
}
|
||||
|
||||
$fullname = format_string($course->fullname, true, array('context' => $context));
|
||||
|
||||
if (is_enrolled($context, NULL, '', true)) { // TODO: use real paypal check
|
||||
redirect($destination, get_string('paymentthanks', '', $course->fullname));
|
||||
redirect($destination, get_string('paymentthanks', '', $fullname));
|
||||
|
||||
} else { /// Somehow they aren't enrolled yet! :-(
|
||||
$PAGE->set_url($destination);
|
||||
echo $OUTPUT->header();
|
||||
$a = new stdClass();
|
||||
$a->teacher = get_string('defaultcourseteacher');
|
||||
$a->fullname = format_string($course->fullname);
|
||||
$a->fullname = $fullname;
|
||||
notice(get_string('paymentsorry', '', $a), $destination);
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ require_login($course);
|
||||
require_capability('moodle/course:managefiles', $context);
|
||||
|
||||
$PAGE->set_url($url);
|
||||
$heading = get_string('coursefiles') . ': ' . $course->fullname;
|
||||
$heading = get_string('coursefiles') . ': ' . format_string($course->fullname, true, array('context' => $context));
|
||||
$strfiles = get_string("files");
|
||||
if ($node = $PAGE->settingsnav->find('coursefiles', navigation_node::TYPE_SETTING)) {
|
||||
$node->make_active();
|
||||
|
@ -129,7 +129,9 @@ class completion_criteria_course extends completion_criteria {
|
||||
global $DB;
|
||||
|
||||
$prereq = $DB->get_record('course', array('id' => $this->courseinstance));
|
||||
return shorten_text(urldecode($prereq->fullname));
|
||||
$coursecontext = get_context_instance(CONTEXT_COURSE, $prereq->id, MUST_EXIST);
|
||||
$fullname = format_string($prereq->fullname, true, array('context' => $coursecontext));
|
||||
return shorten_text(urldecode($fullname));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -208,11 +210,14 @@ class completion_criteria_course extends completion_criteria {
|
||||
$info = new completion_info($course);
|
||||
|
||||
$prereq = $DB->get_record('course', array('id' => $this->courseinstance));
|
||||
$coursecontext = get_context_instance(CONTEXT_COURSE, $prereq->id, MUST_EXIST);
|
||||
$fullname = format_string($prereq->fullname, true, array('context' => $coursecontext));
|
||||
|
||||
$prereq_info = new completion_info($prereq);
|
||||
|
||||
$details = array();
|
||||
$details['type'] = $this->get_title();
|
||||
$details['criteria'] = '<a href="'.$CFG->wwwroot.'/course/view.php?id='.$this->courseinstance.'">'.s($prereq->fullname).'</a>';
|
||||
$details['criteria'] = '<a href="'.$CFG->wwwroot.'/course/view.php?id='.$this->courseinstance.'">'.s($fullname).'</a>';
|
||||
$details['requirement'] = get_string('coursecompleted', 'completion');
|
||||
$details['status'] = '<a href="'.$CFG->wwwroot.'/blocks/completionstatus/details.php?course='.$this->courseinstance.'">'.get_string('seedetails', 'completion').'</a>';
|
||||
|
||||
|
@ -2181,7 +2181,7 @@ class global_navigation extends navigation_node {
|
||||
$coursenode = $parent->add($shortname, $url, self::TYPE_COURSE, $shortname, $course->id);
|
||||
$coursenode->nodetype = self::NODETYPE_BRANCH;
|
||||
$coursenode->hidden = (!$course->visible);
|
||||
$coursenode->title($course->fullname);
|
||||
$coursenode->title(format_string($course->fullname, true, array('context' => get_context_instance(CONTEXT_COURSE, $course->id))));
|
||||
if (!$forcegeneric) {
|
||||
$this->addedcourses[$course->id] = &$coursenode;
|
||||
}
|
||||
|
@ -1087,7 +1087,7 @@ function portfolio_insane_notify_admins($insane, $instances=false) {
|
||||
$site = get_site();
|
||||
|
||||
$a = new StdClass;
|
||||
$a->sitename = $site->fullname;
|
||||
$a->sitename = format_string($site->fullname, true, array('context' => get_context_instance(CONTEXT_COURSE, SITEID)));
|
||||
$a->fixurl = "$CFG->wwwroot/$CFG->admin/settings.php?section=manageportfolios";
|
||||
$a->htmllist = portfolio_report_insane($insane, $instances, true);
|
||||
$a->textlist = '';
|
||||
|
@ -650,7 +650,7 @@ function clam_scan_moodle_file(&$file, $course) {
|
||||
case 1: // bad wicked evil, we have a virus.
|
||||
$info = new stdClass();
|
||||
if (!empty($course)) {
|
||||
$info->course = $course->fullname;
|
||||
$info->course = format_string($course->fullname, true, array('context' => get_context_instance(CONTEXT_COURSE, $course->id)));
|
||||
}
|
||||
else {
|
||||
$info->course = 'No course';
|
||||
|
@ -50,9 +50,11 @@ if (!$assignment = $DB->get_record('assignment', array('id'=>$cm->instance))) {
|
||||
print_error('invalidid', 'assignment');
|
||||
}
|
||||
|
||||
$fullname = format_string($course->fullname, true, array('context' => get_context_instance(CONTEXT_COURSE, $course->id)));
|
||||
|
||||
$PAGE->set_url($url);
|
||||
$PAGE->set_context($context);
|
||||
$title = strip_tags($course->fullname.': '.get_string('modulename', 'assignment').': '.format_string($assignment->name,true));
|
||||
$title = strip_tags($fullname.': '.get_string('modulename', 'assignment').': '.format_string($assignment->name,true));
|
||||
$PAGE->set_title($title);
|
||||
$PAGE->set_heading($title);
|
||||
|
||||
|
@ -51,9 +51,11 @@ if (isguestuser()) {
|
||||
}
|
||||
$instance = new assignment_uploadsingle($cm->id, $assignment, $cm, $course);
|
||||
|
||||
$fullname = format_string($course->fullname, true, array('context' => get_context_instance(CONTEXT_COURSE, $course->id)));
|
||||
|
||||
$PAGE->set_url($url);
|
||||
$PAGE->set_context($context);
|
||||
$title = strip_tags($course->fullname.': '.get_string('modulename', 'assignment').': '.format_string($assignment->name,true));
|
||||
$title = strip_tags($fullname.': '.get_string('modulename', 'assignment').': '.format_string($assignment->name,true));
|
||||
$PAGE->set_title($title);
|
||||
$PAGE->set_heading($title);
|
||||
|
||||
|
@ -116,7 +116,8 @@ if($coursemap = feedback_get_courses_from_sitecourse_map($feedback->id)) {
|
||||
$unmapurl = new moodle_url('/mod/feedback/unmapcourse.php');
|
||||
foreach ($coursemap as $cmap) {
|
||||
$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> ('.$cmap->shortname.') '.$cmap->fullname));
|
||||
$fullname = format_string($cmap->fullname, true, array('context' => get_context_instance(CONTEXT_COURSE, $cmap->courseid)));
|
||||
$table->add_data(array('<a href="'.$unmapurl->out().'"><img src="'.$OUTPUT->pix_url('t/delete') . '" alt="Delete" /></a> ('.$cmap->shortname.') '.$fullname));
|
||||
}
|
||||
|
||||
$table->print_html();
|
||||
|
@ -111,8 +111,9 @@ if ($courseid != SITEID) {
|
||||
$context = get_context_instance(CONTEXT_COURSE, $courseid);
|
||||
$addid = has_capability('moodle/notes:manage', $context) ? $courseid : 0;
|
||||
$view = has_capability('moodle/notes:view', $context);
|
||||
$fullname = format_string($course->fullname, true, array('context' => $context));
|
||||
note_print_notes('<a name="sitenotes"></a>' . $strsitenotes, $addid, $view, 0, $userid, NOTES_STATE_SITE, 0);
|
||||
note_print_notes('<a name="coursenotes"></a>' . $strcoursenotes. ' ('.$course->fullname.')', $addid, $view, $courseid, $userid, NOTES_STATE_PUBLIC, 0);
|
||||
note_print_notes('<a name="coursenotes"></a>' . $strcoursenotes. ' ('.$fullname.')', $addid, $view, $courseid, $userid, NOTES_STATE_PUBLIC, 0);
|
||||
note_print_notes('<a name="personalnotes"></a>' . $strpersonalnotes, $addid, $view, $courseid, $userid, NOTES_STATE_DRAFT, $USER->id);
|
||||
|
||||
} else { // Normal course
|
||||
@ -124,7 +125,9 @@ if ($courseid != SITEID) {
|
||||
if (!empty($userid)) {
|
||||
$courses = enrol_get_users_courses($userid);
|
||||
foreach($courses as $c) {
|
||||
$header = '<a href="' . $CFG->wwwroot . '/course/view.php?id=' . $c->id . '">' . $c->fullname . '</a>';
|
||||
$ccontext = get_context_instance(CONTEXT_COURSE, $c->id);
|
||||
$cfullname = format_string($c->fullname, true, array('context' => $ccontext));
|
||||
$header = '<a href="' . $CFG->wwwroot . '/course/view.php?id=' . $c->id . '">' . $cfullname . '</a>';
|
||||
if (has_capability('moodle/notes:manage', get_context_instance(CONTEXT_COURSE, $c->id))) {
|
||||
$addid = $c->id;
|
||||
} else {
|
||||
|
@ -163,10 +163,11 @@ if ($loggedin) {
|
||||
}
|
||||
}
|
||||
if ($courseid) {
|
||||
$fullname = format_string($course->fullname, true, array('context' => get_context_instance(CONTEXT_COURSE, $course->id)));
|
||||
if ($show == 'course') {
|
||||
$link1 .= ' | <b>'.get_string('moreshowcoursetags', $tagslang, $course->fullname).'</b>';
|
||||
$link1 .= ' | <b>'.get_string('moreshowcoursetags', $tagslang, $fullname).'</b>';
|
||||
} else {
|
||||
$link1 .= ' | <a href="'.$myurl.'?show=course'.$courselink.'">'.get_string('moreshowcoursetags', $tagslang, $course->fullname).'</a>';
|
||||
$link1 .= ' | <a href="'.$myurl.'?show=course'.$courselink.'">'.get_string('moreshowcoursetags', $tagslang, $fullname).'</a>';
|
||||
}
|
||||
}
|
||||
if ($sort == 'alpha') {
|
||||
|
@ -229,7 +229,7 @@ if ($usernew = $userform->get_data()) {
|
||||
|
||||
$a = new stdClass();
|
||||
$a->url = $CFG->wwwroot . '/user/emailupdate.php?key=' . $usernew->preference_newemailkey . '&id=' . $user->id;
|
||||
$a->site = $SITE->fullname;
|
||||
$a->site = format_string($SITE->fullname, true, array('context' => get_context_instance(CONTEXT_COURSE, SITEID)));
|
||||
$a->fullname = fullname($user, true);
|
||||
|
||||
$emailupdatemessage = get_string('emailupdatemessage', 'auth', $a);
|
||||
|
@ -318,7 +318,7 @@ function user_get_user_details($user, $course = null) {
|
||||
if ($mycourse->category) {
|
||||
$enrolledcourse = array();
|
||||
$enrolledcourse['id'] = $mycourse->id;
|
||||
$enrolledcourse['fullname'] = $mycourse->fullname;
|
||||
$enrolledcourse['fullname'] = format_string($mycourse->fullname, true, array('context' => get_context_instance(CONTEXT_COURSE, $mycourse->id)));
|
||||
$enrolledcourse['shortname'] = $mycourse->shortname;
|
||||
$enrolledcourses[] = $enrolledcourse;
|
||||
}
|
||||
|
@ -292,20 +292,21 @@ if (!isset($hiddenfields['mycourses'])) {
|
||||
$courselisting = '';
|
||||
foreach ($mycourses as $mycourse) {
|
||||
if ($mycourse->category) {
|
||||
$ccontext = get_context_instance(CONTEXT_COURSE, $mycourse->id);;
|
||||
$cfullname = format_string($mycourse->fullname, true, array('context' => $ccontext));
|
||||
if ($mycourse->id != $course->id){
|
||||
$class = '';
|
||||
if ($mycourse->visible == 0) {
|
||||
$ccontext = get_context_instance(CONTEXT_COURSE, $mycourse->id);
|
||||
if (!has_capability('moodle/course:viewhiddencourses', $ccontext)) {
|
||||
continue;
|
||||
}
|
||||
$class = 'class="dimmed"';
|
||||
}
|
||||
$courselisting .= "<a href=\"{$CFG->wwwroot}/user/view.php?id={$user->id}&course={$mycourse->id}\" $class >"
|
||||
. format_string($mycourse->fullname) . "</a>, ";
|
||||
. $cfullname . "</a>, ";
|
||||
} else {
|
||||
$courselisting .= format_string($mycourse->fullname) . ", ";
|
||||
$PAGE->navbar->add($mycourse->fullname);
|
||||
$courselisting .= $cfullname . ", ";
|
||||
$PAGE->navbar->add($cfullname);
|
||||
}
|
||||
}
|
||||
$shown++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user