diff options
Diffstat (limited to 'list_pages.php')
| -rwxr-xr-x[-rw-r--r--] | list_pages.php | 36 |
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 |
