]> git.mjollnir.org Git - moodle.git/commitdiff
Merged Nicolas' changes from MDL-8582 into HEAD.
authormoodler <moodler>
Wed, 28 Feb 2007 06:25:22 +0000 (06:25 +0000)
committermoodler <moodler>
Wed, 28 Feb 2007 06:25:22 +0000 (06:25 +0000)
99 files changed:
admin/handlevirus.php
admin/mnet/enr_course_enrol.php
admin/mnet/enr_courses.php
admin/oacleanup.php
admin/process_email.php
admin/register.php
admin/roles/assign.php
admin/roles/override.php
admin/roles/tabs.php
auth/cas/forbidden.php
auth/cas/login.php
auth/mnet/auth.php
backup/backup.php
backup/restore_check.html
backup/restorelib.php
backup/try.php
blocks/admin/block_admin.php
blocks/course_list/block_course_list.php
course/category.php
course/delete.php
course/edit.php
course/grade.php
course/grades.php
course/groups.php
course/import/activities/index.php
course/import/groups/index.php
course/importstudents.php
course/index.php
course/info.php
course/lib.php
course/pending.php
course/recent.php
course/report/log/index.php
course/report/log/lib.php
course/report/outline/index.php
course/report/participation/index.php
course/report/stats/index.php
course/report/stats/report.php
course/scales.php
course/search.php
course/user.php
enrol/authorize/enrol.php
enrol/authorize/locallib.php
enrol/database/enrol.php
enrol/imsenterprise/importnow.php
enrol/mnet/allowed_courses.php
enrol/paypal/ipn.php
files/index.php
grade/exceptions.php
grade/lib.php
group/assign.php
group/group.php
group/grouping.php
group/groupui/index.php
group/groupui/printgrouping.php
group/index.php
lib/accesslib.php
lib/db/mysql.php
lib/db/postgres7.php
lib/moodlelib.php
lib/questionlib.php
lib/simpletest/testweblib.php [new file with mode: 0644]
lib/weblib.php
message/index.php
mod/assignment/lib.php
mod/chat/gui_header_js/index.php
mod/chat/gui_sockets/index.php
mod/choice/view.php
mod/data/edit.php
mod/data/view.php
mod/forum/discuss.php
mod/forum/index.php
mod/forum/lib.php
mod/forum/post.php
mod/forum/user.php
mod/glossary/export.php
mod/glossary/print.php
mod/glossary/showentry.php
mod/hotpot/index.php
mod/hotpot/report.php
mod/hotpot/review.php
mod/hotpot/view.php
mod/lams/index.php
mod/lesson/index.php
mod/resource/index.php
mod/resource/type/file/resource.class.php
mod/resource/type/repository/resource.class.php
mod/scorm/player.php
mod/scorm/report.php
mod/scorm/view.php
mod/survey/report.php
mod/workshop/assess.php
question/category_class.php
user/edit.php
user/editadvanced.php
user/profile/definelib.php
user/profile/index.php
user/tabs.php
user/view.php

index f2b20e2126a3d089ba222963ff28589f013078a1..7a09c1eb672e06d6700ff0696265beb33bae5b29 100644 (file)
@@ -40,7 +40,7 @@ while(!feof($fd)) {
     
     $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;
@@ -78,7 +78,7 @@ function notify_admins_unknown($file,$a) {
     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);
index 906e2280f460800d7ca0fb08885bfd2bd0daa1c2..94af92e1753efeae8b5fac24d210658a32dd9fcf 100644 (file)
@@ -258,7 +258,7 @@ $strsearchresults = get_string('searchresults');
 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"));
 
index 079668f5abf2f3161268326e03ba92e90bd78dcd..f1157dbe1b993d8ec83e3960a9dbb66a129e09e0 100644 (file)
             . "host={$mnethost}&amp;courseid={$course->id}&amp;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>"
index bc603691fb66c9c5705d6ee5daa4c00dadf3a73e..78ac48f39a3bdb5225e5c7178de922a0c4244e54 100644 (file)
@@ -99,7 +99,7 @@ function online_assignment_cleanup($output=false) {
 
                         /// 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;
                         }
 
index 77f72c3f923f6cf3c46852eb32faaaaa7ffa7cda..8e5091abcd0b37ae7028bff04d66b8d7f6729322 100755 (executable)
@@ -16,8 +16,8 @@ if ($_ENV['RECIPIENT'] == $CFG->noreplyaddress) {
     }
     
     $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) {
index 6f5c34c8bf52d7e600682156ffeabfe6246add99..cc142feb752f0f1185cef18f0694f30dedc3a306 100644 (file)
@@ -34,7 +34,7 @@
     $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);
