CoreFiles by mySites.guru
default.php59 lines, 1,622 bytes, from Joomla_4.0.0-alpha5-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha3
md5
c3c3db21f208369830eb5b5b54fdb37c
sha1
4859008d3eb3bb7018f4c750b676581017cb3b89
sha256
65c50ed637ae82607427dd1f4a652ed1a52f22f10fb66e3d812e951725ed1448
<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_content
 *
 * @copyright   Copyright (C) 2005 - 2018 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 2 releases, Joomla 4.0.0-alpha5 to 4.0.0-alpha6. See them all, or every version of this file.