Source for file data.toc.php
Documentation is available at data.toc.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: Christian Fowler <spiderr@users.sourceforge.net>
// +----------------------------------------------------------------------+
define( 'PLUGIN_GUID_DATATOC', 'datatoc' );
'requires_pair' => FALSE,
'load_function' => 'data_toc',
'title' => 'Structure Table Of Contents',
'help_page' => 'DataPluginTOC',
'description' => tra("Display a Table Of Contents for Structures"),
'help_function' => 'data_toc_help',
'syntax' => '{toc structure_id= }',
'booticon' => '{booticon iname="icon-list-ol" iexplain="Structure Table of Contents"}',
'structure_id' => 'id of the structure to display'
return '<table class="data help">'
. '<th>' . tra( "Key" ) . '</th>'
. '<th>' . tra( "Type" ) . '</th>'
. '<th>' . tra( "Comments" ) . '</th>'
. '<td>' . tra( "string") . '<br />' . tra("(optional)") . '</td>'
. '<td>' . tra( "Will display a Table Of Contents for Structures, such as Wiki-books. Works only if the page where the tag is used is a part of some structure. If the page belongs to several wiki-books, use structure_id attribute.") . '</td>'
. tra("Example: ") . '{toc structure_id=8 display=full_toc}';
global $gStructure, $gContent, $gBitSmarty;
if( is_object( $gStructure ) && $gStructure->isValid() ) {
} elseif( @BitBase::verifyId( $pParams['structure_id'] ) ) {
// We take the first structure. not good, but works for now - spiderr
if( !empty( $structures[0] ) ) {
if( !empty( $struct) && is_object( $struct ) && $struct->isValid()) {
if( @BitBase::verifyId( $structure_id ) ) {
$get_structure = $structure_id;
$get_structure = $struct->mStructureId;
$tree = $struct->getSubTree( $get_structure, ( !empty( $pParams['display'] ) && $pParams['display'] == 'full_toc' ));
$gBitSmarty->assign( "subtree", $tree );
$repl = $gBitSmarty->fetch( "bitpackage:liberty/plugins/data_toc.tpl" );
|