Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moodle-theme_boost_campus_child
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elc
moodle-theme_boost_campus_child
Commits
0901e976
Commit
0901e976
authored
3 years ago
by
Julian Wendling
Browse files
Options
Downloads
Patches
Plain Diff
REMOVE All unneeded theme settings
parent
bd3c2905
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
lang/en/theme_boost_campus_child.php
+4
-0
4 additions, 0 deletions
lang/en/theme_boost_campus_child.php
lib.php
+1
-24
1 addition, 24 deletions
lib.php
settings.php
+2
-106
2 additions, 106 deletions
settings.php
with
7 additions
and
130 deletions
lang/en/theme_boost_campus_child.php
+
4
−
0
View file @
0901e976
...
...
@@ -36,5 +36,9 @@ $string['region-footer-middle'] = 'Footer (middle)';
$string
[
'region-footer-right'
]
=
'Footer (right)'
;
$string
[
'region-side-pre'
]
=
'Right'
;
// PRIVACY.
$string
[
'privacy:metadata'
]
=
'The Boost Campus Child theme does not store any personal data about any user.'
;
// SETTINGS.
$string
[
'settingsheading'
]
=
'All Settings should be changed in Boost Campus Theme'
;
\ No newline at end of file
This diff is collapsed.
Click to expand it.
lib.php
+
1
−
24
View file @
0901e976
...
...
@@ -118,30 +118,7 @@ function theme_boost_campus_child_get_pre_scss($theme) {
$boostcampusprescss
=
theme_boost_campus_get_pre_scss
(
$boostcampusconfig
);
// MODIFICATION END.
$scss
=
''
;
$configurable
=
[
// Config key => [variableName, ...].
'brandcolor'
=>
[
'primary'
],
// MODIFICATION START: Add own variables.
'brandsuccesscolor'
=>
[
'success'
],
'brandinfocolor'
=>
[
'info'
],
'brandwarningcolor'
=>
[
'warning'
],
'branddangercolor'
=>
[
'danger'
],
// MODIFICATION END.
];
// Prepend variables first.
foreach
(
$configurable
as
$configkey
=>
$targets
)
{
$value
=
isset
(
$theme
->
settings
->
{
$configkey
})
?
$theme
->
settings
->
{
$configkey
}
:
null
;
if
(
empty
(
$value
))
{
continue
;
}
array_map
(
function
(
$target
)
use
(
&
$scss
,
$value
)
{
$scss
.
=
'$'
.
$target
.
': '
.
$value
.
";
\n
"
;
},
(
array
)
$targets
);
}
// Prepend pre-scss.
// Prepend boost campus child pre-scss.
if
(
!
empty
(
$theme
->
settings
->
scsspre
))
{
$scss
.
=
$theme
->
settings
->
scsspre
;
}
...
...
This diff is collapsed.
Click to expand it.
settings.php
+
2
−
106
View file @
0901e976
...
...
@@ -34,115 +34,11 @@ if ($ADMIN->fulltree) {
$page
=
new
admin_settingpage
(
'theme_boost_campus_child_general'
,
get_string
(
'generalsettings'
,
'theme_boost'
,
null
,
true
));
// Settings title to group preset related settings together with a common heading. We don't want a description here.
$name
=
'theme_boost_campus_child/
pre
setheading'
;
$title
=
get_string
(
'
presetheadingsett
ing'
,
'theme_boost_campus'
,
null
,
true
);
$name
=
'theme_boost_campus_child/set
tings
heading'
;
$title
=
get_string
(
'
settingshead
ing'
,
'theme_boost_campus
_child
'
,
null
,
true
);
$setting
=
new
admin_setting_heading
(
$name
,
$title
,
null
);
$page
->
add
(
$setting
);
// Replicate the preset setting from theme_boost.
$name
=
'theme_boost_campus_child/preset'
;
$title
=
get_string
(
'preset'
,
'theme_boost'
,
null
,
true
);
$description
=
get_string
(
'preset_desc'
,
'theme_boost'
,
null
,
true
);
$default
=
'default.scss'
;
// We list files in our own file area to add to the drop down. We will provide our own function to
// load all the presets from the correct paths.
$context
=
context_system
::
instance
();
$fs
=
get_file_storage
();
$files
=
$fs
->
get_area_files
(
$context
->
id
,
'theme_boost_campus_child'
,
'preset'
,
0
,
'itemid, filepath, filename'
,
false
);
$choices
=
[];
foreach
(
$files
as
$file
)
{
$choices
[
$file
->
get_filename
()]
=
$file
->
get_filename
();
}
// These are the built in presets from Boost.
$choices
[
'default.scss'
]
=
'default.scss'
;
$choices
[
'plain.scss'
]
=
'plain.scss'
;
$setting
=
new
admin_setting_configselect
(
$name
,
$title
,
$description
,
$default
,
$choices
);
$setting
->
set_updatedcallback
(
'theme_reset_all_caches'
);
$page
->
add
(
$setting
);
// Preset files setting.
$name
=
'theme_boost_campus_child/presetfiles'
;
$title
=
get_string
(
'presetfiles'
,
'theme_boost'
,
null
,
true
);
$description
=
get_string
(
'presetfiles_desc'
,
'theme_boost'
,
null
,
true
);
$setting
=
new
admin_setting_configstoredfile
(
$name
,
$title
,
$description
,
'preset'
,
0
,
array
(
'maxfiles'
=>
20
,
'accepted_types'
=>
array
(
'.scss'
)));
$page
->
add
(
$setting
);
// Settings title to group brand color related settings together with a common heading. We don't want a description here.
$name
=
'theme_boost_campus_child/brandcolorheading'
;
$title
=
get_string
(
'brandcolorheadingsetting'
,
'theme_boost_campus'
,
null
,
true
);
$setting
=
new
admin_setting_heading
(
$name
,
$title
,
null
);
$page
->
add
(
$setting
);
// Variable $brand-color.
// We use an empty default value because the default colour should come from the preset.
$name
=
'theme_boost_campus_child/brandcolor'
;
$title
=
get_string
(
'brandcolor'
,
'theme_boost'
,
null
,
true
);
$description
=
get_string
(
'brandcolor_desc'
,
'theme_boost'
,
null
,
true
);
$setting
=
new
admin_setting_configcolourpicker
(
$name
,
$title
,
$description
,
''
);
$setting
->
set_updatedcallback
(
'theme_reset_all_caches'
);
$page
->
add
(
$setting
);
// Variable $brand-succes-color.
$name
=
'theme_boost_campus_child/brandsuccesscolor'
;
$title
=
get_string
(
'brandsuccesscolorsetting'
,
'theme_boost_campus'
,
null
,
true
);
$description
=
get_string
(
'brandsuccesscolorsetting_desc'
,
'theme_boost_campus'
,
null
,
true
);
$setting
=
new
admin_setting_configcolourpicker
(
$name
,
$title
,
$description
,
''
);
$setting
->
set_updatedcallback
(
'theme_reset_all_caches'
);
$page
->
add
(
$setting
);
// Variable $brand-info-color.
$name
=
'theme_boost_campus_child/brandinfocolor'
;
$title
=
get_string
(
'brandinfocolorsetting'
,
'theme_boost_campus'
,
null
,
true
);
$description
=
get_string
(
'brandinfocolorsetting_desc'
,
'theme_boost_campus'
,
null
,
true
);
$setting
=
new
admin_setting_configcolourpicker
(
$name
,
$title
,
$description
,
''
);
$setting
->
set_updatedcallback
(
'theme_reset_all_caches'
);
$page
->
add
(
$setting
);
// Variable $brand-warning-color.
$name
=
'theme_boost_campus_child/brandwarningcolor'
;
$title
=
get_string
(
'brandwarningcolorsetting'
,
'theme_boost_campus'
,
null
,
true
);
$description
=
get_string
(
'brandwarningcolorsetting_desc'
,
'theme_boost_campus'
,
null
,
true
);
$setting
=
new
admin_setting_configcolourpicker
(
$name
,
$title
,
$description
,
''
);
$setting
->
set_updatedcallback
(
'theme_reset_all_caches'
);
$page
->
add
(
$setting
);
// Variable $brand-warning-color.
$name
=
'theme_boost_campus_child/branddangercolor'
;
$title
=
get_string
(
'branddangercolorsetting'
,
'theme_boost_campus'
,
null
,
true
);
$description
=
get_string
(
'branddangercolorsetting_desc'
,
'theme_boost_campus'
,
null
,
true
);
$setting
=
new
admin_setting_configcolourpicker
(
$name
,
$title
,
$description
,
''
);
$setting
->
set_updatedcallback
(
'theme_reset_all_caches'
);
$page
->
add
(
$setting
);
// Add tab to settings page.
$settings
->
add
(
$page
);
// Create advanced settings tab.
$page
=
new
admin_settingpage
(
'theme_boost_campus_child_advanced'
,
get_string
(
'advancedsettings'
,
'theme_boost'
,
null
,
true
));
// Raw SCSS to include before the content.
$name
=
'theme_boost_campus_child/scsspre'
;
$title
=
get_string
(
'rawscsspre'
,
'theme_boost'
,
null
,
true
);
$description
=
get_string
(
'rawscsspre_desc'
,
'theme_boost'
,
null
,
true
);
$setting
=
new
admin_setting_scsscode
(
$name
,
$title
,
$description
,
''
,
PARAM_RAW
);
$setting
->
set_updatedcallback
(
'theme_reset_all_caches'
);
$page
->
add
(
$setting
);
// Raw SCSS to include after the content.
$name
=
'theme_boost_campus_child/scss'
;
$title
=
get_string
(
'rawscss'
,
'theme_boost'
,
null
,
true
);
$description
=
get_string
(
'rawscss_desc'
,
'theme_boost'
,
null
,
true
);
$setting
=
new
admin_setting_scsscode
(
$name
,
$title
,
$description
,
''
,
PARAM_RAW
);
$setting
->
set_updatedcallback
(
'theme_reset_all_caches'
);
$page
->
add
(
$setting
);
// Add tab to settings page.
$settings
->
add
(
$page
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment