Skip to content

Commit

Permalink
Update category.php
Browse files Browse the repository at this point in the history
Adding language code to category options list
  • Loading branch information
artur-stepien committed May 8, 2020
1 parent 3c1c8c9 commit f481621
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion libraries/cms/html/category.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public static function categories($extension, $config = array('filter.published'
$user = JFactory::getUser();
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('a.id, a.title, a.level, a.parent_id')
->select('a.id, a.title, a.level, a.parent_id, a.language')
->from('#__categories AS a')
->where('a.parent_id > 0');

Expand Down Expand Up @@ -191,6 +191,12 @@ public static function categories($extension, $config = array('filter.published'
{
$repeat = ($item->level - 1 >= 0) ? $item->level - 1 : 0;
$item->title = str_repeat('- ', $repeat) . $item->title;

if ($item->language !== '*')
{
$item->title .= ' (' . $item->language . ')';
}

static::$items[$hash][] = JHtml::_('select.option', $item->id, $item->title);
}
// Special "Add to root" option:
Expand Down

0 comments on commit f481621

Please sign in to comment.