/
block.group.php
60 lines (56 loc) · 1.94 KB
/
block.group.php
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
50
51
52
53
54
55
56
57
58
59
60
<?php
##################################################
#
# Copyright (c) 2004-2023 OIC Group, Inc.
#
# This file is part of Exponent
#
# Exponent is free software; you can redistribute
# it and/or modify it under the terms of the GNU
# General Public License as published by the Free
# Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# GPL: http://www.gnu.org/licenses/gpl.txt
#
##################################################
/**
* Smarty {group} block plugin
*
* Type: block<br>
* Name: group<br>
* Purpose: Set up a group block
*
* @param $params
* @param $content
* @param \Smarty $smarty
* @param $repeat
*
* @package Smarty-Plugins
* @subpackage Block
*/
function smarty_block_group($params,$content,&$smarty, &$repeat) {
if(empty($content)) {
if (!empty($params['id']))
echo '<div id="' . $params['id'] . '">';
if (!empty($params['label']))
echo '<div class="control col-sm-12" style="margin-bottom: 0;padding-bottom: 0;"><label class="'.((bs4()||bs5())?'col-sm-12 ':'').((bs3()|bs4()||bs5())?'control-label':'label').'" style="margin-bottom: 0;padding-bottom: 0;">'.$params['label'].'</label></div>';
$class = !empty($params['class']) ? ' ' . $params['class'] : '';
echo '<div role="group" class="group-controls', $class, '">';
} else {
echo $content;
echo '</div>';
if (!empty($params['description'])) {
if (bs3()) {
echo "<div class=\"control\"><p class=\"help-block\">", $params['description'], "</p></div>";
} elseif (bs4() || bs5()) {
echo "<div class=\"control\"><small class=\"form-text text-muted\">",$params['description'],"</small></div>";
} else {
echo "<div class=\"control\"><div class=\"control-desc\">",$params['description'],"</div></div>";
}
}
if (!empty($params['id']))
echo '</div/>';
}
}
?>