summaryrefslogtreecommitdiff
path: root/smartyplugins/function.bithelp.php
blob: 1798e3e52c5743dfbe02087789405f64f83a7825 (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
29
<?php
namespace Bitweaver\Plugins;

/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */

/**
 * source elements
 */

/**
* smarty_function_bithelp
*/
function smarty_function_bithelp($params, &$gBitSmarty) {
	global $gBitSystem, $gBitUser;
	$outstr = "";
	if( $gBitSystem->isFeatureActive('site_online_help') ){
		if($gBitUser->hasPermission( 'p_admin' )){
			$outstr .= "<a href=\"".KERNEL_PKG_URL."admin/index.php\">".smarty_function_biticon(['ipackage'=>'icons', 'iname'=>'preferences-system', 'iexplain'=>'Administration Menu'] )."</a> ";
		}
		if( $helpInfo = $gBitSmarty->getTemplateVars('TikiHelpInfo') ) {
			$outstr .= "<a href=\"".$helpInfo["URL"]."\" >".smarty_function_biticon(['ipackage'=>'icons', 'iname'=>'help-browser', 'iexplain'=>(empty($helpInfo["Desc"])?"help":$helpInfo["Desc"])] )."</a>";
		}
	}
	return $outstr;
}