summaryrefslogtreecommitdiff
path: root/Calendar.php
diff options
context:
space:
mode:
authorNick Palmer <nick@sluggardy.net>2008-02-10 12:18:53 +0000
committerNick Palmer <nick@sluggardy.net>2008-02-10 12:18:53 +0000
commitda5d88102c19034278c9312ad7d2a830b5203f5a (patch)
treeebad7dfd52212b9c5bddb533b519e6828e7ff283 /Calendar.php
parentbfd84fcb36e9c5452ccd1198cdd3584bcbaf862c (diff)
downloadcalendar-da5d88102c19034278c9312ad7d2a830b5203f5a.tar.gz
calendar-da5d88102c19034278c9312ad7d2a830b5203f5a.tar.bz2
calendar-da5d88102c19034278c9312ad7d2a830b5203f5a.zip
Make it possible for packages (like events) to keep control of calendar urls.
Diffstat (limited to 'Calendar.php')
-rw-r--r--Calendar.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/Calendar.php b/Calendar.php
index 4b59fab..ea3d059 100644
--- a/Calendar.php
+++ b/Calendar.php
@@ -1,6 +1,6 @@
<?php
/**
- * @version $Header: /cvsroot/bitweaver/_bit_calendar/Calendar.php,v 1.44 2008/01/13 22:28:36 nickpalmer Exp $
+ * @version $Header: /cvsroot/bitweaver/_bit_calendar/Calendar.php,v 1.45 2008/02/10 12:18:52 nickpalmer Exp $
* @package calendar
*
* @copyright Copyright (c) 2004-2006, bitweaver.org
@@ -14,6 +14,7 @@
include_once( KERNEL_PKG_PATH . 'BitDate.php' );
// set week offset - start with a day other than monday
define( 'WEEK_OFFSET', !empty( $gBitUser->mUserPrefs['calendar_week_offset'] ) ? $gBitUser->mUserPrefs['calendar_week_offset'] : $gBitSystem->getConfig( 'calendar_week_offset', 0 ) );
+
/**
* @package calendar
*/
@@ -442,11 +443,18 @@ class Calendar extends LibertyContent {
}
// Display the actual calendar doing any other work required for the template
- function display($pTitle, $pShowContentOptions = TRUE) {
- global $gBitSystem;
+ function display($pTitle, $pShowContentOptions = TRUE, $pBaseUrl=NULL) {
+ global $gBitSystem, $gBitSmarty;
$this->setupCalendar($pShowContentOptions);
+ // A default base for the calendar
+ if( empty($pBaseUrl) ){
+ $pBaseUrl = CALENDAR_PKG_URL.'index.php';
+ }
+ // Asssign it so templates see it.
+ $gBitSmarty->assign('baseCalendarUrl', $pBaseUrl);
+
$gBitSystem->display( 'bitpackage:calendar/calendar.tpl', $pTitle );
}