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
579a170c
Commit
579a170c
authored
Oct 09, 2015
by
Robert Lyon
Committed by
Gerrit Code Review
Oct 09, 2015
Browse files
Merge "Fix element attributes when creating custom layout (Bug #1486817)"
parents
261f1fde
dc632ff8
Changes
4
Hide whitespace changes
Inline
Side-by-side
htdocs/js/customlayout.js
View file @
579a170c
...
@@ -96,8 +96,8 @@
...
@@ -96,8 +96,8 @@
// clone and tweak
// clone and tweak
var
clone
=
$
(
'
.advancedlayoutselect input[type=radio]:first
'
).
parent
().
clone
();
var
clone
=
$
(
'
.advancedlayoutselect input[type=radio]:first
'
).
parent
().
clone
();
var
id
=
'
viewlayout_advancedlayoutselect
'
+
unique_timestamp
();
var
id
=
'
viewlayout_advancedlayoutselect
'
+
unique_timestamp
();
$
(
'
input
'
,
clone
).
attr
(
'
id
'
,
id
);
$
(
'
label
'
,
clone
).
attr
(
'
for
'
,
id
)
.
text
(
data
.
data
.
text
)
;
$
(
'
input
'
,
clone
).
val
(
layoutid
);
$
(
'
input
'
,
clone
).
attr
(
'
id
'
,
id
).
val
(
layoutid
);
$
(
'
svg
'
,
clone
).
replaceWith
(
data
.
data
.
layoutpreview
);
$
(
'
svg
'
,
clone
).
replaceWith
(
data
.
data
.
layoutpreview
);
//insert into appropriate row
//insert into appropriate row
...
...
htdocs/lib/view.php
View file @
579a170c
...
@@ -1209,7 +1209,12 @@ class View {
...
@@ -1209,7 +1209,12 @@ class View {
$structure
[
'text'
]
=
$alttext
;
$structure
[
'text'
]
=
$alttext
;
$layoutpreview
=
new
LayoutPreviewImage
(
$structure
);
$layoutpreview
=
new
LayoutPreviewImage
(
$structure
);
$preview
=
$layoutpreview
->
create_preview
();
$preview
=
$layoutpreview
->
create_preview
();
$data
=
array
(
'layoutid'
=>
$newlayoutid
,
'newlayout'
=>
1
,
'layoutpreview'
=>
$preview
);
$data
=
array
(
'layoutid'
=>
$newlayoutid
,
'newlayout'
=>
1
,
'layoutpreview'
=>
$preview
,
'text'
=>
$structure
[
'text'
]
);
return
$data
;
return
$data
;
}
}
...
...
htdocs/view/layout.php
View file @
579a170c
...
@@ -73,10 +73,13 @@ foreach ($layoutrows as $key => $layout) {
...
@@ -73,10 +73,13 @@ foreach ($layoutrows as $key => $layout) {
$layoutoptions
[
$key
][
'rows'
]
=
count
(
$layout
);
$layoutoptions
[
$key
][
'rows'
]
=
count
(
$layout
);
$structure
=
array
();
$structure
=
array
();
$rowtext
=
array
();
for
(
$r
=
1
;
$r
<=
count
(
$layout
);
$r
++
)
{
for
(
$r
=
1
;
$r
<=
count
(
$layout
);
$r
++
)
{
$structure
[
'layout'
][
'row'
.
$r
]
=
$layoutcolumns
[
$layout
[
$r
]]
->
widths
;
$widths
=
$layoutcolumns
[
$layout
[
$r
]]
->
widths
;
$structure
[
'layout'
][
'row'
.
$r
]
=
$widths
;
$rowtext
[]
=
str_replace
(
','
,
'-'
,
$widths
);
}
}
$structure
[
'text'
]
=
implode
(
' / '
,
$
structure
[
'layout'
]
);
$structure
[
'text'
]
=
implode
(
' / '
,
$
rowtext
);
$l
=
new
LayoutPreviewImage
(
$structure
);
$l
=
new
LayoutPreviewImage
(
$structure
);
$layoutoptions
[
$key
][
'layout'
]
=
$l
->
create_preview
();
$layoutoptions
[
$key
][
'layout'
]
=
$l
->
create_preview
();
$layoutoptions
[
$key
][
'columns'
]
=
$structure
[
'text'
];
$layoutoptions
[
$key
][
'columns'
]
=
$structure
[
'text'
];
...
...
test/behat/features/view/edit_page.feature
View file @
579a170c
...
@@ -30,3 +30,19 @@ Scenario: Clicking ID's (Bug 1428456)
...
@@ -30,3 +30,19 @@ Scenario: Clicking ID's (Bug 1428456)
# Checking if we can delete a block
# Checking if we can delete a block
When
I delete the block
"Ulysses"
When
I delete the block
"Ulysses"
Then
I should not see
"Buck Mulligan"
Then
I should not see
"Buck Mulligan"
# Checking if we can change page layout
When
I follow
"Edit layout"
And
I follow
"Create custom layout"
And
I press
"Add a row"
And
I wait
"1"
seconds
And
I select
"25 - 50 - 25"
from
"selectcollayoutrow_2"
And
I press
"Add a row"
And
I wait
"1"
seconds
And
I select
"5"
from
"selectnumcolsrow_3"
And
I select
"20 - 20 - 20 - 20 - 20"
from
"selectcollayoutrow_3"
And
I press
"Add a row"
And
I press
"Create new layout"
Then
I should see
"4 rows"
And
I press
"Save"
Then
I should see
"Page layout changed"
\ No newline at end of file
Write
Preview
Supports
Markdown
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