index 24d3a383405c593229718aabf148d12d26901a41..11d1c263cd6909fe8345bdb3cad304e74471ba56 100755 (executable)
 
         /// 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&amp;course=$courseid\">$fullname</a> -> $straction", "", "", true, "&nbsp;", navmenu($course));
         }
 
index a52124f69135cafb90b53616db9ef1618d548200..b94ea7e1cdf7c20258023b6aa17b0f0f6f10189e 100755 (executable)
 
         /// 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&amp;course=$course->id\">$fullname</a> -> $straction", "", "", true, "&nbsp;", navmenu($course));
         }
         $showroles = 1;
index a69baa0101ec382c3217836575d034ee7b7c96e2..f240896af416c457da9de97832ae62021db93949 100755 (executable)
@@ -31,7 +31,7 @@ if ($currenttab != 'update') {
                 $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;
index ce1b8b2dafdbc05ced01e78a8c718df0559f44a1..918261ecf65f0dd8a60505c98d43cabcade2447f 100644 (file)
@@ -10,7 +10,7 @@
     $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;
index d2148b6011564301bf01a8e8c54482d839de7c23..7551bc88c40975f0963f76ee2e9cb81598b49315 100644 (file)
@@ -143,12 +143,12 @@ defined('MOODLE_INTERNAL') or die('Direct access to this script is forbidden.');
             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;
@@ -247,12 +247,12 @@ defined('MOODLE_INTERNAL') or die('Direct access to this script is forbidden.');
         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;
@@ -302,7 +302,7 @@ defined('MOODLE_INTERNAL') or die('Direct access to this script is forbidden.');
         $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();
 
index 9c8c07a394fb90bbf651a7ffffe9ded1c183c6bd..338a9b259bde0b430c22bfd5f3ad9f1a7cb1275c 100644 (file)
@@ -271,7 +271,7 @@ class auth_plugin_mnet
                 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/>";
index f87a6d4aa7dac94189cbd026796045b2bfaa537c..d6a8265df3d7a8a886d96928689d724f0e3e55f5 100644 (file)
@@ -78,7 +78,7 @@
             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
index d28cf701ec39588b905224994571ab11722fff1a..065df0a94b7467e25d528f1b1fe3853f9fefaf18 100644 (file)
                 } 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 {
index 57a4aeffbe3fa7ff2d50d430961a3ef9faa625f9..e4fbc728a1be538aee3245b1a0cfd451d48b0cd9 100644 (file)
                     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 {
index 01e025a47d64d92fb68642a95e24fb4aff183f41..92960c015e641cfb719b28f6c03c75196c6966e7 100644 (file)
 
     $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";
         }
     }
 ?>
index b0b7c5f616dc8e5ae658af937a9bf21077c77949..4ef0a88830720d511e3accc0b109c87f1486c0cc 100644 (file)
@@ -164,10 +164,10 @@ class block_admin extends block_list {
 
         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="" />';
             }
         }
index df9b145ec4185eed7c3df99010011efa337941f1..ba7329c6a83451f1a5b003b23ad0fba0cadde0fa 100644 (file)
@@ -44,8 +44,8 @@ class block_course_list extends block_list {
                         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');
@@ -65,7 +65,7 @@ class block_course_list extends block_list {
             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[] = '';
@@ -83,14 +83,18 @@ class block_course_list extends block_list {
                 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[] = "&nbsp;&nbsp;&nbsp;<a href=\"$CFG->wwwroot/course/index.php\">".get_string("fulllistofcourses")."</a>...";
+                        $this->content->items[] = "&nbsp;&nbsp;&nbsp;<a href=\"$CFG->wwwroot/course/index.php\">"
+                            .get_string("fulllistofcourses")."</a>...";
                     }
                     $this->get_remote_courses();
                 } else {
@@ -123,8 +127,9 @@ class block_course_list extends block_list {
             $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}&amp;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}&amp;wantsurl=/course/view.php?id={$course->remoteid}\">" 
+                    . format_string($course->fullname) . "</a>";
                 $this->content->icons[]=$icon;
             }
             // if we listed courses, we are done
index 25faccaab9a7353f8ad61203823e040204f33d75..f3dd90587fb92a75d824ef133c628c88315fb113 100644 (file)
                 }
                 $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 />";
