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

Source for file mod_structure_toc.php

Documentation is available at mod_structure_toc.php

  1. <?php
  2. /**
  3.  * @version $Header$
  4.  * 
  5.  * @package liberty
  6.  * @subpackage modules
  7.  */
  8.  
  9. /**
  10.  * Initial Setup
  11.  */
  12. global $gStructure, $gContent, $moduleParams, $gBitSmarty;
  13. require_once( LIBERTY_PKG_PATH.'LibertyStructure.php' );
  14.  
  15. extract( $moduleParams );
  16.  
  17. $struct = NULL;
  18.  
  19. if( is_object( $gStructure ) && $gStructure->isValid() && $gStructure->hasViewPermission() ) {
  20.     $struct = &$gStructure;
  21. } elseif( @BitBase::verifyId( $module_params['structure_id'] ) ) {
  22.         $struct = new LibertyStructure( $module_params['structure_id'] );
  23.         $struct->load();
  24. } elseif( is_object( $gContent ) && $gContent->hasViewPermission( FALSE ) ) {
  25.     $structures = $gContent->getStructures();
  26.     // We take the first structure. not good, but works for now - spiderr
  27.     if( !empty( $structures[0] ) ) {
  28.         require_once( LIBERTY_PKG_PATH.'LibertyStructure.php' );
  29.         $struct = new LibertyStructure( $structures[0]['structure_id'] );
  30.         $struct->load();
  31.     }
  32. }
  33.  
  34. if( is_object( $struct ) && count( $struct->isValid() ) ) {
  35.     $_template->tpl_vars['moduleTitle'] = new Smarty_variable( $moduleParams['title'] );
  36.     $toc = $struct->getToc( $struct->mInfo['root_structure_id'], 'asc', FALSE, 2 );
  37.     $_template->tpl_vars['modStructureTOC'] = new Smarty_variable( $struct->getToc( $struct->mInfo['root_structure_id'], 'asc', FALSE, 2 ) );
  38. }

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