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
9fa3c03a
Commit
9fa3c03a
authored
Jun 02, 2017
by
Robert Lyon
Committed by
Gerrit Code Review
Jun 02, 2017
Browse files
Merge "Bug 1694155: Return new block id when calling View->addblocktype"
parents
b4114079
dc821b27
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/view.php
View file @
9fa3c03a
...
...
@@ -2105,9 +2105,11 @@ class View {
* adds a block with the given type to a view
*
* @param array $values parameters for this function
* blocktype => string name of blocktype to add
* column => int column to add to
* order => position in column
* blocktype => string name of blocktype to add
* column => int column to add to
* order => position in column
* returndata => return the rendered HTML for the block, or
* the id of the block if 'returndata' = 'id'
*
*/
public
function
addblocktype
(
$values
)
{
...
...
@@ -2149,7 +2151,10 @@ class View {
$bi
->
commit
();
$this
->
dirtycolumns
[
$values
[
'row'
]][
$values
[
'column'
]]
=
1
;
if
(
$values
[
'returndata'
])
{
if
(
$values
[
'returndata'
]
===
'id'
)
{
return
$bi
->
get
(
'id'
);
}
else
if
(
$values
[
'returndata'
])
{
// Return new block rendered in both configure mode and (editing) display mode
$result
=
array
(
'display'
=>
$bi
->
render_editing
(
false
,
true
),
...
...
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