summaryrefslogtreecommitdiff
path: root/list_pages.php
diff options
context:
space:
mode:
authorlsces <lester@lsces.co.uk>2025-08-29 13:03:49 +0100
committerlsces <lester@lsces.co.uk>2025-08-29 13:03:49 +0100
commit144b7ea64606dd1875b10ce87693250f84bea3f7 (patch)
treedc05003a3f39d5c8641fcd9a9de3569c6eaeff1a /list_pages.php
parent7fefadbccfeb0e9effe1342adb7a5d52755d401c (diff)
downloadwiki-144b7ea64606dd1875b10ce87693250f84bea3f7.tar.gz
wiki-144b7ea64606dd1875b10ce87693250f84bea3f7.tar.bz2
wiki-144b7ea64606dd1875b10ce87693250f84bea3f7.zip
General code updated to PHP8.4 and namespace
Diffstat (limited to 'list_pages.php')
-rwxr-xr-x[-rw-r--r--]list_pages.php36
1 files changed, 16 insertions, 20 deletions
diff --git a/list_pages.php b/list_pages.php
index d6dd9b8..cdf907f 100644..100755
--- a/list_pages.php
+++ b/list_pages.php
@@ -7,8 +7,9 @@
/**
* required setup
*/
-require_once( '../kernel/includes/setup_inc.php' );
-require_once( WIKI_PKG_CLASS_PATH.'BitPage.php' );
+require_once '../kernel/includes/setup_inc.php';
+use Bitweaver\Wiki\BitPage;
+use Bitweaver\KernelTools;
// verify stuff
$gBitSystem->verifyPackage( 'wiki' );
@@ -32,23 +33,19 @@ if( isset( $_REQUEST["batch_submit"] ) && isset( $_REQUEST["checked"] ) && $_REQ
if( !empty( $_REQUEST['cancel'] )) {
// user cancelled - just continue on, doing nothing
} elseif( empty( $_REQUEST['confirm'] )) {
- $formHash['delete'] = TRUE;
+ $formHash['delete'] = true;
$formHash['batch_submit'] = 'remove_pages';
foreach( $_REQUEST["checked"] as $del ) {
$tmpPage = new BitPage( $del);
- if( $tmpPage->load() && !empty( $tmpPage->mInfo['title'] )) {
- $info = $tmpPage->mInfo['title'];
- } else {
- $info = $del;
- }
+ $info = $tmpPage->load() && !empty( $tmpPage->mInfo['title'] ) ? $tmpPage->mInfo['title'] : $del;
$formHash['input'][] = '<input type="hidden" name="checked[]" value="'.$del.'"/>'.$info;
}
$gBitSystem->confirmDialog( $formHash,
- array(
- 'warning' => tra('Are you sure you want to delete these pages?') . ' (' . tra('Count: ') . count( $_REQUEST["checked"] ) . ')',
- 'error' => tra('This cannot be undone!'),
- )
- );
+ [
+ 'warning' => KernelTools::tra('Are you sure you want to delete these pages?') . ' (' . KernelTools::tra('Count: ') . count( $_REQUEST["checked"] ) . ')',
+ 'error' => KernelTools::tra('This cannot be undone!'),
+ ]
+ );
} else {
foreach( $_REQUEST["checked"] as $deletepage ) {
$tmpPage = new BitPage( $deletepage );
@@ -57,18 +54,18 @@ if( isset( $_REQUEST["batch_submit"] ) && isset( $_REQUEST["checked"] ) && $_REQ
}
}
if( !empty( $errors )) {
- $gBitSmarty->assignByRef( 'errors', $errors );
+ $gBitSmarty->assign( 'errors', $errors );
}
}
}
-$gBitSmarty->assignByRef( "gContent", $gContent );
+$gBitSmarty->assign( "gContent", $gContent );
if( !empty( $_REQUEST['sort_mode'] )) {
$listHash['sort_mode'] = preg_replace( '/^user_/', 'creator_user_', $_REQUEST['sort_mode'] );
}
$listHash = $_REQUEST;
-$listHash['extras'] = TRUE;
+$listHash['extras'] = true;
$listpages = $gContent->getList( $listHash );
// we will probably need a better way to do this
@@ -77,9 +74,8 @@ $listHash['listInfo']['parameters']['find_author'] = !empty( $listHash['fin
$listHash['listInfo']['parameters']['find_last_editor'] = !empty( $listHash['find_last_editor'] ) ? $listHash['find_last_editor'] : '';
$listHash['listInfo']['ihash']['content_type_guid'] = BITPAGE_CONTENT_TYPE_GUID;
-$gBitSmarty->assignByRef( 'listpages', $listpages );
-$gBitSmarty->assignByRef( 'listInfo', $listHash['listInfo'] );
+$gBitSmarty->assign( 'listpages', $listpages );
+$gBitSmarty->assign( 'listInfo', $listHash['listInfo'] );
// Display the template
-$gBitSystem->display( 'bitpackage:wiki/list_pages.tpl', tra( 'Wiki Pages' ), array( 'display_mode' => 'list' ));
-?>
+$gBitSystem->display( 'bitpackage:wiki/list_pages.tpl', KernelTools::tra( 'Wiki Pages' ), [ 'display_mode' => 'list' ] ); \ No newline at end of file