Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
81ecd263
Commit
81ecd263
authored
Apr 14, 2020
by
Cecilia Vela Gurovic
Committed by
Gerrit Code Review
Apr 14, 2020
Browse files
Merge "Bug 1871473: Fixing 'sitedefault' page theme problem"
parents
3d364fba
aaf7c5e9
Changes
4
Show whitespace changes
Inline
Side-by-side
htdocs/lang/en.utf8/view.php
View file @
81ecd263
...
...
@@ -385,6 +385,7 @@ $string['noaccesstoview'] = 'You do not have permission to access this page.';
$string
[
'wrongblocktype'
]
=
'The ID supplied is not for a valid blocktype.'
;
$string
[
'changeviewtheme'
]
=
'The theme you have chosen for this page is no longer available to you. Please select a different theme.'
;
$string
[
'nothemeselected1'
]
=
'Use institution theme'
;
$string
[
'usesitetheme'
]
=
'Use site theme'
;
// Templates
$string
[
'Template'
]
=
'Template'
;
...
...
htdocs/lib/mahara.php
View file @
81ecd263
...
...
@@ -777,7 +777,7 @@ function get_user_accessible_themes() {
}
}
$themes
=
array_merge
(
array
(
'sitedefault'
=>
get_string
(
'
nothemeselected1
'
,
'view'
)),
$themes
);
$themes
=
array_merge
(
array
(
'sitedefault'
=>
get_string
(
'
usesitetheme
'
,
'view'
)),
$themes
);
unset
(
$themes
[
'custom'
]);
return
$themes
;
...
...
htdocs/lib/web.php
View file @
81ecd263
...
...
@@ -1019,6 +1019,10 @@ class Theme {
$user
->
find_by_id
(
$userid
);
$themedata
=
$user
->
get_themedata
();
$themedata
->
viewbasename
=
$themedata
->
basename
;
if
(
empty
(
$themedata
->
viewbasename
)
&&
!
empty
(
$themedata
->
altname
)
&&
$themedata
->
altname
==
'sitedefault'
)
{
$themedata
->
viewbasename
=
get_config
(
'theme'
);
}
unset
(
$themedata
->
basename
);
}
}
...
...
htdocs/view/editlayout.php
View file @
81ecd263
...
...
@@ -387,6 +387,8 @@ function get_advanced_elements() {
// Theme dropdown
$theme
=
$view
->
set_user_theme
();
$allowedthemes
=
get_user_accessible_themes
();
$allowedthemes
=
array_merge
(
array
(
''
=>
get_string
(
'nothemeselected1'
,
'view'
)),
$allowedthemes
);
if
(
$theme
&&
!
isset
(
$allowedthemes
[
$theme
]))
{
// We have page set with an unknown theme
// So redirect it to the choose theme page first
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment