diff options
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/mod_structure_toc.php | 16 | ||||
| -rw-r--r-- | modules/mod_structure_toc.tpl | 5 |
2 files changed, 21 insertions, 0 deletions
diff --git a/modules/mod_structure_toc.php b/modules/mod_structure_toc.php new file mode 100644 index 0000000..a8471ac --- /dev/null +++ b/modules/mod_structure_toc.php @@ -0,0 +1,16 @@ +<?php +global $gStructure, $gContent; +$struct = NULL; +if( is_object( $gContent ) && ( empty( $gStructure ) || !$gStructure->isValid() ) ) { + $structures = $gContent->getStructures(); + // We take the first structure. not good, but works for now - spiderr + if( !empty( $structures[0] ) ) { + $struct = new LibertyStructure( $structures[0]['structure_id'] ); + } +} else { + $struct = &$gStructure; +} +if( is_object( $struct ) && count( $struct->isValid() ) ) { + $gBitSmarty->assign( 'modStructureTOC', $struct->get_toc( $struct->mInfo['root_structure_id'] ) ); +} +?> diff --git a/modules/mod_structure_toc.tpl b/modules/mod_structure_toc.tpl new file mode 100644 index 0000000..b299218 --- /dev/null +++ b/modules/mod_structure_toc.tpl @@ -0,0 +1,5 @@ +{if $modStructureTOC} + {bitmodule title="$moduleTitle" name="structure_navigation"} + {$modStructureTOC} + {/bitmodule} +{/if} |
