Commit 0fd5850c authored by Dianne Tennent's avatar Dianne Tennent
Browse files

Bug 1693063: Remove results limit from edit view

When in edit view on the dashboard, 'My Portfolios'
block will no longer have the limit results
dropdown menu. Still has pagination.

Change-Id: I0d04f4002a5431f48a46856f8cb82b1f193f7d6d
parent 94fe0d5a
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -68,8 +68,9 @@ class PluginBlocktypeMyviews extends MaharaCoreBlocktype {
     * @param string template
     * @param array options
     * @param array pagination
     * @param boolean editing
     */
    public static function render_items(&$items, $template, $options, $pagination) {
    public static function render_items(&$items, $template, $options, $pagination, $editing) {
        $smarty = smarty_core();
        $smarty->assign('options', $options);
        $smarty->assign('items', $items['data']);
@@ -85,7 +86,7 @@ class PluginBlocktypeMyviews extends MaharaCoreBlocktype {
                'jsonscript' => $pagination['jsonscript'],
                'count' => $items['count'],
                'limit' => $items['limit'],
                'setlimit' => true,
                'setlimit' => $editing ? false : true,
                'offset' => $items['offset'],
                'numbersincludefirstlast' => false,
                'resultcounttextsingular' => $pagination['resultcounttextsingular'] ? $pagination['resultcounttextsingular'] : get_string('result'),
@@ -134,7 +135,7 @@ class PluginBlocktypeMyviews extends MaharaCoreBlocktype {
            'resultcounttextsingular' => get_string('result'),
            'resultcounttextplural'   => get_string('results'),
        );
        self::render_items($views, 'blocktype:myviews:myviewspaginator.tpl', array(), $pagination);
        self::render_items($views, 'blocktype:myviews:myviewspaginator.tpl', array(), $pagination, $editing);
        $smarty->assign('myviews', $views);
        return $smarty->fetch('blocktype:myviews:myviews.tpl');
    }
+1 −1
Original line number Diff line number Diff line
@@ -61,6 +61,6 @@ $pagination = array(
    'resultcounttextsingular' => get_string('view', 'view'),
    'resultcounttextplural'   => get_string('views', 'view'),
);
PluginBlocktypeMyViews::render_items($views, 'blocktype:myviews:myviewspaginator.tpl', array(), $pagination);
PluginBlocktypeMyViews::render_items($views, 'blocktype:myviews:myviewspaginator.tpl', array(), $pagination, $editing);

json_reply(false, array('data' => $views));