summaryrefslogtreecommitdiff
path: root/index.php
blob: 2092270d34249173cceb46a97d09f98a6bcd99ac (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
<?php
require_once( "../kernel/setup_inc.php" );
require_once( TAGS_PKG_PATH."LibertyTag.php" );

$gBitSystem->verifyPackage( 'tags' );

$gBitSystem->verifyPermission('p_tags_view');

$tag = new LibertyTag();

$_REQUEST['max_records'] = !empty( $_REQUEST['max_records'] ) ? $_REQUEST['max_records'] : NULL;
$listHash = $_REQUEST;
$tagHash = $_REQUEST;

$gBitSmarty->assign( 'cloud', TRUE );

if( isset($_REQUEST['tags']) ){
	$pageTitle = tra( 'Tagged Content' );
	if( $listData = $tag->assignContentList( $listHash ) ) {
		$pageTitle .= ' '.tra( 'with' ).' '.$_REQUEST['tags'];
		$gBitSystem->setCanonicalLink( $tag->getDisplayUriWithTag( $_REQUEST['tags'] ) );
	} else {
		$gBitSystem->setHttpStatus( HttpStatusCodes::HTTP_NOT_FOUND );
	}
	$tagData = $tag->getList( $tagHash );
	$gBitSmarty->assign( 'tagData', $tagData["data"] );
	$gBitSmarty->assign( 'tagsReq', $_REQUEST['tags'] );
	$gBitSystem->display( 'bitpackage:tags/list_content.tpl', $pageTitle, array( 'display_mode' => 'display' ));
}else{
	$listData = $tag->getList( $listHash );
	$gBitSmarty->assign( 'tagData', $listData["data"] );
	$gBitSystem->display( 'bitpackage:tags/list_tags.tpl', tra( 'Tags' ) , array( 'display_mode' => 'display' ));
	
}