'biticon', 'auto_activate' => true, 'requires_pair' => false, 'load_function' => '\data_biticon', 'title' => 'bitweaver Icon', 'help_page' => 'DataPluginBiticon', 'description' => KernelTools::tra( "Display any bitweaver icon" ), 'help_function' => '\data_biticon_help', 'syntax' => '{biticon ipackage= iname= iexplain=}', 'plugin_type' => DATA_PLUGIN, ]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATABITICON, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATABITICON ); /** * data_biticon_help * * @access public * @return string */ function data_biticon_help() { $help = '' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'
' . KernelTools::tra( "Key" ) . '' . KernelTools::tra( "Type" ) . '' . KernelTools::tra( "Comments" ) . '
ipackage' . KernelTools::tra( "key-words") . '
' . KernelTools::tra( "(optional)" ) . '
' . KernelTools::tra( "Package the icon is taken from. The icon style icons take the value 'icons'.") . '
iname' . KernelTools::tra( "key-words") . '
' . KernelTools::tra("(required)") . '
' . KernelTools::tra( "Name of the icon to be displayed" ) . '
ixplain' . KernelTools::tra( "string" ) . '
' . KernelTools::tra("(optional)") . '
' . KernelTools::tra( "Explanation of the icon - visible when hovering over the icon.").'
' . KernelTools::tra( "Example: " ) . '{biticon ipackage="icons" iname="large/accessories-text-editor" iexplain="edit"}'; return $help; } function data_biticon( $pData, $pParams ) { global $gBitSmarty; require_once LIBERTY_PKG_INCLUDE_PATH.'liberty_lib.php'; $ret = KernelTools::tra( 'Please provide an icon name as iname parameter. You can select icons here.' ); if( !empty( $pParams['iname'] )) { // sanitise biticon parameters before they are passed to the function $biticon['iname'] = $pParams['iname']; $biticon['ipackage'] = !empty( $pParams['ipackage'] ) ? $pParams['ipackage'] : 'icons'; $biticon['iexplain'] = !empty( $pParams['iexplain'] ) ? $pParams['iexplain'] : 'icon'; $biticon['ipath'] = !empty( $pParams['ipath'] ) ? $pParams['ipath'] : ''; $ret = \Bitweaver\Liberty\smarty_function_biticon( $biticon, $gBitSmarty ); $wrapper = \Bitweaver\Liberty\liberty_plugins_wrapper_style( $pParams ); if( !empty( $wrapper['style'] )) { $ret ='<'.$wrapper['wrapper'].' class="'.( !empty( $wrapper['class'] ) ? $wrapper['class'] : "biticon-plugin" ).'" style="'.$wrapper['style'].'">'.$ret.''; } } return $ret; }