summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspiderr <spiderr@bitweaver.org>2021-02-12 13:28:46 -0500
committerspiderr <spiderr@bitweaver.org>2021-02-12 13:28:46 -0500
commitca400d1b97ff591f157a11ad0b442046468eb413 (patch)
treeb433ed92187129a781eeb323652f0718860afe0c
parent7c21e90b0a8b347248cccede865fd8ff1f93c21b (diff)
downloadwiki-ca400d1b97ff591f157a11ad0b442046468eb413.tar.gz
wiki-ca400d1b97ff591f157a11ad0b442046468eb413.tar.bz2
wiki-ca400d1b97ff591f157a11ad0b442046468eb413.zip
rename *_structure_inc.php to structure_*_inc.php
-rw-r--r--edit_book.php2
-rw-r--r--includes/lookup_page_inc.php17
-rw-r--r--index.php2
3 files changed, 14 insertions, 7 deletions
diff --git a/edit_book.php b/edit_book.php
index 7d85f4a..9b572a0 100644
--- a/edit_book.php
+++ b/edit_book.php
@@ -140,7 +140,7 @@ if( isset($_REQUEST["createstructure"]) ) {
// set the correct display template
$mid = 'bitpackage:wiki/edit_book.tpl';
- include_once( LIBERTY_PKG_INCLUDE_PATH.'edit_structure_inc.php');
+ include_once( LIBERTY_PKG_INCLUDE_PATH.'structure_edit_inc.php');
if( $gBitThemes->isAjaxRequest() ) {
$gBitSmarty->display( 'bitpackage:kernel/feedback_inc.tpl' );
}
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);
}
}
diff --git a/index.php b/index.php
index 3cf1a10..9cc8fd5 100644
--- a/index.php
+++ b/index.php
@@ -19,7 +19,7 @@ $gBitSystem->verifyPackage( 'wiki' );
require_once( WIKI_PKG_CLASS_PATH.'BitPage.php' );
if( !empty( $_REQUEST['structure_id'] ) ) {
- include( LIBERTY_PKG_INCLUDE_PATH.'display_structure_inc.php' );
+ include( LIBERTY_PKG_INCLUDE_PATH.'structure_display_inc.php' );
} else {
// if no page set
if ( !isset( $_REQUEST['page'] ) and !isset( $_REQUEST['page_id'] ) ) {