- md5
- 284556db7892fdb1a0f8acec7c24db51
- sha1
- 0dd98177c530abad933aaa521a598f3e19aaa83b
- sha256
- 440f4085530b62244d30dd03873b95b2f27bf0bc48426035fd303fbaa64162ad
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
<?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
HTMLHelper::_('behavior.core');
// Add strings for translations in Javascript.
Text::script('JGLOBAL_EXPAND_CATEGORIES');
Text::script('JGLOBAL_COLLAPSE_CATEGORIES');
$js = <<<JS
(function() {
document.addEventListener('DOMContentLoaded', function() {
var categories = [].slice.call(document.querySelectorAll('.categories-list'));
categories.forEach(function(category) {
var buttons = [].slice.call(document.querySelectorAll('.categories-list'));
buttons.forEach(function(button) {
var span = button.querySelector('span');
if(span) {
span.classList.toggle('icon-plus')
span.classList.toggle('icon-minus')
}
if (button.getAttribute('aria-label') === Joomla.JText._('JGLOBAL_EXPAND_CATEGORIES'))
{
button.setAttribute('aria-label', Joomla.JText._('JGLOBAL_COLLAPSE_CATEGORIES'));
} else {
button.setAttribute('aria-label', Joomla.JText._('JGLOBAL_EXPAND_CATEGORIES'));
}
})
})
});
})();
JS;
// @todo move script to a file
Factory::getDocument()->addScriptDeclaration($js);
?>
<div class="com-content-categories categories-list">
<?php
echo LayoutHelper::render('joomla.content.categories_default', $this);
echo $this->loadTemplate('items');
?>
</div>
The same content is in 5 releases, Joomla 4.0.0-alpha7 to 4.0.0-alpha11. See them all, or every version of this file.