summaryrefslogtreecommitdiff
path: root/templates/center_view_generic.php
blob: a000bb15070afef0c7b79e2eaa49934792f0bcf2 (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
38
<?php
/**
 * @version $Header$
 * @package bitweaver
 */
global $moduleParams, $gContent, $gBitSmarty;

$gContent = null;

if( !empty( $moduleParams ) ) {
	extract( $moduleParams );
}

$lookupHash['content_id'] = ( !empty( $module_params['content_id'] ) ? $module_params['content_id'] : null );

if( $gContent = LibertyBase::getLibertyObject( $lookupHash['content_id'] ) ) {
	if( !$gContent->hasViewPermission() ){
		// no perm then get rid of the content object
		$gContent = null;
	}else{
		// deal with the parsing
		$parseHash['format_guid']		= $gContent->mInfo['format_guid'];
		$parseHash['content_id']		= $gContent->mInfo['content_id'];
		$parseHash['user_id']			= $gContent->mInfo['user_id'];
		$parseHash['data']				= $gContent->mInfo['data'];
		$gContent->mInfo['parsed_data'] = LibertyContent::parseDataHash( $parseHash, $gContent );

		if( !empty( $moduleParams['title'] )) {
			$gContent->mInfo['title'] = $moduleParams['title'];
		}

		if ( isset($moduleParams['content_type_guid'] )){
			$gBitSmarty->assign( "contentType", $gContent->getContentTypeName() );
		}
	}
}

$gBitSmarty->assign( "gContent", $gContent );