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
0307f8bc
Commit
0307f8bc
authored
Sep 26, 2016
by
Son Nguyen
Committed by
Gerrit Code Review
Sep 26, 2016
Browse files
Merge "Bug 1622729: Adding the annotation to the last left side 'cell'"
parents
b450d7be
f92ee6c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/module/framework/lib.php
View file @
0307f8bc
...
...
@@ -610,19 +610,25 @@ class Framework {
// Get the title for the option
$title
=
get_field
(
'framework_standard_element'
,
'shortname'
,
'id'
,
$data
->
option
);
// Find out how many blocks already exist for the view.
// Find out which is the last lefthand 'cell' on the page
$lastrow
=
get_field
(
'view'
,
'numrows'
,
'id'
,
$data
->
view
);
if
(
$lastrow
===
false
)
{
throw
new
MaharaException
(
'An error occurred. A valid view should not have an empty "numrows" column'
);
}
// Find out how many blocks already exist for this 'cell'.
$maxorder
=
get_field_sql
(
'SELECT MAX("order") FROM {block_instance} WHERE "view"=? AND "row"=? AND "column"=?'
,
array
(
$data
->
view
,
1
,
1
)
array
(
$data
->
view
,
$lastrow
,
1
)
);
// Create the block at the end of the cell.
// Create the block at the end of the 'cell'.
$annotation
=
new
BlockInstance
(
0
,
array
(
'blocktype'
=>
'annotation'
,
'title'
=>
(
get_string
(
'Annotation'
,
'artefact.annotation'
)
.
': '
.
$title
),
'view'
=>
$data
->
view
,
'row'
=>
1
,
'row'
=>
$lastrow
,
'column'
=>
1
,
'order'
=>
$maxorder
+
1
,
'order'
=>
(
int
)
$maxorder
+
1
,
));
$annotation
->
commit
();
$new
=
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