Skip to content

Commit

Permalink
Merged Nicolas' changes from MDL-8582 into HEAD.
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Feb 28, 2007
1 parent 8663848 commit 6ba65fa
Show file tree
Hide file tree
Showing 99 changed files with 289 additions and 210 deletions.
4 changes: 2 additions & 2 deletions admin/handlevirus.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

$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;
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion admin/mnet/enr_course_enrol.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@
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"));

Expand Down
4 changes: 2 additions & 2 deletions admin/mnet/enr_courses.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
. "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>"
Expand Down
2 changes: 1 addition & 1 deletion admin/oacleanup.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions admin/process_email.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
}

$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) {
Expand Down
2 changes: 1 addition & 1 deletion admin/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion admin/roles/assign.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@

/// 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));
}

Expand Down
2 changes: 1 addition & 1 deletion admin/roles/override.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@

/// 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;
Expand Down
2 changes: 1 addition & 1 deletion admin/roles/tabs.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
$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;
Expand Down
2 changes: 1 addition & 1 deletion auth/cas/forbidden.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions auth/cas/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,12 @@
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;
Expand Down Expand Up @@ -247,12 +247,12 @@
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;
Expand Down Expand Up @@ -302,7 +302,7 @@
$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();

Expand Down
2 changes: 1 addition & 1 deletion auth/mnet/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ function confirm_mnet_session($token, $remotewwwroot) {
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/>";
Expand Down
4 changes: 2 additions & 2 deletions backup/backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -106,7 +106,7 @@
}

//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
Expand Down
2 changes: 1 addition & 1 deletion backup/restore_check.html
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
} 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 {
Expand Down
2 changes: 1 addition & 1 deletion backup/restorelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -5762,7 +5762,7 @@ function restore_execute(&$restore,$info,$course_header,&$errorstr) {
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 {
Expand Down
6 changes: 3 additions & 3 deletions backup/try.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@

$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";
}
}
?>
4 changes: 2 additions & 2 deletions blocks/admin/block_admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,10 @@ function get_content() {

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="" />';
}
}
Expand Down
21 changes: 13 additions & 8 deletions blocks/course_list/block_course_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ function get_content() {
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');
Expand All @@ -65,7 +65,7 @@ function get_content() {
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[] = '';
Expand All @@ -83,14 +83,18 @@ function get_content() {
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 {
Expand Down Expand Up @@ -123,8 +127,9 @@ function get_remote_courses() {
$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
Expand Down
6 changes: 3 additions & 3 deletions course/category.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
}
$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) {
Expand Down Expand Up @@ -312,7 +312,7 @@

$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)) {
Expand Down Expand Up @@ -432,7 +432,7 @@
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 />";
Expand Down
7 changes: 4 additions & 3 deletions course/delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand All @@ -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> -> ".
Expand All @@ -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");

Expand Down
Loading

0 comments on commit 6ba65fa

Please sign in to comment.