index 2063d9347a1243410d75d7908300d4b11bd13154..658a1888b20298a575dc390e07e22d53d377fc03 100644 (file)
@@ -37,7 +37,8 @@
                      "<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&amp;delete=".md5($course->timemodified)."&amp;sesskey=$USER->sesskey", 
                      "category.php?id=$course->category");
 
@@ -57,7 +58,7 @@
 
     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> -> ".
@@ -70,7 +71,7 @@
     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");
 
index 61ff051c0e5212daabf1ea155f6f97ed486b8469..771003d75bc7c005d8a791bb028465061791de4e 100644 (file)
@@ -102,11 +102,11 @@ if (!empty($course)) {
     $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());
     }
index 733b1acd6c2c5199ea1c78ab1f5baf9938b8cfaf..48182377b0cc6a20b4c6caffb24eec903c2255de 100644 (file)
@@ -87,7 +87,7 @@
 
 /// 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");
     
index 53efe9573756d3152488e392431dfdaa1e7555fc..64c93076456058fc4e902c0fd601ec003972c5a8 100644 (file)
@@ -31,7 +31,7 @@
 /// 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");
@@ -41,7 +41,7 @@
         }
     } 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");
     
index 5419d1d6eb465ef09f589f4aab9a7437033c066f..98f15c5876ec21697fa38afd3861bc88e9c1281e 100644 (file)
@@ -61,7 +61,7 @@
     $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));
index 4c312d863ee8bcbf2dbc552fde00e464e46901f9..8364871af74c0c4c5592e11961da091ddd32884e 100644 (file)
@@ -54,7 +54,7 @@
         }
     }
     
-    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");
index 3d32f2445e81d45555e5a5e8c2e52b5116a2b7b4..6fa3f6f1f97b8759aa981f8087d029277497fc20 100755 (executable)
@@ -40,7 +40,7 @@
 
 /// 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");
index a49fd179b9e78bac0069b4d5226c6622e154b0cf..d182dde227ddbaf9d217855404ba1a88bcb58240 100644 (file)
@@ -44,7 +44,7 @@
     $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");
 
index b45ba8a409dddd7735352040ea4dd8e05bd32281..338d3bf7d2516edcfdaa4e07869d9701263728bc 100644 (file)
             $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&amp;sure=".md5($deletecat->timemodified)."&amp;sesskey=$USER->sesskey",
                              "index.php?sesskey=$USER->sesskey");
@@ -353,7 +353,7 @@ function print_category_edit($category, $displaylist, $parentslist, $depth=-1, $
         $linkcss = $category->visible ? '' : ' class="dimmed" ';
         echo '<a '.$linkcss.' title="'.$str->edit.'" '.
              ' href="category.php?id='.$category->id.'&amp;categoryedit=on&amp;sesskey='.sesskey().'">'.
-             s($category->name).'</a>';
+             format_string($category->name).'</a>';
         echo '</td>';
 
         echo '<td class="count">'.$category->coursecount.'</td>';
index 11afb81166b0cf0c6abb2a0db857dbf56e2cd190..c30390bd4e033f0d7dacf3e59566604e6bac23ff 100644 (file)
@@ -30,7 +30,7 @@
 
     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) {
index be4779891487319d45fb284c136d96f6661cb78f..42314fa7272537397883370da18e247dcf772db0 100644 (file)
@@ -988,7 +988,7 @@ function print_overview($courses) {
         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;
@@ -1534,7 +1534,7 @@ function rebuild_course_cache($courseid=0) {
         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) . "'!");
             }
         }
     }
