Commit 230c0629 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Bug 1515484: The my views block on dashboard had broken pagination"

parents 6ab16288 b86741d1
...@@ -19,9 +19,11 @@ safe_require('artefact', 'blog'); ...@@ -19,9 +19,11 @@ safe_require('artefact', 'blog');
$blogs = (object) array( $blogs = (object) array(
'offset' => param_integer('offset', 0), 'offset' => param_integer('offset', 0),
'limit' => param_integer('limit', 10), 'limit' => param_integer('limit', 10),
'institution' => param_alpha('institution', null),
'group' => param_integer('group', null),
); );
list($blogs->count, $blogs->data) = ArtefactTypeBlog::get_blog_list($blogs->limit, $blogs->offset); list($blogs->count, $blogs->data) = ArtefactTypeBlog::get_blog_list($blogs->limit, $blogs->offset, $blogs->institution, $blogs->group);
ArtefactTypeBlog::build_blog_list_html($blogs); ArtefactTypeBlog::build_blog_list_html($blogs);
json_reply(false, array('data' => $blogs)); json_reply(false, array('data' => $blogs));
...@@ -406,6 +406,7 @@ class ArtefactTypeBlog extends ArtefactType { ...@@ -406,6 +406,7 @@ class ArtefactTypeBlog extends ArtefactType {
'count' => $blogs->count, 'count' => $blogs->count,
'limit' => $blogs->limit, 'limit' => $blogs->limit,
'offset' => $blogs->offset, 'offset' => $blogs->offset,
'setlimit' => true,
'firsttext' => '', 'firsttext' => '',
'previoustext' => '', 'previoustext' => '',
'nexttext' => '', 'nexttext' => '',
......
...@@ -31,11 +31,11 @@ $dashboard = new View($viewid); ...@@ -31,11 +31,11 @@ $dashboard = new View($viewid);
if (!can_view_view($dashboard)) { if (!can_view_view($dashboard)) {
json_reply(true, get_string('accessdenied', 'error')); json_reply(true, get_string('accessdenied', 'error'));
} }
$userid = $USER->get('id');
$views = View::view_search( $views = View::view_search(
null, // $query null, // $query
null, // $ownerquery null, // $ownerquery
(object) array('owner' => $userid), // $ownedby (object) array('owner' => $dashboard->get('owner')), // $ownedby
null, // $copyableby null, // $copyableby
10, // $limit 10, // $limit
$offset, // $offset $offset, // $offset
......
...@@ -8,9 +8,11 @@ ...@@ -8,9 +8,11 @@
{if !$blogs->data} {if !$blogs->data}
<p class="no-results">{str tag=youhavenoblogs section=artefact.blog}</p> <p class="no-results">{str tag=youhavenoblogs section=artefact.blog}</p>
{else} {else}
<div id="bloglist" class="rel view-container"> <div class="rel view-container">
<div class="panel-items js-masonry" data-masonry-options='{ "itemSelector": ".panel" }'> <div class="panel-items js-masonry" data-masonry-options='{ "itemSelector": ".panel" }'>
{$blogs->tablerows|safe} <div id="bloglist">
{$blogs->tablerows|safe}
</div>
</div> </div>
{$blogs->pagination|safe} {$blogs->pagination|safe}
</div> </div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment