-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmod_bfhtmlblocklist.php
More file actions
49 lines (39 loc) · 1.03 KB
/
mod_bfhtmlblocklist.php
File metadata and controls
49 lines (39 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/**
* @package Module for displaying a list of HTML code blocks.
* @version 0.0.1
* @author https://www.brainforge.co.uk
* @copyright Copyright (C) 2023 Jonathan Brain. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
use Joomla\CMS\Language\Text;
// no direct access
defined('_JEXEC') or die;
/** @var object $params */
$htmlItems = $params->get('htmlitems');
if (empty($htmlItems)) return;
$htmlItems = (array) $htmlItems;
$headerTag = $params->get('header_tag');
$headerClass = $params->get('header_class');
$showtitles = intval($params->get('showtitles'));
$root = JURI::root(true) . '/';
$del = array();
foreach($htmlItems as $key=>&$item)
{
if (isset($item->state) && $item->state < 1)
{
$del[] = $key;
continue;
}
if ($showtitles)
{
$item->title = Text::_($item->title);
}
}
unset($item);
foreach($del as $key) unset($htmlItems[$key]);
if (empty($htmlItems))
{
return;
}
require JModuleHelper::getLayoutPath('mod_bfhtmlblocklist', $params->get('layout', 'default'));