Skip to content

Commit

Permalink
#2794 Added toggleButton param to admin-ui: $grid
Browse files Browse the repository at this point in the history
  • Loading branch information
CaMer0n committed Sep 23, 2017
1 parent b6d38c7 commit 0fe0bf5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion e107_admin/theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
8 changes: 6 additions & 2 deletions e107_handlers/admin_ui.php
Original file line number Diff line number Diff line change
Expand Up @@ -6173,6 +6173,7 @@ class e_admin_form_ui extends e_form
* @var e_admin_ui
*/
protected $_controller = null;
protected $_list_view = null;



Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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 '<div class="btn-group" >
<a id="admin-ui-carousel-prev" class="btn btn-default" href="#admin-ui-carousel" data-slide="prev"><i class="fa fa-backward"></i></a>
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 0fe0bf5

Please sign in to comment.