Skip to content

Commit

Permalink
Fix tabs in the backend list display.
Browse files Browse the repository at this point in the history
  • Loading branch information
skurvish committed Jul 22, 2018
1 parent 0d20154 commit 35fd84c
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions components/com_fabrik/models/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -12079,7 +12079,7 @@ private function getTabCategories()
* @return array Tabs
*/
public function loadTabs()
{
{
$this->tabs = array();
$tabs = $this->getTabCategories();

Expand All @@ -12091,12 +12091,20 @@ public function loadTabs()
$package = $this->app->getUserState('com_fabrik.package', 'fabrik');
$listId = $this->getId();
$tabsField = $this->getTabField();
$item = $this->app->getMenu()->getActive();
if ($this->app->isSite()) {
$menu = "menu". $this->app->getMenu()->getActive()->id;
} else {
$menu = "admin".JFactory::getUser()->id;
}

$inputArray = $this->app->input->getArray();
$isPagination = array_key_exists($this->session->getFormToken(), $inputArray);

/* get the default rows per page, menu then table then system, whichever is first */
$defaultRowsPerPage = $item->params->get('rows_per_page');
$defaultRowsPerPage = "";
if ($this->app->isSite()) {
$defaultRowsPerPage = $this->app->getMenu()->getActive()->params->get('rows_per_page');
}
if (empty($defaultRowsPerPage)) {
$defaultRowsPerPage = $this->getTable()->rows_per_page;
}
Expand All @@ -12107,7 +12115,7 @@ public function loadTabs()
/* get the various current uri parts */
$uri = JURI::getInstance();
$uriActiveTab = $uri->getVar($tabsField, null);
/* If the tabsField is an array then we are showing merged tabs, we need the merged tabs vales for the activeTabName */
/* If the tabsField is an array then we are showing merged tabs, we need the merged tabs names for the activeTabName */
if (is_array($uriActiveTab)) {
$uriActiveTab = implode('-', $uriActiveTab['value']);
}
Expand All @@ -12117,7 +12125,7 @@ public function loadTabs()
$ActiveTabLimit = FArrayHelper::getValue($inputArray, 'limit'.$listId, $uri->getVar('limit' . $listId, null));

/* Get the cached tabs */
$context = 'com_'.$package.'menu'.$item->id.'list'.$listId;
$context = 'com_'.$package.$menu.$item->id.'list'.$listId;
$cachedTabs = unserialize($this->app->getUserState($context.'tabs'));

if (empty($cachedTabs)) {
Expand Down Expand Up @@ -12168,7 +12176,7 @@ public function loadTabs()
$uri->setVar('limit'.$listId, is_null($ActiveTabLimit) ? $defaultRowsPerPage : $ActiveTabLimit);
$uri->setVar('limitstart'.$listId, is_null($ActiveTabLimitStart) ? 0 : $ActiveTabLimitStart);

/* Handle pagination, the pagination has already happened so we do not want this stuff left in the uri */
/* Handle pagination, the pagination has already happened so are just clearing this stuff from the uri */
if ($isPagination) {
$uri->setVar('resetfilters', null);
$uri->setVar('clearordering', null);
Expand Down

0 comments on commit 35fd84c

Please sign in to comment.