summaryrefslogtreecommitdiff
path: root/index.php
blob: 39c3460c89b1d48602f35075741a3fbdb66b8ddd (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$

// Copyright( c ) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See below for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details.
require_once( '../kernel/includes/setup_inc.php' );

include_once( CALENDAR_PKG_PATH.'Calendar.php' );

$gBitSystem->isPackageActive( 'calendar', TRUE );

$gBitSystem->verifyPermission( 'p_calendar_view' );

// now, lets get the ball rolling!
$gCalendar = new Calendar();

// Handle the request hash storing into the session.
$gCalendar->processRequestHash($_REQUEST, $_SESSION['calendar']);

// Setup which content types we want to view.
if( $gBitUser->hasPermission("p_calendar_view_changes") && $_SESSION['calendar']['content_type_guid'] ) {
	$listHash = $_SESSION['calendar'];
} else {
	foreach ($gLibertySystem->mContentTypes as $key => $val) {
		if ($gBitSystem->isFeatureActive('calendar_default_'.$key)) {
			$listHash['content_type_guid'][] = $key;
		}
	}
}
// Build the calendar
$gCalendar->buildCalendar($listHash, $_SESSION['calendar']);
// And display it with a nice title.
$gCalendar->display(tra('Calendar'));

?>