Merge branch 'MDL-57122-master' of git://github.com/ankitagarwal/moodle

This commit is contained in:
David Monllao 2016-11-28 11:31:05 +08:00
commit dd106016ee
8 changed files with 84 additions and 11 deletions

View File

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

View File

@ -15,7 +15,7 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* 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
];

View File

@ -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,

View File

@ -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
];

View File

@ -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
];

View File

@ -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
];

View File

@ -15,7 +15,7 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* 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,

View File

@ -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": "<div class=\"no-overflow\">Two cookies are used on this site. Both died..</div>",
"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"
}
}}
<div class="m-y-3 hidden-sm-down"></div>