diff --git a/theme/boost/classes/output/core_renderer.php b/theme/boost/classes/output/core_renderer.php index 87a24bf4e66..ee64b872e7d 100644 --- a/theme/boost/classes/output/core_renderer.php +++ b/theme/boost/classes/output/core_renderer.php @@ -511,7 +511,7 @@ class core_renderer extends \core_renderer { $url = $url->out(false); } $context->logourl = $url; - $context->sitename = format_string($SITE->fullname, true, array('context' => context_course::instance(SITEID))); + $context->sitename = format_string($SITE->fullname, true, ['context' => context_course::instance(SITEID), "escape" => false]); return $this->render_from_template('core/login', $context); } @@ -531,7 +531,7 @@ class core_renderer extends \core_renderer { $url = $url->out(false); } $context['logourl'] = $url; - $context['sitename'] = format_string($SITE->fullname, true, array('context' => context_course::instance(SITEID))); + $context['sitename'] = format_string($SITE->fullname, true, ['context' => context_course::instance(SITEID), "escape" => false]); return $this->render_from_template('core/signup_form_layout', $context); } diff --git a/theme/boost/layout/columns1.php b/theme/boost/layout/columns1.php index c4ccf7ff284..d5b041211d7 100644 --- a/theme/boost/layout/columns1.php +++ b/theme/boost/layout/columns1.php @@ -15,7 +15,7 @@ // along with Moodle. If not, see . /** - * A two column layout for the boost theme. + * A one column layout for the boost theme. * * @package theme_boost * @copyright 2016 Damyon Wiese @@ -27,7 +27,7 @@ defined('MOODLE_INTERNAL') || die(); $bodyattributes = $OUTPUT->body_attributes([]); $templatecontext = [ - 'sitename' => format_string($SITE->shortname, true, array('context' => context_course::instance(SITEID))), + 'sitename' => format_string($SITE->shortname, true, ['context' => context_course::instance(SITEID), "escape" => false]), 'output' => $OUTPUT, 'bodyattributes' => $bodyattributes ]; diff --git a/theme/boost/layout/columns2.php b/theme/boost/layout/columns2.php index 914eda40a15..e0207faa3bc 100644 --- a/theme/boost/layout/columns2.php +++ b/theme/boost/layout/columns2.php @@ -41,7 +41,7 @@ $blockshtml = $OUTPUT->blocks('side-pre'); $hasblocks = strpos($blockshtml, 'data-block=') !== false; $regionmainsettingsmenu = $OUTPUT->region_main_settings_menu(); $templatecontext = [ - 'sitename' => format_string($SITE->shortname, true, array('context' => context_course::instance(SITEID))), + 'sitename' => format_string($SITE->shortname, true, ['context' => context_course::instance(SITEID), "escape" => false]), 'output' => $OUTPUT, 'sidepreblocks' => $blockshtml, 'hasblocks' => $hasblocks, diff --git a/theme/boost/layout/embedded.php b/theme/boost/layout/embedded.php index cf02ae5d786..5469e1bf5b5 100644 --- a/theme/boost/layout/embedded.php +++ b/theme/boost/layout/embedded.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') || die(); $templatecontext = [ - 'sitename' => format_string($SITE->shortname, true, array('context' => context_course::instance(SITEID))), + 'sitename' => format_string($SITE->shortname, true, ['context' => context_course::instance(SITEID), "escape" => false]), 'output' => $OUTPUT ]; diff --git a/theme/boost/layout/login.php b/theme/boost/layout/login.php index 0ae675d0050..e86169dfc06 100644 --- a/theme/boost/layout/login.php +++ b/theme/boost/layout/login.php @@ -17,7 +17,7 @@ defined('MOODLE_INTERNAL') || die(); /** - * A two column layout for the boost theme. + * A login page layout for the boost theme. * * @package theme_boost * @copyright 2016 Damyon Wiese @@ -27,7 +27,7 @@ defined('MOODLE_INTERNAL') || die(); $bodyattributes = $OUTPUT->body_attributes(); $templatecontext = [ - 'sitename' => format_string($SITE->shortname, true, array('context' => context_course::instance(SITEID))), + 'sitename' => format_string($SITE->shortname, true, ['context' => context_course::instance(SITEID), "escape" => false]), 'output' => $OUTPUT, 'bodyattributes' => $bodyattributes ]; diff --git a/theme/boost/layout/maintenance.php b/theme/boost/layout/maintenance.php index eeb0fbfb9cd..953debe303c 100644 --- a/theme/boost/layout/maintenance.php +++ b/theme/boost/layout/maintenance.php @@ -27,7 +27,7 @@ defined('MOODLE_INTERNAL') || die(); $templatecontext = [ // We cannot pass the context to format_string, this layout can be used during // installation. At that stage database tables do not exist yet. - 'sitename' => format_string($SITE->shortname), + 'sitename' => format_string($SITE->shortname, true, ["escape" => false]), 'output' => $OUTPUT ]; diff --git a/theme/boost/layout/secure.php b/theme/boost/layout/secure.php index 4765c2c3f13..74fe3f9543a 100644 --- a/theme/boost/layout/secure.php +++ b/theme/boost/layout/secure.php @@ -15,7 +15,7 @@ // along with Moodle. If not, see . /** - * A three column layout for the boost theme. + * A secure layout for the boost theme. * * @package theme_boost * @copyright 2016 Damyon Wiese @@ -29,7 +29,7 @@ $hasblocks = strpos($blockshtml, 'data-block=') !== false; $bodyattributes = $OUTPUT->body_attributes(); $templatecontext = [ - 'sitename' => format_string($SITE->shortname, true, array('context' => context_course::instance(SITEID))), + 'sitename' => format_string($SITE->shortname, true, ['context' => context_course::instance(SITEID), "escape" => false]), 'output' => $OUTPUT, 'bodyattributes' => $bodyattributes, 'sidepreblocks' => $blockshtml, diff --git a/theme/boost/templates/core/login.mustache b/theme/boost/templates/core/login.mustache index eb50c468c0a..8f3a2173b07 100644 --- a/theme/boost/templates/core/login.mustache +++ b/theme/boost/templates/core/login.mustache @@ -18,6 +18,79 @@ @template core/login Moodle template for the login page. + + Context variables required for this template: + * autofocusform: Auto focus on form ?, + * canloginasguest - Is guest login allowed?, + * canloginbyemail - Is login by email allowed?, + * cansignup - Signup allowed?, + * cookieshelpicon - cookies help icon details + * error - Any errors in the form?, + * forgotpasswordurl - Forgot password url, + * hasidentityproviders - Flag, set to true to hide identity providers, + * hasinstructions - Flag, set to true to show instructions, + * identityproviders - List of identiy providers, + * instructions - Instructions, + * instructionsformat - Format of instructions, + * loginurl - Login url, + * rememberusername - Remeber username?, + * passwordautocomplete - Allow password autocomplete?, + * signupurl - Signup url, + * cookieshelpiconformatted - Formatted html of cookies help icon, + * errorformatted - Formatted error, + * logourl - Flag, logo url, + * sitename - Name of site. + + Example context (json): + { + "autofocusform": false, + "canloginasguest": "1", + "canloginbyemail": false, + "cansignup": true, + "cookieshelpicon": { + "heading": "Cookies must be enabled in your browser", + "text": "
Two cookies are used on this site. Both died..
", + "icon": { + "attributes": [ + { + "name": "class", + "value": "iconhelp" + }, + { + "name": "alt", + "value": "Help with Cookies must be enabled in your browser" + }, + { + "name": "title", + "value": "Help with Cookies must be enabled in your browser" + }, + { + "name": "src", + "value": "http://localhost/stable_master/theme/image.php?theme=boost&component=core&image=help" + } + ] + }, + "linktext": null, + "title": "Help with Cookies must be enabled in your browser", + "url": "http://localhost/stable_master/help.php?component=core&identifier=cookiesenabled&lang=en", + "ltr": true + }, + "error": "", + "forgotpasswordurl": "http://localhost/stable_master/login/forgot_password.php", + "hasidentityproviders": false, + "hasinstructions": true, + "identityproviders": [], + "instructions": "For full access to this site, you first need to create an account.", + "instructionsformat": "1", + "loginurl": "http://localhost/stable_master/login/index.php", + "rememberusername": true, + "passwordautocomplete": false, + "signupurl": "http://localhost/stable_master/login/signup.php", + "cookieshelpiconformatted": "", + "errorformatted": "", + "logourl": false, + "sitename": "Beer & Chips" + } }}