-
- get_alert_messages();
diff --git a/layout/includes/secondarynav.php b/layout/includes/secondarynav.php
deleted file mode 100644
index 1acb431..0000000
--- a/layout/includes/secondarynav.php
+++ /dev/null
@@ -1,42 +0,0 @@
-.
-
-/**
- * Secondary navigation and overflow.
- *
- * @package theme_adaptable
- * @copyright 2023 G J Barnard
- * {@link https://moodle.org/user/profile.php?id=442195}
- * {@link https://gjbarnard.co.uk}
- * @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later.
- */
-
-defined('MOODLE_INTERNAL') || die;
-
-$secondarynavigation = '';
-$overflow = '';
-if ($PAGE->has_secondary_navigation()) {
- $tablistnav = $PAGE->has_tablist_secondary_navigation();
- $moremenu = new \core\navigation\output\more_menu($PAGE->secondarynav, 'nav-tabs', true, $tablistnav);
- $secondarynavigation = $moremenu->export_for_template($OUTPUT);
- $secondarynavigation = $OUTPUT->render_from_template('theme_adaptable/secondarynav', $secondarynavigation);
-
- $overflowdata = $PAGE->secondarynav->get_overflow_menu_data();
- if (!is_null($overflowdata)) {
- $overflow = $overflowdata->export_for_template($OUTPUT);
- $overflow = $OUTPUT->render_from_template('theme_adaptable/overflow', $overflow);
- }
-}
diff --git a/layout/includes/sidepostheader.php b/layout/includes/sidepostheader.php
deleted file mode 100644
index 4382dec..0000000
--- a/layout/includes/sidepostheader.php
+++ /dev/null
@@ -1,65 +0,0 @@
-.
-
-/**
- * Side post header.
- *
- * @package theme_adaptable
- * @copyright 2022 G J Barnard
- * {@link https://moodle.org/user/profile.php?id=442195}
- * {@link https://gjbarnard.co.uk}
- * @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later.
- */
-
-defined('MOODLE_INTERNAL') || die;
-
-user_preference_allow_ajax_update('drawer-open-block', PARAM_BOOL);
-
-if (isloggedin()) {
- $sidepostopen = (get_user_preferences('drawer-open-block', true) == true);
-} else {
- $sidepostopen = false;
-}
-
-// Add block button in editing mode.
-$addblockbutton = $OUTPUT->addblockbutton();
-
-$sideposthtml = $OUTPUT->blocks('side-post');
-$hassidepost = (strpos($sideposthtml, 'data-block=') !== false || !empty($addblockbutton));
-if (!$hassidepost) {
- $sidepostopen = false;
-}
-
-if (defined('BEHAT_SITE_RUNNING')) {
- $sidepostopen = true;
-}
-
-$sidepostcontext = [
- 'addblockbutton' => $addblockbutton,
- 'hassidepost' => $hassidepost,
- 'left' => $left,
- 'sidepostopen' => $sidepostopen,
- 'sidepost' => $sideposthtml,
-];
-
-$sideposttogglecontext = [
- 'hassidepost' => $hassidepost,
- 'left' => $left,
- 'sidepostopen' => $sidepostopen,
-];
-
-$sidepostmarkup = $OUTPUT->render_from_template('theme_adaptable/sidepost', $sidepostcontext);
-$sideposttogglemarkup = $OUTPUT->render_from_template('theme_adaptable/sideposttoggle', $sideposttogglecontext);
diff --git a/layout/login.php b/layout/login.php
index 3cf602c..b1fee9a 100644
--- a/layout/login.php
+++ b/layout/login.php
@@ -28,41 +28,4 @@
defined('MOODLE_INTERNAL') || die;
-// Include header.
-global $OUTPUT;
-
-$logincontent = '
';
-$logincontent .= $OUTPUT->main_content();
-$logincontent .= '
';
-
-$result = $OUTPUT->generate_login($logincontent);
-
-if (!empty($result->header)) {
- $sidepostdrawer = false;
- require_once(dirname(__FILE__) . '/includes/header.php');
-} else {
- require_once(dirname(__FILE__) . '/includes/noheader.php');
-}
-$PAGE->set_secondary_navigation(false);
-
-echo '
';
- echo $OUTPUT->page_navbar();
-?>
-
-
-
-header)) {
- require_once(dirname(__FILE__) . '/includes/footer.php');
-} else {
- require_once(dirname(__FILE__) . '/includes/nofooter.php');
-}
+echo $OUTPUT->login_layout();
diff --git a/layout/secure.php b/layout/secure.php
index 0be49ca..dec7e20 100644
--- a/layout/secure.php
+++ b/layout/secure.php
@@ -28,43 +28,4 @@
defined('MOODLE_INTERNAL') || die;
-// Include header.
-$sidepostdrawer = true;
-require_once(dirname(__FILE__) . '/includes/header.php');
-// Include secondary navigation.
-require_once(dirname(__FILE__) . '/includes/secondarynav.php');
-?>
-
-
- page_navbar();
- ?>
-
-
-
- get_course_alerts();
- echo $OUTPUT->course_content_header();
- if (!empty($secondarynavigation)) {
- echo $secondarynavigation;
- }
- if (!empty($overflow)) {
- echo $overflow;
- }
- echo $OUTPUT->main_content();
- if ($PAGE->has_set_url()) {
- $currenturl = $PAGE->url;
- } else {
- $currenturl = $_SERVER["REQUEST_URI"];
- } ?>
-
-
-
-
-
-
-
-secure_layout();
diff --git a/lib.php b/lib.php
index 91d4045..6576d2f 100644
--- a/lib.php
+++ b/lib.php
@@ -104,6 +104,7 @@ function theme_adaptable_get_main_scss_content($theme) {
'button',
'course',
'extras',
+ 'header',
'login',
'menu',
'responsive',
@@ -182,6 +183,7 @@ function theme_adaptable_process_scss($scss, $theme) {
'[[setting:buttoncolor]]' => '#51666C',
'[[setting:buttontextcolor]]' => '#ffffff',
'[[setting:buttonhovercolor]]' => '#009688',
+ '[[setting:buttontexthovercolor]]' => '#eeeeee',
'[[setting:buttoncolorscnd]]' => '#51666C',
'[[setting:buttontextcolorscnd]]' => '#ffffff',
'[[setting:buttonhovercolorscnd]]' => '#009688',
@@ -211,7 +213,9 @@ function theme_adaptable_process_scss($scss, $theme) {
'[[setting:footerlinkcolor]]' => '#ffffff',
'[[setting:headerbkcolor]]' => '#00796B',
'[[setting:headerbkcolor2]]' => '#009688',
+ '[[setting:headerbgimagetextcolour]]' => '#ffffff',
'[[setting:headertextcolor]]' => '#ffffff',
+ '[[setting:headertextcolor2]]' => '#ffffff',
'[[setting:msgbadgecolor]]' => '#E53935',
'[[setting:blockbackgroundcolor]]' => '#FFFFFF',
'[[setting:blockheaderbackgroundcolor]]' => '#FFFFFF',
@@ -675,21 +679,6 @@ function theme_adaptable_page_init(moodle_page $page) {
}
}
-/**
- * Strip full site title from header
- * @param string $heading
- */
-function theme_adaptable_remove_site_fullname($heading) {
- global $SITE, $PAGE;
- if (strpos($PAGE->pagetype, 'course-view-') === 0) {
- return $heading;
- }
-
- $header = preg_replace("/^" . $SITE->fullname . "/", "", $heading);
-
- return $header;
-}
-
/**
*
* Get the current page to allow us to check if the block is allowed to display.
diff --git a/scss/nosettings/_header.scss b/scss/nosettings/_header.scss
index 69305ad..dabe0fb 100644
--- a/scss/nosettings/_header.scss
+++ b/scss/nosettings/_header.scss
@@ -29,8 +29,11 @@
background-size: cover;
}
-#sitetitle img {
- max-height: 107px;
- max-width: 100%;
- width: auto;
+#headertitle,
+#sitetitle {
+ img {
+ max-height: 107px;
+ max-width: 100%;
+ width: auto;
+ }
}
diff --git a/scss/settings/adaptable.scss b/scss/settings/adaptable.scss
index 710aaaa..66c15bf 100644
--- a/scss/settings/adaptable.scss
+++ b/scss/settings/adaptable.scss
@@ -86,16 +86,6 @@ a:focus {
outline-offset: -2px;
}
-// Lists.
-#adaptable-page-header-wrapper {
- .dropdown-menu > li > a:hover,
- .dropdown-menu > li > a:focus,
- .dropdown-submenu:hover > a,
- .dropdown-submenu:focus > a {
- background-image: none;
- }
-}
-
// Text Selection.
::selection,
::-moz-selection {
@@ -203,6 +193,7 @@ div.signuppanel h2 {
// Header.
#adaptable-page-header-wrapper {
background-color: [[setting:headerbkcolor2]];
+ color: [[setting:headertextcolor2]];
z-index: 10;
&.sticky {
@@ -211,6 +202,14 @@ div.signuppanel h2 {
top: 0;
width: 100%;
}
+
+ // Lists.
+ .dropdown-menu > li > a:hover,
+ .dropdown-menu > li > a:focus,
+ .dropdown-submenu:hover > a,
+ .dropdown-submenu:focus > a {
+ background-image: none;
+ }
}
#page-header {
@@ -237,15 +236,15 @@ div.signuppanel h2 {
margin: 5px 15px 10px 0;
}
-#sitetitle,
-#sitetitle a,
-#sitetitle p,
-#sitetitle h1,
-#sitetitle h2,
-#sitetitle h3,
-#sitetitle h4,
-#sitetitle h5,
-#sitetitle h6 {
+#headertitle,
+#headertitle a,
+#headertitle p,
+#headertitle h1,
+#headertitle h2,
+#headertitle h3,
+#headertitle h4,
+#headertitle h5,
+#headertitle h6 {
color: [[setting:fonttitlecolor]];
font-family: [[setting:fonttitlename]], sans-serif;
@@ -682,56 +681,41 @@ langmenu a:hover {
}
.breadcrumb {
- background: none !important;
- background-color: [[setting:breadcrumb]] !important;
- padding: 5px;
-}
-
-.breadcrumb li {
- margin: 5px 0;
- text-shadow: none;
-}
-
-.breadcrumb li span a {
- text-decoration: none;
-}
-
-.breadcrumb li span.divider {
- display: none !important;
-}
-
-.breadcrumb > a {
- display: inline-block;
- margin: 5px 0;
-}
-
-.breadcrumb .fa {
- display: inline;
- margin: 12px 0;
+ background-color: [[setting:breadcrumb]];
+ padding: 0 10px;
+ li {
+ margin: 5px 0;
+ text-shadow: none;
+ span {
+ a {
+ text-decoration: none;
+ }
+ &.divider {
+ border-bottom: 0 solid [[setting:maincolor]];
+ display: none !important;
+ }
+ }
+ a.firstli {
+ padding-left: 15px;
+ padding-right: 20px;
+ }
+ }
+ > a {
+ display: inline-block;
+ margin: 5px 0;
+ }
+ ul i,
+ li.lastli span {
+ color: [[setting:breadcrumbtextcolor]];
+ text-decoration: none;
+ }
}
.separator {
margin: 9px;
-}
-
-.separator i {
- margin-left: 5px;
-}
-
-.breadcrumb ul i,
-.breadcrumb li.lastli span {
- color: [[setting:breadcrumbtextcolor]];
- text-decoration: none;
-}
-
-.breadcrumb li a.firstli {
- padding-left: 15px;
- padding-right: 20px;
-}
-
-.breadcrumb li span.divider {
- border-bottom: 0 solid [[setting:maincolor]];
- display: none !important;
+ i {
+ margin-left: 5px;
+ }
}
.breadcrumb-button {
@@ -1313,10 +1297,10 @@ button.search-box__button {
}
.search-box__button:hover {
- background: [[setting:buttonhovercolor]];
+ background-color: [[setting:buttonhovercolor]];
border: 1px solid rgba(#000, .05);
box-shadow: 1px 1px 2px rgba(255, 255, 255, .2);
- color: [[setting:buttontextcolor]];
+ color: [[setting:buttontexthovercolor]];
opacity: 0.9;
text-decoration: none;
text-shadow: -1px -1px 0 [[setting:buttonhovercolor]];
@@ -1872,7 +1856,6 @@ a.dimmed_text:visited,
#savediscardsection {
background-color: #eee;
filter: alpha(opacity=80);
- min-width: 100%;
min-height: 30px;
opacity: 0.8;
padding: 10px;
@@ -1881,6 +1864,38 @@ a.dimmed_text:visited,
width: 100%;
}
+@media (min-width: 992px) {
+ #page.drawers {
+ #savediscardsection {
+ margin-left: -1.25rem;
+ padding-left: 1.5rem;
+ padding-right: 1.5rem;
+ }
+ &.show-drawer-left,
+ &.show-drawer-right {
+ #savediscardsection {
+ min-width: auto;
+ }
+ }
+ &.show-drawer-left {
+ #savediscardsection {
+ margin-left: 0;
+ width: calc(100% - #{$drawer-left-width});
+ }
+ }
+ &.show-drawer-right {
+ #savediscardsection {
+ width: calc(100% - #{$drawer-right-width});
+ }
+ }
+ &.show-drawer-left.show-drawer-right {
+ #savediscardsection {
+ width: calc(100% - #{$drawer-left-width} - #{$drawer-right-width});
+ }
+ }
+ }
+}
+
img.smallicon {
height: 16px;
width: 16px;
@@ -2096,12 +2111,17 @@ img.smallicon {
color: #000 !important;
}
-// Danger icon.
-.text-danger,
+
+.text-danger .icon,
.notconnected,
.que .validationerror,
.text-error {
color: [[setting:dangericoncolor]] !important;
+}
+
+.notconnected,
+.que .validationerror,
+.text-error {
margin-right: 1px !important;
margin-top: 8px !important;
}
diff --git a/scss/settings/button.scss b/scss/settings/button.scss
index 74bb2b6..c3ef628 100644
--- a/scss/settings/button.scss
+++ b/scss/settings/button.scss
@@ -42,6 +42,19 @@
text-shadow: none;
}
+.btn {
+ &.btn-icon {
+ @include hover-focus {
+ background-color: [[setting:buttonhovercolor]];
+ color: [[setting:buttontexthovercolor]];
+ }
+ }
+ // Caret.
+ .caret {
+ border-top-color: [[setting:buttontextcolor]] !important;
+ }
+}
+
// Primary button.
.btn-primary,
.backup-restore .singlebutton button[type="submit"],
@@ -64,7 +77,6 @@ td.submit input,
div.discussionsubscription > a.discussiontoggle,
.btn-outline-secondary,
.paging-morelink a,
-.btn-link,
a#adaptable-message-user-button,
// Add Restrictions Dialogue.
@@ -91,7 +103,7 @@ a#adaptable-message-user-button,
.btn-primary:hover {
background-color: [[setting:buttonhovercolor]] !important;
text-decoration: none !important;
- color: [[setting:buttontextcolor]] !important;
+ color: [[setting:buttontexthovercolor]] !important;
}
// Secondary button.
@@ -131,7 +143,6 @@ a.submit:hover,
.submitbutton:hover,
.nav-pills > .active > a:hover, .nav-pills > .active > a:focus,
.btn-outline-secondary:hover,
-.btn-link:hover,
div.discussionsubscription > a.discussiontoggle:hover,
a#adaptable-message-user-button:hover,
@@ -145,7 +156,7 @@ a#adaptable-message-user-button:hover,
background-position: 0 -100%;
background-color: [[setting:buttonhovercolor]] !important;
text-decoration: none !important;
- color: [[setting:buttontextcolor]] !important;
+ color: [[setting:buttontexthovercolor]] !important;
}
input[type="submit"]:focus,
@@ -156,7 +167,7 @@ a.submit:focus, #notice .singlebutton + .singlebutton input:focus,
background-color: [[setting:buttonhovercolor]] !important;
background-position: 0 -100%;
text-decoration: none !important;
- color: [[setting:buttontextcolor]] !important;
+ color: [[setting:buttontexthovercolor]] !important;
}
button.close {
@@ -228,7 +239,7 @@ input#id_submitbutton2[disabled],
td.submit input[disabled] {
background-image: none;
background-color: [[setting:buttonhovercolor]] !important;
- color: [[setting:buttontextcolor]] !important;
+ color: [[setting:buttontexthovercolor]] !important;
box-shadow: 0 [[setting:buttondropshadow]] 0 0 rgba(0, 0, 0, 0.5) inset;
}
@@ -348,11 +359,6 @@ button[name="resetbutton"]:hover,
border: none;
}
-// Caret.
-.btn .caret {
- border-top-color: [[setting:buttontextcolor]] !important;
-}
-
// Message Drawer styles (moodle 3.6 and higher).
// Hide messages drawer unused buttons.
@@ -391,27 +397,42 @@ a.btn[data-toggle="popover"] {
}
// .btn-link styles.
-.btn-link {
- background-color: transparent;
- color: [[setting:linkcolor]] !important;
+.btn-link,
+a.btn-link {
+ background-color: [[setting:buttoncolor]];
box-shadow: none;
-}
+ color: [[setting:buttontextcolor]] !important;
-.btn-link:hover,
-.btn-link:focus {
- background-color: transparent !important;
- color: [[setting:linkhover]] !important;
-}
+ &:hover,
+ :focus {
+ background-color: [[setting:buttonhovercolor]];
+ color: [[setting:buttontexthovercolor]] !important;
+ }
-.btn-link .icon {
- margin-right: 0;
-}
+ &.add-sections,
+ &.section-modchooser-link {
+ background-color: transparent;
+ color: [[setting:linkcolor]] !important;
-.btn-link .menu-action-text .icon {
- margin-top: 8px;
-}
+ &:hover,
+ :focus {
+ background-color: transparent;
+ color: [[setting:linkhover]] !important;
+ }
+ }
+ &.text-reset {
+ color: [[setting:buttontextcolor]] !important;
+ }
+ .icon {
+ margin-right: 0;
+ }
+
+ .menu-action-text .icon {
+ margin-top: 8px;
+ }
+}
.discussiontoggle {
padding: 10px;
diff --git a/scss/settings/course.scss b/scss/settings/course.scss
index 9a78252..a3d8a33 100644
--- a/scss/settings/course.scss
+++ b/scss/settings/course.scss
@@ -33,7 +33,7 @@
}
#coursetitle,
-#sitetitle #coursetitle {
+#headertitle #coursetitle {
color: [[setting:fonttitlecolorcourse]];
}
diff --git a/scss/settings/extras.scss b/scss/settings/extras.scss
index cc4fa11..3770eb0 100644
--- a/scss/settings/extras.scss
+++ b/scss/settings/extras.scss
@@ -508,7 +508,7 @@ ul.teachers {
background-image: none;
background-color: [[setting:buttonhovercolor]];
box-shadow: 0 -2px 0 0 rgba(0, 0, 0, 0.5) inset;
- color: [[setting:buttontextcolor]] !important;
+ color: [[setting:buttontexthovercolor]] !important;
}
.box {
diff --git a/scss/settings/header.scss b/scss/settings/header.scss
new file mode 100644
index 0000000..22fc5aa
--- /dev/null
+++ b/scss/settings/header.scss
@@ -0,0 +1,41 @@
+//
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see
.
+//
+//
+// Adaptable Header Style sheet
+//
+// @package theme_adaptable
+// @copyright © 2024 - G J Barnard
+// @author G J Barnard - {@link http://moodle.org/user/profile.php?id=442195}
+// @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+//
+
+.headerbgimage {
+ color: [[setting:headerbgimagetextcolour]];
+
+ .headersearch .btn,
+ #headertitle,
+ #headertitle a,
+ #headertitle p,
+ #headertitle h1,
+ #headertitle h2,
+ #headertitle h3,
+ #headertitle h4,
+ #headertitle h5,
+ #headertitle h6 {
+ color: [[setting:headerbgimagetextcolour]];
+ }
+}
diff --git a/scss/settings/menu.scss b/scss/settings/menu.scss
index 455d4fa..f9a17f7 100644
--- a/scss/settings/menu.scss
+++ b/scss/settings/menu.scss
@@ -75,6 +75,10 @@
transition: all [[setting:navbardropdowntransitiontime]];
}
+#adaptable-page-header-wrapper #main-navbar .navbar-nav {
+ margin-left: -[[setting:menufontpadding]];
+}
+
#adaptable-page-header-wrapper .dropdown-menu ul {
margin: 0;
padding: 0;
@@ -309,6 +313,16 @@
color: [[setting:navbardropdowntexthovercolor]];
}
+// Add dropdown menu items styles for each theme color (mantainning default hover colour for contrast).
+@each $color, $value in $theme-colors {
+ .dropdown-item.text-#{$color} {
+ color: $value;
+ &:hover {
+ color: [[setting:navbardropdowntexthovercolor]] !important; /* stylelint-disable-line declaration-no-important */
+ }
+ }
+}
+
.dropdown-item:focus-within a {
color: [[setting:navbardropdowntexthovercolor]];
}
@@ -447,8 +461,13 @@
margin-right: 0;
}
-#adaptable-page-header-wrapper #main-navbar .nav-item .nav-link .fa:not(.sections-menu) {
- margin-right: 2px;
+#adaptable-page-header-wrapper #main-navbar .nav-item {
+ .nav-link .fa:not(.sections-menu) {
+ margin-right: 2px;
+ }
+ &:first-of-type .nav-link .fa:not(.sections-menu) {
+ margin-left: 2px;
+ }
}
#adaptable-page-header-wrapper #main-navbar .nav-item .fa-circle {
diff --git a/scss/settings/responsive.scss b/scss/settings/responsive.scss
index cf9e026..523940b 100644
--- a/scss/settings/responsive.scss
+++ b/scss/settings/responsive.scss
@@ -131,8 +131,8 @@
margin: 0 auto;
}
- // Site title.
- #sitetitle {
+ // Header title.
+ #headertitle {
clear: both;
display: block;
height: auto;
diff --git a/scss/settings/search.scss b/scss/settings/search.scss
index 251fee9..811f2a2 100644
--- a/scss/settings/search.scss
+++ b/scss/settings/search.scss
@@ -23,23 +23,20 @@
//
.headersearch {
- color: [[setting:fonttitlecolor]];
padding: [[setting:searchboxpadding]];
+ .btn {
+ color: [[setting:headertextcolor2]];
+ }
}
-.headersearch .btn-close,
-.navbarsearchsocial .btn-close {
- border-width: 0;
-}
-
-.headersearch .btn-open {
- border-radius: 0;
- color: [[setting:fonttitlecolorcourse]];
-}
-
-.headersearch .btn,
-.navbarsearchsocial .btn {
- box-shadow: none;
+.headersearch,
+.navbarsearchsocial {
+ .btn {
+ box-shadow: none;
+ }
+ .btn-close {
+ border-width: 0;
+ }
}
#adaptable-page-header-wrapper #header2 a.btn-open i {
diff --git a/settings/array_definitions.php b/settings/array_definitions.php
index 70139de..aaa1af4 100644
--- a/settings/array_definitions.php
+++ b/settings/array_definitions.php
@@ -285,7 +285,7 @@
// Fonts and Google ones.
$fontlist = [
- 'sans-serif' => new lang_string('fontdefault', 'theme_adaptable'),
+ 'default' => new lang_string('fontdefault', 'theme_adaptable'),
'ABeeZee' => 'ABeeZee',
'Abel' => 'Abel',
'Abhaya Libre' => 'Abhaya Libre',
diff --git a/settings/buttons.php b/settings/buttons.php
index 985475a..6f79c97 100644
--- a/settings/buttons.php
+++ b/settings/buttons.php
@@ -61,6 +61,15 @@
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
+ // Buttons text hover color.
+ $name = 'theme_adaptable/buttontexthovercolor';
+ $title = get_string('buttontexthovercolor', 'theme_adaptable');
+ $description = get_string('buttontexthovercolordesc', 'theme_adaptable');
+ $previewconfig = null;
+ $setting = new admin_setting_configcolourpicker($name, $title, $description, '#eeeeee', $previewconfig);
+ $setting->set_updatedcallback('theme_reset_all_caches');
+ $page->add($setting);
+
// Buttons focus color.
$name = 'theme_adaptable/buttonfocuscolor';
$title = get_string('buttonfocuscolor', 'theme_adaptable');
diff --git a/settings/category_headers.php b/settings/category_headers.php
index 072e5d9..7c5de6e 100644
--- a/settings/category_headers.php
+++ b/settings/category_headers.php
@@ -105,6 +105,25 @@
$setting = new admin_setting_configstoredfile($name, $title, $description, 'categoryheaderbgimage' . $customheaderid);
$page->add($setting);
+ // Background image text colour.
+ $name = 'theme_adaptable/categoryheaderbgimagetextcolour' . $customheaderid;
+ $title = get_string('categoryheaderbgimagetextcolour', 'theme_adaptable', ['id' => $customheaderid,
+ 'name' => $catinfo['name'], ]);
+ $previewconfig = null;
+ if (empty($catinfo['children'])) {
+ $description = get_string('categoryheaderbgimagetextcolourdesc', 'theme_adaptable', ['id' => $customheaderid,
+ 'name' => $catinfo['name'], ]);
+ } else {
+ $description = get_string(
+ 'categoryheaderbgimagetextcolourdescchildren',
+ 'theme_adaptable',
+ ['id' => $customheaderid, 'name' => $catinfo['name'], 'children' => $childrentext]
+ );
+ }
+ $setting = new admin_setting_configcolourpicker($name, $title, $description, '#ffffff', $previewconfig);
+ $setting->set_updatedcallback('theme_reset_all_caches');
+ $page->add($setting);
+
// Logo.
$name = 'theme_adaptable/categoryheaderlogo' . $customheaderid;
$title = get_string('categoryheaderlogo', 'theme_adaptable', ['id' => $customheaderid,
diff --git a/settings/colors.php b/settings/colors.php
index fe67ab4..806b3c9 100644
--- a/settings/colors.php
+++ b/settings/colors.php
@@ -178,6 +178,15 @@
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
+ // Bottom header text color.
+ $name = 'theme_adaptable/headertextcolor2';
+ $title = get_string('headertextcolor2', 'theme_adaptable');
+ $description = get_string('headertextcolor2desc', 'theme_adaptable');
+ $previewconfig = null;
+ $setting = new admin_setting_configcolourpicker($name, $title, $description, '#ffffff', $previewconfig);
+ $setting->set_updatedcallback('theme_reset_all_caches');
+ $page->add($setting);
+
// Market blocks colors heading.
$name = 'theme_adaptable/settingsmarketingcolors';
$heading = get_string('settingsmarketingcolors', 'theme_adaptable');
diff --git a/settings/fonts.php b/settings/fonts.php
index 845b389..85145c2 100644
--- a/settings/fonts.php
+++ b/settings/fonts.php
@@ -79,7 +79,7 @@
$name = 'theme_adaptable/fontname';
$title = get_string('fontname', 'theme_adaptable');
$description = get_string('fontnamedesc', 'theme_adaptable');
- $default = 'sans-serif';
+ $default = 'default';
$setting = new admin_setting_configselect($name, $title, $description, $default, $fontlist);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
@@ -157,7 +157,7 @@
$name = 'theme_adaptable/fontheadername';
$title = get_string('fontheadername', 'theme_adaptable');
$description = get_string('fontheadernamedesc', 'theme_adaptable');
- $default = 'sans-serif';
+ $default = 'default';
$setting = new admin_setting_configselect($name, $title, $description, $default, $fontlist);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
@@ -182,7 +182,7 @@
$name = 'theme_adaptable/fonttitlename';
$title = get_string('fonttitlename', 'theme_adaptable');
$description = get_string('fonttitlenamedesc', 'theme_adaptable');
- $default = 'sans-serif';
+ $default = 'default';
$setting = new admin_setting_configselect($name, $title, $description, $default, $fontlist);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
diff --git a/settings/header.php b/settings/header.php
index 036e253..92e2edd 100644
--- a/settings/header.php
+++ b/settings/header.php
@@ -36,12 +36,21 @@
));
// Header image.
- $name = 'theme_adaptable/headerbgimage'; // TODO - served by 'theme_adaptable_pluginfile'?
+ $name = 'theme_adaptable/headerbgimage';
$title = get_string('headerbgimage', 'theme_adaptable');
$description = get_string('headerbgimagedesc', 'theme_adaptable');
$setting = new admin_setting_configstoredfile($name, $title, $description, 'headerbgimage');
$page->add($setting);
+ // Header image text colour.
+ $name = 'theme_adaptable/headerbgimagetextcolour';
+ $title = get_string('headerbgimagetextcolour', 'theme_adaptable');
+ $description = get_string('headerbgimagetextcolourdesc', 'theme_adaptable');
+ $previewconfig = null;
+ $setting = new admin_setting_configcolourpicker($name, $title, $description, '#ffffff', $previewconfig);
+ $setting->set_updatedcallback('theme_reset_all_caches');
+ $page->add($setting);
+
// Select type of login.
$name = 'theme_adaptable/displaylogin';
$title = get_string('displaylogin', 'theme_adaptable');
@@ -78,6 +87,18 @@
$page->add($setting);
// Course page header title.
+ $name = 'theme_adaptable/coursepageheaderhidetitle';
+ $title = get_string('coursepageheaderhidetitle', 'theme_adaptable');
+ $description = get_string('coursepageheaderhidetitledesc', 'theme_adaptable');
+ $existing = get_config('theme_adaptable', 'coursepageheaderhidesitetitle');
+ if (!empty($existing)) {
+ $default = $existing;
+ } else {
+ $default = false;
+ }
+ $setting = new admin_setting_configcheckbox($name, $title, $description, $default);
+ $page->add($setting);
+
$name = 'theme_adaptable/coursepageheaderhidesitetitle';
$title = get_string('coursepageheaderhidesitetitle', 'theme_adaptable');
$description = get_string('coursepageheaderhidesitetitledesc', 'theme_adaptable');
@@ -123,16 +144,22 @@
$setting = new admin_setting_configselect($name, $title, $description, 'fullname', $radchoices);
$page->add($setting);
- // Display Breadcrumb or Course title where the breadcrumb normally is.
- $name = 'theme_adaptable/breadcrumbdisplay';
- $title = get_string('breadcrumbdisplay', 'theme_adaptable');
- $description = get_string('breadcrumbdisplaydesc', 'theme_adaptable');
+ // Display Course title.
+ $name = 'theme_adaptable/enablecoursetitle';
+ $title = get_string('enablecoursetitle', 'theme_adaptable');
+ $description = get_string('enablecoursetitledesc', 'theme_adaptable');
$radchoices = [
- 'breadcrumb' => get_string('breadcrumb', 'theme_adaptable'),
'fullname' => get_string('coursetitlefullname', 'theme_adaptable'),
'shortname' => get_string('coursetitleshortname', 'theme_adaptable'),
+ 'off' => get_string('hide'),
];
- $setting = new admin_setting_configselect($name, $title, $description, 'breadcrumb', $radchoices);
+ $existing = get_config('theme_adaptable', 'enableheading');
+ if (!empty($existing)) {
+ $default = $existing;
+ } else {
+ $default = 'fullname';
+ }
+ $setting = new admin_setting_configselect($name, $title, $description, $default, $radchoices);
$page->add($setting);
// Course Title Maximum Width.
@@ -142,6 +169,18 @@
$setting = new admin_setting_configtext($name, $title, $description, '20', PARAM_INT);
$page->add($setting);
+ // Display Breadcrumb or Course title where the breadcrumb normally is.
+ $name = 'theme_adaptable/breadcrumbdisplay';
+ $title = get_string('breadcrumbdisplay', 'theme_adaptable');
+ $description = get_string('breadcrumbdisplaydesc', 'theme_adaptable');
+ $radchoices = [
+ 'breadcrumb' => get_string('breadcrumb', 'theme_adaptable'),
+ 'fullname' => get_string('coursetitlefullname', 'theme_adaptable'),
+ 'shortname' => get_string('coursetitleshortname', 'theme_adaptable'),
+ ];
+ $setting = new admin_setting_configselect($name, $title, $description, 'breadcrumb', $radchoices);
+ $page->add($setting);
+
// Breadcrumb home.
$name = 'theme_adaptable/breadcrumbhome';
$title = get_string('breadcrumbhome', 'theme_adaptable');
diff --git a/settings/layout_responsive.php b/settings/layout_responsive.php
index 0cd360b..48fa61f 100644
--- a/settings/layout_responsive.php
+++ b/settings/layout_responsive.php
@@ -77,6 +77,34 @@
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$page->add($setting);
+ // Hide header title.
+ $name = 'theme_adaptable/responsiveheadertitle';
+ $title = get_string('responsiveheadertitle', 'theme_adaptable');
+ $description = get_string('responsiveheadertitledesc', 'theme_adaptable');
+ $existing = get_config('theme_adaptable', 'responsivecoursetitle');
+ if (!empty($existing)) {
+ $default = $existing;
+ } else {
+ $default = 'd-none d-lg-inline-block';
+ }
+ $choices = $screensizeinlineblock;
+ $setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
+ $page->add($setting);
+
+ // Hide site title.
+ $name = 'theme_adaptable/responsivesitetitle';
+ $title = get_string('responsivesitetitle', 'theme_adaptable');
+ $description = get_string('responsivesitetitledesc', 'theme_adaptable');
+ $existing = get_config('theme_adaptable', 'responsivecoursetitle');
+ if (!empty($existing)) {
+ $default = $existing;
+ } else {
+ $default = 'd-none d-lg-inline-block';
+ }
+ $choices = $screensizeinlineblock;
+ $setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
+ $page->add($setting);
+
// Hide activity / section navigation.
$name = 'theme_adaptable/responsivesectionnav';
$title = get_string('responsivesectionnav', 'theme_adaptable');
diff --git a/settings/marketing_blocks.php b/settings/marketing_blocks.php
index f817560..f9757c0 100644
--- a/settings/marketing_blocks.php
+++ b/settings/marketing_blocks.php
@@ -61,6 +61,17 @@
$setting = new admin_setting_configcheckbox($name, $title, $description, $default, true, false);
$page->add($setting);
+ $name = 'theme_adaptable/marketingvisible';
+ $title = get_string('marketingvisible', 'theme_adaptable');
+ $description = get_string('marketingvisibledesc', 'theme_adaptable');
+ $options = [
+ 1 => get_string('marketingvisibleloggedout', 'theme_adaptable'),
+ 2 => get_string('marketingvisibleloggedin', 'theme_adaptable'),
+ 3 => get_string('marketingvisibleloggedinout', 'theme_adaptable'),
+ ];
+ $setting = new admin_setting_configselect($name, $title, $description, 3, $options);
+ $page->add($setting);
+
$name = 'theme_adaptable/frontpagemarketoption';
$title = get_string('frontpagemarketoption', 'theme_adaptable');
$description = get_string('frontpagemarketoptiondesc', 'theme_adaptable');
diff --git a/templates/footer.mustache b/templates/footer.mustache
new file mode 100644
index 0000000..06b58dc
--- /dev/null
+++ b/templates/footer.mustache
@@ -0,0 +1,89 @@
+{{!
+ This file is part of Moodle - http://moodle.org/
+
+ Moodle is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Moodle is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Moodle. If not, see
.
+
+ @copyright 2024 G J Barnard
+ {@link https://moodle.org/user/profile.php?id=442195}
+ {@link https://gjbarnard.co.uk}
+ @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later.
+}}
+{{!
+ @template theme_adaptable/footer
+
+ Footer.
+
+ Example context (json):
+ {
+ }
+}}
+{{{output.standard_after_main_region_html}}}
+
+
+{{#savediscard}}{{{savediscard}}}{{/savediscard}}
+
+
{{! End #page. }}
+