Source for file data.include.php
Documentation is available at data.include.php
* @subpackage plugins_data
// +----------------------------------------------------------------------+
// | Copyright (c) 2004, bitweaver.org
// +----------------------------------------------------------------------+
// | All Rights Reserved. See below for details and a complete list of authors.
// | Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details
// | For comments, please use phpdocu.sourceforge.net documentation standards!!!
// | -> see http://phpdocu.sourceforge.net/
// +----------------------------------------------------------------------+
// | Author (TikiWiki): Marc Laporte <marclaporte@users.sourceforge.net>
// | Reworked for Bitweaver (& Undoubtedly Screwed-Up)
// | by: StarRider <starrrider@users.sourceforge.net>
// +----------------------------------------------------------------------+
define( 'PLUGIN_GUID_DATAINCLUDE', 'datainclude' );
'requires_pair' => FALSE,
'load_function' => 'data_include',
'help_page' => 'DataPluginInclude',
'description' => tra("This plugin is used to include the contents of one Wiki page in another Wiki page."),
'help_function' => 'data_include_help',
'syntax' => "{INCLUDE content_id= }",
<table class="plugin help">
<th>'. tra( 'key' ). '</th>
<th>'. tra( 'type' ). '</th>
<th>'. tra( 'comments' ). '</th>
<td>'. tra( 'string (optional)' ). '</td>
<td>'. tra( 'To include any wiki page you can use it\'s page name (this has to be a unique name. if it\'s not unique, use the page_id instead) (this method is deprecated).' ). '</td>
<td>'. tra( 'numeric (optional)' ). '</td>
<td>'. tra( 'To include any wiki page you can use it\'s page_id number.' ). '</td>
<td>'. tra( 'numeric (optional)' ). '</td>
<td>'. tra( 'To include any content from bitweaver insert the appropriate numeric content id. This can include blog posts, images, wiki texts...<br />
Avaliable content can be viewed <a href="'. LIBERTY_PKG_URL. 'list_content.php">here</a>' ). '</td>
Example: {INCLUDE page_name=Welcome}
Example: {INCLUDE page_id=15}
Example: {INCLUDE content_id=15}';
$ret = "<p>Please enter a valid 'page_name', 'page_id' or 'content_id' to include in this page.</p>";
if( isset ( $params['page_id'] ) && is_numeric( $params['page_id'] ) ) {
require_once( WIKI_PKG_PATH. 'BitPage.php');
$wp = new BitPage( $params['page_id'] );
// load page by content_id
} elseif( isset ( $params['content_id'] ) && is_numeric( $params['content_id'] ) ) {
// load page by page_name
} elseif( isset ( $params['page_name'] ) ) {
$ret = "page_name isn't working yet, please use page_id or content_id";
// if $ret is empty, we need to make sure there is at least a space that we get rid of the {}
|