diff options
Diffstat (limited to 'rankings.php')
| -rwxr-xr-x[-rw-r--r--] | rankings.php | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/rankings.php b/rankings.php index 19f1cb8..e1153bb 100644..100755 --- a/rankings.php +++ b/rankings.php @@ -10,50 +10,51 @@ */ require_once '../kernel/includes/setup_inc.php'; -include_once( LIBERTY_PKG_CLASS_PATH.'LibertyContent.php' ); -include_once( ARTICLES_PKG_CLASS_PATH.'BitArticle.php' ); +use Bitweaver\KernelTools; +use Bitweaver\Liberty\LibertyContent; +use Bitweaver\Articles\BitArticle; $gBitSystem->isPackageActive( 'articles' ); $gBitSystem->isFeatureActive( 'articles_rankings' ); $gBitSystem->verifyPermission( 'p_articles_read' ); -$rankingOptions = array( - array( - 'output' => tra( 'Most Often Viewed' ), - 'value' => 'hits_desc' - ), - array( - 'output' => tra( 'Most Recently Modified' ), - 'value' => 'last_modified_desc' - ), - array( - 'output' => tra( 'Most Active Authors' ), - 'value' => 'top_authors' - ), -); +$rankingOptions = [ + [ + 'output' => KernelTools::tra( 'Most Often Viewed' ), + 'value' => 'hits_desc', + ], + [ + 'output' => KernelTools::tra( 'Most Recently Modified' ), + 'value' => 'last_modified_desc', + ], + [ + 'output' => KernelTools::tra( 'Most Active Authors' ), + 'value' => 'top_authors', + ], +]; $gBitSmarty->assign( 'rankingOptions', $rankingOptions ); if( !empty( $_REQUEST['sort_mode'] ) ) { switch( $_REQUEST['sort_mode'] ) { case 'last_modified_desc': $gBitSmarty->assign( 'attribute', 'last_modified' ); - $_REQUEST['attribute'] = tra( 'Date of last modification' ); + $_REQUEST['attribute'] = KernelTools::tra( 'Date of last modification' ); break; case 'top_authors': $gBitSmarty->assign( 'attribute', 'ag_hits' ); - $_REQUEST['attribute'] = tra( 'Hits to items by this Author' ); + $_REQUEST['attribute'] = KernelTools::tra( 'Hits to items by this Author' ); break; default: $gBitSmarty->assign( 'attribute', 'hits' ); - $_REQUEST['attribute'] = tra( 'Hits' ); + $_REQUEST['attribute'] = KernelTools::tra( 'Hits' ); break; } } else { $gBitSmarty->assign( 'attribute', 'hits' ); - $_REQUEST['attribute'] = tra( 'Hits' ); + $_REQUEST['attribute'] = KernelTools::tra( 'Hits' ); } -$_REQUEST['title'] = tra( 'Article Rankings' ); +$_REQUEST['title'] = KernelTools::tra( 'Article Rankings' ); $_REQUEST['content_type_guid'] = BITARTICLE_CONTENT_TYPE_GUID; $_REQUEST['max_records'] = !empty( $_REQUEST['max_records'] ) ? $_REQUEST['max_records'] : 10; @@ -63,4 +64,4 @@ if( empty( $gContent ) ) { $rankList = $gContent->getContentRanking( $_REQUEST ); $gBitSmarty->assign( 'rankList', $rankList ); -$gBitSystem->display( 'bitpackage:liberty/rankings.tpl', tra( "Article Rankings" ) , array( 'display_mode' => 'display' )); +$gBitSystem->display( 'bitpackage:liberty/rankings.tpl', KernelTools::tra( "Article Rankings" ) , [ 'display_mode' => 'display' ]); |
