liberty
[ class tree: liberty ] [ index: liberty ] [ all elements ]

Source for file data.biticon.php

Documentation is available at data.biticon.php

  1. <?php
  2. /**
  3.  * @version  $Revision$
  4.  * @package  liberty
  5.  * @subpackage plugins_data
  6.  */
  7.  
  8. /**
  9.  * definitions
  10.  */
  11. define'PLUGIN_GUID_DATABITICON''databiticon' );
  12. global $gLibertySystem;
  13. $pluginParams array (
  14.     'tag'           => 'biticon',
  15.     'auto_activate' => TRUE,
  16.     'requires_pair' => FALSE,
  17.     'load_function' => 'data_biticon',
  18.     'title'         => 'bitweaver Icon',
  19.     'help_page'     => 'DataPluginBiticon',
  20.     'description'   => tra"Display any bitweaver icon" ),
  21.     'help_function' => 'data_biticon_help',
  22.     'syntax'        => '{biticon ipackage= iname= iexplain=}',
  23.     'plugin_type'   => DATA_PLUGIN
  24. );
  25. $gLibertySystem->registerPluginPLUGIN_GUID_DATABITICON$pluginParams );
  26. $gLibertySystem->registerDataTag$pluginParams['tag']PLUGIN_GUID_DATABITICON );
  27.  
  28. /**
  29.  * data_biticon_help
  30.  * 
  31.  * @access public
  32.  * @return TRUE on success, FALSE on failure - mErrors will contain reason for failure
  33.  */
  34. function data_biticon_help({
  35.     $help =
  36.         '<table class="data help">'
  37.             .'<tr>'
  38.                 .'<th>' tra"Key" '</th>'
  39.                 .'<th>' tra"Type" '</th>'
  40.                 .'<th>' tra"Comments" '</th>'
  41.             .'</tr>'
  42.             .'<tr class="odd">'
  43.                 .'<td>ipackage</td>'
  44.                 .'<td>' tra"key-words"'<br />' tra"(optional)" '</td>'
  45.                 .'<td>' tra"Package the icon is taken from. The icon style icons take the value 'icons'."'</td>'
  46.             .'</tr>'
  47.             .'<tr class="even">'
  48.                 .'<td>iname</td>'
  49.                 .'<td>' tra"key-words"'<br />' tra("(required)"'</td>'
  50.                 .'<td>' tra"Name of the icon to be displayed" '</td>'
  51.             .'</tr>'
  52.             .'<tr class="odd">'
  53.                 .'<td>ixplain</td>'
  54.                 .'<td>' tra"string" '<br />' tra("(optional)"'</td>'
  55.                 .'<td>' tra"Explanation of the icon - visible when hovering over the icon.").'</td>'
  56.             .'</tr>'
  57.         .'</table>'
  58.         . tra"Example: " '{biticon ipackage="icons" iname="large/accessories-text-editor" iexplain="edit"}';
  59.     return $help;
  60. }
  61.  
  62. function data_biticon$pData$pParams {
  63.     global $gBitSmarty;
  64.     $ret tra'Please provide an icon name as iname parameter. You can <a href="'.THEMES_PKG_URL.'icon_browser.php">select icons here</a>.' );
  65.  
  66.     if!empty$pParams['iname')) {
  67.         $gBitSmarty->loadPlugin'smarty_function_biticon' );
  68.  
  69.         // sanitise biticon parameters before they are passed to the function
  70.         $biticon['iname']    $pParams['iname'];
  71.         $biticon['ipackage'!empty$pParams['ipackage'$pParams['ipackage''icons';
  72.         $biticon['iexplain'!empty$pParams['iexplain'$pParams['iexplain''icon';
  73.         $biticon['ipath']    !empty$pParams['ipath')    $pParams['ipath']    '';
  74.         $ret smarty_function_biticon$biticon$gBitSmarty );
  75.         $wrapper liberty_plugins_wrapper_style$pParamsFALSE );
  76.         if!empty$wrapper['style')) {
  77.             $ret ='<'.$wrapper['wrapper'].' class="'.!empty$wrapper['class'$wrapper['class'"biticon-plugin" ).'" style="'.$wrapper['style'].'">'.$ret.'</'.$wrapper['wrapper'].'>';
  78.         }
  79.     }
  80.     return $ret;
  81. }
  82. ?>

Documentation generated on Wed, 29 Jul 2015 13:56:18 +0000 by phpDocumentor 1.5.0-lsces