summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--admin/admin_external_wikis.php4
-rw-r--r--admin/pump_wiki_inc.php2
-rw-r--r--admin/schema_inc.php4
-rw-r--r--admin/upgrade_inc.php6
-rw-r--r--backlinks.php4
-rw-r--r--book_to_html.php4
-rw-r--r--books.php4
-rw-r--r--copyrights.php6
-rw-r--r--edit.php31
-rw-r--r--edit_book.php10
-rw-r--r--export_wiki_pages.php6
-rw-r--r--includes/bit_setup_inc.php (renamed from bit_setup_inc.php)2
-rw-r--r--includes/classes/BitBook.php (renamed from BitBook.php)4
-rw-r--r--includes/classes/BitPage.php (renamed from BitPage.php)8
-rw-r--r--includes/copyrights_lib.php (renamed from copyrights_lib.php)0
-rw-r--r--includes/display_bitpage_inc.php (renamed from display_bitpage_inc.php)16
-rw-r--r--includes/export_lib.php (renamed from export_lib.php)6
-rw-r--r--includes/lookup_page_inc.php (renamed from lookup_page_inc.php)21
-rw-r--r--includes/plugins_lib.php (renamed from plugins_lib.php)0
-rw-r--r--index.php10
-rw-r--r--like_pages.php6
-rw-r--r--list_pages.php4
-rw-r--r--modules/mod_comm_received_objects.php2
-rw-r--r--modules/mod_random_pages.php2
-rw-r--r--modules/mod_recent_page_changes.php12
-rw-r--r--modules/mod_top_pages.php2
-rw-r--r--modules/mod_wiki_last_comments.php2
-rw-r--r--orphan_pages.php4
-rw-r--r--page_history.php8
-rw-r--r--page_loader.php4
-rw-r--r--page_watches.php6
-rw-r--r--print_multi_pages.php9
-rw-r--r--print_pages.php4
-rw-r--r--rankings.php2
-rw-r--r--remove_page.php6
-rw-r--r--sitemap.php4
-rwxr-xr-xslideshow.php8
-rw-r--r--templates/center_wiki_page.php2
-rwxr-xr-xtemplates/edit_book.tpl2
-rw-r--r--templates/list_books.tpl2
-rw-r--r--templates/page_icons.tpl2
-rw-r--r--wiki_graph.php6
-rw-r--r--wiki_rss.php8
43 files changed, 124 insertions, 131 deletions
diff --git a/admin/admin_external_wikis.php b/admin/admin_external_wikis.php
index 6daab7b..636fd87 100644
--- a/admin/admin_external_wikis.php
+++ b/admin/admin_external_wikis.php
@@ -3,8 +3,8 @@
// 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.
// Initialization
-require_once( '../../kernel/setup_inc.php' );
-include_once( KERNEL_PKG_PATH.'admin_lib.php' );
+require_once( '../../kernel/includes/setup_inc.php' );
+include_once( KERNEL_PKG_INCLUDE_PATH.'admin_lib.php' );
if (!$gBitUser->isAdmin()) {
$gBitSmarty->assign('msg', tra("You dont have permission to use this feature"));
$gBitSystem->display( 'error.tpl' , NULL, array( 'display_mode' => 'admin' ));
diff --git a/admin/pump_wiki_inc.php b/admin/pump_wiki_inc.php
index 92a6afa..ba4c01e 100644
--- a/admin/pump_wiki_inc.php
+++ b/admin/pump_wiki_inc.php
@@ -7,7 +7,7 @@
/**
* required setup
*/
-require_once( WIKI_PKG_PATH.'BitPage.php' );
+require_once( WIKI_PKG_CLASS_PATH.'BitPage.php' );
$tutorial_intro = '^This tutorial does not contain any direct links to any particular pages. This is to help you understand how to navigate bitweaver. If you don\'t feel confident about finding your way back to this page, it might be useful to open a second browser window to carry out these instructions or print this page before continuing.
diff --git a/admin/schema_inc.php b/admin/schema_inc.php
index c156d50..2ff6e8b 100644
--- a/admin/schema_inc.php
+++ b/admin/schema_inc.php
@@ -135,8 +135,8 @@ if( defined( 'RSS_PKG_NAME' )) {
// ### Register content types
$gBitInstaller->registerContentObjects( WIKI_PKG_NAME, array(
- 'BitPage' => WIKI_PKG_PATH.'BitPage.php',
- 'BitBook' => WIKI_PKG_PATH.'BitBook.php',
+ 'BitPage' => WIKI_PKG_CLASS_PATH.'BitPage.php',
+ 'BitBook' => WIKI_PKG_CLASS_PATH.'BitBook.php',
));
// Requirements
diff --git a/admin/upgrade_inc.php b/admin/upgrade_inc.php
index 65d2c0e..0431384 100644
--- a/admin/upgrade_inc.php
+++ b/admin/upgrade_inc.php
@@ -84,7 +84,7 @@ array( 'ALTER' => array(
// STEP 3
array( 'PHP' => '
global $gBitSystem;
- require_once( WIKI_PKG_PATH."BitPage.php" );
+ require_once( WIKI_PKG_CLASS_PATH.'BitPage.php' );
$max = $gBitSystem->mDb->getOne( "SELECT MAX(`page_id`) FROM `'.BIT_DB_PREFIX.'tiki_pages`" );
$gBitSystem->mDb->CreateSequence( "tiki_pages_page_id_seq", $max + 1 );
$query = "SELECT uu.`user_id`, uu2.`user_id` AS modifier_user_id, tp.`lastModif` AS created, tp.`lastModif` AS `last_modified`, tp.`data`, tp.`pageName` AS `title`, tp.`ip`, tp.`hits`
@@ -225,8 +225,8 @@ array( 'QUERY' =>
// STEP 5
array( 'PHP' => '
global $gBitSystem;
- require_once( LIBERTY_PKG_PATH."LibertyStructure.php" );
- require_once( WIKI_PKG_PATH."BitBook.php" );
+ require_once( LIBERTY_PKG_CLASS_PATH.'LibertyStructure.php' );
+ require_once( WIKI_PKG_CLASS_PATH.'BitBook.php' );
$query = "SELECT `structure_id`, `content_id` FROM `".BIT_DB_PREFIX."tiki_structures` WHERE `parent_id` IS NULL OR `parent_id`=0";
$roots = $gBitSystem->mDb->getAssoc( $query );
$s = new LibertyStructure();
diff --git a/backlinks.php b/backlinks.php
index 3c01f90..f637de5 100644
--- a/backlinks.php
+++ b/backlinks.php
@@ -12,8 +12,8 @@
/**
* required setup
*/
-require_once( '../kernel/setup_inc.php' );
-include_once( WIKI_PKG_PATH.'lookup_page_inc.php');
+require_once( '../kernel/includes/setup_inc.php' );
+include_once( WIKI_PKG_INCLUDE_PATH.'lookup_page_inc.php');
$gBitSystem->verifyPackage( 'wiki' );
$gBitSystem->verifyFeature( 'wiki_backlinks' );
diff --git a/book_to_html.php b/book_to_html.php
index 203be49..a5c5802 100644
--- a/book_to_html.php
+++ b/book_to_html.php
@@ -13,9 +13,9 @@
/**
* required setup
*/
-require_once( '../kernel/setup_inc.php' );
+require_once( '../kernel/includes/setup_inc.php' );
-include_once( WIKI_PKG_PATH.'BitBook.php');
+include_once( WIKI_PKG_CLASS_PATH.'BitBook.php');
function copys($source,$dest)
{
diff --git a/books.php b/books.php
index 66d848a..f1bdcb9 100644
--- a/books.php
+++ b/books.php
@@ -13,8 +13,8 @@
/**
* required setup
*/
-require_once( '../kernel/setup_inc.php' );
-include_once( WIKI_PKG_PATH.'BitBook.php');
+require_once( '../kernel/includes/setup_inc.php' );
+include_once( WIKI_PKG_CLASS_PATH.'BitBook.php');
// verify stuff
$gBitSystem->verifyPackage( 'wiki' );
diff --git a/copyrights.php b/copyrights.php
index 6a5dd46..c3a10dd 100644
--- a/copyrights.php
+++ b/copyrights.php
@@ -13,12 +13,12 @@
/**
* required setup
*/
-require_once( '../kernel/setup_inc.php' );
+require_once( '../kernel/includes/setup_inc.php' );
$gBitSystem->isFeatureActive( 'wiki_copyrights', tra("The copyright management feature is not enabled.") );
$gBitUser->hasPermission( 'p_wiki_edit_copyright' );
-require_once( WIKI_PKG_PATH.'copyrights_lib.php' );
-require_once( WIKI_PKG_PATH.'lookup_page_inc.php' );
+require_once( WIKI_PKG_INCLUDE_PATH.'copyrights_lib.php' );
+require_once( WIKI_PKG_INCLUDE_PATH.'lookup_page_inc.php' );
if (isset($_REQUEST['addcopyright'])) {
if ($gBitSystem->isFeatureActive( 'wiki_copyrights' ) && isset($_REQUEST['copyrightTitle']) && isset($_REQUEST['copyrightYear'])
diff --git a/edit.php b/edit.php
index 3a083c7..aba7162 100644
--- a/edit.php
+++ b/edit.php
@@ -13,8 +13,8 @@
/**
* required setup
*/
-require_once( '../kernel/setup_inc.php' );
-include_once( WIKI_PKG_PATH.'BitBook.php' );
+require_once( '../kernel/includes/setup_inc.php' );
+include_once( WIKI_PKG_CLASS_PATH.'BitBook.php' );
$gBitSystem->verifyPackage( 'wiki' );
@@ -22,7 +22,7 @@ $gBitSystem->verifyPackage( 'wiki' );
unset($_REQUEST['content_id']);
// Disable parsing data if not asking to preview page
$_REQUEST["parse"] = false;
-include( WIKI_PKG_PATH.'lookup_page_inc.php' );
+include( WIKI_PKG_INCLUDE_PATH.'lookup_page_inc.php' );
if( $gContent->isValid() ) {
$gContent->verifyUpdatePermission();
@@ -32,7 +32,7 @@ if( $gContent->isValid() ) {
//make comment count for this page available for templates
if( $gBitSystem->isFeatureActive( 'wiki_comments' ) && !empty( $_REQUEST['page_id'] ) ) {
- require_once( LIBERTY_PKG_PATH.'LibertyComment.php' );
+ require_once( LIBERTY_PKG_CLASS_PATH.'LibertyComment.php' );
$gComment = new LibertyComment();
$numComments = $gComment->getNumComments($gContent->mContentId);
$gBitSmarty->assign('comments_count', $numComments);
@@ -73,10 +73,10 @@ if( $gBitSystem->isFeatureActive( 'wiki_footnotes' ) ) {
$gBitSmarty->assign( 'footnote', $footnote );
if( $footnote )
$gBitSmarty->assign( 'has_footnote', 'y' );
- $gBitSmarty->assign( 'parsed_footnote', $gContent->parseData( $footnote ) );
+ $gBitSmarty->assign( 'parsed_footnote', LibertyContent::parseDataHash( $footnote ) );
if( isset( $_REQUEST['footnote'] ) ) {
- $gBitSmarty->assign( 'parsed_footnote', $gContent->parseData( $_REQUEST['footnote'] ) );
+ $gBitSmarty->assign( 'parsed_footnote', LibertyContent::parseDataHash( $_REQUEST['footnote'] ) );
$gBitSmarty->assign( 'footnote', $_REQUEST['footnote'] );
$gBitSmarty->assign( 'has_footnote', 'y' );
if( empty( $_REQUEST['footnote'] ) ) {
@@ -142,17 +142,12 @@ if( isset( $_REQUEST["fCancel"] ) ) {
&& !empty( $_REQUEST['copyrightYear'] )
&& !empty( $_REQUEST['copyrightTitle'] )
) {
- require_once( WIKI_PKG_PATH.'copyrights_lib.php' );
+ require_once( WIKI_PKG_INCLUDE_PATH.'copyrights_lib.php' );
$copyrightYear = $_REQUEST['copyrightYear'];
$copyrightTitle = $_REQUEST['copyrightTitle'];
$copyrightAuthors = $_REQUEST['copyrightAuthors'];
$copyrightslib->add_copyright( $gContent->mPageId, $copyrightTitle, $copyrightYear, $copyrightAuthors, $gBitUser->mUserId );
}
- // Parse $edit and eliminate image references to external URIs( make them internal )
- if( $gBitSystem->isPackageActive( 'imagegals' ) ) {
- include_once( IMAGEGALS_PKG_PATH.'imagegal_lib.php' );
- $edit = $imagegallib->capture_images( $edit );
- }
if( $gContent->mPageId )
{ if( isset( $_REQUEST['isminor'] ) && $_REQUEST['isminor']=='on' ) {
@@ -210,16 +205,12 @@ if( isset( $_REQUEST["preview"] ) ) {
$formInfo['edit_section'] = 1;
}
- $data_to_parse = $formInfo['edit'];
+ $data_to_parse['data'] = $formInfo['edit'];
if( !empty( $formInfo['section'] ) && !empty( $gContent->mInfo['data'] )) {
$full_page_data = $gContent->mInfo['data'];
}
-
- $formInfo['parsed_data'] = $gContent->parseData(
- $data_to_parse,
- ( !empty( $_REQUEST['format_guid'] ) ? $_REQUEST['format_guid'] : ( isset( $gContent->mInfo['format_guid'] ) ? $gContent->mInfo['format_guid'] : 'tikiwiki' ))
- );
+ $formInfo['parsed_data'] = LibertyContent::parseDataHash( $data_to_parse );
$gContent->invokeServices( 'content_preview_function' );
}
@@ -417,7 +408,7 @@ if( isset( $_REQUEST["suck_url"] ) ) {
$gBitSystem->fatalError( tra( "Importing remote URLs is disabled" ));
}
// Suck another page and append to the end of current
- require_once( UTIL_PKG_INC.'htmlparser/html_parser_inc.php' );
+ require_once( UTIL_PKG_INCLUDE_PATH.'htmlparser/html_parser_inc.php' );
$suck_url = isset( $_REQUEST["suck_url"] ) ? $_REQUEST["suck_url"] : '';
$parsehtml = isset( $_REQUEST["parsehtml"] ) ? ( $_REQUEST["parsehtml"] == 'on' ? 'y' : 'n' ): 'n';
if( isset( $_REQUEST['do_suck'] ) && strlen( $suck_url ) > 0 ) {
@@ -447,7 +438,7 @@ if( isset( $_REQUEST["suck_url"] ) ) {
// Need to parse HTML?
if( $parsehtml == 'y' ) {
// Read compiled( serialized ) grammar
- $grammarfile = UTIL_PKG_INC.'htmlparser/htmlgrammar.cmp';
+ $grammarfile = UTIL_PKG_INCLUDE_PATH.'htmlparser/htmlgrammar.cmp';
if( !$fp = @fopen( $grammarfile,'r' ) ) {
$gBitSystem->fatalError( tra( "Can't parse remote HTML page" ));
}
diff --git a/edit_book.php b/edit_book.php
index 7080784..dd20c72 100644
--- a/edit_book.php
+++ b/edit_book.php
@@ -13,7 +13,7 @@
/**
* required setup
*/
-require_once( '../kernel/setup_inc.php' );
+require_once( '../kernel/includes/setup_inc.php' );
if( isset( $_COOKIE['book_section'] ) && $_COOKIE['book_section'] == 'o' ) {
$book_section = 'block';
@@ -22,8 +22,8 @@ if( isset( $_COOKIE['book_section'] ) && $_COOKIE['book_section'] == 'o' ) {
}
$gBitSmarty->assign( 'book_section',$book_section );
-include_once( LIBERTY_PKG_PATH.'LibertyStructure.php');
-include_once( WIKI_PKG_PATH.'BitBook.php');
+include_once( LIBERTY_PKG_CLASS_PATH.'LibertyStructure.php');
+include_once( WIKI_PKG_CLASS_PATH.'BitBook.php');
global $gStructure;
@@ -34,7 +34,7 @@ global $gStructure;
// get a book instance
global $gContent;
if( @BitBase::verifyId( $_REQUEST["structure_id"] ) || @BitBase::verifyId( $_REQUEST["content_id"] ) ) {
- include_once( LIBERTY_PKG_PATH.'lookup_content_inc.php' );
+ include_once( LIBERTY_PKG_INCLUDE_PATH.'lookup_content_inc.php' );
if( empty( $gContent ) ){
$gBitSystem->fatalError( 'Error: Invalid structure id, the book you requested could not be found.' );
} elseif( empty( $_REQUEST["structure_id"] ) ) {
@@ -140,7 +140,7 @@ if( isset($_REQUEST["createstructure"]) ) {
// set the correct display template
$mid = 'bitpackage:wiki/edit_book.tpl';
- include_once( LIBERTY_PKG_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/export_wiki_pages.php b/export_wiki_pages.php
index c6f18fb..cf78b56 100644
--- a/export_wiki_pages.php
+++ b/export_wiki_pages.php
@@ -13,9 +13,9 @@
/**
* required setup
*/
-require_once( '../kernel/setup_inc.php' );
-include_once( UTIL_PKG_INC.'zip_lib.php' );
-include_once( WIKI_PKG_PATH.'export_lib.php' );
+require_once( '../kernel/includes/setup_inc.php' );
+include_once( UTIL_PKG_INCLUDE_PATH.'zip_lib.php' );
+include_once( WIKI_PKG_INCLUDE_PATH.'export_lib.php' );
if (!$gBitUser->hasPermission( 'p_wiki_admin' ))
die;
if (!isset($_REQUEST["page_id"])) {
diff --git a/bit_setup_inc.php b/includes/bit_setup_inc.php
index fdb877c..4b4b556 100644
--- a/bit_setup_inc.php
+++ b/includes/bit_setup_inc.php
@@ -3,7 +3,7 @@ global $gBitSystem, $gBitUser;
$registerHash = array(
'package_name' => 'wiki',
- 'package_path' => dirname( __FILE__ ).'/',
+ 'package_path' => dirname( dirname( __FILE__ ) ).'/',
'homeable' => TRUE,
);
$gBitSystem->registerPackage( $registerHash );
diff --git a/BitBook.php b/includes/classes/BitBook.php
index 3845e2e..f31d35a 100644
--- a/BitBook.php
+++ b/includes/classes/BitBook.php
@@ -24,8 +24,8 @@
/**
* required setup
*/
-require_once( WIKI_PKG_PATH.'BitPage.php' );
-require_once( LIBERTY_PKG_PATH.'LibertyStructure.php' );
+require_once( WIKI_PKG_CLASS_PATH.'BitPage.php' );
+require_once( LIBERTY_PKG_CLASS_PATH.'LibertyStructure.php' );
define('BITBOOK_CONTENT_TYPE_GUID', 'bitbook' );
diff --git a/BitPage.php b/includes/classes/BitPage.php
index 043feee..92c0776 100644
--- a/BitPage.php
+++ b/includes/classes/BitPage.php
@@ -13,7 +13,7 @@
/**
* required setup
*/
-require_once( LIBERTY_PKG_PATH.'LibertyMime.php' );
+require_once( LIBERTY_PKG_CLASS_PATH.'LibertyMime.php' );
/**
* @package wiki
@@ -194,7 +194,7 @@ class BitPage extends LibertyMime implements BitCacheable {
}
if ( $parse ) {
- $this->mInfo['parsed_data'] = $this->parseData();
+ $this->getParsedData();
}
} else {
$this->mPageId = NULL;
@@ -239,7 +239,7 @@ class BitPage extends LibertyMime implements BitCacheable {
if( isset( $mailEvents ) ) {
global $notificationlib, $gBitUser, $gBitSystem, $gBitSmarty;
- include_once( KERNEL_PKG_PATH.'notification_lib.php' );
+ include_once( KERNEL_PKG_INCLUDE_PATH.'notification_lib.php' );
$notificationlib->post_content_event($this->mContentId, $this->mInfo['content_type_guid'], 'wiki', $this->mInfo['title'], $this->mInfo['modifier_user'], $this->mInfo['edit_comment'], $this->mInfo['data']);
if( $gBitSystem->isFeatureActive( 'users_watches') ) {
@@ -484,7 +484,7 @@ class BitPage extends LibertyMime implements BitCacheable {
* @return the fully specified path to file to be included
*/
function getRenderFile() {
- return WIKI_PKG_PATH."display_bitpage_inc.php";
+ return WIKI_PKG_INCLUDE_PATH."display_bitpage_inc.php";
}
diff --git a/copyrights_lib.php b/includes/copyrights_lib.php
index ef8d1be..ef8d1be 100644
--- a/copyrights_lib.php
+++ b/includes/copyrights_lib.php
diff --git a/display_bitpage_inc.php b/includes/display_bitpage_inc.php
index 4154b41..e129e73 100644
--- a/display_bitpage_inc.php
+++ b/includes/display_bitpage_inc.php
@@ -13,7 +13,7 @@
/**
* required setup
*/
-include_once( WIKI_PKG_PATH.'BitBook.php');
+include_once( WIKI_PKG_CLASS_PATH.'BitBook.php');
$gBitSystem->verifyPackage( 'wiki' );
@@ -110,19 +110,19 @@ if( $gBitSystem->isFeatureActive( 'wiki_comments' )) {
$comments_return_url .= '&comments_maxComments=1';
}
}
- include_once( LIBERTY_PKG_PATH.'comments_inc.php' );
+ include_once( LIBERTY_PKG_INCLUDE_PATH.'comments_inc.php' );
}
// Footnotes
if( $gBitSystem->isFeatureActive( 'wiki_footnotes' ) && $gBitUser->isValid() ) {
if( $footnote = $gContent->getFootnote( $gBitUser->mUserId ) ) {
- $gBitSmarty->assign( 'footnote', $gContent->parseData( $footnote ) );
+ $gBitSmarty->assign( 'footnote', LibertyContent::parseDataHash( $footnote ) );
}
}
// Copyrights
if( $gBitSystem->isFeatureActive( 'wiki_copyrights' ) ) {
- require_once( WIKI_PKG_PATH.'copyrights_lib.php' );
+ require_once( WIKI_PKG_INCLUDE_PATH.'copyrights_lib.php' );
$copyrights = $copyrightslib->list_copyrights( $gContent->mPageId );
$gBitSmarty->assign('pageCopyrights', $copyrights["data"]);
}
@@ -147,7 +147,7 @@ if( $gBitSystem->isFeatureActive( 'users_watches' ) ) {
}
if( $gContent->isValid() && $gBitSystem->isPackageActive( 'stickies' ) ) {
- require_once( STICKIES_PKG_PATH.'BitSticky.php' );
+ require_once( STICKIES_PKG_CLASS_PATH.'BitSticky.php' );
global $gNote;
$gNote = new BitSticky( NULL, NULL, $gContent->mContentId );
$gNote->load();
@@ -160,10 +160,4 @@ $pageInfo['title'] = $gContent->getTitle();
// Display the Index Template
$gBitSmarty->assignByRef( 'pageInfo', $pageInfo );
-// S5 slideshows
-if( isset( $_REQUEST['s5'] )) {
- include_once( WIKI_PKG_PATH.'s5.php');
-}
-
$gBitSystem->display( 'bitpackage:wiki/show_page.tpl', $pageInfo['title'], array( 'display_mode' => 'display' ));
-?>
diff --git a/export_lib.php b/includes/export_lib.php
index 58f9377..264bc20 100644
--- a/export_lib.php
+++ b/includes/export_lib.php
@@ -12,8 +12,8 @@
/**
* required setup
*/
-require_once( KERNEL_PKG_PATH.'BitBase.php' );
-require_once( WIKI_PKG_PATH.'BitPage.php' );
+require_once( KERNEL_PKG_CLASS_PATH.'BitBase.php' );
+require_once( WIKI_PKG_CLASS_PATH.'BitPage.php' );
/**
* @package wiki
* @subpackage ExportLib
@@ -22,7 +22,7 @@ class ExportLib extends BitBase {
function MakeWikiZip( $pExportFile ) {
global $gBitUser,$gBitSystem;
- include_once (UTIL_PKG_INC."tar.class.php");
+ include_once (UTIL_PKG_INCLUDE_PATH."tar.class.php");
$tar = new tar();
$query = "SELECT wp.`page_id` from `".BIT_DB_PREFIX."wiki_pages` wp INNER JOIN `".BIT_DB_PREFIX."liberty_content` lc ON (lc.`content_id` = wp.`content_id`)
ORDER BY lc.".$this->mDb->convertSortmode("title_asc");
diff --git a/lookup_page_inc.php b/includes/lookup_page_inc.php
index 33650be..e7eb19f 100644
--- a/lookup_page_inc.php
+++ b/includes/lookup_page_inc.php
@@ -13,10 +13,10 @@
/**
* required setup
*/
-require_once( WIKI_PKG_PATH.'BitBook.php');
+require_once( WIKI_PKG_CLASS_PATH.'BitBook.php');
global $gContent;
-include_once( LIBERTY_PKG_PATH.'lookup_content_inc.php' );
+include_once( LIBERTY_PKG_INCLUDE_PATH.'lookup_content_inc.php' );
// this is needed when the center module is applied to avoid abusing $_REQUEST
if( empty( $lookupHash )) {
@@ -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/plugins_lib.php b/includes/plugins_lib.php
index 61ffe41..61ffe41 100644
--- a/plugins_lib.php
+++ b/includes/plugins_lib.php
diff --git a/index.php b/index.php
index c5aecbd..9cc8fd5 100644
--- a/index.php
+++ b/index.php
@@ -13,13 +13,13 @@
/**
* required setup
*/
-require_once( '../kernel/setup_inc.php' );
+require_once( '../kernel/includes/setup_inc.php' );
$gBitSystem->verifyPackage( 'wiki' );
-require_once( WIKI_PKG_PATH.'BitPage.php' );
+require_once( WIKI_PKG_CLASS_PATH.'BitPage.php' );
if( !empty( $_REQUEST['structure_id'] ) ) {
- include( LIBERTY_PKG_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'] ) ) {
@@ -43,9 +43,9 @@ if( !empty( $_REQUEST['structure_id'] ) ) {
$gHome->store( $homeHash );
}
- include( WIKI_PKG_PATH.'lookup_page_inc.php' );
+ include( WIKI_PKG_INCLUDE_PATH.'lookup_page_inc.php' );
if( $gContent->isValid() ) {
$gBitSystem->setCanonicalLink( $gContent->getDisplayUrl() );
}
- include( WIKI_PKG_PATH.'display_bitpage_inc.php' );
+ include( WIKI_PKG_INCLUDE_PATH.'display_bitpage_inc.php' );
}
diff --git a/like_pages.php b/like_pages.php
index d23c719..2762e24 100644
--- a/like_pages.php
+++ b/like_pages.php
@@ -13,9 +13,9 @@
/**
* required setup
*/
-require_once( '../kernel/setup_inc.php' );
-include_once( WIKI_PKG_PATH.'BitPage.php');
-include_once( WIKI_PKG_PATH.'lookup_page_inc.php' );
+require_once( '../kernel/includes/setup_inc.php' );
+include_once( WIKI_PKG_CLASS_PATH.'BitPage.php');
+include_once( WIKI_PKG_INCLUDE_PATH.'lookup_page_inc.php' );
$gBitSystem->verifyPackage( 'wiki' );
$gBitSystem->verifyFeature( 'wiki_like_pages' );
$gBitSystem->verifyPermission( 'p_wiki_list_pages' );
diff --git a/list_pages.php b/list_pages.php
index be8ef91..d6dd9b8 100644
--- a/list_pages.php
+++ b/list_pages.php
@@ -7,8 +7,8 @@
/**
* required setup
*/
-require_once( '../kernel/setup_inc.php' );
-require_once( WIKI_PKG_PATH.'BitPage.php' );
+require_once( '../kernel/includes/setup_inc.php' );
+require_once( WIKI_PKG_CLASS_PATH.'BitPage.php' );
// verify stuff
$gBitSystem->verifyPackage( 'wiki' );
diff --git a/modules/mod_comm_received_objects.php b/modules/mod_comm_received_objects.php
index 6c857b5..667a588 100644
--- a/modules/mod_comm_received_objects.php
+++ b/modules/mod_comm_received_objects.php
@@ -13,7 +13,7 @@
/**
* required setup
*/
-require_once( WIKI_PKG_PATH.'BitPage.php' );
+require_once( WIKI_PKG_CLASS_PATH.'BitPage.php' );
$wikilib = new WikiLib();
$ranking = $wikilib->list_received_pages(0, -1, $sort_mode = 'title_asc', '');
$_template->tpl_vars['modReceivedPages'] = new Smarty_variable( $ranking["cant"]);
diff --git a/modules/mod_random_pages.php b/modules/mod_random_pages.php
index a104820..a6674bc 100644
--- a/modules/mod_random_pages.php
+++ b/modules/mod_random_pages.php
@@ -13,7 +13,7 @@
/**
* Required files
*/
-require_once( WIKI_PKG_PATH.'BitPage.php' );
+require_once( WIKI_PKG_CLASS_PATH.'BitPage.php' );
$wp = new BitPage();
if( $gBitUser->hasPermission( 'p_wiki_view_page' ) ) {
diff --git a/modules/mod_recent_page_changes.php b/modules/mod_recent_page_changes.php
index c597952..5299b5b 100644
--- a/modules/mod_recent_page_changes.php
+++ b/modules/mod_recent_page_changes.php
@@ -10,24 +10,26 @@
* @subpackage modules
*/
global $gQueryUserId, $moduleParams;
-$params = $moduleParams['module_params'];
/**
* required setup
*/
if( $gBitUser->hasPermission( 'p_wiki_view_page' ) ) {
- require_once( WIKI_PKG_PATH.'BitPage.php' );
+ require_once( WIKI_PKG_CLASS_PATH.'BitPage.php' );
$wp = new BitPage();
$listHash = array(
- 'max_records' => $moduleParams['module_rows'],
'sort_mode' => 'last_modified_desc',
'user_id' => $gQueryUserId,
);
+ if( !empty( $moduleParams['module_rows'] ) ) {
+ $listHash['max_records'] = $moduleParams['module_rows'];
+ }
$modLastModif = $wp->getList( $listHash );
$_template->tpl_vars['modLastModif'] = new Smarty_variable( $modLastModif );
- $_template->tpl_vars['maxlen'] = new Smarty_variable( isset( $params["maxlen"] ) );
+ if( !empty( $moduleParams['module_params']["maxlen"] ) ) {
+ $_template->tpl_vars['maxlen'] = new Smarty_variable( isset( $moduleParams['module_params']["maxlen"] ) );
+ }
}
-?>
diff --git a/modules/mod_top_pages.php b/modules/mod_top_pages.php
index 052228c..0062542 100644
--- a/modules/mod_top_pages.php
+++ b/modules/mod_top_pages.php
@@ -13,7 +13,7 @@
/**
* required setup
*/
-require_once( WIKI_PKG_PATH.'BitPage.php' );
+require_once( WIKI_PKG_CLASS_PATH.'BitPage.php' );
global $gQueryUser, $module_rows, $module_params;
extract( $moduleParams );
diff --git a/modules/mod_wiki_last_comments.php b/modules/mod_wiki_last_comments.php
index 4f8e544..b3d8fae 100644
--- a/modules/mod_wiki_last_comments.php
+++ b/modules/mod_wiki_last_comments.php
@@ -18,7 +18,7 @@ global $gQueryUserId, $moduleParams;
* required setup
*/
if( $gBitUser->hasPermission( 'p_wiki_view_page' ) ) {
- require_once( LIBERTY_PKG_PATH.'LibertyComment.php' );
+ require_once( LIBERTY_PKG_CLASS_PATH.'LibertyComment.php' );
$cmt = new LibertyComment();
$listHash = array( 'max_records' => $moduleParams['module_rows'], 'user_id' => $gQueryUserId, 'content_type_guid' => BITPAGE_CONTENT_TYPE_GUID );
$lastComments = $cmt->getList( $listHash );
diff --git a/orphan_pages.php b/orphan_pages.php
index 682c85f..7ba51be 100644
--- a/orphan_pages.php
+++ b/orphan_pages.php
@@ -7,8 +7,8 @@
/**
* required setup
*/
-require_once( '../kernel/setup_inc.php' );
-include_once( WIKI_PKG_PATH.'BitPage.php' );
+require_once( '../kernel/includes/setup_inc.php' );
+include_once( WIKI_PKG_CLASS_PATH.'BitPage.php' );
// verify stuff
$gBitSystem->verifyPackage( 'wiki' );
diff --git a/page_history.php b/page_history.php
index ebd3063..86f18fe 100644
--- a/page_history.php
+++ b/page_history.php
@@ -13,14 +13,14 @@
/**
* required setup
*/
-require_once( '../kernel/setup_inc.php' );
-require_once( WIKI_PKG_PATH.'BitPage.php');
+require_once( '../kernel/includes/setup_inc.php' );
+require_once( WIKI_PKG_CLASS_PATH.'BitPage.php');
$gBitSystem->verifyPackage( 'wiki' );
$gBitSystem->verifyFeature( 'wiki_history' );
// Get the page from the request var or default it to HomePage
-include( WIKI_PKG_PATH.'lookup_page_inc.php' );
+include( WIKI_PKG_INCLUDE_PATH.'lookup_page_inc.php' );
//vd($gContent->mPageId);vd($gContent->mInfo);
if( !$gContent->isValid() || empty( $gContent->mInfo ) ) {
@@ -39,7 +39,7 @@ if (!empty( $_REQUEST['rollback_preview'] )) {
// set up stuff to get history working
$smartyContentRef = 'pageInfo';
$rollbackPerm = 'p_wiki_rollback';
-include_once( LIBERTY_PKG_PATH.'content_history_inc.php' );
+include_once( LIBERTY_PKG_INCLUDE_PATH.'content_history_inc.php' );
// pagination stuff
$gBitSmarty->assign( 'page', $page = !empty( $_REQUEST['page'] ) ? $_REQUEST['page'] : 1 );
diff --git a/page_loader.php b/page_loader.php
index d15060b..bcc9b33 100644
--- a/page_loader.php
+++ b/page_loader.php
@@ -13,8 +13,8 @@
/**
* required setup
*/
-include_once( '../../kernel/setup_inc.php' );
-include_once (HTML_PKG_PATH.'htmlpages_lib.php');
+include_once( '../../kernel/includes/setup_inc.php' );
+include_once (HTML_PKG_INCLUDE_PATH.'htmlpages_lib.php');
$refresh = 1000 * $_REQUEST["refresh"];
?>
<html>
diff --git a/page_watches.php b/page_watches.php
index 485bf88..791f78f 100644
--- a/page_watches.php
+++ b/page_watches.php
@@ -13,15 +13,15 @@
/**
* required setup
*/
-require_once( '../kernel/setup_inc.php' );
-include_once( WIKI_PKG_PATH.'BitPage.php');
+require_once( '../kernel/includes/setup_inc.php' );
+include_once( WIKI_PKG_CLASS_PATH.'BitPage.php');
$gBitSystem->verifyPackage( 'wiki' );
$gBitSystem->verifyFeature( 'users_watches' );
$gBitSystem->verifyPermission( 'p_admin_users', tra( "Permission denied you cannot browse these page watches" ) );
// Get the page from the request var or default it to HomePage
-include( WIKI_PKG_PATH.'lookup_page_inc.php' );
+include( WIKI_PKG_INCLUDE_PATH.'lookup_page_inc.php' );
// make comment count for this page available for templates
$gComment = new LibertyComment();
diff --git a/print_multi_pages.php b/print_multi_pages.php
index acd4063..60155c8 100644
--- a/print_multi_pages.php
+++ b/print_multi_pages.php
@@ -13,8 +13,8 @@
/**
* required setup
*/
-require_once( '../kernel/setup_inc.php' );
-require_once( WIKI_PKG_PATH.'BitPage.php' );
+require_once( '../kernel/includes/setup_inc.php' );
+require_once( WIKI_PKG_CLASS_PATH.'BitPage.php' );
$gBitSystem->verifyFeature( 'wiki_multiprint' );
@@ -31,9 +31,8 @@ if (isset($_REQUEST["print"])) {
$page = new BitPage( NULL, $contentId );
if( $page->load() ) {
$page->verifyViewPermission();
- $page_info = $page->mInfo;
- $page_info["parsed"] = $page->parseData( $page_info );
- $pages[] = $page_info;
+ $page->getParsedData();
+ $pages[] = $page->mInfo;
}
}
}
diff --git a/print_pages.php b/print_pages.php
index 4c27d5b..d7e5f61 100644
--- a/print_pages.php
+++ b/print_pages.php
@@ -13,8 +13,8 @@
/**
* required setup
*/
-require_once( '../kernel/setup_inc.php' );
-require_once( WIKI_PKG_PATH.'BitPage.php' );
+require_once( '../kernel/includes/setup_inc.php' );
+require_once( WIKI_PKG_CLASS_PATH.'BitPage.php' );
if( !$gBitSystem->isFeatureActive( 'wiki_multiprint' ) ) {
$gBitSystem->fatalError( tra("This feature is disabled").": wiki_multiprint" );
}
diff --git a/rankings.php b/rankings.php
index 184a6ec..217b917 100644
--- a/rankings.php
+++ b/rankings.php
@@ -13,7 +13,7 @@
/**
* required setup
*/
-require_once( '../kernel/setup_inc.php' );
+require_once( '../kernel/includes/setup_inc.php' );
$gBitSystem->verifyPackage( 'wiki' );
$gBitSystem->verifyFeature( 'wiki_rankings' );
diff --git a/remove_page.php b/remove_page.php
index ea7f86e..ba380e7 100644
--- a/remove_page.php
+++ b/remove_page.php
@@ -13,9 +13,9 @@
/**
* required setup
*/
-require_once( '../kernel/setup_inc.php' );
-include_once( WIKI_PKG_PATH.'BitPage.php');
-include_once( WIKI_PKG_PATH.'lookup_page_inc.php' );
+require_once( '../kernel/includes/setup_inc.php' );
+include_once( WIKI_PKG_CLASS_PATH.'BitPage.php');
+include_once( WIKI_PKG_INCLUDE_PATH.'lookup_page_inc.php' );
$gBitSystem->verifyPackage( 'wiki' );
diff --git a/sitemap.php b/sitemap.php
index 3556a4e..80a5295 100644
--- a/sitemap.php
+++ b/sitemap.php
@@ -13,9 +13,9 @@
/**
* required setup
*/
-require_once( '../kernel/setup_inc.php' );
+require_once( '../kernel/includes/setup_inc.php' );
-require_once( WIKI_PKG_PATH.'BitBook.php' );
+require_once( WIKI_PKG_CLASS_PATH.'BitBook.php' );
$book = new BitBook();
$gSiteMapHash = array();
diff --git a/slideshow.php b/slideshow.php
index d403b9b..0767273 100755
--- a/slideshow.php
+++ b/slideshow.php
@@ -13,7 +13,7 @@
/**
* required setup
*/
-require_once( '../kernel/setup_inc.php' );
+require_once( '../kernel/includes/setup_inc.php' );
require_once( 'BitPage.php' );
$gBitSystem->verifyPackage( 'wiki' );
@@ -25,7 +25,7 @@ if (!isset($_SESSION["thedate"])) {
$thedate = $_SESSION["thedate"];
}
-require_once ( WIKI_PKG_PATH.'lookup_page_inc.php' );
+require_once ( WIKI_PKG_INCLUDE_PATH.'lookup_page_inc.php' );
// If the page doesn't exist then display an error
if (!$gContent->isValid()) {
$gBitSystem->fatalError( tra("Page cannot be found"), NULL, NULL, HttpStatusCodes::HTTP_NOT_FOUND );
@@ -35,7 +35,7 @@ if (!$gContent->isValid()) {
$gContent->verifyViewPermission();
// Get page data
-include( WIKI_PKG_PATH.'lookup_page_inc.php' );
+include( WIKI_PKG_INCLUDE_PATH.'lookup_page_inc.php' );
$info = $gContent->mInfo;
// If not locked and last version is user version then can undo
@@ -72,7 +72,7 @@ if (isset($reqs[1][$_REQUEST["slide"]])) {
$slide_title = '';
}
-$slide_data = $gContent->parseData( $slides[$_REQUEST["slide"] + 1] );
+$slide_data = LibertyContent::parseDataHash( $slides[$_REQUEST["slide"] + 1] );
if (isset($reqs[1][$_REQUEST["slide"] - 1])) {
$slide_prev_title = $reqs[1][$_REQUEST["slide"] - 1];
diff --git a/templates/center_wiki_page.php b/templates/center_wiki_page.php
index 45460bf..74a661f 100644
--- a/templates/center_wiki_page.php
+++ b/templates/center_wiki_page.php
@@ -6,7 +6,7 @@ $lookupHash['page_id'] = ( !empty( $moduleParams['module_params']['page_id']
$lookupHash['content_id'] = ( !empty( $moduleParams['module_params']['content_id'] ) ? $moduleParams['module_params']['content_id'] : NULL );
$lookupHash['page'] = ( !empty( $moduleParams['module_params']['page'] ) ? $moduleParams['module_params']['page'] : NULL );
-require_once( WIKI_PKG_PATH."BitPage.php" );
+require_once( WIKI_PKG_CLASS_PATH.'BitPage.php' );
$modulePage = BitPage::lookupObject( $lookupHash );
$showTitle = TRUE;
if( !empty( $moduleParams['module_params']['notitle'] ) ) {
diff --git a/templates/edit_book.tpl b/templates/edit_book.tpl
index 1627695..c315868 100755
--- a/templates/edit_book.tpl
+++ b/templates/edit_book.tpl
@@ -6,6 +6,6 @@
</div>
<div class="body">
- {include file="bitpackage:liberty/edit_structure.tpl"}
+ {include file="bitpackage:liberty/structure_edit.tpl"}
</div><!-- end .body -->
</div><!-- end .edit -->
diff --git a/templates/list_books.tpl b/templates/list_books.tpl
index 2dd8dd6..00fe866 100644
--- a/templates/list_books.tpl
+++ b/templates/list_books.tpl
@@ -32,7 +32,7 @@
{/if}
{/if}
{if ($channels[ix].creator_user_id == $gBitUser->mUserId) || $gBitUser->hasPermission( 'p_wiki_admin_book' )}
- <a href="{$smarty.const.WIKI_PKG_URL}edit_book.php?action=remove&structure_id={$channels[ix].structure_id}">{booticon iname="icon-trash" ipackage="icons" iexplain="remove"}</a>
+ <a href="{$smarty.const.WIKI_PKG_URL}edit_book.php?action=remove&structure_id={$channels[ix].structure_id}&tk={$gBitUser->mTicket}">{booticon iname="icon-trash" ipackage="icons" iexplain="remove"}</a>
{/if}
</td>
</tr>
diff --git a/templates/page_icons.tpl b/templates/page_icons.tpl
index cd49496..67a3ae1 100644
--- a/templates/page_icons.tpl
+++ b/templates/page_icons.tpl
@@ -85,7 +85,7 @@
</div>
{/if}
- {if count($showstructs) gt 0}
+ {if $showstructs && (count($showstructs) gt 0)}
<select id="sel-structures" name="page" onchange="javascript:BitBase.go(this)">
<option value="">{tr}Wiki Books{/tr} &hellip;</option>
{section name=struct loop=$showstructs}
diff --git a/wiki_graph.php b/wiki_graph.php
index d4c82fa..f8b60f8 100644
--- a/wiki_graph.php
+++ b/wiki_graph.php
@@ -13,9 +13,9 @@
/**
* required setup
*/
-include_once( '../kernel/setup_inc.php' );
-include_once( WIKI_PKG_PATH.'BitPage.php');
-include_once( WIKI_PKG_PATH.'lookup_page_inc.php');
+include_once( '../kernel/includes/setup_inc.php' );
+include_once( WIKI_PKG_CLASS_PATH.'BitPage.php');
+include_once( WIKI_PKG_INCLUDE_PATH.'lookup_page_inc.php');
include_once( 'Image/GraphViz.php' );
$graph = new Image_GraphViz();
diff --git a/wiki_rss.php b/wiki_rss.php
index d616c5b..6af3d04 100644
--- a/wiki_rss.php
+++ b/wiki_rss.php
@@ -7,14 +7,14 @@
/**
* Initialization
*/
-require_once( "../kernel/setup_inc.php" );
+require_once( "../kernel/includes/setup_inc.php" );
$gBitSystem->verifyPackage( 'wiki' );
$gBitSystem->verifyPackage( 'rss' );
$gBitSystem->verifyFeature( 'wiki_rss' );
-require_once( WIKI_PKG_PATH."BitPage.php" );
-require_once( RSS_PKG_PATH."rss_inc.php" );
+require_once( WIKI_PKG_CLASS_PATH.'BitPage.php' );
+require_once( RSS_PKG_INCLUDE_PATH.'rss_inc.php' );
$rss->title = $gBitSystem->getConfig( 'wiki_rss_title', $gBitSystem->getConfig( 'site_title' ).' - '.tra( 'Wiki' ) );
$rss->description = $gBitSystem->getConfig( 'wiki_rss_description', $gBitSystem->getConfig( 'site_title' ).' - '.tra( 'RSS Feed' ) );
@@ -43,7 +43,7 @@ if( !$gBitUser->hasPermission( 'p_wiki_view_page' ) ) {
$item = new FeedItem();
$item->title = $feed['title'];
$item->link = BIT_BASE_URI.$wiki->getDisplayUrl( $feed['title'] );
- $item->description = $wiki->parseData( $feed );
+ $item->description = BitPage::parseDataHash( $feed );
$item->date = ( int )$feed['last_modified'];
$item->source = 'http://'.$_SERVER['HTTP_HOST'].BIT_ROOT_URL;