From 49393a160803631f1127b17e7d3201b047d9cf6c Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Thu, 3 Aug 2023 16:29:13 +0800 Subject: [PATCH] MDL-78806 core: Remove redundant site name MDL-78806 core: Remove redundant site name on page titles * With the site name now being appended to the page titles, there is no need to manually append the page titles. --- admin/category.php | 2 +- admin/index.php | 4 ++-- admin/searchreindex.php | 2 +- admin/settings.php | 2 +- admin/tool/filetypes/delete.php | 2 +- admin/tool/filetypes/edit.php | 2 +- admin/tool/filetypes/index.php | 2 +- admin/tool/filetypes/revert.php | 2 +- admin/tool/mobile/logout.php | 2 +- auth/ldap/ntlmsso_attempt.php | 2 +- auth/ldap/ntlmsso_finish.php | 2 +- auth/shibboleth/login.php | 2 +- blog/edit.php | 6 +++--- blog/external_blog_edit.php | 2 +- blog/external_blogs.php | 2 +- blog/lib.php | 19 +++++++++++-------- blog/preferences.php | 2 +- calendar/delete.php | 2 +- course/delete.php | 4 ++-- course/edit.php | 2 +- course/editcategory.php | 2 +- course/renderer.php | 6 +++--- course/search.php | 4 ++-- h5p/libraries.php | 2 +- h5p/overview.php | 2 +- index.php | 2 +- lib/adminlib.php | 2 +- lib/pagelib.php | 6 +----- lib/weblib.php | 1 - login/index.php | 4 ++-- login/logout.php | 4 ++-- message/output/popup/notifications.php | 2 +- mod/lti/register.php | 2 +- mod/lti/registersettings.php | 2 +- mod/lti/toolconfigure.php | 2 +- mod/lti/toolproxies.php | 2 +- mod/lti/toolssettings.php | 2 +- mod/lti/typessettings.php | 2 +- report/insights/done.php | 2 +- report/log/index.php | 2 +- user/editadvanced.php | 3 ++- user/emailupdate.php | 2 +- user/profile.php | 2 +- 43 files changed, 62 insertions(+), 63 deletions(-) diff --git a/admin/category.php b/admin/category.php index fb37fa1d7e0aa..f6f6d52c9c3b8 100644 --- a/admin/category.php +++ b/admin/category.php @@ -132,7 +132,7 @@ } $visiblepathtosection = array_reverse($settingspage->visiblepath); -$PAGE->set_title("$SITE->shortname: " . implode(": ",$visiblepathtosection)); +$PAGE->set_title(implode(": ",$visiblepathtosection)); $PAGE->set_heading($SITE->fullname); if ($buttons) { $PAGE->set_button($buttons); diff --git a/admin/index.php b/admin/index.php index 27f474bae90ca..8c21f4a2d6f7d 100644 --- a/admin/index.php +++ b/admin/index.php @@ -224,7 +224,7 @@ $strlicense = get_string('license'); $PAGE->navbar->add($strlicense); - $PAGE->set_title($strinstallation.' - Moodle '.$CFG->target_release); + $PAGE->set_title($strinstallation . moodle_page::TITLE_SEPARATOR . 'Moodle ' . $CFG->target_release, false); $PAGE->set_heading($strinstallation); $PAGE->set_cacheable(false); @@ -811,7 +811,7 @@ if (!has_capability('moodle/site:config', $context)) { // Do not throw exception display an empty page with administration menu if visible for current user. - $PAGE->set_title($SITE->fullname); + $PAGE->set_title(get_string('home')); $PAGE->set_heading($SITE->fullname); echo $OUTPUT->header(); echo $OUTPUT->footer(); diff --git a/admin/searchreindex.php b/admin/searchreindex.php index 8525847e56ec6..158e3fc520df9 100644 --- a/admin/searchreindex.php +++ b/admin/searchreindex.php @@ -44,7 +44,7 @@ // Start page output. $heading = get_string('gradualreindex', 'search', ''); -$PAGE->set_title($PAGE->title . ': ' . $heading); +$PAGE->set_title($areaname . ' - ' . get_string('gradualreindex', 'search', '')); $PAGE->navbar->add($heading); echo $OUTPUT->header(); echo $OUTPUT->heading($heading); diff --git a/admin/settings.php b/admin/settings.php index 30c61121b2347..a67c8a075a688 100644 --- a/admin/settings.php +++ b/admin/settings.php @@ -131,7 +131,7 @@ $visiblepathtosection = array_reverse($settingspage->visiblepath); - $PAGE->set_title("$SITE->shortname: " . implode(": ",$visiblepathtosection)); + $PAGE->set_title(implode(": ",$visiblepathtosection)); $PAGE->set_heading($SITE->fullname); echo $OUTPUT->header(); diff --git a/admin/tool/filetypes/delete.php b/admin/tool/filetypes/delete.php index db8b55f3dc788..ea154b48bbb62 100644 --- a/admin/tool/filetypes/delete.php +++ b/admin/tool/filetypes/delete.php @@ -46,7 +46,7 @@ $PAGE->navbar->add($title); $PAGE->set_context($context); $PAGE->set_pagelayout('admin'); -$PAGE->set_title($SITE->fullname. ': ' . $title); +$PAGE->set_title($title); $PAGE->set_primary_active_tab('siteadminnode'); $PAGE->set_secondary_active_tab('server'); diff --git a/admin/tool/filetypes/edit.php b/admin/tool/filetypes/edit.php index b23187eb6e4fb..9cdd72a5a88c7 100644 --- a/admin/tool/filetypes/edit.php +++ b/admin/tool/filetypes/edit.php @@ -107,7 +107,7 @@ $PAGE->navbar->add($oldextension ? s($oldextension) : $title); $PAGE->set_context($context); $PAGE->set_pagelayout('admin'); -$PAGE->set_title($SITE->fullname. ': ' . $title); +$PAGE->set_title($title); // Display the page. echo $OUTPUT->header(); diff --git a/admin/tool/filetypes/index.php b/admin/tool/filetypes/index.php index 6ac20dcd682cd..a237731cd7ea2 100644 --- a/admin/tool/filetypes/index.php +++ b/admin/tool/filetypes/index.php @@ -34,7 +34,7 @@ $PAGE->set_url(new \moodle_url('/admin/tool/filetypes/index.php')); $PAGE->set_context($context); $PAGE->set_pagelayout('admin'); -$PAGE->set_title($SITE->fullname. ': ' . $title); +$PAGE->set_title($title); $renderer = $PAGE->get_renderer('tool_filetypes'); diff --git a/admin/tool/filetypes/revert.php b/admin/tool/filetypes/revert.php index c401f93bc1c2b..b76748d1a18ea 100644 --- a/admin/tool/filetypes/revert.php +++ b/admin/tool/filetypes/revert.php @@ -46,7 +46,7 @@ $PAGE->navbar->add($title); $PAGE->set_context($context); $PAGE->set_pagelayout('admin'); -$PAGE->set_title($SITE->fullname. ': ' . $title); +$PAGE->set_title($title); // Display the page. echo $OUTPUT->header(); diff --git a/admin/tool/mobile/logout.php b/admin/tool/mobile/logout.php index ebadfec87ed65..a1881e3d50fff 100644 --- a/admin/tool/mobile/logout.php +++ b/admin/tool/mobile/logout.php @@ -56,7 +56,7 @@ $PAGE->set_url(new \moodle_url('/'.$CFG->admin.'/tool/mobile/logout.php')); $PAGE->navbar->add($title); $PAGE->set_context($context); -$PAGE->set_title($SITE->fullname. ': ' . $title); +$PAGE->set_title($title); // Display the page. echo $OUTPUT->header(); diff --git a/auth/ldap/ntlmsso_attempt.php b/auth/ldap/ntlmsso_attempt.php index 6f107caba0fa1..a7c8749a56392 100644 --- a/auth/ldap/ntlmsso_attempt.php +++ b/auth/ldap/ntlmsso_attempt.php @@ -26,7 +26,7 @@ // when we've already left the page that set the timer. $loginsite = get_string("loginsite"); $PAGE->navbar->add($loginsite); -$PAGE->set_title("$site->fullname: $loginsite"); +$PAGE->set_title($loginsite); $PAGE->set_heading($site->fullname); echo $OUTPUT->header(); diff --git a/auth/ldap/ntlmsso_finish.php b/auth/ldap/ntlmsso_finish.php index b0d4d7373b8f5..9a802ed3bcb4b 100644 --- a/auth/ldap/ntlmsso_finish.php +++ b/auth/ldap/ntlmsso_finish.php @@ -26,7 +26,7 @@ // here (and not add 3 more secs). $loginsite = get_string("loginsite"); $PAGE->navbar->add($loginsite); - $PAGE->set_title("$site->fullname: $loginsite"); + $PAGE->set_title($loginsite); $PAGE->set_heading($site->fullname); echo $OUTPUT->header(); redirect($CFG->wwwroot . '/login/index.php?authldap_skipntlmsso=1', diff --git a/auth/shibboleth/login.php b/auth/shibboleth/login.php index d4fc639ce5bc9..df23826ed2288 100644 --- a/auth/shibboleth/login.php +++ b/auth/shibboleth/login.php @@ -55,7 +55,7 @@ $PAGE->set_url('/auth/shibboleth/login.php'); $PAGE->set_context(context_system::instance()); $PAGE->navbar->add($loginsite); - $PAGE->set_title("$site->fullname: $loginsite"); + $PAGE->set_title($loginsite); $PAGE->set_heading($site->fullname); $PAGE->set_pagelayout('login'); diff --git a/blog/edit.php b/blog/edit.php index 435445d748764..2c77cbb998d41 100644 --- a/blog/edit.php +++ b/blog/edit.php @@ -143,7 +143,7 @@ 'sesskey' => sesskey(), 'courseid' => $courseid); $optionsno = array('userid' => $entry->userid, 'courseid' => $courseid); - $PAGE->set_title("$SITE->shortname: $strblogs"); + $PAGE->set_title($strblogs); $PAGE->set_heading($SITE->fullname); echo $OUTPUT->header(); @@ -164,11 +164,11 @@ } } else if ($action == 'add') { $editmodetitle = $strblogs . ': ' . get_string('addnewentry', 'blog'); - $PAGE->set_title("$SITE->shortname: $editmodetitle"); + $PAGE->set_title($editmodetitle); $PAGE->set_heading(fullname($USER)); } else if ($action == 'edit') { $editmodetitle = $strblogs . ': ' . get_string('editentry', 'blog'); - $PAGE->set_title("$SITE->shortname: $editmodetitle"); + $PAGE->set_title($editmodetitle); $PAGE->set_heading(fullname($USER)); } diff --git a/blog/external_blog_edit.php b/blog/external_blog_edit.php index 37fb2a5ce5214..b8cc1ee0f82b9 100644 --- a/blog/external_blog_edit.php +++ b/blog/external_blog_edit.php @@ -138,7 +138,7 @@ $PAGE->navbar->add(get_string('addnewexternalblog', 'blog')); $PAGE->set_heading(fullname($USER)); -$PAGE->set_title("$SITE->shortname: $strblogs: $strexternalblogs"); +$PAGE->set_title("$strblogs: $strexternalblogs"); echo $OUTPUT->header(); echo $OUTPUT->heading($strformheading, 2); diff --git a/blog/external_blogs.php b/blog/external_blogs.php index 996ee7a342206..667f4b70c1a5a 100644 --- a/blog/external_blogs.php +++ b/blog/external_blogs.php @@ -67,7 +67,7 @@ $blogs = $DB->get_records('blog_external', array('userid' => $USER->id)); $PAGE->set_heading(fullname($USER)); -$PAGE->set_title("$SITE->shortname: $strblogs: $strexternalblogs"); +$PAGE->set_title("$strblogs: $strexternalblogs"); $PAGE->set_pagelayout('standard'); echo $OUTPUT->header(); diff --git a/blog/lib.php b/blog/lib.php index 174b610d0b4e0..1cd66666f5531 100644 --- a/blog/lib.php +++ b/blog/lib.php @@ -716,9 +716,10 @@ function blog_get_headers($courseid=null, $groupid=null, $userid=null, $tagid=nu // Note: if action is set to 'add' or 'edit', we do this at the end. if (empty($entryid) && empty($modid) && empty($courseid) && empty($userid) && !in_array($action, array('edit', 'add'))) { $PAGE->navbar->add($strblogentries, $blogurl); - $PAGE->set_title($site->fullname); + $strsiteblog = get_string('siteblogheading', 'blog'); + $PAGE->set_title($strsiteblog); $PAGE->set_heading($site->fullname); - $headers['heading'] = get_string('siteblogheading', 'blog'); + $headers['heading'] = $strsiteblog; } // Case 2: only entryid is requested, ignore all other filters. courseid is used to give more contextual information. @@ -742,9 +743,10 @@ function blog_get_headers($courseid=null, $groupid=null, $userid=null, $tagid=nu $blogurl->remove_params('userid'); $PAGE->navbar->add($entry->subject, $blogurl); - $PAGE->set_title("$shortname: " . fullname($user) . ": $entry->subject"); + $blogentryby = get_string('blogentrybyuser', 'blog', fullname($user)); + $PAGE->set_title($entry->subject . moodle_page::TITLE_SEPARATOR . $blogentryby); $PAGE->set_heading("$shortname: " . fullname($user) . ": $entry->subject"); - $headers['heading'] = get_string('blogentrybyuser', 'blog', fullname($user)); + $headers['heading'] = $blogentryby; // We ignore tag and search params. if (empty($action) || !$CFG->useblogassociations) { @@ -758,7 +760,7 @@ function blog_get_headers($courseid=null, $groupid=null, $userid=null, $tagid=nu $shortname = format_string($site->shortname, true, array('context' => context_course::instance(SITEID))); $blogurl->param('userid', $userid); - $PAGE->set_title("$shortname: " . fullname($user) . ": " . get_string('blog', 'blog')); + $PAGE->set_title(fullname($user) . ": " . get_string('blog', 'blog')); $PAGE->set_heading("$shortname: " . fullname($user) . ": " . get_string('blog', 'blog')); $headers['heading'] = get_string('userblog', 'blog', fullname($user)); $headers['strview'] = get_string('viewuserentries', 'blog', fullname($user)); @@ -766,9 +768,10 @@ function blog_get_headers($courseid=null, $groupid=null, $userid=null, $tagid=nu } else if (!$CFG->useblogassociations && empty($userid) && !in_array($action, array('edit', 'add'))) { // Case 4: No blog associations, no userid. - $PAGE->set_title($site->fullname); + $strsiteblog = get_string('siteblogheading', 'blog'); + $PAGE->set_title($strsiteblog); $PAGE->set_heading($site->fullname); - $headers['heading'] = get_string('siteblogheading', 'blog'); + $headers['heading'] = $strsiteblog; } else if (!empty($userid) && !empty($modid) && empty($entryid)) { // Case 5: Blog entries associated with an activity by a specific user (courseid ignored). @@ -781,7 +784,7 @@ function blog_get_headers($courseid=null, $groupid=null, $userid=null, $tagid=nu $PAGE->navbar->add(fullname($user), "$CFG->wwwroot/user/view.php?id=$user->id"); $PAGE->navbar->add($strblogentries, $blogurl); - $PAGE->set_title("$shortname: $cm->name: " . fullname($user) . ': ' . get_string('blogentries', 'blog')); + $PAGE->set_title(fullname($user) . ': ' . get_string('blogentries', 'blog') . moodle_page::TITLE_SEPARATOR . $cm->name); $PAGE->set_heading("$shortname: $cm->name: " . fullname($user) . ': ' . get_string('blogentries', 'blog')); $a = new stdClass(); diff --git a/blog/preferences.php b/blog/preferences.php index c950f3792552a..4c16a56883e07 100644 --- a/blog/preferences.php +++ b/blog/preferences.php @@ -95,7 +95,7 @@ $strpreferences = get_string('preferences'); $strblogs = get_string('blogs', 'blog'); -$title = "$site->shortname: $strblogs : $strpreferences"; +$title = "$strblogs : $strpreferences"; $PAGE->set_title($title); $PAGE->set_heading(fullname($USER)); diff --git a/calendar/delete.php b/calendar/delete.php index 28af3809c997a..b4536e3a542a0 100644 --- a/calendar/delete.php +++ b/calendar/delete.php @@ -92,7 +92,7 @@ $PAGE->navbar->add($strcalendar, $viewcalendarurl); $PAGE->navbar->add($title); -$PAGE->set_title($site->shortname.': '.$strcalendar.': '.$title); +$PAGE->set_title($strcalendar.': '.$title); $PAGE->set_heading($COURSE->fullname); if ($course) { $PAGE->set_secondary_navigation(false); diff --git a/course/delete.php b/course/delete.php index c4a942ffe9c5d..c6fa725368d1f 100644 --- a/course/delete.php +++ b/course/delete.php @@ -57,7 +57,7 @@ $strdeletingcourse = get_string("deletingcourse", "", $courseshortname); $PAGE->navbar->add($strdeletingcourse); - $PAGE->set_title("$SITE->shortname: $strdeletingcourse"); + $PAGE->set_title($strdeletingcourse); $PAGE->set_heading($SITE->fullname); echo $OUTPUT->header(); @@ -77,7 +77,7 @@ $strdeletecheck = get_string("deletecheck", "", $courseshortname); $PAGE->navbar->add($strdeletecheck); -$PAGE->set_title("$SITE->shortname: $strdeletecheck"); +$PAGE->set_title($strdeletecheck); $PAGE->set_heading($SITE->fullname); echo $OUTPUT->header(); diff --git a/course/edit.php b/course/edit.php index 93acabafc58d0..2d357bd1218e5 100644 --- a/course/edit.php +++ b/course/edit.php @@ -235,7 +235,7 @@ $PAGE->navbar->add(get_string('coursemgmt', 'admin'), $managementurl); $pagedesc = $straddnewcourse; - $title = "$site->shortname: $straddnewcourse"; + $title = $straddnewcourse; $fullname = format_string($category->name); $PAGE->navbar->add($pagedesc); } diff --git a/course/editcategory.php b/course/editcategory.php index af6d13c8f0fbf..c50adb2339ede 100644 --- a/course/editcategory.php +++ b/course/editcategory.php @@ -72,7 +72,7 @@ } else { $context = context_system::instance(); $fullname = $SITE->fullname; - $title = "$SITE->shortname: $strtitle"; + $title = $strtitle; $PAGE->set_secondary_active_tab('courses'); } diff --git a/course/renderer.php b/course/renderer.php index 2db11d1d89ddc..70c2bc8ca9861 100644 --- a/course/renderer.php +++ b/course/renderer.php @@ -1662,13 +1662,13 @@ public function course_category($category) { if (core_course_category::is_simple_site()) { // There is only one category in the system, do not display link to it. $strfulllistofcourses = get_string('fulllistofcourses'); - $this->page->set_title("$site->shortname: $strfulllistofcourses"); + $this->page->set_title($strfulllistofcourses); } else if (!$coursecat->id || !$coursecat->is_uservisible()) { $strcategories = get_string('categories'); - $this->page->set_title("$site->shortname: $strcategories"); + $this->page->set_title($strcategories); } else { $strfulllistofcourses = get_string('fulllistofcourses'); - $this->page->set_title("$site->shortname: $strfulllistofcourses"); + $this->page->set_title($strfulllistofcourses); } // Print current category description diff --git a/course/search.php b/course/search.php index ccaf4b302a994..f0d9d62561403 100644 --- a/course/search.php +++ b/course/search.php @@ -86,10 +86,10 @@ if (empty($searchcriteria)) { // no search criteria specified, print page with just search form - $PAGE->set_title("$site->fullname : $strsearch"); + $PAGE->set_title($strsearch); } else { // this is search results page - $PAGE->set_title("$site->fullname : $strsearchresults"); + $PAGE->set_title($strsearchresults); // Link to manage search results should be visible if user have system or category level capability if ((can_edit_in_category() || !empty($usercatlist))) { $aurl = new moodle_url('/course/management.php', $searchcriteria); diff --git a/h5p/libraries.php b/h5p/libraries.php index 40cbc924fe234..bebe0cf1f10dd 100644 --- a/h5p/libraries.php +++ b/h5p/libraries.php @@ -39,7 +39,7 @@ $PAGE->set_context($context); $PAGE->set_url($url); $PAGE->set_pagelayout('admin'); -$PAGE->set_title("$SITE->shortname: " . $pagetitle); +$PAGE->set_title($pagetitle); $PAGE->set_heading($SITE->fullname); $h5pfactory = new \core_h5p\factory(); diff --git a/h5p/overview.php b/h5p/overview.php index 996cb92c70bf8..45648a3702bdd 100644 --- a/h5p/overview.php +++ b/h5p/overview.php @@ -35,7 +35,7 @@ $PAGE->set_context($context); $PAGE->set_url($url); $PAGE->set_pagelayout('admin'); -$PAGE->set_title("$SITE->shortname: " . $pagetitle); +$PAGE->set_title($pagetitle); $PAGE->set_heading($SITE->fullname); echo $OUTPUT->header(); diff --git a/index.php b/index.php index b0ceb50e1afb1..8e0058c35e539 100644 --- a/index.php +++ b/index.php @@ -101,7 +101,7 @@ $PAGE->set_pagetype('site-index'); $PAGE->set_docs_path(''); $editing = $PAGE->user_is_editing(); -$PAGE->set_title($SITE->fullname); +$PAGE->set_title(get_string('home')); $PAGE->set_heading($SITE->fullname); $PAGE->set_secondary_active_tab('coursehome'); diff --git a/lib/adminlib.php b/lib/adminlib.php index 1f251bf6e2891..42ad98fa7021c 100644 --- a/lib/adminlib.php +++ b/lib/adminlib.php @@ -8830,7 +8830,7 @@ function admin_externalpage_setup($section, $extrabutton = '', array $extraurlpa $PAGE->set_button($OUTPUT->single_button($url, $caption, 'get')); } - $PAGE->set_title("$SITE->shortname: " . implode(": ", $visiblepathtosection)); + $PAGE->set_title(implode(": ", $visiblepathtosection)); $PAGE->set_heading($SITE->fullname); if ($hassiteconfig && empty($options['nosearch'])) { diff --git a/lib/pagelib.php b/lib/pagelib.php index 7254d44921424..3202396f88c86 100644 --- a/lib/pagelib.php +++ b/lib/pagelib.php @@ -1702,11 +1702,7 @@ protected function starting_output() { '/settings.php?section=maintenancemode">' . get_string('maintenancemode', 'admin') . ' ' . $this->button); - $title = $this->title; - if ($title) { - $title .= ' - '; - } - $this->set_title($title . get_string('maintenancemode', 'admin')); + $this->set_title(get_string('maintenancemode', 'admin')); } $this->initialise_standard_body_classes(); diff --git a/lib/weblib.php b/lib/weblib.php index 9ae8624b0a570..363866dd2ea81 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -3197,7 +3197,6 @@ function print_maintenance_message() { $PAGE->set_pagetype('maintenance-message'); $PAGE->set_pagelayout('maintenance'); - $PAGE->set_title(strip_tags($SITE->fullname)); $PAGE->set_heading($SITE->fullname); echo $OUTPUT->header(); echo $OUTPUT->heading(get_string('sitemaintenance', 'admin')); diff --git a/login/index.php b/login/index.php index ca9ddc994db56..3a487bd86c2a8 100644 --- a/login/index.php +++ b/login/index.php @@ -244,7 +244,7 @@ $passwordchangeurl = $CFG->wwwroot.'/login/change_password.php'; } $days2expire = $userauth->password_expire($USER->username); - $PAGE->set_title("$site->fullname: $loginsite"); + $PAGE->set_title($loginsite); $PAGE->set_heading("$site->fullname"); if (intval($days2expire) > 0 && intval($days2expire) < intval($userauth->config->expiration_warning)) { echo $OUTPUT->header(); @@ -361,7 +361,7 @@ redirect(new moodle_url('/login/index.php')); } -$PAGE->set_title("$site->fullname: $loginsite"); +$PAGE->set_title($loginsite); $PAGE->set_heading("$site->fullname"); echo $OUTPUT->header(); diff --git a/login/logout.php b/login/logout.php index 664b179aa9546..e7ebddefd8ebd 100644 --- a/login/logout.php +++ b/login/logout.php @@ -45,7 +45,7 @@ redirect($redirect); } else if (!confirm_sesskey($sesskey)) { - $PAGE->set_title($SITE->fullname); + $PAGE->set_title(get_string('logout')); $PAGE->set_heading($SITE->fullname); echo $OUTPUT->header(); echo $OUTPUT->confirm(get_string('logoutconfirm'), new moodle_url($PAGE->url, array('sesskey'=>sesskey())), $CFG->wwwroot.'/'); @@ -61,4 +61,4 @@ require_logout(); -redirect($redirect); \ No newline at end of file +redirect($redirect); diff --git a/message/output/popup/notifications.php b/message/output/popup/notifications.php index 1a2988e140df5..c44c0cafdfc88 100644 --- a/message/output/popup/notifications.php +++ b/message/output/popup/notifications.php @@ -51,7 +51,7 @@ // Display page header. $title = get_string('notifications', 'message'); -$PAGE->set_title("{$SITE->shortname}: " . $title); +$PAGE->set_title($title); $PAGE->set_heading(fullname($user)); // Grab the renderer. diff --git a/mod/lti/register.php b/mod/lti/register.php index 20a460fae9020..6146aa64b0d81 100644 --- a/mod/lti/register.php +++ b/mod/lti/register.php @@ -67,7 +67,7 @@ $PAGE->set_heading(get_string('toolproxyregistration', 'lti')); -$PAGE->set_title("{$SITE->shortname}: " . get_string('toolproxyregistration', 'lti')); +$PAGE->set_title(get_string('toolproxyregistration', 'lti')); // Print the page header. echo $OUTPUT->header(); diff --git a/mod/lti/registersettings.php b/mod/lti/registersettings.php index 4ed9dafea0ad2..0b63dcd2739cb 100644 --- a/mod/lti/registersettings.php +++ b/mod/lti/registersettings.php @@ -84,7 +84,7 @@ $id = lti_add_tool_proxy($data); redirect($redirect); } else { - $PAGE->set_title("{$SITE->shortname}: " . get_string('toolregistration', 'lti')); + $PAGE->set_title(get_string('toolregistration', 'lti')); $PAGE->navbar->add(get_string('lti_administration', 'lti'), $redirect); echo $OUTPUT->header(); diff --git a/mod/lti/toolconfigure.php b/mod/lti/toolconfigure.php index 2b7bc00bc232c..5b957271d10f8 100644 --- a/mod/lti/toolconfigure.php +++ b/mod/lti/toolconfigure.php @@ -45,7 +45,7 @@ $pageurl = new moodle_url('/mod/lti/toolconfigure.php'); $PAGE->set_url($pageurl); -$PAGE->set_title("{$SITE->shortname}: " . get_string('toolregistration', 'mod_lti')); +$PAGE->set_title(get_string('toolregistration', 'mod_lti')); $PAGE->requires->string_for_js('success', 'moodle'); $PAGE->requires->string_for_js('error', 'moodle'); $PAGE->requires->string_for_js('successfullycreatedtooltype', 'mod_lti'); diff --git a/mod/lti/toolproxies.php b/mod/lti/toolproxies.php index 7926ef94ce08a..8075ff4e14fa4 100644 --- a/mod/lti/toolproxies.php +++ b/mod/lti/toolproxies.php @@ -35,7 +35,7 @@ admin_externalpage_setup('ltitoolproxies'); -$PAGE->set_title("{$SITE->shortname}: " . get_string('toolregistration', 'lti')); +$PAGE->set_title(get_string('toolregistration', 'lti')); $configuredtoolproxieshtml = ''; $pendingtoolproxieshtml = ''; diff --git a/mod/lti/toolssettings.php b/mod/lti/toolssettings.php index 693405fd82887..edb9a7c2d3fbb 100644 --- a/mod/lti/toolssettings.php +++ b/mod/lti/toolssettings.php @@ -106,7 +106,7 @@ redirect($redirect); } -$PAGE->set_title(format_string($SITE->shortname) . ': ' . get_string('toolsetup', 'lti')); +$PAGE->set_title(get_string('toolsetup', 'lti')); $PAGE->navbar->add(get_string('lti_administration', 'lti'), $CFG->wwwroot.'/'.$CFG->admin.'/settings.php?section=modsettinglti'); echo $OUTPUT->header(); diff --git a/mod/lti/typessettings.php b/mod/lti/typessettings.php index 1ac8b72f3a797..371c4eacaefb2 100644 --- a/mod/lti/typessettings.php +++ b/mod/lti/typessettings.php @@ -143,7 +143,7 @@ redirect($redirect); } -$PAGE->set_title("$SITE->shortname: " . get_string('toolsetup', 'lti')); +$PAGE->set_title(get_string('toolsetup', 'lti')); $PAGE->set_primary_active_tab('siteadminnode'); $PAGE->set_secondary_active_tab('ltitoolconfigure'); $PAGE->navbar->add(get_string('manage_external_tools', 'lti'), new moodle_url('/mod/lti/toolconfigure.php')); diff --git a/report/insights/done.php b/report/insights/done.php index e11aff98843e8..15257b91c15da 100644 --- a/report/insights/done.php +++ b/report/insights/done.php @@ -37,7 +37,7 @@ exit(0); } -$PAGE->set_title(get_site()->fullname); +$PAGE->set_title(get_string('insights', 'report_insights')); $PAGE->set_url(new \moodle_url('/report/insights/done.php')); echo $OUTPUT->header(); diff --git a/report/log/index.php b/report/log/index.php index 8db48419616a1..e3c7187efc2aa 100644 --- a/report/log/index.php +++ b/report/log/index.php @@ -143,7 +143,7 @@ if ($course->id == $SITE->id) { admin_externalpage_setup('reportlog', '', null, '', array('pagelayout' => 'report')); - $PAGE->set_title($SITE->shortname .': '. $strlogs); + $PAGE->set_title($strlogs); $PAGE->set_primary_active_tab('siteadminnode'); } else { $PAGE->set_title($course->shortname .': '. $strlogs); diff --git a/user/editadvanced.php b/user/editadvanced.php index 3a45e188d23b5..3d8795ebfef05 100644 --- a/user/editadvanced.php +++ b/user/editadvanced.php @@ -332,7 +332,8 @@ $streditmyprofile = get_string('editmyprofile'); $userfullname = fullname($user, true); $PAGE->set_heading($userfullname); - $PAGE->set_title("$course->shortname: $streditmyprofile - $userfullname"); + $coursename = $course->id !== SITEID ? "$course->shortname" : ''; + $PAGE->set_title("$streditmyprofile: $userfullname" . moodle_page::TITLE_SEPARATOR . $coursename); echo $OUTPUT->header(); echo $OUTPUT->heading($userfullname); } diff --git a/user/emailupdate.php b/user/emailupdate.php index 0577c68a0a9ec..6de500eff433d 100644 --- a/user/emailupdate.php +++ b/user/emailupdate.php @@ -42,7 +42,7 @@ $a->fullname = fullname($user, true); $stremailupdate = get_string('emailupdate', 'auth', $a); -$PAGE->set_title(format_string($SITE->fullname) . ": $stremailupdate"); +$PAGE->set_title($stremailupdate); $PAGE->set_heading(format_string($SITE->fullname) . ": $stremailupdate"); if (empty($preferences['newemailattemptsleft'])) { diff --git a/user/profile.php b/user/profile.php index 2de644ed5368d..553b24f56a730 100644 --- a/user/profile.php +++ b/user/profile.php @@ -83,7 +83,7 @@ // Course managers can be browsed at site level. If not forceloginforprofiles, allow access (bug #4366). $struser = get_string('user'); $PAGE->set_context(context_system::instance()); - $PAGE->set_title("$SITE->shortname: $struser"); // Do not leak the name. + $PAGE->set_title($struser); // Do not leak the name. $PAGE->set_heading($struser); $PAGE->set_pagelayout('mypublic'); $PAGE->add_body_class('limitedwidth');