89 lines
3.9 KiB
PHP
89 lines
3.9 KiB
PHP
<?php
|
|
|
|
|
|
/**
|
|
* @package Joomla.Site
|
|
* @subpackage Layout
|
|
*
|
|
* @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
|
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
|
*
|
|
* html5 (chosen html5 tag and font header tags)
|
|
*/
|
|
|
|
defined('_JEXEC') or die;
|
|
|
|
use Joomla\Utilities\ArrayHelper;
|
|
|
|
$module = $displayData['module'];
|
|
$params = $displayData['params'];
|
|
|
|
//var_dump($module->position);
|
|
|
|
if ((string) $module->content === '') {
|
|
return;
|
|
}
|
|
|
|
$moduleIcon = '';
|
|
|
|
if ($module->position == 'sidebar-left' || $module->position == 'sidebar-right') {
|
|
switch ($module->module) {
|
|
case 'mod_virtuemart_cart':
|
|
$moduleIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="currentColor" class="bi bi-cart3" viewBox="0 0 16 16">
|
|
<path d="M0 1.5A.5.5 0 0 1 .5 1H2a.5.5 0 0 1 .485.379L2.89 3H14.5a.5.5 0 0 1 .49.598l-1 5a.5.5 0 0 1-.465.401l-9.397.472L4.415 11H13a.5.5 0 0 1 0 1H4a.5.5 0 0 1-.491-.408L2.01 3.607 1.61 2H.5a.5.5 0 0 1-.5-.5M3.102 4l.84 4.479 9.144-.459L13.89 4zM5 12a2 2 0 1 0 0 4 2 2 0 0 0 0-4m7 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4m-7 1a1 1 0 1 1 0 2 1 1 0 0 1 0-2m7 0a1 1 0 1 1 0 2 1 1 0 0 1 0-2"/>
|
|
</svg>';
|
|
break;
|
|
case 'mod_virtuemart_category':
|
|
$moduleIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="currentColor" class="bi bi-list" viewBox="0 0 16 16">
|
|
<path fill-rule="evenodd" d="M2.5 12a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5"/>
|
|
</svg>';
|
|
break;
|
|
case 'mod_virtuemart_product':
|
|
$moduleIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-list-task" viewBox="0 0 16 16">
|
|
<path fill-rule="evenodd" d="M2 2.5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5V3a.5.5 0 0 0-.5-.5zM3 3H2v1h1z"/>
|
|
<path d="M5 3.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5M5.5 7a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1zm0 4a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1z"/>
|
|
<path fill-rule="evenodd" d="M1.5 7a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5zM2 7h1v1H2zm0 3.5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5zm1 .5H2v1h1z"/>
|
|
</svg>';
|
|
break;
|
|
default:
|
|
$moduleIcon = '';
|
|
}
|
|
}
|
|
|
|
$moduleTag = htmlspecialchars($params->get('module_tag', 'div'), ENT_QUOTES, 'UTF-8');
|
|
$moduleAttribs = [];
|
|
$moduleAttribs['class'] = 'moduletable ' . htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_QUOTES, 'UTF-8');
|
|
$bootstrapSize = (int) $params->get('bootstrap_size', 0);
|
|
$asideCol = ($module->position == 'sidebar-left' || $module->position == 'sidebar-right') ? ' col-md-6' : '';
|
|
$footerCol = $module->position == 'footer' ? ' col-md-6' : '';
|
|
$moduleAttribs['class'] .= $bootstrapSize !== 0 ? $footerCol . ' col-lg-' . $bootstrapSize : $asideCol;
|
|
$headerTag = htmlspecialchars($params->get('header_tag', 'h3'), ENT_QUOTES, 'UTF-8');
|
|
$headerClass = htmlspecialchars($params->get('header_class', ''), ENT_QUOTES, 'UTF-8');
|
|
$headerAttribs = [];
|
|
$headerAttribs['class'] = 'module-title ';
|
|
|
|
// Only output a header class if one is set
|
|
if ($headerClass !== '') {
|
|
$headerAttribs['class'] = $headerClass;
|
|
}
|
|
|
|
// Only add aria if the moduleTag is not a div
|
|
if ($moduleTag !== 'div') {
|
|
if ($module->showtitle) :
|
|
$moduleAttribs['aria-labelledby'] = 'mod-' . $module->id;
|
|
$headerAttribs['id'] = 'mod-' . $module->id;
|
|
else :
|
|
$moduleAttribs['aria-label'] = $module->title;
|
|
endif;
|
|
}
|
|
|
|
$header = '<' . $headerTag . ' ' . ArrayHelper::toString($headerAttribs) . '>' . $module->title . $moduleIcon . '</' . $headerTag . '>';
|
|
?>
|
|
<<?php echo $moduleTag; ?> <?php echo ArrayHelper::toString($moduleAttribs); ?>>
|
|
<?php if ((bool) $module->showtitle) : ?>
|
|
<?php echo $header; ?>
|
|
<?php endif; ?>
|
|
<?php echo $module->content; ?>
|
|
</<?php echo $moduleTag; ?>>
|
|
|