@@ -1557,9 +1557,9 @@ function make_categories_list(&$list, &$parents, $category=NULL, $path="") {
 
     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 {
@@ -1678,7 +1678,7 @@ function print_category_info($category, $depth, $files = false) {
 
         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">&nbsp;</td>';
         echo '</tr>';
@@ -1688,7 +1688,7 @@ function print_category_info($category, $depth, $files = false) {
                 $linkcss = $course->visible ? '' : ' class="dimmed" ';
                 echo '<tr><td valign="top">&nbsp;';
                 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.'">';
@@ -1724,7 +1724,7 @@ function print_category_info($category, $depth, $files = false) {
         }
 
         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) {
@@ -1791,7 +1791,7 @@ function print_course($course) {
     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')) {
@@ -1946,10 +1946,10 @@ function print_remote_course($course, $width="100%") {
     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;
@@ -2336,7 +2336,7 @@ function make_editing_buttons($mod, $absolute=false, $moveselect=true, $indent=-
  */
 function course_format_name ($course,$max=100) {
 
-    $str = $course->shortname.': '.$course->fullname;
+    $str = $course->shortname.': '. $course->fullname;
     if (strlen($str) <= $max) {
         return $str;
     }
index c8655b4792bdfd67ff0d0bf65027945cbad66a8e..0f865386a8f2201400245f96f676e1a599c3934d 100644 (file)
             //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.'&amp;sesskey='.sesskey().'">'.get_string('approve').'</a> | '
                                    .'<a href="pending.php?reject='.$course->id.'&amp;sesskey='.sesskey().'">'.get_string('reject').'</a>');
         }
index 173a7b96464fc9a512780b5226ebbc41d96a3c53..af2f60f1aeda72f8eac947a2f0f29208ed447b8e 100644 (file)
             $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);
         }
 
index 8943b2c1241aa8f990fd810a61257ec7e0b9c681..8d7edcc30cbf16398d358976e03123fc0addeb97 100644 (file)
@@ -86,7 +86,7 @@
                                   <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) {
index 380fcfaa219a53933c8facb6d34e1f71b0fc64d3..67fe479cda7e293f093b20549573a0c8d6e82870 100644 (file)
@@ -335,7 +335,7 @@ function print_log_selector_form($course, $selecteduser=0, $selecteddate='today'
         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)";
                 }
index 01752e338516ed50a2e5d61cfcca8b3aea5f1938..c4c45fdfbd9df617a683d21c63b787c2950facb5 100644 (file)
     $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>";
index 818ac2516130405af0e156cc9158c5c8be96f484..5220203ea7a5d175db4881c86f7551e1b3438b28 100644 (file)
     $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");
index ddf11eb5e23eeb5789c3038851bb92f7bdcfa12b..187e815036ea23dcc029c9d93e2ade15f2fbfd36 100644 (file)
 
     $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, '&nbsp;', $menu);
     
     
index f3159a84d4e28d9f0092e4e81ff180fa2846eed5..5cf737e666fd51896c7a0db2b6c909cc145a8eb2 100644 (file)
 
             $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) : ''));
 
index 5838d96cea06f88129dc53df311ce551c01c945b..efbe8cf763cd83449d9c49666aee8556f15d15fc 100644 (file)
         //        $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, "&nbsp;", "&nbsp;");
 
         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");
 
index d8b1667b432c270a25321c27449c40389d9bd5a2..dc1944cab9b07a554961e5e9b56835ed61ea3d98 100644 (file)
                 }
 
                 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\">";
                 
index 1c084ef66cf90bbfc1d4fe374e5eae07280f89ba..653573d3c70a6ae838ca2c2c559367d4c96a72a8 100644 (file)
     $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&amp;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&amp;course=$course->id\">$fullname</a> -> 
                   $stractivityreport -> $strmode");
     }
index 1e6883d2fbc2acd42a1bfc15fa73519499348142..42fb074cce9274f03dbced4a050a94f6ce3913bb 100755 (executable)
@@ -258,7 +258,7 @@ class enrolment_plugin_authorize
                 $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)) {
@@ -269,7 +269,7 @@ class enrolment_plugin_authorize
                 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));
                 }
             }
index 86cc78a98848299e837da33849150d20648a8675..42443da0290b7f2b6150185f04cb714ae2b0d2fd 100644 (file)
@@ -242,7 +242,7 @@ function authorize_print_order_details($orderno)
     $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);
@@ -287,7 +287,7 @@ function authorize_print_order_details($orderno)
                     }
                     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 {
index 3d99bc3ed860c86a79ae6d25cf798deb7c366de7..b3d017da1e4e2a429a76b9a29b223b4fcb0ff737 100644 (file)
@@ -283,9 +283,9 @@ function sync_enrolments($role = null) {
         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";
                 }
             }
         }
@@ -325,9 +325,9 @@ function sync_enrolments($role = null) {
             }
             
             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
