diff options
| author | lsces <lester@lsces.co.uk> | 2026-02-01 17:57:53 +0000 |
|---|---|---|
| committer | lsces <lester@lsces.co.uk> | 2026-02-01 17:57:53 +0000 |
| commit | 0b7bc39d45c39f36e13e704ac126f9246a9be62f (patch) | |
| tree | bed4210bdc7e2c43716ca3d42a44e9cbbc58780d /article_history.php | |
| parent | e75480ed0929f12c69465d63aba1615db7b9436a (diff) | |
| download | articles-0b7bc39d45c39f36e13e704ac126f9246a9be62f.tar.gz articles-0b7bc39d45c39f36e13e704ac126f9246a9be62f.tar.bz2 articles-0b7bc39d45c39f36e13e704ac126f9246a9be62f.zip | |
Major refactor for namespace, php8.4 and smarty5
Diffstat (limited to 'article_history.php')
| -rwxr-xr-x[-rw-r--r--] | article_history.php | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/article_history.php b/article_history.php index 79c7bed..cf1b040 100644..100755 --- a/article_history.php +++ b/article_history.php @@ -17,26 +17,27 @@ * required setup */ require_once '../kernel/includes/setup_inc.php'; -require_once( ARTICLES_PKG_CLASS_PATH.'BitArticle.php' ); +use Bitweaver\Articles\BitArticle; +use Bitweaver\KernelTools; $gBitSystem->verifyPackage( 'articles' ); $gBitSystem->verifyPermission( 'p_articles_read' ); $gBitSystem->verifyPermission( 'p_articles_read_history' ); if( !isset( $_REQUEST["article_id"] ) ) { - $gBitSystem->fatalError( tra( "No article indicated" )); + $gBitSystem->fatalError( KernelTools::tra( "No article indicated" )); } include_once( ARTICLES_PKG_INCLUDE_PATH.'lookup_article_inc.php' ); //vd($gContent->mPageId);vd($gContent->mInfo); if( !$gContent->isValid() || empty( $gContent->mInfo ) ) { - $gBitSystem->fatalError( tra( "Unknown article" )); + $gBitSystem->fatalError( KernelTools::tra( "Unknown article" )); } // additionally we need to check if this article is a submission and see if user has perms to view it. if( $gContent->getField( 'status_id' ) != ARTICLE_STATUS_APPROVED && !( $gContent->hasUserPermission( 'p_articles_update_submission' ) || $gBitUser->isAdmin() ) ) { - $gBitSmarty->assign( 'msg', tra( "Permission denied you cannot view this article" ) ); + $gBitSmarty->assign( 'msg', KernelTools::tra( "Permission denied you cannot view this article" ) ); $gBitSystem->display( "error.tpl" , NULL, array( 'display_mode' => 'display' )); die; } @@ -47,8 +48,8 @@ include_once( LIBERTY_PKG_INCLUDE_PATH.'content_history_inc.php' ); $gBitSmarty->assign( 'page', $page = !empty( $_REQUEST['list_page'] ) ? $_REQUEST['list_page'] : 1 ); $offset = ( $page - 1 ) * $gBitSystem->getConfig( 'max_records' ); $history = $gContent->getHistory( NULL, NULL, $offset, $gBitSystem->getConfig( 'max_records' ) ); -$gBitSmarty->assignByRef( 'data', $history['data'] ); -$gBitSmarty->assignByRef( 'listInfo', $history['listInfo'] ); +$gBitSmarty->assign( 'data', $history['data'] ); +$gBitSmarty->assign( 'listInfo', $history['listInfo'] ); //vd($gContent->getHistoryCount()); @@ -57,5 +58,5 @@ $numPages = ceil( $gContent->getHistoryCount() / $gBitSystem->getConfig('max_rec $gBitSmarty->assign( 'numPages', $numPages ); // Display the template -$gBitSmarty->assignByRef( 'gContent', $gContent ); +$gBitSmarty->assign( 'gContent', $gContent ); $gBitSystem->display( 'bitpackage:articles/article_history.tpl', NULL, array( 'display_mode' => 'display' )); |
