Skip to content

Commit 06e584d

Browse files
Remove category or level from filter fields when disabled in configuration
1 parent 3dab44e commit 06e584d

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

components/com_jtg/views/files/tmpl/list.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
// Load core.js to enable tableordering
2222
JHtml::_('script', 'system/core.js', false, true);
2323

24+
$this->filterForm = $this->get('FilterForm');
25+
if (!$this->params->get('jtg_param_use_cats')) $this->filterForm->removeField('trackcat','filter');
26+
if (!$this->cfg->uselevel) $this->filterForm->removeField('tracklevel','filter');
27+
2428
echo $this->lh;
2529

2630
$iconheight = $this->params->get('jtg_param_list_icon_max_height');

components/com_jtg/views/jtg/tmpl/default.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@
2020
$this->getModel()->setState('list.limit','0'); // show all tracks
2121
$this->items = $this->get('Items');
2222
$this->filterForm = $this->get('FilterForm');
23-
$this->activeFilters = $this->get('ActiveFilters');
23+
24+
if (!$this->params->get('jtg_param_use_cats')) $this->filterForm->removeField('trackcat','filter');
25+
if (!$this->cfg->uselevel) $this->filterForm->removeField('tracklevel','filter');
26+
2427
echo $this->lh;
2528

2629
echo "\n<script>\n";

0 commit comments

Comments
 (0)