From 0fe0bf57bfc6b8afaf7cde12a93ad7b111a350eb Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 22 Sep 2017 18:12:47 -0700 Subject: [PATCH] #2794 Added toggleButton param to admin-ui: $grid --- e107_admin/theme.php | 2 +- e107_handlers/admin_ui.php | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/e107_admin/theme.php b/e107_admin/theme.php index 35ec262489..df88454475 100644 --- a/e107_admin/theme.php +++ b/e107_admin/theme.php @@ -190,7 +190,7 @@ class theme_admin_ui extends e_admin_ui // protected \$sortField = 'somefield_order'; // protected \$sortParent = 'somefield_parent'; // protected \$treePrefix = 'somefield_title'; - protected $grid = array('price'=>'price', 'version'=>'version','title'=>'name', 'image'=>'thumbnail', 'body'=>'', 'class'=>'col-md-2', 'perPage'=>12, 'carousel'=>true); + protected $grid = array('price'=>'price', 'version'=>'version','title'=>'name', 'image'=>'thumbnail', 'body'=>'', 'class'=>'col-md-2', 'perPage'=>12, 'carousel'=>true, 'toggleButton'=>false); protected $fields = array( diff --git a/e107_handlers/admin_ui.php b/e107_handlers/admin_ui.php index b082dd15d4..0df0443ecf 100644 --- a/e107_handlers/admin_ui.php +++ b/e107_handlers/admin_ui.php @@ -6173,6 +6173,7 @@ class e_admin_form_ui extends e_form * @var e_admin_ui */ protected $_controller = null; + protected $_list_view = null; @@ -6410,6 +6411,7 @@ function getSettings() public function getList($ajax = false, $view='default') { $tp = e107::getParser(); + $this->_list_view = $view; $controller = $this->getController(); $request = $controller->getRequest(); @@ -6580,7 +6582,7 @@ public function getConfirmDelete($ids, $ajax = false) */ public function renderPagination() { - if($this->getController()->getAction() === 'grid' && $this->getController()->getGrid('carousel') === true) + if($this->_list_view === 'grid' && $this->getController()->getGrid('carousel') === true) { return '
@@ -6652,9 +6654,11 @@ function renderFilter($current_query = array(), $location = '', $input_options = // $tree = $this->getTree(); // $total = $this->getTotal(); $grid = $this->getController()->getGrid(); + + $gridToggle = ''; - if(!empty($grid)) + if(!empty($grid) && varset($grid['toggleButton']) !==false) { $gridAction = $this->getController()->getAction() === 'grid' ? 'list' : 'grid'; $gridQuery = (array) $_GET;