see http://phpdocu.sourceforge.net/ // +----------------------------------------------------------------------+ // | Author: Southpaw // +----------------------------------------------------------------------+ // $Id: data.freemind.php,v 1.10 2007/06/09 18:09:39 squareing Exp $ /** * definitions */ global $gLibertySystem; define( 'PLUGIN_GUID_DATAFREEMIND', 'datafreemind' ); global $gLibertySystem; $pluginParams = array ( 'tag' => 'MM', 'auto_activate' => FALSE, 'requires_pair' => FALSE, 'load_function' => 'data_freemind', 'title' => 'FreeMind - Mind Map', 'help_page' => 'DataPluginFreeMind', 'description' => tra("Displays a Freemind mindmap"), 'help_function' => 'data_freemind_help', 'syntax' => "{MM src= height= width= }", 'path' => LIBERTY_PKG_PATH.'plugins/data.freemind.php', 'security' => 'registered', 'plugin_type' => DATA_PLUGIN ); $gLibertySystem->registerPlugin( PLUGIN_GUID_DATAFREEMIND, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATAFREEMIND ); // Help Function function data_freemind_help() { $help = '' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'
' . tra( "Key" ) . '' . tra( "Type" ) . '' . tra( "Comments" ) . '
src' . tra( "string") . '
' . tra("(manditory)") . '
' . tra( "Location where the Mindmap MM file can be found. This can be any URL or a site value. See Examples.") . '
width' . tra( "number or percentage") . '
' . tra("(optional)") . '
' . tra( "The width of the Mindmap window. This value can be given in pixels or as a percentage of available area. A pixel value is assumed so only a numeric value is needed. To specify a percentage - the character % MUST follow the value. The Default is taken from the Mindmap file if this parameter is not defined.") . '
height' . tra( "number or percentage") . '
' . tra("(optional)") . '
' . tra( "The height of the Mindmap window. This value can be given in pixels or as a percentage. A pixel value is assumed so only a numeric value is needed. To specify a percentage - the character % MUST follow the value. When a percentage is given - the value is defined by the Mindmap file with a maximum of 100%. Note: The Default is taken from the Mindmap file if this parameter is not defined.") . '
' . tra("Example: ") . "{MM src='http://www.bitweaver.org/examples/bitweaver.mm' width='100%' height='600' }"; return $help; } // Load Function function data_freemind( $data, $params ) { $repl = ''; if( !empty( $params['src'] ) ) { $height = !empty( $params['height'] ) ? $params['height'] : '600'; $width = !empty( $params['width'] ) ? $params['width'] : '100%'; $drvr = '../drivers/freemind.jar'; if (!file_exists($drvr)) { $repl = tra("Error - the file") . ' freemind.jar ' . tra("does not exist in the site's drivers directory."); } else { $repl = ''. ''. ' '. ' '. ' '. ' '. ' '. ''. '
'. 'Download this mind map and use this application to edit it: Freemind '; } } return $repl; } ?>