Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
mahara
mahara
Commits
00fa6014
Commit
00fa6014
authored
Jun 13, 2019
by
Robert Lyon
Committed by
Gerrit Code Review
Jun 13, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge "Bug 1827272: move theme dropdown menu to page settings"
parents
a07cd80a
33d1f349
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
30 additions
and
50 deletions
+30
-50
htdocs/js/views.js
htdocs/js/views.js
+0
-17
htdocs/lang/en.utf8/view.php
htdocs/lang/en.utf8/view.php
+2
-1
htdocs/theme/raw/templates/view/blocks.tpl
htdocs/theme/raw/templates/view/blocks.tpl
+0
-24
htdocs/theme/raw/templates/view/changetheme.tpl
htdocs/theme/raw/templates/view/changetheme.tpl
+1
-1
htdocs/view/blocks.php
htdocs/view/blocks.php
+0
-5
htdocs/view/editlayout.php
htdocs/view/editlayout.php
+22
-0
test/behat/features/settings/user_themes.feature
test/behat/features/settings/user_themes.feature
+5
-2
No files found.
htdocs/js/views.js
View file @
00fa6014
...
...
@@ -208,8 +208,6 @@
showColumnBackgroundsOnSort
();
rewriteViewThemeSelector
();
makeNewBlocksDraggable
();
makeExistingBlocksSortable
();
...
...
@@ -1141,21 +1139,6 @@
}
}
/**
* Wire up the view theme selector
*/
function
rewriteViewThemeSelector
()
{
if
(
!
viewThemeSelect
)
{
return
;
}
var
currentTheme
=
$
(
'
option:selected
'
,
viewThemeSelect
).
val
();
viewThemeSelect
.
on
(
'
change
'
,
function
()
{
if
(
$
(
'
option:selected
'
,
viewThemeSelect
).
val
()
!=
currentTheme
)
{
$
(
viewThemeSelect
).
closest
(
'
form
'
).
trigger
(
'
submit
'
);
}
});
}
function
addConfigureBlock
(
oldblock
,
configblock
,
removeoncancel
)
{
hideMediaPlayers
();
...
...
htdocs/lang/en.utf8/view.php
View file @
00fa6014
...
...
@@ -521,9 +521,10 @@ $string['textbox1'] = 'Note';
$string
[
'image'
]
=
'Image'
;
$string
[
'addcontent'
]
=
'Add Content'
;
$string
[
'theme'
]
=
'Theme'
;
$string
[
'choosethemedesc'
]
=
'Choose a theme for the page.'
;
$string
[
'lockblocks'
]
=
"Lock blocks"
;
$string
[
'lockblocksdescription'
]
=
"You can lock the blocks on the page and prevent th
at they are
removed when people copy the page."
;
$string
[
'lockblocksdescription'
]
=
"You can lock the blocks on the page and prevent th
em from being
removed when people copy the page."
;
$string
[
'instructions'
]
=
'Instructions'
;
$string
[
'advanced'
]
=
'Advanced'
;
...
...
htdocs/theme/raw/templates/view/blocks.tpl
View file @
00fa6014
...
...
@@ -36,18 +36,6 @@
<div
id=
"editcontent-sidebar-wrapper"
class=
"col-collapse"
>
<div
id=
"editcontent-sidebar"
data-spy=
"affix"
data-offset-top=
"420"
data-offset-top=
"100"
class=
"toolbar-affix"
>
{
include
file
=
"view/contenteditor.tpl"
selected
=
'content'
}
{
if
$viewthemes
}
<div
id=
"select-theme"
class=
"select dropdown theme-dropdown"
>
<label
id=
"select-theme-header"
>
{
str
tag
=
theme
section
=
view
}
</label>
<span
class=
"picker"
>
<select
id=
"viewtheme-select"
class=
"form-control select"
name=
"viewtheme"
>
{
foreach
from
=
$viewthemes
key
=
themeid
item
=
themename
}
<option
value=
"
{
$themeid
}
"
{
if
$themeid
==
$viewtheme
}
selected=
"selected"
{/
if
}
>
{
$themename
}
</option>
{/
foreach
}
</select>
</span>
</div>
{/
if
}
</div>
</div>
<div
class=
"col-with-collapse"
>
...
...
@@ -102,18 +90,6 @@
<div
id=
"editcontent-sidebar-wrapper"
class=
"col-collapse"
>
<div
id=
"editcontent-sidebar"
>
{
include
file
=
"view/contenteditor.tpl"
selected
=
'content'
}
{
if
$viewthemes
}
<div
id=
"select-theme"
class=
"select dropdown theme-dropdown"
>
<label
id=
"select-theme-header"
>
{
str
tag
=
theme
section
=
view
}
</label>
<span
class=
"picker"
>
<select
id=
"viewtheme-select"
class=
"form-control select"
name=
"viewtheme"
>
{
foreach
from
=
$viewthemes
key
=
themeid
item
=
themename
}
<option
value=
"
{
$themeid
}
"
{
if
$themeid
==
$viewtheme
}
selected=
"selected"
{/
if
}
>
{
$themename
}
</option>
{/
foreach
}
</select>
</span>
</div>
{/
if
}
</div>
</div>
<div
class=
"blockconfig-background"
>
...
...
htdocs/theme/raw/templates/view/changetheme.tpl
View file @
00fa6014
...
...
@@ -5,7 +5,7 @@
<form
action=
"
{
$formurl
}
"
method=
"post"
class=
"pieform form-inline"
>
<input
type=
"hidden"
id=
"viewid"
name=
"id"
value=
"
{
$view
}
"
>
<input
type=
"hidden"
name=
"sesskey"
value=
"
{
$SESSKEY
}
"
>
<div
class=
"select
form-group
"
>
<div
class=
"select"
>
<label
for=
"viewtheme-select"
>
{
str
tag
=
theme
}
:
</label>
<span
class=
"picker"
>
<select
id=
"viewtheme-select"
name=
"viewtheme"
class=
"form-control select autofocus"
>
...
...
htdocs/view/blocks.php
View file @
00fa6014
...
...
@@ -265,11 +265,6 @@ if (isset($groupurl)) {
}
$smarty
->
assign
(
'institution'
,
$institution
);
if
(
get_config
(
'userscanchooseviewthemes'
)
&&
$view
->
is_themeable
())
{
$smarty
->
assign
(
'viewtheme'
,
$viewtheme
);
$smarty
->
assign
(
'viewthemes'
,
$allowedthemes
);
}
$smarty
->
assign
(
'viewid'
,
$view
->
get
(
'id'
));
$collectionid
=
false
;
if
(
$collection
=
$view
->
get
(
'collection'
))
{
...
...
htdocs/view/editlayout.php
View file @
00fa6014
...
...
@@ -382,6 +382,25 @@ function get_advanced_elements() {
'defaultvalue'
=>
$view
->
get
(
'anonymise'
),
);
}
// Theme dropdown
$theme
=
$view
->
set_user_theme
();
$allowedthemes
=
get_user_accessible_themes
();
if
(
$theme
&&
!
isset
(
$allowedthemes
[
$theme
]))
{
// We have page set with an unknown theme
// So redirect it to the choose theme page first
redirect
(
'/view/blocks.php?id='
.
$view
->
get
(
'id'
));
}
if
(
get_config
(
'userscanchooseviewthemes'
)
&&
$view
->
is_themeable
())
{
$elements
[
'theme'
]
=
array
(
'type'
=>
'select'
,
'title'
=>
get_string
(
'theme'
,
'view'
),
'description'
=>
get_string
(
'choosethemedesc'
,
'view'
),
'options'
=>
$allowedthemes
,
'defaultvalue'
=>
$theme
,
);
};
return
$elements
;
}
...
...
@@ -1000,6 +1019,9 @@ function set_view_title_and_description(Pieform $form, $values) {
if
(
isset
(
$values
[
'lockblocks'
]))
{
$view
->
set
(
'lockblocks'
,
(
int
)
$values
[
'lockblocks'
]);
}
if
(
isset
(
$values
[
'theme'
]))
{
$view
->
set
(
'theme'
,
$values
[
'theme'
]);
}
if
(
isset
(
$values
[
'ownerformat'
])
&&
$view
->
get
(
'owner'
))
{
$view
->
set
(
'ownerformat'
,
$values
[
'ownerformat'
]);
}
...
...
test/behat/features/settings/user_themes.feature
View file @
00fa6014
...
...
@@ -24,6 +24,9 @@ Scenario: Activate page themes setting and edit a page (Bug 1591304)
Given
I log in as
"UserA"
with password
"Kupuh1pa!"
And
I follow
"Page UserA_01"
And
I follow
"Edit"
And
I scroll to the id
"select-theme"
And
I select
"Modern"
from
"viewtheme"
And
I follow
"Settings"
in the
"Toolbar buttons"
property
And
I follow
"Advanced"
And
I scroll to the id
"settings_theme"
And
I select
"Modern"
from
"theme"
And
I press
"Save"
Then
the
"div#logo-area"
element should contain
"/theme/modern/images/site-logo"
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