index b04bc5c51d7db589b86e40bfff197849ccdb1f9d..a5af41dcabe300a8616ed62eded334a22d830cf7 100644 (file)
@@ -10,7 +10,7 @@ if (!$site = get_site()) {
 /// 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");
 
index 9612667fae94af2ceef4d21be968cdae3d7078a2..176e596635d4f0a770f02e3f95de796ef0b583fd 100644 (file)
@@ -155,7 +155,7 @@ if (count($categories) < 1) {
                            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>
@@ -176,7 +176,7 @@ if (count($categories) < 1) {
                            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>
@@ -212,7 +212,7 @@ if (count($courses) < 1) {
                            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>
@@ -233,7 +233,7 @@ if (count($courses) < 1) {
                            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>
index 2052db5208bd9bbb27c0d416a85ad6f7d338dc93..5c6becab354168a9e10237b6f39a482c2627b71a 100644 (file)
                 $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) {
index a9c057456155204096d830653e869121a6ee303b..b6b9143bdc6a8cb0f04d910b0a4ed948944c364b 100644 (file)
                 }
 
             } 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);
             }
index 90657b3eeff70ac55bd4fbd9977ca6fecdf9a347..337829638000854c94080f6fe554b352c2e1147d 100644 (file)
@@ -16,7 +16,7 @@
 
     $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);
 
index d4a1ae7b70a3ebdd22511356585771580a0f621c..4422b0b0a06289d16d3dc4b47fd538a140ac6e16 100644 (file)
@@ -2362,7 +2362,8 @@ function grade_set_grade_weights() {
                 }
             }
             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 />';
             }
         }
     }
@@ -2403,7 +2404,7 @@ function grade_display_grade_weights() {
             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>';
@@ -2701,10 +2702,10 @@ function grade_category_select($id_selected = 0) {
                 $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>';
             }
         }
     }
index 1887152bb83a4e3c67aeb19c87b7c9e5cadcff70..38416ed5be6afe7f6bddd2c3e5584134eed1e871 100644 (file)
@@ -78,7 +78,7 @@ if ($success) {
     $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));
index a2bf058d8b7ebc31bd0a4c0f10cb76bf61aa45b4..6408fc0f6fba0a32b3be28f8380348bcdc3cce90 100644 (file)
@@ -139,7 +139,7 @@ if ($success) {
 /// 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));
index 16cebb6339a39b55881d8aab06f1d60c068432f2..0ea021bb8147d73e60818251a078393121f68e63 100644 (file)
@@ -104,7 +104,7 @@ if ($success) {
 /// 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));
index 4761d5591ee5f085911aec1e0305c4d5e4d598fd..48f3181cd8b44bd063b0f3df80c6b3d00398c3d0 100644 (file)
@@ -48,7 +48,7 @@ if (!$error) {
        $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));
index 34da1bf2a436c103bc4da3cda8cb7eb934120863..726f60a4ed58117920afbd95910faa7bb3612e05 100644 (file)
@@ -38,7 +38,7 @@ if ($success) {
        // 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>".
index 58cb20fd3ec7557d78a7f3a41a92aa361ddc6cd2..276a6dee24cc75cdf3814b49cc80945b5be93881 100644 (file)
@@ -145,7 +145,7 @@ if ($success) {
     $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));
@@ -154,7 +154,7 @@ if ($success) {
     //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>
index a04ca0d68e231ce9c5ce31324e67b00cc58b39be..33bed77ee9e84bd2cdf19dbe9e2d187e48c93f33 100755 (executable)
@@ -2511,13 +2511,13 @@ function print_context_name($context) {
 
         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;
 
index 4ceeabbc3852ea1d2906ef9692f11339fa32162b..d42ba5eb71a5b377fbc17a057e58e6e8cd4a2ef7 100644 (file)
@@ -126,7 +126,7 @@ function main_upgrade($oldversion=0) {
                     $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) ) {
@@ -144,7 +144,7 @@ function main_upgrade($oldversion=0) {
                     $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) ) {
@@ -169,7 +169,7 @@ function main_upgrade($oldversion=0) {
                 $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) . "'!");
                 }
             }
         }
@@ -199,7 +199,7 @@ function main_upgrade($oldversion=0) {
                 $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) . "'!");
                 }
             }
         }
@@ -286,7 +286,7 @@ function main_upgrade($oldversion=0) {
                 $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) . "'!");
                 }
             }
         }
@@ -506,7 +506,7 @@ function main_upgrade($oldversion=0) {
 
         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")) {
index 41ffe2468152d480dcea095d2dfd0a8a48fc2447..22fe33aa2549b344625e312a4f8b8941b58939ea 100644 (file)
@@ -63,7 +63,7 @@ function main_upgrade($oldversion=0) {
                 $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) . "'!");
                 }
             }
         }
