summaryrefslogtreecommitdiff
path: root/templates/center_list_articles.php
diff options
context:
space:
mode:
Diffstat (limited to 'templates/center_list_articles.php')
-rwxr-xr-x[-rw-r--r--]templates/center_list_articles.php27
1 files changed, 14 insertions, 13 deletions
diff --git a/templates/center_list_articles.php b/templates/center_list_articles.php
index 7c6c67d..2300e13 100644..100755
--- a/templates/center_list_articles.php
+++ b/templates/center_list_articles.php
@@ -1,15 +1,16 @@
<?php
-// $Header$
-global $gBitSmarty, $gBitSystem, $gQueryUserId, $moduleParams;
+use Bitweaver\Users\RoleUser;
+
+global $gBitSmarty, $gBitSystem, $gQueryUserId, $moduleParams, $gContent;
if ( !empty( $moduleParams ) ) {
extract( $moduleParams );
}
-include_once( ARTICLES_PKG_CLASS_PATH.'BitArticle.php' );
+
include_once( ARTICLES_PKG_INCLUDE_PATH.'lookup_article_inc.php' );
include_once( ARTICLES_PKG_INCLUDE_PATH.'article_filter_inc.php' );
-$listHash = array();
+$listHash = [];
if ( $gBitUser->hasPermission( 'p_articles_admin' ) ) {
$_REQUEST['status_id'] = !empty( $_REQUEST['status_id'] ) ? $_REQUEST['status_id'] : ARTICLE_STATUS_APPROVED;
@@ -17,13 +18,13 @@ if ( $gBitUser->hasPermission( 'p_articles_admin' ) ) {
$_REQUEST['topic_id'] = !empty( $_REQUEST['topic_id'] ) ? $_REQUEST['topic_id'] : NULL;
$_REQUEST['type_id'] = !empty( $_REQUEST['type_id'] ) ? $_REQUEST['type_id'] : NULL;
- $_template->tpl_vars['futures'] = new Smarty_variable( $gContent->getFutureList( $listHash ) );
+ $gBitSmarty->assign( 'futures', $gContent->getFutureList( $listHash ) );
} else {
$_REQUEST['status_id'] = ARTICLE_STATUS_APPROVED;
$_REQUEST['max_records'] = $gBitSystem->getConfig( 'articles_max_list' );
}
if ( !empty( $_REQUEST['topic'] ) ) {
- $_template->tpl_vars['topic'] = new Smarty_variable( $_REQUEST['topic'] );
+ $gBitSmarty->assign( 'topic', $_REQUEST['topic'] );
}
if ( !empty( $moduleParams )) {
@@ -35,19 +36,19 @@ if ( !empty( $moduleParams )) {
$listHash = $_REQUEST;
}
-BitUser::userCollection( $_REQUEST, $listHash );
-
+RoleUser::userCollection( $_REQUEST, $listHash );
+$listHash['sort_mode'] = ' last_modified_desc';
$articles = $gContent->getList( $listHash );
-$_template->tpl_vars['gContent'] = new Smarty_variable( $gContent );
-$_template->tpl_vars['articles'] = new Smarty_variable( $articles );
-$_template->tpl_vars['listInfo'] = new Smarty_variable( $listHash['listInfo'] );
+$gBitSmarty->assign( 'gContent', $gContent );
+$gBitSmarty->assign( 'articles', $articles );
+$gBitSmarty->assign( 'listInfo', $listHash['listInfo'] );
// show only descriptions on listing page
-$_template->tpl_vars['showDescriptionsOnly'] = new Smarty_variable( TRUE );
+$gBitSmarty->assign( 'showDescriptionsOnly', TRUE );
// display submissions if we have the perm to approve them
if ( $gBitUser->hasPermission( 'p_articles_approve_submission' ) || ( $gBitSystem->isFeatureActive( 'articles_auto_approve' ) && $gBitUser->isRegistered() )) {
$listHash = array( 'status_id' => ARTICLE_STATUS_PENDING );
$submissions = $gContent->getList( $listHash );
- $_template->tpl_vars['submissions'] = new Smarty_variable( $submissions );
+ $gBitSmarty->assign( 'submissions', $submissions );
}