diff options
Diffstat (limited to 'includes/lookup_page_inc.php')
| -rw-r--r-- | includes/lookup_page_inc.php | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/includes/lookup_page_inc.php b/includes/lookup_page_inc.php index 8fe4da9..e7eb19f 100644 --- a/includes/lookup_page_inc.php +++ b/includes/lookup_page_inc.php @@ -75,16 +75,23 @@ if( $gContent->isValid() && empty( $gStructure ) ) { } else { $structure=''; } - $structs = $gContent->getStructures(); - if (count($structs)==1) { - $gStructure = new LibertyStructure( $structs[0]['structure_id'] ); + if( $structs = $gContent->getStructures() ) { + $structId = $structs[0]['structure_id']; + if( count( $structs ) > 0 ) { + $gBitSmarty->assign('showstructs', $structs); + foreach( $structs as $struct ) { + if( $struct['parent_id'] == 0 ) { + $structId = $struct['structure_id']; + break; + } + } + } + $gStructure = new LibertyStructure( $structId ); if( $gStructure->load() ) { $gStructure->loadNavigation(); $gStructure->loadPath(); $gBitSmarty->assign( 'structureInfo', $gStructure->mInfo ); } - } else { - $gBitSmarty->assign('showstructs', $structs); } } |