@@ -255,7 +255,7 @@ function main_upgrade($oldversion=0) {
 
         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")) {
index 17bc7197ac68464a80dc4af9bac99dfded92e80c..09c37521d0077dc260744404d525e7941d8803ca 100644 (file)
@@ -1752,7 +1752,7 @@ function require_login($courseorid=0, $autologinguest=true, $cm=null) {
                 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, 
@@ -1773,9 +1773,9 @@ function require_login($courseorid=0, $autologinguest=true, $cm=null) {
                 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;
@@ -3663,7 +3663,7 @@ function email_welcome_message_to_user($course, $user=NULL) {
     }
 
     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";
index 2713996c7f89d517421a59cf0ae67c4d544ee69a..b4b311ec861ce4756a73872fca57068fc868722e 100644 (file)
@@ -495,7 +495,7 @@ function question_delete_course($course, $feedback=true) {
                     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();
diff --git a/lib/simpletest/testweblib.php b/lib/simpletest/testweblib.php
new file mode 100644 (file)
index 0000000..9506311
--- /dev/null
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Unit tests for (some of) ../weblib.php.
+ *
+ * @copyright &copy; 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("& &&&&& &&"), "&amp; &amp;&amp;&amp;&amp;&amp; &amp;&amp;");        
+        $this->assertEqual(format_string("ANother & &&&&& Category"), "ANother &amp; &amp;&amp;&amp;&amp;&amp; Category");
+        $this->assertEqual(format_string("ANother & &&&&& Category", true), "ANother &amp; &amp;&amp;&amp;&amp;&amp; Category");
+        $this->assertEqual(format_string("Nick's Test Site & Other things", true), "Nick's Test Site &amp; Other things");
+    }    
+}
+?>
index 3f0f7c79aa130e0eb5c465dcfc7a09eca4959986..e53d70ed26e0d39a042e74286a2b6dc36f9b6ffc 100644 (file)
@@ -1410,7 +1410,10 @@ function format_title($string, $plaintext=true, $courseid=null) {
 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};)/", "&amp;", $string);
+    
     //We'll use a in-memory cache here to speed up repeated strings
     static $strcache = false;
 
@@ -1436,7 +1439,8 @@ function format_string ($string, $striplinks = false, $courseid=NULL ) {
 
     //Store to cache
     $strcache[$md5] = $string;
-
+       
+        
     return $string;
 }
 
@@ -2032,7 +2036,9 @@ function print_header ($title='', $heading='', $navigation='', $focus='',
                        $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().');
@@ -2222,7 +2228,8 @@ function print_header ($title='', $heading='', $navigation='', $focus='',
     $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();
@@ -2317,10 +2324,10 @@ function print_header_simple($title='', $heading='', $navigation='', $focus='',
 
     $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) {
@@ -2358,7 +2365,7 @@ function print_footer($course=NULL, $usercourse=NULL, $return=false) {
             $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 {
@@ -2813,16 +2820,47 @@ function print_navigation ($navigation, $separator=0, $return=false) {
     }
 
     if ($navigation) {
-        //Accessibility: breadcrumb links now in a list, &raquo; 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, &raquo; 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";
     }
 
@@ -5730,4 +5768,4 @@ function frametarget() {
 }
 
 // vim:autoindent:expandtab:shiftwidth=4:tabstop=4:tw=140:
-?>
\ No newline at end of file
+?>
index 7f12d4388f26e85bb93d5c15bbe730ba517ab61a..10f2ba570d5f7276ceb6077f751e08d283d0bac6 100644 (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%">';
index fa274b1f82dc914c8f677bb5a8eaaf1b7ecb9fab..a2d82cf836d99e275f48618a5b4a7fef35a8b768 100644 (file)
@@ -1763,7 +1763,7 @@ function assignment_cron () {
             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;
             }
 
index 712a7a4b25a8d3c5479b2537b40701c47bee60b7..65e4d8656c9e28d673131412ce36b5d058208c49 100644 (file)
@@ -64,7 +64,7 @@
  <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">
index 220b37010c3c06e4c57e0c08e315049b1ae805d2..33ca929dc10a91e787000535cafed83ec3169879 100644 (file)
@@ -59,7 +59,7 @@
  <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">
index 30ef20393804c1e19462846ef28a5cbab8dbcfb6..5673836771947a49c9e9a6053608a8340984bb0d 100644 (file)
             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();
 
index e2b884a92567ef30a5bc39bbdb1d77b93fc72b2b..6253d4a526765698de8d62264794e9bddee169e4 100755 (executable)
@@ -96,7 +96,7 @@
     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.'" /> ';
index 69e95ecafed2037ef355615639c6b510cd072c70..6ca69d86187201e310096081792aee6fbeb5f645 100755 (executable)
     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.'" /> ';
index b9f8175aa50e56624969148f49807399ee43fa80..9736f6c6c752462f1c6174f8a32fc8ade81ef889 100644 (file)
     $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));
     }
 
index df7c92f0e49f47dc6c900cc83edd02925edcbcaf..14bcff3147628189325ee421cdbfce61c475cf39 100644 (file)
         $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));
     }
 
