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

Source for file edit_help_inc.php

Documentation is available at edit_help_inc.php

  1. <?php
  2. /**
  3.  * $Id$
  4.  * edit_help_inc
  5.  *
  6.  * @author   spider <spider@steelsun.com>
  7.  * @version  $Revision$
  8.  * @package  liberty
  9.  * @subpackage functions
  10.  */
  11.  
  12. /**
  13.  * required setup
  14.  */
  15. global $gLibertySystem, $gBitSmarty;
  16.  
  17. $inEditor = TRUE; // Required by PluginHelp to Determin Executed in an Editor
  18.  
  19. $dataplugins = array_merge( $gLibertySystem->getPluginsOfType( DATA_PLUGIN ), $gLibertySystem->getPluginsOfType( FILTER_PLUGIN ));
  20. $formatplugins = $gLibertySystem->getPluginsOfType( FORMAT_PLUGIN );
  21. $mimeplugins = $gLibertySystem->getPluginsOfType( MIME_PLUGIN );
  22.  
  23. // allow mime plugins to append help to the attachment plugin
  24. foreach( $mimeplugins as $guid => $plugin ) {
  25.     if( $func = $gLibertySystem->getPluginFunction( $guid, 'help_function' )) {
  26.         $plugin['exthelp'] = $func();
  27.         $mimeplugins[$guid]= $plugin;
  28.     } else {
  29.         unset( $mimeplugins[$guid] );
  30.     }
  31. }
  32.  
  33. // refine data plugins and add help where available
  34. foreach( $dataplugins as $guid => $plugin ) {
  35.     if( !empty( $plugin['description'] ) && !empty( $plugin['syntax'] )) {
  36.         $plugin["plugin_guid"] = preg_replace( "/^(data|filter)/", "", $guid );
  37.         $plugin["exthelp"]     = !empty( $plugin['help_function'] ) && $gLibertySystem->getPluginFunction( $guid, 'help_function' ) ? $plugin['help_function']() : '';
  38.         $dataplugins[$guid]    = $plugin;
  39.     } else {
  40.         unset( $dataplugins[$guid] );
  41.     }
  42. }
  43.  
  44. foreach( array_keys( $formatplugins ) as $guid ) {
  45.     // check to see if we have some format syntax help
  46.     if( is_file( LIBERTY_PKG_PATH."templates/help_format_{$guid}_inc.tpl" )) {
  47.         $formatplugins[$guid]['format_help'] = "bitpackage:liberty/help_format_{$guid}_inc.tpl";
  48.         if( is_file( LIBERTY_PKG_PATH."help_format_{$guid}_inc.php" )) {
  49.             include_once( LIBERTY_PKG_PATH."help_format_{$guid}_inc.php" );
  50.         }
  51.     }
  52. }
  53.  
  54. if( !empty( $formatplugins ) ) {
  55.     usort( $formatplugins, 'usort_by_title' );
  56.     $gBitSmarty->assign_by_ref( 'formatplugins', $formatplugins );
  57. }
  58.  
  59. if( !empty( $mimeplugins ) ) {
  60.     usort( $mimeplugins, 'usort_by_title' );
  61.     $gBitSmarty->assign_by_ref( 'mimeplugins', $mimeplugins );
  62. }
  63.  
  64. if( !empty( $dataplugins ) ) {
  65.     usort( $dataplugins, 'usort_by_title' );
  66.     $gBitSmarty->assign_by_ref( 'dataplugins', $dataplugins );
  67. }
  68. ?>

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