summaryrefslogtreecommitdiff
path: root/modules/mod_last_changes.php
blob: 2866506bfa2497a3ea358473b3c8cc7390f67106 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
// $Header: /cvsroot/bitweaver/_bit_liberty/modules/mod_last_changes.php,v 1.3 2005/07/25 20:02:13 squareing Exp $
/**
 * Params:
 * - content_type_guid : if set, show only those content_type_guid's
 * - show_date : if set, show date of last modification
 * @package Liberty
 * @subpackage modules
 */


global $gQueryUser, $gBitUser, $module_rows, $module_params, $gLibertySystem, $module_title;


$userId = NULL;
if( !empty( $gQueryUser->mUserId ) ) {
	$userId = $gQueryUser->mUserId;
}

if( empty( $module_title ) ) {
	if( !empty( $module_params['content_type_guid'] ) && !empty( $gLibertySystem->mContentTypes[$module_params['content_type_guid']] ) ) {
		$title = tra( "Last Changes" ).': '.tra( $gLibertySystem->mContentTypes[$module_params['content_type_guid']]['content_description'] );
		$smarty->assign( 'contentType', $module_params['content_type_guid'] );
	} else {
		$smarty->assign( 'contentType', FALSE );
		$title = tra( "Last Changes" );
	}
	$smarty->assign( 'moduleTitle', $title );
}

if( !empty( $module_params['show_date'] ) ) {
	$smarty->assign( 'showDate' , TRUE );
}

$modLastContent = $gBitUser->getContentList( !empty( $module_params['content_type_guid'] ) ? $module_params['content_type_guid'] : NULL, 0, $module_rows, 'last_modified_desc', NULL, $userId );
$smarty->assign_by_ref( 'modLastContent', $modLastContent['data'] );
?>