index 3a42cc2c68bef41104e6ff2bb474e1dc92e76df8..e7db81aeadab0bf5ddb987a45236ca155f7b7ec3 100644 (file)
@@ -1726,7 +1726,7 @@ function forum_get_course_forum($courseid, $type) {
     $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
index 1ef11503337bbfa0e525f1858dad85bf0fdc40fd..b26815d11b6408760d49f0a909e2915acab1703a 100644 (file)
     }
     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));
 
     }
index a28e33a91593937df45af42d52bf8573e62ddc7c..4fb6749302f0f3875856f13f3fb425794aeaa6c5 100644 (file)
     $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&amp;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&amp;course=$course->id\">$fullname</a> -> 
                   $strforumposts -> $strmode");
     }
index e27b601cf0de4d5123bdbb42140fa7c0cbef2142..305d42c2bf7fcf0c201948cc5a1f7a3c55871281 100644 (file)
@@ -43,7 +43,7 @@
         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));
index d99bc3abd201984817c444c5089cdf85f530bffd..1aa8dae0282a104453200968393e6aac2c93ff88 100644 (file)
 
     $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) {
index febbd5b57927bbb21af8efed55656d13a6ab77f4..a01affd8fb1948356eb3861c956521088cee32b7 100644 (file)
 
         $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, "&nbsp;", "&nbsp;");
         } else {
-            print_header(strip_tags("$course->shortname: $strglossaries $strsearch"), "$course->fullname",
+            print_header(strip_tags("$course->shortname: $strglossaries $strsearch"), $course->fullname,
             "$strglossaries -> $strsearch", "", "", true, "&nbsp;", "&nbsp;");
         }
 
index 1d15ee6e9f933ba7925f433e59b18a09606a6d29..04bd0e149539228398d017e7ddb8f3a948bf5035 100644 (file)
@@ -34,9 +34,9 @@
 
     // 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";
     }
index b4007f79d6a6df856df0de2006f95044201c38cd..13883d84650ed0d8936fa7ec00cbcf79bac8a34a 100644 (file)
@@ -398,8 +398,8 @@ function hotpot_print_report_heading(&$course, &$cm, &$hotpot, &$mode) {
     $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> -> ";
index 0f9357e216d7549c144ce3b87b9a547546f5e47f..d0f7f39878e11cd6a3bf76328c6e0a20196cec50 100644 (file)
@@ -50,8 +50,8 @@
     $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";
index 9e315737060fdccacfddaeae88ceae376b0a58a1..375d9fab63eef47624629f136aa78b0c20db7429 100644 (file)
@@ -40,8 +40,8 @@
     // 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;
index 62399df417501c29e710b70d046161e629993412..83d1ecb269f9f4ac49b4c72b1525a88823e3c966 100644 (file)
@@ -28,7 +28,7 @@
         $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
 
index 10b9802bdea6e12bf4d6969c588452138b017e66..26c90cc8100e2be9e46a8083a236910ff3bb3523 100644 (file)
@@ -36,7 +36,7 @@
         $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
 
index 22cd156bc5698212544c8b9781e09b560c21ce89..7f3ae9c29cfb8a231b5638c6336bc921ed4dc415 100644 (file)
@@ -27,7 +27,7 @@
     $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)) {
index 0537b4fc49925a7619aa016e9c798daef0b23c1c..a00c6f605b7ca3a2b7128fa722d18ab0a093da51 100644 (file)
@@ -354,7 +354,7 @@ function display() {
         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}&amp;type={$resource->type}&amp;frameset=top\" title=\"".get_string('modulename','resource')."\"/>";
         if (!empty($localpath)) {  // Show it like this so we interpose some HTML
index d851076743180c4c953c1c687816ba7ec9c24b12..75400a6bfbd7a7499e0829d42103728257dd0d1d 100644 (file)
@@ -347,7 +347,7 @@ function display() {
         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}&amp;type={$resource->type}&amp;frameset=top\" title=\"".get_string('modulename','resource')."\"/>";
         if (!empty($localpath)) {  // Show it like this so we interpose some HTML
index d2f6e68695f9cf76ac8d3bd44556b591617ae78c..d3918ab864db0bdcd5bacce6c54c6893ed4229a4 100755 (executable)
@@ -61,7 +61,7 @@
     $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>)&nbsp;';
-    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') {
index 7967a4c2660915af0b61dc64045c8fe204a5a0eb..136366d23a332c54f0228bc33e81046391ef82e9 100755 (executable)
         $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>
index ddbee264d1fbccddc871761450052d311ba2860a..1d547b1be071dbaaa78016990a24fc7af35633ca 100755 (executable)
@@ -66,7 +66,7 @@
     //
     // 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));
 
index f2abe247e7db2acf3d72a95eb33ef3c0e3a88eee..113f107dc257746cd30b0cff2a55067593f4fc1c 100644 (file)
@@ -65,7 +65,7 @@
                        <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));
 
