New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[com_content] - Add tags filtering based on language filter #19509
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,13 +9,38 @@ | |
|
||
defined('_JEXEC') or die; | ||
|
||
use Joomla\CMS\Component\ComponentHelper; | ||
use Joomla\CMS\Language\Multilanguage; | ||
|
||
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); | ||
|
||
// Create some shortcuts. | ||
$params = &$this->item->params; | ||
$n = count($this->items); | ||
$listOrder = $this->escape($this->state->get('list.ordering')); | ||
$listDirn = $this->escape($this->state->get('list.direction')); | ||
$params = &$this->item->params; | ||
$n = count($this->items); | ||
$listOrder = $this->escape($this->state->get('list.ordering')); | ||
$listDirn = $this->escape($this->state->get('list.direction')); | ||
$langFilter = false; | ||
|
||
//Tags filtering based on language filter | ||
if (($this->params->get('filter_field') === 'tag') && (Multilanguage::isEnabled())) | ||
{ | ||
$tagfilter = ComponentHelper::getParams('com_tags')->get('tag_list_language_filter'); | ||
|
||
switch ($tagfilter) | ||
{ | ||
case 'current_language' : | ||
$langFilter = JFactory::getApplication()->getLanguage()->getTag(); | ||
break; | ||
|
||
case 'all' : | ||
$langFilter = false; | ||
break; | ||
|
||
default : | ||
$langFilter = ComponentHelper::getParams('com_tags')->get('tag_list_language_filter'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
} | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Delete blank line. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
|
||
// Check for at least one editable article | ||
$isEditable = false; | ||
|
@@ -55,7 +80,7 @@ | |
<?php else : ?> | ||
<select name="filter_tag" id="filter_tag" onchange="document.adminForm.submit();" > | ||
<option value=""><?php echo JText::_('JOPTION_SELECT_TAG'); ?></option> | ||
<?php echo JHtml::_('select.options', JHtml::_('tag.options', true, true), 'value', 'text', $this->state->get('filter.tag')); ?> | ||
<?php echo JHtml::_('select.options', JHtml::_('tag.options', array('filter.published' => array(1), 'filter.language' => $langFilter), true), 'value', 'text', $this->state->get('filter.tag')); ?> | ||
</select> | ||
<?php endif; ?> | ||
</div> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add space after
//
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done