| Current Path : /home/ataenra/www/templates/t4_builder/html/mod_custom/ |
| Current File : /home/ataenra/www/templates/t4_builder/html/mod_custom/t4builder.php |
<?php
/**
* @package Joomla.Site
* @subpackage mod_custom
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @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\Uri\Uri;
$modId = 'mod-custom' . $module->id;
if ($params->get('backgroundimage'))
{
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->addInlineStyle('
#' . $modId . '{background-image: url("' . Uri::root(true) . '/' . HTMLHelper::_('cleanImageURL', $params->get('backgroundimage'))->url . '");}
', ['name' => $modId]);
}
$items = [];
\JPB\Helper\Render::loadItems($module->content, $items);
if(!empty($items)){
foreach ($items as $item) {
$pages = $item;
}
}
$html = $pages->page_html;
$html = \JPB\Helper\Html::loadShareBlock($html);
$html = \JPB\Helper\Html::renderJdoc ($html);
$module->content = $html ? "<div class='jpb-page'>".$html."</div><style>".$pages->css."</style>" : $module->content ;
?>
<div id="<?php echo $modId; ?>" class="mod-custom custom">
<?php echo $module->content; ?>
</div>