index 99d23b7d07c2986140a7f1d3fa9ec42c91d609e5..ebe11ac977a2d7eb7599d9c0ae5918c793fa2e03 100644 (file)
@@ -47,7 +47,7 @@
         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&amp;sid=$sid&amp;frameset=top&amp;redirect=$redirect\" border=\"10\" />";
         echo "  <frame src=\"assess.php?id=$id&amp;sid=$sid&amp;frameset=bottom&amp;redirect=$redirect\" />";
index 68e52476e98174ad804e9f7e509ef8b24bffbe91..92cf48578588852bc254f9f5b1e8ac4bc6d43a44 100644 (file)
@@ -427,7 +427,7 @@ class question_category_object {
 
         $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";
@@ -583,7 +583,7 @@ class question_category_object {
                 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 {
@@ -622,7 +622,7 @@ class question_category_object {
 
         /// 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');
         }
     }
 
index 26e01d938b1db7c2d2e90055de8828e997f5479c..10b5461cf7a3d74eceda3a6293f8d369e4f3a0b1 100644 (file)
                       -> <a href=\"view.php?id=$user->id&amp;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&amp;course=$course->id\">$userfullname</a>
                       -> $streditmyprofile", "");
     }
index ec40bb6cf56bcc223cf83f54892d31213c628aca..91482f72d50dcbca4ea7a026e9985d32f544cace 100644 (file)
                           -> <a href=\"view.php?id=$user->id&amp;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&amp;course=$course->id\">$userfullname</a>
                           -> $streditmyprofile", "");
         }
index 5c1ae827c00acb3d38bdb0a6afaa5b1fcbb37dc6..a936f276ebd2454a605d94ef9ed9a71a5191b144 100644 (file)
@@ -414,7 +414,7 @@ function profile_edit_category($id, $redirect, $adminroot) {
         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
index 973382534294c06830e71eba39d8220ac3b430a7..f2946b5cd172f80ae387125f336e9a2345a7e918 100644 (file)
@@ -123,7 +123,7 @@ foreach ($categories as $category) {
         }
     }
 
-    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 {
index e960bc0eed3b31358f9dcbdb167535f2d4bff81e..7aba3f3d1f86da2df83facfd1677e8b56b32e613 100644 (file)
@@ -31,7 +31,7 @@
     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))) {
@@ -49,7 +49,7 @@
     } 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) {
 
index 3994ad07eb9f461e972c877d09eb455b816b1f33..cb5680f7e4f26e65781730debf4336eb125b1020 100644 (file)
                       <a href=\"index.php?id=$course->id\">$strparticipants</a> -> $fullname",
                       "", "", true, "&nbsp;", navmenu($course));
     } else {
-        print_header("$course->fullname: $strpersonalprofile: $fullname", "$course->fullname",
+        print_header("$course->fullname: $strpersonalprofile: $fullname", $course->fullname,
                      "$fullname", "", "", true, "&nbsp;", 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&amp;course=$mycourse->id\">$mycourse->fullname</a>, ";
+                    $courselisting .= "<a href=\"$CFG->wwwroot/user/view.php?id=$user->id&amp;course=$mycourse->id\">"
+                        . format_string($mycourse->fullname) . "</a>, ";
                 }
                 else {
-                    $courselisting .= "$mycourse->fullname, ";
+                    $courselisting .= format_string($mycourse->fullname) . ", ";
                 }
             }
             $shown++;