summaryrefslogtreecommitdiff
path: root/smartyplugins/function.required.php
blob: 9ea4a1a1c8f8d7777fee912d1d0de8ceb7342ca5 (plain)
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
<?php
namespace Bitweaver\Plugins;

use Bitweaver\KernelTools;
/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */

/**
 * smarty_function_required
 */
function smarty_function_required( $pParams, &$pSmarty=NULL ) {
	global $gBitSmarty;
//	$gBitSmarty->loadPlugin( 'smarty_function_biticon' );
	$biticon = [
		'ipackage' => 'icons',
		'iname'    => 'emblem-important',
		'iexplain' => 'Required',
	];
	$ret = \Bitweaver\Plugins\smarty_function_biticon( $biticon );

	if( !empty( $pParams['legend'] )) {
		$ret = "<p>$ret ".KernelTools::tra( "Elements marked with this symbol are required." )."</p>";
	}
	return $ret;
}