aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Hu <jimhu@users.sourceforge.net>2008-12-28 00:46:49 +0000
committerJim Hu <jimhu@users.sourceforge.net>2008-12-28 00:46:49 +0000
commit8933f4144fa0fe022d9939ed2e2f31743f6de939 (patch)
treecadf734d6b6e3fde054cd3386f70aed0d80b46e9
parenta8a822e8fe1916540ea4bce97c4861bb452ab21f (diff)
downloadphpicalendar-8933f4144fa0fe022d9939ed2e2f31743f6de939.tar.gz
phpicalendar-8933f4144fa0fe022d9939ed2e2f31743f6de939.tar.bz2
phpicalendar-8933f4144fa0fe022d9939ed2e2f31743f6de939.zip
add back link to print view
-rw-r--r--config.inc.php8
-rw-r--r--index.php9
-rw-r--r--languages/english.inc.php1
-rw-r--r--print.php5
-rw-r--r--templates/default/print.tpl11
-rw-r--r--templates/tan/print.tpl11
6 files changed, 26 insertions, 19 deletions
diff --git a/config.inc.php b/config.inc.php
index 943886f..1f9beab 100644
--- a/config.inc.php
+++ b/config.inc.php
@@ -44,16 +44,18 @@ phpicalendar currently supports about 30 language variants. For a list of suppo
# 'language' => 'Spanish',
# 'default_cal' => 'US Holidays', // Exact filename of calendar without .ics. Or set to 'ALL_CALENDARS_COMBINED to open all calenders combined into one.
# 'template' => 'green'; // Template support: change this to have a different "skin" for your installation.
-# 'default_view' => 'month', // Default view for calendars' => 'day', 'week', 'month', 'year'
+ 'default_view' => 'year', // Default view for calendars' => 'day', 'week', 'month', 'year'
+ 'printview_default' => 'yes', // Set print view as the default view. Uses'default_view (listed above).
# 'gridLength' => 10, // Grid size in day and week views. Allowed values are 1,2,3,4,10,12,15,20,30,60. Default is 15
# 'minical_view' => 'current', // Where do the mini-calendars go when clicked?' => 'day', 'week', 'month', 'current'
# 'allow_preferences' => 'no',
# 'show_search' => 'yes',
# 'show_todos' => 'no',
# 'show_completed' => 'no',
+ 'allow_login' => 'yes', // Set to yes to prompt for login to unlock calendars.
# 'allow_admin' => 'yes',
- 'week_start_day' => 'Monday', // Day of the week your week starts on
- 'week_length' => '5', // Number of days to display in the week view
+# 'week_start_day' => 'Monday', // Day of the week your week starts on
+# 'week_length' => '5', // Number of days to display in the week view
# 'day_start' => '0600', // Start time for day grid
# 'day_end' => '2000', // End time for day grid
);
diff --git a/index.php b/index.php
index a865512..05edd88 100644
--- a/index.php
+++ b/index.php
@@ -3,19 +3,18 @@ if (!defined('BASE')) define('BASE', './');
include_once(BASE.'functions/init.inc.php');
if ($phpiCal_config->printview_default == 'yes') {
- $printview = $phpiCal_config->default_view;
- $phpiCal_config->setProperty('default_view', "print.php");
+ $theview ="print.php";
} else {
$check = array ('day', 'week', 'month', 'year');
if (in_array($phpiCal_config->default_view, $check)) {
- $phpiCal_config->setProperty('default_view', $phpiCal_config->default_view . '.php');
+ $theview = $phpiCal_config->default_view . '.php';
} else {
die('illegal view');
}
}
if(isset($_GET['cpath'])){
- $phpiCal_config->default_view .= '?cpath='.$_GET['cpath'];
+ $theview .= '?cpath='.$_GET['cpath'];
}
-header("Location: $phpiCal_config->default_view");
+header("Location: $theview");
?>
diff --git a/languages/english.inc.php b/languages/english.inc.php
index a2a581b..b5bd4f3 100644
--- a/languages/english.inc.php
+++ b/languages/english.inc.php
@@ -47,6 +47,7 @@ $lang['l_pick_multiple'] = 'Pick multiple';
$lang['l_query'] = 'Query'; // will be followed by the search query
$lang['l_no_results'] = 'No events found';
$lang['l_goprint'] = 'Printer Friendly';
+$lang['l_view_calendars'] = 'Calendar view';
$lang['l_time'] = 'Time';
$lang['l_summary'] = 'Summary';
$lang['l_description'] = 'Description';
diff --git a/print.php b/print.php
index 5c2a30a..aee8f39 100644
--- a/print.php
+++ b/print.php
@@ -8,7 +8,7 @@ $end_week_time = $start_week_time + (6 * 25 * 60 * 60);
$parse_month = date ("Ym", strtotime($getdate));
$events_week = 0;
$unix_time = strtotime($getdate);
-$printview = 'month';
+$printview = $phpiCal_config->default_view;
if (isset($_GET['printview'])) $printview = $_GET['printview'];
if ($printview == 'day') {
@@ -57,7 +57,9 @@ $page->replace_tags(array(
'event_js' => '',
'charset' => $phpiCal_config->charset,
'default_path' => $phpiCal_config->default_path,
+ 'default_view' => $phpiCal_config->default_view,
'template' => $phpiCal_config->template,
+ 'cpath' => $phpiCal_config->cpath,
'cal' => $cal,
'getdate' => $getdate,
'calendar_name' => $cal_displayname,
@@ -84,6 +86,7 @@ $page->replace_tags(array(
'l_summary' => $lang['l_summary'],
'l_description' => $lang['l_description'],
'l_calendar' => $lang['l_calendar'],
+ 'l_view_calendars' => $lang['l_view_calendars'],
'l_day' => $lang['l_day'],
'l_week' => $lang['l_week'],
'l_month' => $lang['l_month'],
diff --git a/templates/default/print.tpl b/templates/default/print.tpl
index dfc773b..1aa8be3 100644
--- a/templates/default/print.tpl
+++ b/templates/default/print.tpl
@@ -5,15 +5,16 @@
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top">
- <td align="left" width="400" class="title"><h1>{DISPLAY_DATE}</h1><span class="V9G">{CALENDAR_NAME} {L_CALENDAR}</span></td>
+ <td align="left" width="400" class="title"><h1>{DISPLAY_DATE}</h1><span class="V9G">{CALENDAR_NAME} {L_CALENDAR}</span><br />
+ <a class="psf" href="{DEFAULT_VIEW}.php?cal={CAL}&amp;getdate={GETDATE}&amp;cpath={CPATH}">{L_VIEW_CALENDARS}</a></td>
<td valign="top" align="right" width="120" class="navback">
<div style="padding-top: 3px;">
<table width="90" border="0" cellpadding="0" cellspacing="0">
<tr valign="top">
- <td><a class="psf" href="print.php?cal={CAL}&amp;getdate={GETDATE}&amp;printview=day"><img src="templates/{TEMPLATE}/images/day_on.gif" alt="{L_DAY}" border="0" /></a></td>
- <td><a class="psf" href="print.php?cal={CAL}&amp;getdate={GETDATE}&amp;printview=week"><img src="templates/{TEMPLATE}/images/week_on.gif" alt="{L_WEEK}" border="0" /></a></td>
- <td><a class="psf" href="print.php?cal={CAL}&amp;getdate={GETDATE}&amp;printview=month"><img src="templates/{TEMPLATE}/images/month_on.gif" alt="{L_MONTH}" border="0" /></a></td>
- <td><a class="psf" href="print.php?cal={CAL}&amp;getdate={GETDATE}&amp;printview=year"><img src="templates/{TEMPLATE}/images/year_on.gif" alt="{L_YEAR}" border="0" /></a></td>
+ <td><a class="psf" href="print.php?cal={CAL}&amp;cpath={CPATH}&amp;getdate={GETDATE}&amp;printview=day"><img src="templates/{TEMPLATE}/images/day_on.gif" alt="{L_DAY}" border="0" /></a></td>
+ <td><a class="psf" href="print.php?cal={CAL}&amp;cpath={CPATH}&amp;getdate={GETDATE}&amp;printview=week"><img src="templates/{TEMPLATE}/images/week_on.gif" alt="{L_WEEK}" border="0" /></a></td>
+ <td><a class="psf" href="print.php?cal={CAL}&amp;cpath={CPATH}&amp;getdate={GETDATE}&amp;printview=month"><img src="templates/{TEMPLATE}/images/month_on.gif" alt="{L_MONTH}" border="0" /></a></td>
+ <td><a class="psf" href="print.php?cal={CAL}&amp;cpath={CPATH}&amp;getdate={GETDATE}&amp;printview=year"><img src="templates/{TEMPLATE}/images/year_on.gif" alt="{L_YEAR}" border="0" /></a></td>
</tr>
</table>
</div>
diff --git a/templates/tan/print.tpl b/templates/tan/print.tpl
index dfc773b..bee669a 100644
--- a/templates/tan/print.tpl
+++ b/templates/tan/print.tpl
@@ -5,15 +5,16 @@
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top">
- <td align="left" width="400" class="title"><h1>{DISPLAY_DATE}</h1><span class="V9G">{CALENDAR_NAME} {L_CALENDAR}</span></td>
+ <td align="left" width="400" class="title"><h1>{DISPLAY_DATE}</h1><span class="V9G">{CALENDAR_NAME} {L_CALENDAR}</span><br />
+ <a class="psf" href="{DEFAULT_VIEW}.php?cal={CAL}&amp;getdate={GETDATE}&amp;cpath={CPATH}">Foo{L_VIEW_CALENDARS}</a></td>
<td valign="top" align="right" width="120" class="navback">
<div style="padding-top: 3px;">
<table width="90" border="0" cellpadding="0" cellspacing="0">
<tr valign="top">
- <td><a class="psf" href="print.php?cal={CAL}&amp;getdate={GETDATE}&amp;printview=day"><img src="templates/{TEMPLATE}/images/day_on.gif" alt="{L_DAY}" border="0" /></a></td>
- <td><a class="psf" href="print.php?cal={CAL}&amp;getdate={GETDATE}&amp;printview=week"><img src="templates/{TEMPLATE}/images/week_on.gif" alt="{L_WEEK}" border="0" /></a></td>
- <td><a class="psf" href="print.php?cal={CAL}&amp;getdate={GETDATE}&amp;printview=month"><img src="templates/{TEMPLATE}/images/month_on.gif" alt="{L_MONTH}" border="0" /></a></td>
- <td><a class="psf" href="print.php?cal={CAL}&amp;getdate={GETDATE}&amp;printview=year"><img src="templates/{TEMPLATE}/images/year_on.gif" alt="{L_YEAR}" border="0" /></a></td>
+ <td><a class="psf" href="print.php?cal={CAL}&amp;cpath={CPATH}&amp;getdate={GETDATE}&amp;printview=day"><img src="templates/{TEMPLATE}/images/day_on.gif" alt="{L_DAY}" border="0" /></a></td>
+ <td><a class="psf" href="print.php?cal={CAL}&amp;cpath={CPATH}&amp;getdate={GETDATE}&amp;printview=week"><img src="templates/{TEMPLATE}/images/week_on.gif" alt="{L_WEEK}" border="0" /></a></td>
+ <td><a class="psf" href="print.php?cal={CAL}&amp;cpath={CPATH}&amp;getdate={GETDATE}&amp;printview=month"><img src="templates/{TEMPLATE}/images/month_on.gif" alt="{L_MONTH}" border="0" /></a></td>
+ <td><a class="psf" href="print.php?cal={CAL}&amp;cpath={CPATH}&amp;getdate={GETDATE}&amp;printview=year"><img src="templates/{TEMPLATE}/images/year_on.gif" alt="{L_YEAR}" border="0" /></a></td>
</tr>
</table>
</div>

© 2014-2024 Faster IT GmbH | imprint | privacy policy