$user = get_record("user","id",$log->userid);
$course = get_record("course","id",$log->course);
- $subject = get_string('virusfoundsubject','moodle',$site->fullname);
+ $subject = get_string('virusfoundsubject','moodle',format_string($site->fullname));
$a->date = userdate($log->time);
$a->action = $action;
global $site;
$admins = get_admins();
- $subject = get_string('virusfoundsubject','moodle',$site->fullname);
+ $subject = get_string('virusfoundsubject','moodle',format_string($site->fullname));
$body = get_string('virusfoundlateradminnolog','moodle',$a);
foreach ($admins as $admin) {
email_to_user($admin,$admin,$subject,$body);
admin_externalpage_print_header($adminroot);
print_box('<strong>' . s($mnet_peer->name) . ' : '
- . s($course->shortname) .' '. s($course->fullname)
+ . format_string($course->shortname) .' '. format_string($course->fullname)
. '</strong><br />'
. get_string("enrolcourseenrol_desc", "mnet"));
. "host={$mnethost}&courseid={$course->id}&sesskey={$USER->sesskey}";
print ('<tr>'
. "<td>$icon</td>"
- . "<td><a href=\"$link\">".s($course->fullname). "</a></td>"
+ . "<td><a href=\"$link\">".format_string($course->fullname). "</a></td>"
. '</tr><tr>'
. '<td></td>'
- . '<td>'.s($course->shortname). ' - ' .s($course->cat_name).'</td>'
+ . '<td>'.format_string($course->shortname). ' - ' .format_string($course->cat_name).'</td>'
. '</tr><tr>'
. '<td></td>'
. "<td align=\"left\" >{$course->summary}</td>"
/// grab the section record
if (!($section = get_record('course_sections', 'id', $newsection))) {
- if ($output) echo 'Serious error: Cannot retrieve section: '.$newsection.' for course: '.$course->fullname.'<br />';
+ if ($output) echo 'Serious error: Cannot retrieve section: '.$newsection.' for course: '. format_string($course->fullname) .'<br />';
continue;
}
}
$site = get_site();
- $subject = get_string('noreplybouncesubject','moodle',$site->fullname);
- $body = get_string('noreplybouncemessage','moodle',$site->fullname)."\n\n";
+ $subject = get_string('noreplybouncesubject','moodle',format_string($site->fullname));
+ $body = get_string('noreplybouncemessage','moodle',format_string($site->fullname))."\n\n";
$fd = fopen('php://stdin','r');
if ($fd) {
$strregistration = get_string("registration");
$strregistrationinfo = get_string("registrationinfo");
- print_header("$site->shortname: $strregistration", "$site->fullname",
+ print_header("$site->shortname: $strregistration", $site->fullname,
"<a href=\"../$CFG->admin/index.php\">$stradministration</a> -> $strregistration");
print_heading($strregistration);
/// site header
} else {
- print_header("$course->fullname: $fullname", "$course->fullname",
+ print_header("$course->fullname: $fullname", $course->fullname,
"<a href=\"$CFG->wwwroot/user/view.php?id=$userid&course=$courseid\">$fullname</a> -> $straction", "", "", true, " ", navmenu($course));
}
/// site header
} else {
- print_header("$course->fullname: $fullname", "$course->fullname",
+ print_header("$course->fullname: $fullname", $course->fullname,
"<a href=\"$CFG->wwwroot/user/view.php?id=$userid&course=$course->id\">$fullname</a> -> $straction", "", "", true, " ", navmenu($course));
}
$showroles = 1;
$streditcoursesettings = get_string("editcoursesettings");
$course = get_record('course', 'id', $context->instanceid);
- print_header($streditcoursesettings, "$course->fullname",
+ print_header($streditcoursesettings, $course->fullname,
"<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a> -> $straction");
}
break;
$loginsite = get_string("loginsite");
$errormsg = get_string("auth_cas_invalidcaslogin", "auth");
- print_header("$site->fullname: $loginsite", "$site->fullname", $loginsite);
+ print_header("$site->fullname: $loginsite", $site->fullname, $loginsite);
include("forbidden.html");
print_footer();
exit;
if ($ldapauth->config->expiration == 1) {
$days2expire = $ldapauth->password_expire($USER->username);
if (intval($days2expire) > 0 && intval($days2expire) < intval($CFG->{$USER->auth.'_expiration_warning'})) {
- print_header("$site->fullname: $loginsite", "$site->fullname", $loginsite, $focus, "", true, "<div align=\"right\">$langmenu</div>");
+ print_header("$site->fullname: $loginsite", $site->fullname, $loginsite, $focus, "", true, "<div align=\"right\">$langmenu</div>");
notice_yesno(get_string('auth_passwordwillexpire', 'auth', $days2expire), $passwordchangeurl, $urltogo);
print_footer();
exit;
} elseif (intval($days2expire) < 0 ) {
- print_header("$site->fullname: $loginsite", "$site->fullname", $loginsite, $focus, "", true, "<div align=\"right\">$langmenu</div>");
+ print_header("$site->fullname: $loginsite", $site->fullname, $loginsite, $focus, "", true, "<div align=\"right\">$langmenu</div>");
notice_yesno(get_string('auth_passwordisexpired', 'auth'), $passwordchangeurl, $urltogo);
print_footer();
exit;
if ($ldapauth->config->expiration == 1) {
$days2expire = $ldapauth->password_expire($USER->username);
if (intval($days2expire) > 0 && intval($days2expire) < intval($CFG->{$USER->auth.'_expiration_warning'})) {
- print_header("$site->fullname: $loginsite", "$site->fullname", $loginsite, $focus, "", true, "<div class=\"langmenu\">$langmenu</div>");
+ print_header("$site->fullname: $loginsite", $site->fullname, $loginsite, $focus, "", true, "<div class=\"langmenu\">$langmenu</div>");
notice_yesno(get_string('auth_passwordwillexpire', 'auth', $days2expire), $passwordchangeurl, $urltogo);
print_footer();
exit;
} elseif (intval($days2expire) < 0 ) {
- print_header("$site->fullname: $loginsite", "$site->fullname", $loginsite, $focus, "", true, "<div class=\"langmenu\">$langmenu</div>");
+ print_header("$site->fullname: $loginsite", $site->fullname, $loginsite, $focus, "", true, "<div class=\"langmenu\">$langmenu</div>");
notice_yesno(get_string('auth_passwordisexpired', 'auth'), $passwordchangeurl, $urltogo);
print_footer();
exit;
$show_instructions = false;
}
- print_header("$site->fullname: $loginsite", "$site->fullname", $loginsite, $focus, "", true, "<div align=\"right\">$langmenu</div>");
+ print_header("$site->fullname: $loginsite", $site->fullname, $loginsite, $focus, "", true, "<div align=\"right\">$langmenu</div>");
include($CFG->dirroot.'/auth/cas/index_form.html');
print_footer();
list($code, $message) = array_map('trim',explode(':', $errormessage, 2));
if($code == 702) {
$site = get_site();
- print_error('mnet_session_prohibited','mnet', $remotewwwroot, $site->fullname);
+ print_error('mnet_session_prohibited','mnet', $remotewwwroot, format_string($site->fullname));
exit;
}
$message .= "ERROR $code:<br/>$errormessage<br/>";
print_heading(get_string("choosecourse"));
print_simple_box_start("center");
foreach ($courses as $course) {
- echo '<a href="backup.php?id='.$course->id.'">'.s($course->fullname).' ('.s($course->shortname).')</a><br />'."\n";
+ echo '<a href="backup.php?id='.$course->id.'">'.format_string($course->fullname).' ('.format_string($course->shortname).')</a><br />'."\n";
}
print_simple_box_end();
} else {
}
//Print form
- print_heading("$strcoursebackup: $course->fullname ($course->shortname)");
+ print_heading(format_string("$strcoursebackup: $course->fullname ($course->shortname)"));
print_simple_box_start("center");
//Adjust some php variables to the execution of this script
} else {
$optdimmed = '';
}
- echo "<a $optdimmed href=\"restore.php?course_id=$course->id&launch=check&id=$id&file=$file\">".s($course->fullname).' ('.s($course->shortname).')</a><br />'."\n";
+ echo "<a $optdimmed href=\"restore.php?course_id=$course->id&launch=check&id=$id&file=$file\">".format_string($course->fullname).' ('.format_string($course->shortname).')</a><br />'."\n";
}
print_simple_box_end();
} else {
echo "<li>".get_string("usingexistingcourse");
echo "<ul>";
echo "<li>".get_string("from").": ".$course_header->course_fullname." (".$course_header->course_shortname.")".'</li>';
- echo "<li>".get_string("to").": ".$course->fullname." (".$course->shortname.")".'</li>';
+ echo "<li>".get_string("to").": ". format_string($course->fullname) ." (".format_string($course->shortname).")".'</li>';
if (($restore->deleting)) {
echo "<li>".get_string("deletingexistingcoursedata").'</li>';
} else {
$courses = get_records("course");
foreach ($courses as $course) {
- echo "Start course ".$course->fullname;
+ echo "Start course ". format_string($course->fullname);
$preferences = schedule_backup_course_configure($course);
if ($preferences && $status) {
$status = schedule_backup_course_execute($preferences);
}
if ($status && $preferences) {
- echo "End course ".$course->fullname." OK\n\n";
+ echo "End course ". format_string($course->fullname)." OK\n\n";
} else {
- echo "End course ".$course->fullname." FAIL\n\n";
+ echo "End course ". format_string($course->fullname)." FAIL\n\n";
}
}
?>
if (empty($course->metacourse) && ($course->id!==SITEID)) {
if (has_capability('moodle/legacy:guest', $context, NULL, false)) { // Are a guest now
- $this->content->items[]='<a href="enrol.php?id='.$this->instance->pageid.'">'.get_string('enrolme', '', s($course->shortname)).'</a>';
+ $this->content->items[]='<a href="enrol.php?id='.$this->instance->pageid.'">'.get_string('enrolme', '', format_string($course->shortname)).'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/user.gif" class="icon" alt="" />';
} else if (has_capability('moodle/role:unassignself', $context, NULL, false)) { // Have some role
- $this->content->items[]='<a href="unenrol.php?id='.$this->instance->pageid.'">'.get_string('unenrolme', '', s($course->shortname)).'</a>';
+ $this->content->items[]='<a href="unenrol.php?id='.$this->instance->pageid.'">'.get_string('unenrolme', '', format_string($course->shortname)).'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/user.gif" class="icon" alt="" />';
}
}
continue;
}
$linkcss = $course->visible ? "" : " class=\"dimmed\" ";
- $this->content->items[]="<a $linkcss title=\"" . s($course->shortname) . "\" ".
- "href=\"$CFG->wwwroot/course/view.php?id=$course->id\">" . s($course->fullname) . "</a>";
+ $this->content->items[]="<a $linkcss title=\"" . format_string($course->shortname) . "\" ".
+ "href=\"$CFG->wwwroot/course/view.php?id=$course->id\">" . format_string($course->fullname) . "</a>";
$this->content->icons[]=$icon;
}
$this->title = get_string('mycourses');
if (count($categories) > 1 || (count($categories) == 1 && count_records('course') > 200)) { // Just print top level category links
foreach ($categories as $category) {
$linkcss = $category->visible ? "" : " class=\"dimmed\" ";
- $this->content->items[]="<a $linkcss href=\"$CFG->wwwroot/course/category.php?id=$category->id\">" . s($category->name) . "</a>";
+ $this->content->items[]="<a $linkcss href=\"$CFG->wwwroot/course/category.php?id=$category->id\">" . format_string($category->name) . "</a>";
$this->content->icons[]=$icon;
}
$this->content->icons[] = '';
if ($courses) {
foreach ($courses as $course) {
$linkcss = $course->visible ? "" : " class=\"dimmed\" ";
- $this->content->items[]="<a $linkcss title=\"".s($course->shortname)."\" ".
- "href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname</a>";
+
+ $this->content->items[]="<a $linkcss title=\""
+ . format_string($course->shortname)."\" ".
+ "href=\"$CFG->wwwroot/course/view.php?id=$course->id\">"
+ . format_string($course->fullname) . "</a>";
$this->content->icons[]=$icon;
}
/// If we can update any course of the view all isn't hidden, show the view all courses link
if (has_capability('moodle/course:update', get_context_instance(CONTEXT_SYSTEM)) || empty($CFG->block_course_list_hideallcourseslink)) {
$this->content->icons[] = '';
- $this->content->items[] = " <a href=\"$CFG->wwwroot/course/index.php\">".get_string("fulllistofcourses")."</a>...";
+ $this->content->items[] = " <a href=\"$CFG->wwwroot/course/index.php\">"
+ .get_string("fulllistofcourses")."</a>...";
}
$this->get_remote_courses();
} else {
$this->content->items[] = get_string('remotecourses','mnet');
$this->content->icons[] = '';
foreach ($courses as $course) {
- $this->content->items[]="<a title=\"$course->shortname\" ".
- "href=\"{$CFG->wwwroot}/auth/mnet/jump.php?hostid={$course->hostid}&wantsurl=/course/view.php?id={$course->remoteid}\">$course->fullname</a>";
+ $this->content->items[]="<a title=\"" . format_string($course->shortname) . "\" ".
+ "href=\"{$CFG->wwwroot}/auth/mnet/jump.php?hostid={$course->hostid}&wantsurl=/course/view.php?id={$course->remoteid}\">"
+ . format_string($course->fullname) . "</a>";
$this->content->icons[]=$icon;
}
// if we listed courses, we are done
}
$catlinkcss = $subcategory->visible ? "" : " class=\"dimmed\" ";
echo '<a '.$catlinkcss.' href="category.php?id='.$subcategory->id.'">'.
- $subcategory->name.'</a><br />';
+ format_string($subcategory->name).'</a><br />';
}
}
if (!$firstentry) {
$linkcss = $acourse->visible ? "" : ' class="dimmed" ';
echo '<tr>';
- echo '<td><a '.$linkcss.' href="view.php?id='.$acourse->id.'">'.$acourse->fullname.'</a></td>';
+ echo '<td><a '.$linkcss.' href="view.php?id='.$acourse->id.'">'. format_string($acourse->fullname) .'</a></td>';
if ($creatorediting) {
echo "<td>";
if (has_capability('moodle/course:update', $coursecontext)) {
echo '<form id="renameform" action="category.php" method="post">';
echo '<input type="hidden" name="id" value="'.$category->id.'" />';
echo '<input type="hidden" name="sesskey" value="'.$USER->sesskey.'" />';
- echo '<input type="text" size="30" name="rename" value="'.s($category->name).'" alt="'.$strrename.'" />';
+ echo '<input type="text" size="30" name="rename" value="'.format_string($category->name).'" alt="'.$strrename.'" />';
echo '<input type="submit" value="'.$strrename.'" />';
echo "</form>";
echo "<br />";
"<a href=\"category.php?id=$course->category\">$category->name</a> -> ".
"$strdeletecheck");
- notice_yesno("$strdeletecoursecheck<br /><br />$course->fullname ($course->shortname)",
+ notice_yesno("$strdeletecoursecheck<br /><br />" . format_string($course->fullname) .
+ " (" . format_string($course->shortname) . ")",
"delete.php?id=$course->id&delete=".md5($course->timemodified)."&sesskey=$USER->sesskey",
"category.php?id=$course->category");
add_to_log(SITEID, "course", "delete", "view.php?id=$course->id", "$course->fullname (ID $course->id)");
- $strdeletingcourse = get_string("deletingcourse", "", $course->shortname);
+ $strdeletingcourse = get_string("deletingcourse", "", format_string($course->shortname));
print_header("$site->shortname: $strdeletingcourse", $site->fullname,
"<a href=\"../$CFG->admin/index.php\">$stradministration</a> -> ".
delete_course($course->id);
fix_course_sortorder(); //update course count in catagories
- print_heading( get_string("deletedcourse", "", $course->shortname) );
+ print_heading( get_string("deletedcourse", "", format_string($course->shortname)) );
print_continue("category.php?id=$course->category");
$strcategories = get_string("categories");
if (!empty($course)) {
- print_header($streditcoursesettings, "$course->fullname",
+ print_header($streditcoursesettings, $course->fullname,
"<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a>
-> $streditcoursesettings", $editform->focus());
} else {
- print_header("$site->shortname: $straddnewcourse", "$site->fullname",
+ print_header("$site->shortname: $straddnewcourse", $site->fullname,
"<a href=\"$CFG->wwwroot/$CFG->admin/index.php\">$stradministration</a> -> ".
"<a href=\"index.php\">$strcategories</a> -> $straddnewcourse", $editform->focus());
}
/// OK, we have all the data, now present it to the user
- print_header("$course->shortname: $strgrades", "$course->fullname",
+ print_header("$course->shortname: $strgrades", $course->fullname,
"<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a>
-> $strgrades");
/// Get a list of all students
if ($currentgroup) {
if (!$students = get_group_students($currentgroup, "u.lastname ASC")) {
- print_header("$course->shortname: $strgrades", "$course->fullname",
+ print_header("$course->shortname: $strgrades", $course->fullname,
"<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a>
-> $strgrades");
setup_and_print_groups($course, $groupmode, "grades.php?id=$course->id");
}
} else {
if (!$students = get_course_students($course->id, "u.lastname ASC")) {
- print_header("$course->shortname: $strgrades", "$course->fullname",
+ print_header("$course->shortname: $strgrades", $course->fullname,
"<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a>
-> $strgrades");
notice(get_string("nostudentsyet"), "$CFG->wwwroot/course/view.php?id=$course->id");
} else { // Just print the web page
- print_header("$course->shortname: $strgrades", "$course->fullname",
+ print_header("$course->shortname: $strgrades", $course->fullname,
"<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a>
-> $strgrades");
$strgroupmemberssee = get_string('groupmemberssee');
$strparticipants = get_string('participants');
- print_header("$course->shortname: $strgroups", "$course->fullname",
+ print_header("$course->shortname: $strgroups", $course->fullname,
"<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a> ".
"-> <a href=\"$CFG->wwwroot/user/index.php?id=$course->id\">$strparticipants</a> ".
"-> $strgroups", "", "", true, '', user_login_string($course, $USER));
}
}
- print_header("$course->shortname: $strimportactivities", "$course->fullname",
+ print_header("$course->shortname: $strimportactivities", $course->fullname,
"<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a> ".
"-> <a href=\"$CFG->wwwroot/course/import.php?id=$course->id\">".get_string('import')."</a> ".
"-> $strimportactivities");
/// Print the header
- print_header("$course->shortname: $strimportgroups", "$course->fullname",
+ print_header("$course->shortname: $strimportgroups", $course->fullname,
"<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a> ".
"-> <a href=\"$CFG->wwwroot/course/import.php?id=$course->id\">".get_string('import')."</a> ".
"-> $strimportgroups");
$strshowall = get_string("showall");
print_header("$course->shortname: $strassigncourses",
- "$site->fullname",
+ $site->fullname,
"<a href=\"view.php?id=$course->id\">$course->shortname</a> -> $strassigncourses",
"searchtext");
$newcategory->name = $form->addcategory;
$newcategory->sortorder = 999;
if (!insert_record('course_categories', $newcategory)) {
- notify("Could not insert the new category '" . s($newcategory->name) . "'");
+ notify("Could not insert the new category '" . format_string($newcategory->name) . "'");
} else {
- notify(get_string('categoryadded', '', s($newcategory->name)));
+ notify(get_string('categoryadded', '', format_string($newcategory->name)));
}
}
}
/// Finally delete the category itself
if (delete_records('course_categories', 'id', $deletecat->id)) {
- notify(get_string('categorydeleted', '', s($deletecat->name)));
+ notify(get_string('categorydeleted', '', format_string($deletecat->name)));
}
}
else {
- $strdeletecategorycheck = get_string('deletecategorycheck','', s($deletecat->name));
+ $strdeletecategorycheck = get_string('deletecategorycheck','', format_string($deletecat->name));
notice_yesno($strdeletecategorycheck,
"index.php?delete=$delete&sure=".md5($deletecat->timemodified)."&sesskey=$USER->sesskey",
"index.php?sesskey=$USER->sesskey");
$linkcss = $category->visible ? '' : ' class="dimmed" ';
echo '<a '.$linkcss.' title="'.$str->edit.'" '.
' href="category.php?id='.$category->id.'&categoryedit=on&sesskey='.sesskey().'">'.
- s($category->name).'</a>';
+ format_string($category->name).'</a>';
echo '</td>';
echo '<td class="count">'.$category->coursecount.'</td>';
print_header(get_string("summaryof", "", $course->fullname));
- echo "<h3 align=\"center\">$course->fullname<br />($course->shortname)</h3>";
+ echo "<h3 align=\"center\">" . format_string($course->fullname) . "<br />(" . format_string($course->shortname) . ")</h3>";
echo "<center>";
if ($course->guest) {
if (empty($course->visible)) {
$linkcss = 'class="dimmed"';
}
- print_heading('<a title="'.$course->fullname.'" '.$linkcss.' href="'.$CFG->wwwroot.'/course/view.php?id='.$course->id.'">'.$course->fullname.'</a>');
+ print_heading('<a title="'. format_string($course->fullname).'" '.$linkcss.' href="'.$CFG->wwwroot.'/course/view.php?id='.$course->id.'">'. format_string($course->fullname).'</a>');
if (array_key_exists($course->id,$htmlarray)) {
foreach ($htmlarray[$course->id] as $modname => $html) {
echo $html;
foreach ($courses as $course) {
$modinfo = serialize(get_array_of_activities($course->id));
if (!set_field("course", "modinfo", $modinfo, "id", $course->id)) {
- notify("Could not cache module information for course '$course->fullname'!");
+ notify("Could not cache module information for course '" . format_string($course->fullname) . "'!");
}
}
}
if ($category) {
if ($path) {
- $path = $path.' / '.s($category->name);
+ $path = $path.' / '.format_string($category->name);
} else {
- $path = s($category->name);
+ $path = format_string($category->name);
}
$list[$category->id] = $path;
} else {
echo '<td valign="top" class="category image">'.$catimage.'</td>';
echo '<td valign="top" class="category name">';
- echo '<a '.$catlinkcss.' href="'.$CFG->wwwroot.'/course/category.php?id='.$category->id.'">'.$category->name.'</a>';
+ echo '<a '.$catlinkcss.' href="'.$CFG->wwwroot.'/course/category.php?id='.$category->id.'">'. format_string($category->name).'</a>';
echo '</td>';
echo '<td class="category info"> </td>';
echo '</tr>';
$linkcss = $course->visible ? '' : ' class="dimmed" ';
echo '<tr><td valign="top"> ';
echo '</td><td valign="top" class="course name">';
- echo '<a '.$linkcss.' href="'.$CFG->wwwroot.'/course/view.php?id='.$course->id.'">'.$course->fullname.'</a>';
+ echo '<a '.$linkcss.' href="'.$CFG->wwwroot.'/course/view.php?id='.$course->id.'">'. format_string($course->fullname).'</a>';
echo '</td><td align="right" valign="top" class="course info">';
if ($course->guest ) {
echo '<a title="'.$strallowguests.'" href="'.$CFG->wwwroot.'/course/view.php?id='.$course->id.'">';
}
echo '<td valign="top" class="category name">';
- echo '<a '.$catlinkcss.' href="'.$CFG->wwwroot.'/course/category.php?id='.$category->id.'">'.$category->name.'</a>';
+ echo '<a '.$catlinkcss.' href="'.$CFG->wwwroot.'/course/category.php?id='.$category->id.'">'. format_string($category->name).'</a>';
echo '</td>';
echo '<td valign="top" class="category number">';
if ($category->coursecount) {
echo '<div class="info">';
echo '<div class="name"><a title="'.get_string('entercourse').'"'.
$linkcss.' href="'.$CFG->wwwroot.'/course/view.php?id='.$course->id.'">'.
- $course->fullname.'</a></div>';
+ format_string($course->fullname).'</a></div>';
/// first find all roles that are supposed to be displayed
if ($managerroles = get_config('', 'coursemanager')) {
echo '<div class="info">';
echo '<div class="name"><a title="'.get_string('entercourse').'"'.
$linkcss.' href="'.$url.'">'
- . s($course->fullname) .'</a><br />'
- . s($course->hostname) . ' : '
- . s($course->cat_name) . ' : '
- . s($course->shortname). '</div>';
+ . format_string($course->fullname) .'</a><br />'
+ . format_string($course->hostname) . ' : '
+ . format_string($course->cat_name) . ' : '
+ . format_string($course->shortname). '</div>';
echo '</div><div class="summary">';
$options = NULL;
$options->noclean = true;
*/
function course_format_name ($course,$max=100) {
- $str = $course->shortname.': '.$course->fullname;
+ $str = $course->shortname.': '. $course->fullname;
if (strlen($str) <= $max) {
return $str;
}
//do not output raw html from request, quote html entities using s()!!
$table->data[] = array(((!empty($course->password)) ?
'<img hspace="1" alt="'.$strrequireskey.'" class="icon" src="'.$CFG->pixpath.'/i/key.gif" />' : ''),
- s($course->shortname),s($course->fullname),fullname($requester),
- s($course->summary),s($course->reason),
+ format_string($course->shortname),format_string($course->fullname),fullname($requester),
+ format_string($course->summary),format_string($course->reason),
'<a href="pending.php?approve='.$course->id.'&sesskey='.sesskey().'">'.get_string('approve').'</a> | '
.'<a href="pending.php?reject='.$course->id.'&sesskey='.sesskey().'">'.get_string('reject').'</a>');
}
$dateinfo = userdate($date, get_string("strftimedaydate"));
if ($course->id != SITEID) {
- print_header("$course->shortname: $strrecentactivity", "$course->fullname",
+ print_header("$course->shortname: $strrecentactivity", $course->fullname,
"<a href=\"view.php?id=$course->id\">$course->shortname</a> ->
<a href=\"recent.php?id=$course->id\">$strrecentactivity</a> -> $userinfo, $dateinfo", "", $meta);
} else {
- print_header("$course->shortname: $strrecentactivity", "$course->fullname",
+ print_header("$course->shortname: $strrecentactivity", $course->fullname,
"<a href=\"recent.php?id=$course->id\">$strrecentactivity</a> -> $userinfo, $dateinfo", "", $meta);
}
- print_heading("$course->fullname: $userinfo, $dateinfo (".usertimezone().")", '', 3);
+ print_heading(format_string($course->fullname) . ": $userinfo, $dateinfo (".usertimezone().")", '', 3);
$advancedfilter = 1;
print_recent_selector_form($course, $advancedfilter, $user, $date, $modname, $modid, $modaction, $selectedgroup, $sortby);
}
if ($course->id != SITEID) {
- print_header("$course->shortname: $strrecentactivity", "$course->fullname",
+ print_header("$course->shortname: $strrecentactivity", $course->fullname,
"<a href=\"view.php?id=$course->id\">$course->shortname</a> -> $strrecentactivity", "", $meta);
} else {
- print_header("$course->shortname: $strrecentactivity", "$course->fullname",
+ print_header("$course->shortname: $strrecentactivity", $course->fullname,
"$strrecentactivity", "", $meta);
}
<a href=\"index.php?id=$course->id\">$strlogs</a> -> $userinfo, $dateinfo", '');
}
- print_heading("$course->fullname: $userinfo, $dateinfo (".usertimezone().")");
+ print_heading(format_string($course->fullname) . ": $userinfo, $dateinfo (".usertimezone().")");
print_mnet_log_selector_form($hostid, $course, $user, $date, $modname, $modid, $modaction, $group, $showcourses, $showusers, $logformat);
if($hostid == $CFG->mnet_localhost_id) {
if ($ccc = get_records("course", "", "", "fullname","id,fullname,category")) {
foreach ($ccc as $cc) {
if ($cc->category) {
- $courses["$cc->id"] = "$cc->fullname";
+ $courses["$cc->id"] = $cc->fullname;
} else {
$courses["$cc->id"] = " $cc->fullname (Site)";
}
$strtodaylogs = get_string("todaylogs");
$strreports = get_string("reports");
- print_header("$course->shortname: $stractivityreport", "$course->fullname",
+ print_header("$course->shortname: $stractivityreport", $course->fullname,
"<a href=\"../../view.php?id=$course->id\">$course->shortname</a> ->
<a href=\"../../report.php?id=$course->id\">$strreports</a> ->
$stractivityreport");
- print_heading("$course->fullname");
+ print_heading(format_string($course->fullname));
echo "<table cellpadding=\"10\" align=\"center\"><tr>";
echo "<td>$stractivityreport: </td>";
$strallactions = get_string('allactions');
$strreports = get_string('reports');
- $strnav = "<a href=\"../../view.php?id=$course->id\">$course->shortname</a> ->
+ $strnav = "<a href=\"../../view.php?id=$course->id\">" . format_string($course->shortname) . "</a> ->
<a href=\"../../report.php?id=$course->id\">$strreports</a> -> ". $strparticipation;
- print_header("$course->shortname: $strparticipation", "$course->fullname",
+ print_header("$course->shortname: $strparticipation", $course->fullname,
"<a href=\"../../view.php?id=$course->id\">$course->shortname</a> ->
<a href=\"../../report.php?id=$course->id\">$strreports</a> ->
$strparticipation");
$menu = report_stats_mode_menu($course, $mode, $time, "$CFG->wwwroot/course/report/stats/index.php");
- $crumb = "<a href=\"../../view.php?id=$course->id\">$course->shortname</a> ->
+ $crumb = "<a href=\"../../view.php?id=$course->id\">" . format_string($course->shortname) . "</a> ->
<a href=\"../../report.php?id=$course->id\">$strreports</a> ->
$strstats";
- print_header("$course->shortname: $strstats", "$course->fullname",
+ print_header("$course->shortname: $strstats", $course->fullname,
$crumb, '', '', true, ' ', $menu);
$stats = stats_fix_zeros($stats,$param->timeafter,$param->table,(!empty($param->line2)));
- print_heading($course->shortname.' - '.get_string('statsreport'.$report)
+ print_heading(format_string($course->shortname).' - '.get_string('statsreport'.$report)
.((!empty($user)) ? ' '.get_string('statsreportforuser').' ' .fullname($user,true) : '')
.((!empty($roleid)) ? ' '.get_field('role','name','id',$roleid) : ''));
// $scales_site_uses = site_scale_used($scale->id,$courses);
$scalemenu = make_menu_from_list($scale->scale);
- print_header("$course->shortname: $strscales", "$course->fullname",
+ print_header("$course->shortname: $strscales", $course->fullname,
"$course->shortname -> $strscales -> $scale->name", "", "", true, " ", " ");
close_window_button();
}
//Print out the headers
- print_header("$course->shortname: $strscales", "$course->fullname",
+ print_header("$course->shortname: $strscales", $course->fullname,
"<a href=\"view.php?id=$course->id\">$course->shortname</a>".
" -> <a href=\"scales.php?id=$course->id\">$strscales</a>".
" -> ".get_string("editinga","",$strscale), $focus);
/// Print out the main page
- print_header("$course->shortname: $strscales", "$course->fullname",
+ print_header("$course->shortname: $strscales", $course->fullname,
"<a href=\"view.php?id=$course->id\">$course->shortname</a>
-> $strscales");
}
echo "<tr>";
- echo "<td><a $linkcss href=\"view.php?id=$course->id\">$course->fullname</a></td>";
+ echo "<td><a $linkcss href=\"view.php?id=$course->id\">" . format_string($course->fullname) . "</a></td>";
echo "<td>".$displaylist[$course->category]."</td>";
echo "<td align=\"center\">";
$fullname = fullname($user, true);
if ($course->id != SITEID) {
- print_header("$course->shortname: $stractivityreport ($mode)", "$course->fullname",
+ print_header("$course->shortname: $stractivityreport ($mode)", $course->fullname,
"<a href=\"../course/view.php?id=$course->id\">$course->shortname</a> ->
<a href=\"../user/index.php?id=$course->id\">$strparticipants</a> ->
<a href=\"../user/view.php?id=$user->id&course=$course->id\">$fullname</a> ->
$stractivityreport -> $strmode");
} else {
- print_header("$course->shortname: $stractivityreport ($mode)", "$course->fullname",
+ print_header("$course->shortname: $stractivityreport ($mode)", $course->fullname,
"<a href=\"../user/view.php?id=$user->id&course=$course->id\">$fullname</a> ->
$stractivityreport -> $strmode");
}
$a->user = fullname($USER);
email_to_user($paymentmanager,
$USER,
- get_string("enrolmentnew", '', $course->shortname),
+ get_string("enrolmentnew", '', format_string($course->shortname)),
get_string('enrolmentnewuser', '', $a));
}
if (!empty($CFG->enrol_mailadmins)) {
foreach ($admins as $admin) {
email_to_user($admin,
$USER,
- get_string("enrolmentnew", '', $course->shortname),
+ get_string("enrolmentnew", '', format_string($course->shortname)),
get_string('enrolmentnewuser', '', $a));
}
}
$table->data[] = array("<b>$authstrs->amount:</b>", "$order->currency $order->amount");
if (empty($cmdcapture) and empty($cmdrefund) and empty($cmdvoid) and empty($cmddelete)) {
$color = authorize_get_status_color($status->status);
- $table->data[] = array("<b>$strs->course:</b>", $course->shortname);
+ $table->data[] = array("<b>$strs->course:</b>", format_string($course->shortname));
$table->data[] = array("<b>$strs->status:</b>", "<font style='color:$color'>" . $authstrs->{$status->status} . "</font>");
if ($order->paymentmethod == AN_METHOD_CC) {
$table->data[] = array("<b>$authstrs->nameoncard:</b>", $order->ccname);
}
else {
$table->data[] = array("<b><font color='red'>$strs->error:</font></b>",
- "Error while trying to enrol ".fullname($user)." in '$course->shortname'");
+ "Error while trying to enrol ".fullname($user)." in '" . format_string($course->shortname) . "'");
}
}
else {
if ($to_prune) {
foreach ($to_prune as $role_assignment) {
if (role_unassign($role->id, $role_assignment->userid, 0, $role_assignment->contextid)){
- print "Unassigned {$role->shortname} assignment #{$role_assignment->id} for course {$course->id} ({$course->shortname}); user {$role_assignment->userid}\n";
+ print "Unassigned {$role->shortname} assignment #{$role_assignment->id} for course {$course->id} (" . format_string($course->shortname) . "); user {$role_assignment->userid}\n";
} else {
- print "Failed to unassign {$role->shortname} assignment #{$role_assignment->id} for course {$course->id} ({$course->shortname}); user {$role_assignment->userid}\n";
+ print "Failed to unassign {$role->shortname} assignment #{$role_assignment->id} for course {$course->id} (" . format_string($course->shortname) . "); user {$role_assignment->userid}\n";
}
}
}
}
if (role_assign($role->id, $userid, 0, $context->id, 0, 0, 0, 'database')){
- print "Assigned role {$role->shortname} to user {$userid} in course {$course->id} ({$course->shortname})\n";
+ print "Assigned role {$role->shortname} to user {$userid} in course {$course->id} (" . format_string($course->shortname) . ")\n";
} else {
- print "Failed to assign role {$role->shortname} to user {$userid} in course {$course->id} ({$course->shortname})\n";
+ print "Failed to assign role {$role->shortname} to user {$userid} in course {$course->id} (" . format_string($course->shortname) . ")\n";
}
} // end foreach member
/// get language strings
$str = get_strings(array('enrolments', 'users', 'administration', 'settings'));
-print_header("$site->shortname: $str->enrolments", "$site->fullname",
+print_header("$site->shortname: $str->enrolments", $site->fullname,
"<a href=\"../../$CFG->admin/index.php\">$str->administration</a> ->
$str->enrolments -> IMS import");
getElementById('allowedcoursesform').addcategories.selectedIndex=-1;" >
<?php
foreach ($allowedcategories as $category) {
- echo "<option value=\"$category->id\"> $category->name </option>\n";
+ echo "<option value=\"$category->id\"> " . format_string($category->name) . " </option>\n";
}
?>
</select>
getElementById('allowedcoursesform').removecategories.selectedIndex=-1;">
<?php
foreach ($potentialcategories as $category) {
- echo "<option value=\"$category->id\"> $category->name </option>\n";
+ echo "<option value=\"$category->id\"> " . format_string($category->name) . " </option>\n";
}
?>
</select>
getElementById('allowedcoursesform').addcourses.selectedIndex=-1;">
<?php
foreach ($allowedcourses as $course) {
- echo "<option value=\"$course->id\"> $course->shortname </option>\n";
+ echo "<option value=\"$course->id\"> " . format_string($course->shortname) . " </option>\n";
}
?>
</select>
getElementById('allowedcoursesform').removecourses.selectedIndex=-1;">
<?php
foreach ($potentialcourses as $course) {
- echo "<option value=\"$course->id\"> $course->shortname </option>\n";
+ echo "<option value=\"$course->id\"> " . format_string($course->shortname) . " </option>\n";
}
?>
</select>
$teacher = get_teacher($course->id);
if (!empty($CFG->enrol_mailstudents)) {
- $a->coursename = "$course->fullname";
+ $a->coursename = $course->fullname;
$a->profileurl = "$CFG->wwwroot/user/view.php?id=$user->id";
email_to_user($user, $teacher, get_string("enrolmentnew", '', $course->shortname),
get_string('welcometocoursetext', '', $a));
}
if (!empty($CFG->enrol_mailteachers)) {
- $a->course = "$course->fullname";
+ $a->course = $course->fullname;
$a->user = fullname($user);
email_to_user($teacher, $user, get_string("enrolmentnew", '', $course->shortname),
get_string('enrolmentnewuser', '', $a));
}
if (!empty($CFG->enrol_mailadmins)) {
- $a->course = "$course->fullname";
+ $a->course = $course->fullname;
$a->user = fullname($user);
$admins = get_admins();
foreach ($admins as $admin) {
}
} else {
- print_header("$course->shortname: $strfiles", "$course->fullname",
+ print_header("$course->shortname: $strfiles", $course->fullname,
"<a href=\"../course/view.php?id=$course->id\">$course->shortname".
"</a> -> $fullnav", $formfield);
}
$group = get_current_group($course->id);
- print_header("$course->shortname: ".get_string('grades'), "$course->fullname", grade_nav($course, $action));
+ print_header("$course->shortname: ".get_string('grades'), $course->fullname, grade_nav($course, $action));
grade_preferences_menu($action, $course, $group);
}
}
else {
- echo '<center><font color="red">'.get_string('nonumericweight','grades').$category->name.': "'.$submitted_category.'"</font></center><br />';
+ echo '<center><font color="red">'.get_string('nonumericweight','grades').
+ format_string($category->name) .': "'.$submitted_category.'"</font></center><br />';
}
}
}
if ($category->name == UNCATEGORISED) {
$category->name = get_string(UNCATEGORISED, 'grades');
}
- echo '<tr><td align="center" class="generalboxcontent">'.$category->name.'</td>';
+ echo '<tr><td align="center" class="generalboxcontent">'. format_string($category->name) .'</td>';
echo '<td align="center" class="generalboxcontent"><input type="text" size="5" name="'.$form_catname.'" value="'.$val.'" /></td>';
echo '<td align="center" class="generalboxcontent"><input type="text" size="5" name="drop_x_lowest'.$form_catname.'" value="'.$category->drop_x_lowest.'" /></td>';
echo '<td align="center" class="generalboxcontent"><input type="text" size="5" name="bonus_points'.$form_catname.'" value="'.$category->bonus_points.'" /></td>';
$category->name = get_string('uncategorised', 'grades');
}
if ($category->id == $id_selected) {
- echo '<option value="'.$category->id.'" selected="selected">'.$category->name.'</option>';
+ echo '<option value="'.$category->id.'" selected="selected">'. format_string($category->name) .'</option>';
}
else {
- echo '<option value="'.$category->id.'">'.$category->name.'</option>';
+ echo '<option value="'.$category->id.'">'. format_string($category->name) .'</option>';
}
}
}
$groupname = groups_get_group_displayname($groupid);
print_header("$course->shortname: $strgroups",
- "$course->fullname",
+ $course->fullname,
"<a href=\"$CFG->wwwroot/course/view.php?id=$courseid\">$course->shortname</a> ".
"-> <a href=\"$CFG->wwwroot/user/index.php?id=$courseid\">$strparticipants</a> ".
"-> $strgroups", '', '', true, '', user_login_string($course, $USER));
/// Print the page and form
print_header("$course->shortname: ". $strheading,
- "$course->fullname",
+ $course->fullname,
"<a href=\"$CFG->wwwroot/course/view.php?id=$courseid\">$course->shortname</a> ".
"-> <a href=\"$CFG->wwwroot/user/index.php?id=$courseid\">$strparticipants</a> ".
"-> $strgroups", '', '', true, '', user_login_string($course, $USER));
/// Print the page and form
print_header("$course->shortname: $strgroups",
- "$course->fullname",
+ $course->fullname,
"<a href=\"$CFG->wwwroot/course/view.php?id=$courseid\">$course->shortname</a> ".
"-> <a href=\"$CFG->wwwroot/user/index.php?id=$courseid\">$strparticipants</a> ".
"-> $strgroups", '', '', true, '', user_login_string($course, $USER));
$strparticipants = get_string('participants');
// Print the page and form
print_header("$course->shortname: $strgroups",
- "$course->fullname",
+ $course->fullname,
"<a href=\"$CFG->wwwroot/course/view.php?id=$courseid\">$course->shortname</a> ".
"-> <a href=\"$CFG->wwwroot/user/index.php?id=$courseid\">$strparticipants</a> ".
"-> $strgroups", "", "", true, '', user_login_string($course, $USER));
// Print the page and form
$strgroups = get_string('groups');
$strparticipants = get_string('participants');
- print_header("$course->shortname: $strgroups", "$course->fullname",
+ print_header("$course->shortname: $strgroups", $course->fullname,
"<a href=\"$CFG->wwwroot/course/view.php?id=$courseid\">$course->shortname</a> ".
"-> <a href=\"$CFG->wwwroot/user/index.php?id=$courseid\">$strparticipants</a> ".
"-> <a href=\"$CFG->wwwroot/group/groupui/index.php?id=$courseid\">$strgroups</a>".
$strparticipants = get_string('participants');
print_header("$course->shortname: $strgroups home", //TODO: home
- "$course->fullname",
+ $course->fullname,
"<a href=\"$CFG->wwwroot/course/view.php?id=$courseid\">$course->shortname</a> ".
"-> <a href=\"$CFG->wwwroot/user/index.php?id=$courseid\">$strparticipants</a> ".
"-> $strgroups", '', '', true, '', user_login_string($course, $USER));
//TODO: eventually we'll implement all buttons, meantime hide the ones we haven't finised.
$shownotdone = false;
- print_heading($course->shortname.' '.$strgroups, 'center', 3);
+ print_heading(format_string($course->shortname) .' '.$strgroups, 'center', 3);
?>
<form id="groupeditform" action="index.php" method="post">
<div>
case CONTEXT_COURSECAT: // Coursecat -> coursecat or site
if ($category = get_record('course_categories', 'id', $context->instanceid)) {
- $name = get_string('category').': '.$category->name;
+ $name = get_string('category').': '. format_string($category->name);
}
break;
case CONTEXT_COURSE: // 1 to 1 to course cat
if ($course = get_record('course', 'id', $context->instanceid)) {
- $name = get_string('course').': '.$course->fullname;
+ $name = get_string('course').': '. format_string($course->fullname);
}
break;
$mod->instance = $news->id;
$mod->section = 0;
if (! $mod->coursemodule = add_course_module($mod) ) {
- notify("Could not add a new course module to the course '$course->fullname'");
+ notify("Could not add a new course module to the course '" . format_string($course->fullname) . "'");
return false;
}
if (! $sectionid = add_mod_to_section($mod) ) {
$mod->instance = $social->id;
$mod->section = 0;
if (! $mod->coursemodule = add_course_module($mod) ) {
- notify("Could not add a new course module to the course '$course->fullname'");
+ notify("Could not add a new course module to the course '" . format_string($course->fullname) . "'");
return false;
}
if (! $sectionid = add_mod_to_section($mod) ) {
$modinfo = serialize(get_array_of_activities($course->id));
if (!set_field("course", "modinfo", $modinfo, "id", $course->id)) {
- notify("Could not cache module information for course '$course->fullname'!");
+ notify("Could not cache module information for course '" . format_string($course->fullname) . "'!");
}
}
}
$modinfo = serialize(get_array_of_activities($course->id));
if (!set_field("course", "modinfo", $modinfo, "id", $course->id)) {
- notify("Could not cache module information for course '$course->fullname'!");
+ notify("Could not cache module information for course '" . format_string($course->fullname) . "'!");
}
}
}
$modinfo = serialize(get_array_of_activities($course->id));
if (!set_field("course", "modinfo", $modinfo, "id", $course->id)) {
- notify("Could not cache module information for course '$course->fullname'!");
+ notify("Could not cache module information for course '" . format_string($course->fullname) . "'!");
}
}
}
if ($courses = get_records_select("course", "category > 0")) {
foreach ($courses as $course) {
- notify("Processing $course->fullname ...", "green");
+ notify("Processing " . format_string($course->fullname) . " ...", "green");
flush();
if ($users = get_records_select("user_teachers", "course = '$course->id'",
"id", "id, userid, timeaccess")) {
$modinfo = serialize(get_array_of_activities($course->id));
if (!set_field("course", "modinfo", $modinfo, "id", $course->id)) {
- notify("Could not cache module information for course '$course->fullname'!");
+ notify("Could not cache module information for course '" . format_string($course->fullname) . "'!");
}
}
}
if ($courses = get_records_select("course", "category > 0")) {
foreach ($courses as $course) {
- notify("Processing $course->fullname ...", "green");
+ notify("Processing " . format_string($course->fullname) . " ...", "green");
flush();
if ($users = get_records_select("user_teachers", "course = '$course->id'",
"id", "id, userid, timeaccess")) {
case 1: /// Guests always allowed
if (!has_capability('moodle/course:view', $context)) { // Prohibited by capability
print_header_simple();
- notice(get_string('guestsnotallowed', '', $COURSE->fullname), "$CFG->wwwroot/login/index.php");
+ notice(get_string('guestsnotallowed', '', format_string($COURSE->fullname)), "$CFG->wwwroot/login/index.php");
}
if (!empty($cm) and !$cm->visible) { // Not allowed to see module, send to course page
redirect($CFG->wwwroot.'/course/view.php?id='.$cm->course,
default: /// Guests not allowed
print_header_simple('', '', get_string('loggedinasguest'));
if (empty($USER->switchrole[$context->id])) { // Normal guest
- notice(get_string('guestsnotallowed', '', $COURSE->fullname), "$CFG->wwwroot/login/index.php");
+ notice(get_string('guestsnotallowed', '', format_string($COURSE->fullname)), "$CFG->wwwroot/login/index.php");
} else {
- notify(get_string('guestsnotallowed', '', $COURSE->fullname));
+ notify(get_string('guestsnotallowed', '', format_string($COURSE->fullname)));
echo '<div class="notifyproblem">'.switchroles_form($COURSE->id).'</div>';
print_footer($COURSE);
exit;
}
if (!empty($course->welcomemessage)) {
- $subject = get_string('welcometocourse', '', $course->fullname);
+ $subject = get_string('welcometocourse', '', format_string($course->fullname));
$a->coursename = $course->fullname;
$a->profileurl = "$CFG->wwwroot/user/view.php?id=$USER->id&course=$course->id";
if (!isset($course->shortname)) {
$course->shortname = 'id=' . $course->id;
}
- $concat->name = get_string('savedfromdeletedcourse', 'quiz', $course->shortname);
+ $concat->name = get_string('savedfromdeletedcourse', 'quiz', format_string($course->shortname));
$concat->info = $concat->name;
$concat->publish = 1;
$concat->stamp = make_unique_id_code();
--- /dev/null
+<?php
+/**
+ * Unit tests for (some of) ../weblib.php.
+ *
+ * @copyright © 2006 The Open University
+ * @author T.J.Hunt@open.ac.uk
+ * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
+ * @package moodlecore
+ */
+
+/** */
+require_once(dirname(__FILE__) . '/../../config.php');
+
+global $CFG;
+require_once($CFG->libdir . '/simpletestlib.php');
+require_once($CFG->libdir . '/weblib.php');
+
+class web_test extends UnitTestCase {
+
+ function setUp() {
+ }
+
+ function tearDown() {
+ }
+
+ function test_format_string() {
+ $this->assertEqual(format_string("& &&&&& &&"), "& &&&&& &&");
+ $this->assertEqual(format_string("ANother & &&&&& Category"), "ANother & &&&&& Category");
+ $this->assertEqual(format_string("ANother & &&&&& Category", true), "ANother & &&&&& Category");
+ $this->assertEqual(format_string("Nick's Test Site & Other things", true), "Nick's Test Site & Other things");
+ }
+}
+?>
function format_string ($string, $striplinks = false, $courseid=NULL ) {
global $CFG, $COURSE;
-
+
+ // First replace all ampersands not followed html entity code
+ $string = preg_replace("/\&(?![a-z0-9]{1,8};)/", "&", $string);
+
//We'll use a in-memory cache here to speed up repeated strings
static $strcache = false;
//Store to cache
$strcache[$md5] = $string;
-
+
+
return $string;
}
$usexml=false, $bodytags='', $return=false) {
global $USER, $CFG, $THEME, $SESSION, $ME, $SITE, $COURSE;
-
+
+ $heading = format_string($heading); // Fix for MDL-8582
+
/// This makes sure that the header is never repeated twice on a page
if (defined('HEADER_PRINTED')) {
debugging('print_header() was called more than once - this should not happen. Please check the code for this page closely. Note: error() and redirect() are now safe to call after print_header().');
$bodytags .= ' class="'.$pageclass.'" id="'.$pageid.'"';
ob_start();
- $title = s($title); // fix for MDL-8582
+
+ $title = format_string($title); // fix for MDL-8582
include($CFG->header);
$output = ob_get_contents();
ob_end_clean();
$shortname ='';
if ($COURSE->id != SITEID) {
- $shortname = '<a href="'.$CFG->wwwroot.'/course/view.php?id='. $COURSE->id .'">'. s($COURSE->shortname) .'</a> ->';
+ $shortname = '<a href="'.$CFG->wwwroot.'/course/view.php?id='. $COURSE->id .'">'. $COURSE->shortname .'</a> ->';
}
- $output = print_header(s($COURSE->shortname) .': '. s($title), s($COURSE->fullname) .' '. s($heading), $shortname.' '. $navigation, $focus, $meta,
+ $output = print_header($COURSE->shortname .': '. $title, $COURSE->fullname .' '. $heading, $shortname.' '. $navigation, $focus, $meta,
$cache, $button, $menu, $usexml, $bodytags, true);
if ($return) {
$home = true;
} else {
$homelink = '<div class="homelink"><a '.$CFG->frametarget.' href="'.$CFG->wwwroot.
- '/course/view.php?id='.$course->id.'">'.s($course->shortname).'</a></div>';
+ '/course/view.php?id='.$course->id.'">'.format_string($course->shortname).'</a></div>';
$home = false;
}
} else {
}
if ($navigation) {
- //Accessibility: breadcrumb links now in a list, » replaced with a 'silent' character.
- $nav_text = get_string('youarehere','access');
- $output .= '<h2 class="accesshide">'.$nav_text."</h2><ul>\n";
+
+ if (!is_array($navigation)) {
+ $ar = explode('->', $navigation);
+ $navigation = array();
+
+ foreach ($ar as $a) {
+ if (strpos($a, '</a>') === false) {
+ $navigation[trim(format_string($a))] = '';
+ } else {
+ if (preg_match('/<a.*href="([^"]*)">(.*)<\/a>/', $a, $matches)) {
+ $navigation[trim(format_string($matches[2]))] = $matches[1];
+ }
+ }
+ }
+ }
+
if (! $site = get_site()) {
+ $site = new object();
$site->shortname = get_string('home');
}
-
- $navigation = "<li>$separator ". str_replace('->', "</li>\n<li>$separator", $navigation) ."</li>\n";
- $output .= '<li class="first"><a '.$CFG->frametarget.' onclick="this.target=\''.$CFG->framename.'\'" href="'. $CFG->wwwroot.((!has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID)) && !empty($USER->id) && !empty($CFG->mymoodleredirect) && !isguest())
- ? '/my' : '') .'/">'. $site->shortname ."</a></li>\n". $navigation;
+
+ //Accessibility: breadcrumb links now in a list, » replaced with a 'silent' character.
+ $nav_text = get_string('youarehere','access');
+ $output .= '<h2 class="accesshide">'.$nav_text."</h2><ul>\n";
+
+ $output .= '<li class="first"><a '.$CFG->frametarget.' onclick="this.target=\''.$CFG->framename.'\'" href="'
+ .$CFG->wwwroot.((!has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID))
+ && !empty($USER->id) && !empty($CFG->mymoodleredirect) && !isguest())
+ ? '/my' : '') .'/">'. format_string($site->shortname) ."</a></li>\n";
+
+
+ foreach ($navigation as $title=>$url) {
+ $title = strip_tags(format_string($title));
+ if (empty($url)) {
+ $output .= '<li class="first">'."$separator $title</li>\n";
+ } else {
+ $output .= '<li class="first">' . $separator . ' <a '.$CFG->frametarget.' onclick="this.target=\''.$CFG->framename.'\'" href="'
+ .$url.'">'."$title</a></li>\n";
+ }
+ }
+
$output .= "</ul>\n";
}
}
// vim:autoindent:expandtab:shiftwidth=4:tabstop=4:tw=140:
-?>
\ No newline at end of file
+?>
/// Header on this page
if ($tab == 'contacts') {
- print_header(get_string('messages', 'message').' - '.$SITE->fullname, '', '', '',
+ print_header(get_string('messages', 'message').' - '.format_string($SITE->fullname), '', '', '',
'<meta http-equiv="refresh" content="'. $CFG->message_contacts_refresh .'; url=index.php" />');
} else {
- print_header(get_string('messages', 'message').' - '.$SITE->fullname);
+ print_header(get_string('messages', 'message').' - '.format_string($SITE->fullname));
}
echo '<table cellspacing="2" cellpadding="2" border="0" align="center" width="95%">';
course_setup($course);
if (!has_capability('moodle/course:view', get_context_instance(CONTEXT_COURSE, $submission->course), $user->id)) {
- echo fullname($user)." not an active participant in $course->shortname\n";
+ echo fullname($user)." not an active participant in " . format_string($course->shortname) . "\n";
continue;
}
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>
- <?php echo "$strchat: $course->shortname: ".format_string($chat->name,true)."$groupname" ?>
+ <?php echo "$strchat: " . format_string($course->shortname) . ": ".format_string($chat->name,true)."$groupname" ?>
</title>
</head>
<frameset cols="*,200" border="5" framespacing="no" frameborder="yes" marginwidth="2" marginheight="1">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>
- <?php echo "$strchat: $course->shortname: ".format_string($chat->name,true)."$groupname" ?>
+ <?php echo "$strchat: " . format_string($course->shortname) . ": ".format_string($chat->name,true)."$groupname" ?>
</title>
</head>
<frameset cols="*,200" border="5" framespacing="no" frameborder="yes" marginwidth="2" marginheight="1">
echo '<p align="center">'. get_string('noguestchoose', 'choice') .'</p>';
echo '<div class="continuebutton">';
print_single_button($CFG->wwwroot.'/course/enrol.php?id='.$course->id, NULL,
- get_string('enrolme', '', $course->shortname), 'post', $CFG->framename);
+ get_string('enrolme', '', format_string($course->shortname)), 'post', $CFG->framename);
echo '</div>'."\n";
print_simple_box_end();
if (!empty($CFG->enablerssfeeds) && !empty($CFG->data_enablerssfeeds) && $data->rssarticles > 0) {
$rsspath = rss_get_url($course->id, $USER->id, 'data', $data->id);
$meta .= '<link rel="alternate" type="application/rss+xml" ';
- $meta .= 'title ="'.$course->shortname.': %fullname%" href="'.$rsspath.'" />';
+ $meta .= 'title ="'. format_string($course->shortname) .': %fullname%" href="'.$rsspath.'" />';
}
if ($data->csstemplate) {
$meta .= '<link rel="stylesheet" type="text/css" href="'.$CFG->wwwroot.'/mod/data/css.php?d='.$data->id.'" /> ';
if (!empty($CFG->enablerssfeeds) && !empty($CFG->data_enablerssfeeds) && $data->rssarticles > 0) {
$rsspath = rss_get_url($course->id, $USER->id, 'data', $data->id);
$meta .= '<link rel="alternate" type="application/rss+xml" ';
- $meta .= 'title ="'.$course->shortname.': %fullname%" href="'.$rsspath.'" />';
+ $meta .= 'title ="'. format_string($course->shortname) .': %fullname%" href="'.$rsspath.'" />';
}
if ($data->csstemplate) {
$meta .= '<link rel="stylesheet" type="text/css" href="'.$CFG->wwwroot.'/mod/data/css.php?d='.$data->id.'" /> ';
$searchform = forum_search_form($course);
if ($course->id != SITEID) {
- print_header("$course->shortname: ".format_string($discussion->name), "$course->fullname",
+ print_header("$course->shortname: ".format_string($discussion->name), $course->fullname,
"<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> ->
$navmiddle $navtail", "", "", true, $searchform, navmenu($course, $cm));
} else {
- print_header("$course->shortname: ".format_string($discussion->name), "$course->fullname",
+ print_header("$course->shortname: ".format_string($discussion->name), $course->fullname,
"$navmiddle $navtail", "", "", true, $searchform, navmenu($course, $cm));
}
$returnto = forum_go_back_to("index.php?id=$course->id");
if ($subscribe) {
add_to_log($course->id, "forum", "subscribeall", "index.php?id=$course->id", $course->id);
- redirect($returnto, get_string("nowallsubscribed", "forum", $course->shortname), 1);
+ redirect($returnto, get_string("nowallsubscribed", "forum", format_string($course->shortname)), 1);
} else {
add_to_log($course->id, "forum", "unsubscribeall", "index.php?id=$course->id", $course->id);
- redirect($returnto, get_string("nowallunsubscribed", "forum", $course->shortname), 1);
+ redirect($returnto, get_string("nowallunsubscribed", "forum", format_string($course->shortname)), 1);
}
}
/// Output the page
if ($course->id != SITEID) {
- print_header("$course->shortname: $strforums", "$course->fullname",
+ print_header("$course->shortname: $strforums", $course->fullname,
"<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> -> $strforums",
"", "", true, $searchform, navmenu($course));
} else {
- print_header("$course->shortname: $strforums", "$course->fullname", "$strforums",
+ print_header("$course->shortname: $strforums", $course->fullname, "$strforums",
"", "", true, $searchform, navmenu($course));
}
$mod->instance = $forum->id;
$mod->section = 0;
if (! $mod->coursemodule = add_course_module($mod) ) { // assumes course/lib.php is loaded
- notify("Could not add a new course module to the course '$course->fullname'");
+ notify("Could not add a new course module to the course '" . format_string($course->fullname) . "'");
return false;
}
if (! $sectionid = add_mod_to_section($mod) ) { // assumes course/lib.php is loaded
}
if ($course->id != SITEID) {
print_header("$course->shortname: $strdiscussionname ".
- format_string($toppost->subject), "$course->fullname",
+ format_string($toppost->subject), $course->fullname,
"<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> ->
$navmiddle $navtail", $mform_post->focus(), "", true, "", navmenu($course, $cm));
} else {
print_header("$course->shortname: $strdiscussionname ".
- format_string($toppost->subject), "$course->fullname",
+ format_string($toppost->subject), $course->fullname,
"$navmiddle $navtail", $mform_post->focus(), "", true, "", navmenu($course, $cm));
}
$fullname = fullname($user, has_capability('moodle/site:viewfullnames', $syscontext));
if ($course->id != SITEID) {
- print_header("$course->shortname: $fullname: $strmode", "$course->fullname",
+ print_header("$course->shortname: $fullname: $strmode", $course->fullname,
"<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a> ->
<a href=\"$CFG->wwwroot/user/index.php?id=$course->id\">$strparticipants</a> ->
<a href=\"$CFG->wwwroot/user/view.php?id=$user->id&course=$course->id\">$fullname</a> ->
$strforumposts -> $strmode");
} else {
- print_header("$course->shortname: $fullname: $strmode", "$course->fullname",
+ print_header("$course->shortname: $fullname: $strmode", $course->fullname,
"<a href=\"$CFG->wwwroot/user/view.php?id=$user->id&course=$course->id\">$fullname</a> ->
$strforumposts -> $strmode");
}
require_login($course->id);
}
- print_header("$course->shortname: ".format_string($glossary->name), "$course->fullname",
+ print_header("$course->shortname: ".format_string($glossary->name), $course->fullname,
"$navigation <a href=\"index.php?id=$course->id\">$strglossaries</a> -> ".format_string($glossary->name),
"", "", true, update_module_button($cm->id, $course->id, $strglossary),
navmenu($course, $cm));
$site = get_record("course","id",1);
echo '<p align="right"><font size="-1">' . userdate(time()) . '</font></p>';
- echo get_string("site") . ': <strong>' . $site->fullname . '</strong><br />';
- echo get_string("course") . ': <strong>' . $course->fullname . ' ('. $course->shortname . ')</strong><br />';
+ echo get_string("site") . ': <strong>' . format_string($site->fullname) . '</strong><br />';
+ echo get_string("course") . ': <strong>' . format_string($course->fullname) . ' ('. format_string($course->shortname) . ')</strong><br />';
echo get_string("modulename","glossary") . ': <strong>' . format_string($glossary->name, true) . '</strong>';
if ( $allentries ) {
foreach ($allentries as $entry) {
$CFG->framename = "newwindow";
if ($course->id != SITEID) {
- print_header(strip_tags("$course->shortname: $strglossaries $strsearch"), "$course->fullname",
+ print_header(strip_tags("$course->shortname: $strglossaries $strsearch"), $course->fullname,
"<a target=\"newwindow\" href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a> -> $strglossaries -> $strsearch", "", "", true, " ", " ");
} else {
- print_header(strip_tags("$course->shortname: $strglossaries $strsearch"), "$course->fullname",
+ print_header(strip_tags("$course->shortname: $strglossaries $strsearch"), $course->fullname,
"$strglossaries -> $strsearch", "", "", true, " ", " ");
}
// Print the header
- $title = "$course->shortname: $strmodulenameplural";
- $heading = "$course->fullname";
- $navigation = "$strmodulenameplural";
+ $title = format_string($course->shortname) . ": $strmodulenameplural";
+ $heading = $course->fullname;
+ $navigation = $strmodulenameplural;
if ($course->id != SITEID) {
$navigation = "<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> -> $navigation";
}
$strmodulenameplural = get_string("modulenameplural", "hotpot");
$strmodulename = get_string("modulename", "hotpot");
- $title = "$course->shortname: $hotpot->name";
- $heading = "$course->fullname";
+ $title = format_string($course->shortname) . ": $hotpot->name";
+ $heading = $course->fullname;
$navigation = "<a href=index.php?id=$course->id>$strmodulenameplural</a> -> ";
$navigation .= "<a href=\"view.php?id=$cm->id\">$hotpot->name</a> -> ";
$strmodulenameplural = get_string("modulenameplural", "hotpot");
$strmodulename = get_string("modulename", "hotpot");
// print header
- $title = "$course->shortname: $hotpot->name";
- $heading = "$course->fullname";
+ $title = format_string($course->shortname) . ": $hotpot->name";
+ $heading = $course->fullname;
$navigation = "<a href=\"index.php?id=$course->id\">$strmodulenameplural</a> -> ".get_string("review", "quiz");
if ($course->id != SITEID) {
$navigation = "<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> -> $navigation";
// set nextpage (for error messages)
$nextpage = "$CFG->wwwroot/course/view.php?id=$course->id";
// header strings
- $title = strip_tags($course->shortname.': '.$hotpot->name);
- $heading = "$course->fullname";
+ $title = format_string($course->shortname.': '.$hotpot->name, true);
+ $heading = $course->fullname;
$navigation = '<a '.$CFG->frametarget.' href="'.$CFG->wwwroot.'/mod/hotpot/index.php?id='.$course->id.'">'.get_string("modulenameplural", "hotpot")."</a> -> $hotpot->name";
if ($course->id != SITEID) {
$navigation = '<a '.$CFG->frametarget.' href="'.$CFG->wwwroot.'/course/view.php?id='.$course->id.'">'.$course->shortname.'</a> -> '.$navigation;
$navigation = "<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> ->";
}
- print_header("$course->shortname: $strlamss", "$course->fullname", "$navigation $strlamss", "", "", true, "", navmenu($course));
+ print_header("$course->shortname: $strlamss", $course->fullname, "$navigation $strlamss", "", "", true, "", navmenu($course));
/// Get all the appropriate data
$navigation = '';
}
- print_header("$course->shortname: $strlessons", "$course->fullname", "$navigation $strlessons", "", "", true, "", navmenu($course));
+ print_header("$course->shortname: $strlessons", $course->fullname, "$navigation $strlessons", "", "", true, "", navmenu($course));
/// Get all the appropriate data
$strsummary = get_string("summary");
$strlastmodified = get_string("lastmodified");
- print_header("$course->shortname: $strresources", "$course->fullname", "$navigation $strresources",
+ print_header("$course->shortname: $strresources", $course->fullname, "$navigation $strresources",
"", "", true, "", navmenu($course));
if (! $resources = get_all_instances_in_course("resource", $course)) {
echo "<html dir=\"ltr\">\n";
echo '<head>';
echo '<meta http-equiv="content-type" content="text/html; charset=utf-8" />';
- echo "<title>{$course->shortname}: ".strip_tags(format_string($resource->name,true))."</title></head>\n";
+ echo "<title>" . format_string($course->shortname) . ": ".strip_tags(format_string($resource->name,true))."</title></head>\n";
echo "<frameset rows=\"$CFG->resource_framesize,*\">";
echo "<frame src=\"view.php?id={$cm->id}&type={$resource->type}&frameset=top\" title=\"".get_string('modulename','resource')."\"/>";
if (!empty($localpath)) { // Show it like this so we interpose some HTML
echo "<html dir=\"ltr\">\n";
echo '<head>';
echo '<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />';
- echo "<title>{$course->shortname}: ".strip_tags(format_string($resource->name,true))."</title></head>\n";
+ echo "<title>" . format_string($course->shortname) . ": ".strip_tags(format_string($resource->name,true))."</title></head>\n";
echo "<frameset rows=\"$CFG->resource_framesize,*\">";
echo "<frame src=\"view.php?id={$cm->id}&type={$resource->type}&frameset=top\" title=\"".get_string('modulename','resource')."\"/>";
if (!empty($localpath)) { // Show it like this so we interpose some HTML
$pagetitle = strip_tags("$course->shortname: ".format_string($scorm->name));
if (!$cm->visible and !has_capability('moodle/course:viewhiddenactivities', get_context_instance(CONTEXT_COURSE,$course->id))) {
- print_header($pagetitle, "$course->fullname",
+ print_header($pagetitle, $course->fullname,
"$navigation <a $CFG->frametarget href=\"view.php?id=$cm->id\">".format_string($scorm->name,true)."</a>",
'', '', true, update_module_button($cm->id, $course->id, $strscorm), '', false);
notice(get_string("activityiscurrentlyhidden"));
$bodyscript = 'onunload="main.close();"';
}
$exitlink = '(<a href="'.$CFG->wwwroot.'/course/view.php?id='.$cm->course.'">'.get_string('exit','scorm').'</a>) ';
- print_header($pagetitle, "$course->fullname",
+ print_header($pagetitle, $course->fullname,
"$navigation <a $CFG->frametarget href=\"view.php?id=$cm->id\">".format_string($scorm->name,true)."</a>",
'', '', true, $exitlink.update_module_button($cm->id, $course->id, $strscorm), '', false, $bodyscript);
if ($sco->scormtype == 'sco') {
$strname = get_string('name');
if (empty($b)) {
if (empty($a)) {
- print_header("$course->shortname: ".format_string($scorm->name), "$course->fullname",
+ print_header("$course->shortname: ".format_string($scorm->name), $course->fullname,
"$navigation <a href=\"index.php?id=$course->id\">$strscorms</a>
-> <a href=\"view.php?id=$cm->id\">".format_string($scorm->name,true)."</a> -> $strreport",
'', '', true);
} else {
- print_header("$course->shortname: ".format_string($scorm->name), "$course->fullname",
+ print_header("$course->shortname: ".format_string($scorm->name), $course->fullname,
"$navigation <a href=\"index.php?id=$course->id\">$strscorms</a>
-> <a href=\"view.php?id=$cm->id\">".format_string($scorm->name,true)."</a>
-> <a href=\"report.php?id=$cm->id\">$strreport</a> -> $strattempt $attempt - ".fullname($userdata),
'', '', true);
}
} else {
- print_header("$course->shortname: ".format_string($scorm->name), "$course->fullname",
+ print_header("$course->shortname: ".format_string($scorm->name), $course->fullname,
"$navigation <a href=\"index.php?id=$course->id\">$strscorms</a>
-> <a href=\"view.php?id=$cm->id\">".format_string($scorm->name,true)."</a>
-> <a href=\"report.php?id=$cm->id\">$strreport</a>
//
// Print the page header
//
- print_header($pagetitle, "$course->fullname",
+ print_header($pagetitle, $course->fullname,
"$navigation <a $CFG->frametarget href=\"view.php?id=$cm->id\">".format_string($scorm->name,true)."</a>",
'', '', true, update_module_button($cm->id, $course->id, $strscorm), navmenu($course, $cm));
<a href=\"view.php?id=$cm->id\">".format_string($survey->name,true)."</a> -> ";
}
- print_header("$course->shortname: ".format_string($survey->name), "$course->fullname", "$navigation $strreport",
+ print_header("$course->shortname: ".format_string($survey->name), $course->fullname, "$navigation $strreport",
"", "", true,
update_module_button($cm->id, $course->id, $strsurvey), navmenu($course, $cm));
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">\n";
echo "<html $direction>\n";
echo "<head><meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n";
- echo "<title>{$course->shortname}: ".format_string($workshop->name,true)."</title></head>\n";
+ echo "<title>" . format_string($course->shortname) . ": ".format_string($workshop->name,true)."</title></head>\n";
echo "<frameset rows=\"50%,*\" border=\"10\">";
echo " <frame src=\"assess.php?id=$id&sid=$sid&frameset=top&redirect=$redirect\" border=\"10\" />";
echo " <frame src=\"assess.php?id=$id&sid=$sid&frameset=bottom&redirect=$redirect\" />";
$edittable->align['category'] = "left";
$edittable->wrap['category'] = "nowrap";
- $row['category'] = '<input type="text" name="updatename" value="' . $category->name . '" size="15" />';
+ $row['category'] = '<input type="text" name="updatename" value="' . format_string($category->name) . '" size="15" />';
$edittable->align['info'] = "left";
$edittable->wrap['info'] = "nowrap";
error("No such category $destcategoryid!", "category.php?id={$this->course->id}");
}
if (! set_field('question', 'category', $destcategoryid, 'category', $deletecat)) {
- error("Error while moving questions from category '$category->name' to '$category2->name'", "category.php?id={$this->course->id}");
+ error("Error while moving questions from category '" . format_string($category->name) . "' to '$category2->name'", "category.php?id={$this->course->id}");
}
} else {
/// Finally delete the category itself
if (delete_records("question_categories", "id", $category->id)) {
- notify(get_string("categorydeleted", "quiz", $category->name), 'notifysuccess');
+ notify(get_string("categorydeleted", "quiz", format_string($category->name)), 'notifysuccess');
}
}
-> <a href=\"view.php?id=$user->id&course=$course->id\">$userfullname</a>
-> $streditmyprofile", "");
} else {
- print_header("$course->shortname: $streditmyprofile", "$course->fullname",
+ print_header("$course->shortname: $streditmyprofile", $course->fullname,
"<a href=\"view.php?id=$user->id&course=$course->id\">$userfullname</a>
-> $streditmyprofile", "");
}
-> <a href=\"view.php?id=$user->id&course=$course->id\">$userfullname</a>
-> $streditmyprofile", "");
} else {
- print_header("$course->shortname: $streditmyprofile", "$course->fullname",
+ print_header("$course->shortname: $streditmyprofile", $course->fullname,
"<a href=\"view.php?id=$user->id&course=$course->id\">$userfullname</a>
-> $streditmyprofile", "");
}
if (empty($id)) {
$strheading = get_string('profilecreatenewcategory', 'admin');
} else {
- $strheading = get_string('profileeditcategory', 'admin', $category->name);
+ $strheading = get_string('profileeditcategory', 'admin', format_string($category->name));
}
/// Print the page
}
}
- print_heading($category->name.' '.profile_category_icons($category));
+ print_heading(format_string($category->name) .' '.profile_category_icons($category));
if (count($table->data)) {
print_table($table);
} else {
if ($filtertype == 'site') {
$site = get_site();
- print_heading($site->fullname);
+ print_heading(format_string($site->fullname));
if ($CFG->bloglevel >= 4) {
if (has_capability('moodle/course:viewparticipants', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
} else if ($filtertype == 'course' && $filterselect) {
$course = get_record('course','id',$filterselect);
- print_heading($course->fullname);
+ print_heading(format_string($course->fullname));
if ($CFG->bloglevel >= 3) {
<a href=\"index.php?id=$course->id\">$strparticipants</a> -> $fullname",
"", "", true, " ", navmenu($course));
} else {
- print_header("$course->fullname: $strpersonalprofile: $fullname", "$course->fullname",
+ print_header("$course->fullname: $strpersonalprofile: $fullname", $course->fullname,
"$fullname", "", "", true, " ", navmenu($course));
}
foreach ($mycourses as $mycourse) {
if ($mycourse->visible and $mycourse->category) {
if ($mycourse->id != $course->id){
- $courselisting .= "<a href=\"$CFG->wwwroot/user/view.php?id=$user->id&course=$mycourse->id\">$mycourse->fullname</a>, ";
+ $courselisting .= "<a href=\"$CFG->wwwroot/user/view.php?id=$user->id&course=$mycourse->id\">"
+ . format_string($mycourse->fullname) . "</a>, ";
}
else {
- $courselisting .= "$mycourse->fullname, ";
+ $courselisting .= format_string($mycourse->fullname) . ", ";
}
}
$shown++;