diff --git a/theme/boost/layout/columns1.php b/theme/boost/layout/columns1.php
index fc8266745cb..618eb77ed38 100644
--- a/theme/boost/layout/columns1.php
+++ b/theme/boost/layout/columns1.php
@@ -14,8 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
-defined('MOODLE_INTERNAL') || die();
-
/**
* A one column layout for the boost theme.
*
@@ -23,6 +21,9 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2016 Damyon Wiese
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+
+defined('MOODLE_INTERNAL') || die();
+
$templatecontext = [
'sitename' => format_string($SITE->shortname, true, array('context' => context_course::instance(SITEID))),
'output' => $OUTPUT
diff --git a/theme/boost/layout/columns2.php b/theme/boost/layout/columns2.php
index 74984707d0d..90c4fc1e18e 100644
--- a/theme/boost/layout/columns2.php
+++ b/theme/boost/layout/columns2.php
@@ -14,8 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
-defined('MOODLE_INTERNAL') || die();
-
/**
* A two column layout for the boost theme.
*
@@ -23,6 +21,9 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2016 Damyon Wiese
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+
+defined('MOODLE_INTERNAL') || die();
+
$templatecontext = [
'sitename' => format_string($SITE->shortname, true, array('context' => context_course::instance(SITEID))),
'output' => $OUTPUT,
diff --git a/theme/boost/layout/embedded.php b/theme/boost/layout/embedded.php
index db615e0c2fa..cf02ae5d786 100644
--- a/theme/boost/layout/embedded.php
+++ b/theme/boost/layout/embedded.php
@@ -14,8 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
-defined('MOODLE_INTERNAL') || die();
-
/**
* An embedded layout for the boost theme.
*
@@ -23,6 +21,9 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2016 Damyon Wiese
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+
+defined('MOODLE_INTERNAL') || die();
+
$templatecontext = [
'sitename' => format_string($SITE->shortname, true, array('context' => context_course::instance(SITEID))),
'output' => $OUTPUT
diff --git a/theme/boost/layout/maintenance.php b/theme/boost/layout/maintenance.php
index 6557edc8fc0..eeb0fbfb9cd 100644
--- a/theme/boost/layout/maintenance.php
+++ b/theme/boost/layout/maintenance.php
@@ -14,8 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
-defined('MOODLE_INTERNAL') || die();
-
/**
* A maintenance layout for the boost theme.
*
@@ -23,6 +21,9 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2016 Damyon Wiese
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+
+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.
diff --git a/theme/boost/layout/secure.php b/theme/boost/layout/secure.php
index 4f4299bf8ea..c1217901b7d 100644
--- a/theme/boost/layout/secure.php
+++ b/theme/boost/layout/secure.php
@@ -14,8 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
-defined('MOODLE_INTERNAL') || die();
-
/**
* A three column layout for the boost theme.
*
@@ -23,6 +21,9 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2016 Damyon Wiese
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+
+defined('MOODLE_INTERNAL') || die();
+
$templatecontext = [
'sitename' => format_string($SITE->shortname, true, array('context' => context_course::instance(SITEID))),
'output' => $OUTPUT,