<?php
/**
 * @package     Joomla.Site
 * @subpackage  Layout
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 *
 * html5 (chosen html5 tag and font header tags)
 */

defined('_JEXEC') or die;

$module  = $displayData['module'];
$params  = $displayData['params'];
$attribs  = $displayData['attribs'];


$badge = '';
if ($params->get('moduleclass_sfx') != null && preg_match('/badge/', $params->get('moduleclass_sfx'))){
	$badge = '<span class="badge">&nbsp;</span>';
}
$moduleTag      = htmlspecialchars($params->get('module_tag', 'div'));
$headerTag      = htmlspecialchars($params->get('header_tag', 'h4'));
$headerClass    = $params->get('header_class');
$bootstrapSize  = $params->get('bootstrap_size');
$moduleClass    = !empty($bootstrapSize) ? ' span' . (int) $bootstrapSize . '' : '';
$moduleClassSfx = $params->get('moduleclass_sfx') != null
	? htmlspecialchars($params->get('moduleclass_sfx')) : '';


// section Space
$topSpace = 'top-'.$params->get('top-space', 'blank');

// section Space
$bottomSpace = 'bottom-'.$params->get('bottom-space', 'blank');

// Mod Action
$moduleAction = '';
if($params->get('section-link')) {
	$moduleAction = '<div data-aos="fade-up" data-aos-delay="200" class="bottom-actions"><a class="section-actions btn btn-'.$params->get('type-btn').'" href="'.$params->get('link-btn').'">'.$params->get('title-btn').'</a></div>';
}

// Mod Main 
$modMain = '';
if($params->get('main-section')) {
	$modMain = '<span class="h1 main-title my-0" data-aos="fade-up" data-aos-delay="200">'.$params->get('main-section').'</span>';
}

// Bottom Desc
$bottomDesc = '';
if($params->get('bottom-desc')) {
	$bottomDesc = '<div data-aos="fade-up" data-aos-delay="200" class="section-bottom-desc lead">'.$params->get('bottom-desc').'</div>';
}

// Mod Title
$modTitle = '';
if($module->showtitle != 0) {
	$modTitle = '<'.$headerTag.' class="section-title h3 text-gradient'.$headerClass.'" data-aos="fade-up"><span>'.$module->title.'</span></'.$headerTag.'>';
}




if (!empty ($module->content)) {
	$html = "<{$moduleTag} class=\"t4-mod-wrap  {$moduleClassSfx} {$moduleClass} {$topSpace} {$bottomSpace}\" id=\"Mod{$module->id}\">" .
				"<div class=\"section-inner\">" . $badge;

	if ($module->showtitle != 0 || $modMain) {
		$html .= "<div class=\"container\"><div class=\"section-title-wrap {$moduleClassSfx}\"><div class=\"mod-title-wrap\">{$modTitle}{$modMain}</div></div></div>";
	}

	$html .= "<div class=\"section-ct\">{$module->content}</div>{$bottomDesc}{$moduleAction}</div></{$moduleTag}>";

	echo $html;
}