Skip to content

Commit 8933f41

Browse files
author
Jim Hu
committed
add back link to print view
1 parent a8a822e commit 8933f41

File tree

6 files changed

+26
-19
lines changed

6 files changed

+26
-19
lines changed

config.inc.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,18 @@
4444
# 'language' => 'Spanish',
4545
# 'default_cal' => 'US Holidays', // Exact filename of calendar without .ics. Or set to 'ALL_CALENDARS_COMBINED to open all calenders combined into one.
4646
# 'template' => 'green'; // Template support: change this to have a different "skin" for your installation.
47-
# 'default_view' => 'month', // Default view for calendars' => 'day', 'week', 'month', 'year'
47+
'default_view' => 'year', // Default view for calendars' => 'day', 'week', 'month', 'year'
48+
'printview_default' => 'yes', // Set print view as the default view. Uses'default_view (listed above).
4849
# '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
4950
# 'minical_view' => 'current', // Where do the mini-calendars go when clicked?' => 'day', 'week', 'month', 'current'
5051
# 'allow_preferences' => 'no',
5152
# 'show_search' => 'yes',
5253
# 'show_todos' => 'no',
5354
# 'show_completed' => 'no',
55+
'allow_login' => 'yes', // Set to yes to prompt for login to unlock calendars.
5456
# 'allow_admin' => 'yes',
55-
'week_start_day' => 'Monday', // Day of the week your week starts on
56-
'week_length' => '5', // Number of days to display in the week view
57+
# 'week_start_day' => 'Monday', // Day of the week your week starts on
58+
# 'week_length' => '5', // Number of days to display in the week view
5759
# 'day_start' => '0600', // Start time for day grid
5860
# 'day_end' => '2000', // End time for day grid
5961
);

index.php

+4-5
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,18 @@
33
include_once(BASE.'functions/init.inc.php');
44

55
if ($phpiCal_config->printview_default == 'yes') {
6-
$printview = $phpiCal_config->default_view;
7-
$phpiCal_config->setProperty('default_view', "print.php");
6+
$theview ="print.php";
87
} else {
98
$check = array ('day', 'week', 'month', 'year');
109
if (in_array($phpiCal_config->default_view, $check)) {
11-
$phpiCal_config->setProperty('default_view', $phpiCal_config->default_view . '.php');
10+
$theview = $phpiCal_config->default_view . '.php';
1211
} else {
1312
die('illegal view');
1413
}
1514
}
1615
if(isset($_GET['cpath'])){
17-
$phpiCal_config->default_view .= '?cpath='.$_GET['cpath'];
16+
$theview .= '?cpath='.$_GET['cpath'];
1817
}
19-
header("Location: $phpiCal_config->default_view");
18+
header("Location: $theview");
2019

2120
?>

languages/english.inc.php

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
$lang['l_query'] = 'Query'; // will be followed by the search query
4848
$lang['l_no_results'] = 'No events found';
4949
$lang['l_goprint'] = 'Printer Friendly';
50+
$lang['l_view_calendars'] = 'Calendar view';
5051
$lang['l_time'] = 'Time';
5152
$lang['l_summary'] = 'Summary';
5253
$lang['l_description'] = 'Description';

print.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
$parse_month = date ("Ym", strtotime($getdate));
99
$events_week = 0;
1010
$unix_time = strtotime($getdate);
11-
$printview = 'month';
11+
$printview = $phpiCal_config->default_view;
1212
if (isset($_GET['printview'])) $printview = $_GET['printview'];
1313

1414
if ($printview == 'day') {
@@ -57,7 +57,9 @@
5757
'event_js' => '',
5858
'charset' => $phpiCal_config->charset,
5959
'default_path' => $phpiCal_config->default_path,
60+
'default_view' => $phpiCal_config->default_view,
6061
'template' => $phpiCal_config->template,
62+
'cpath' => $phpiCal_config->cpath,
6163
'cal' => $cal,
6264
'getdate' => $getdate,
6365
'calendar_name' => $cal_displayname,
@@ -84,6 +86,7 @@
8486
'l_summary' => $lang['l_summary'],
8587
'l_description' => $lang['l_description'],
8688
'l_calendar' => $lang['l_calendar'],
89+
'l_view_calendars' => $lang['l_view_calendars'],
8790
'l_day' => $lang['l_day'],
8891
'l_week' => $lang['l_week'],
8992
'l_month' => $lang['l_month'],

templates/default/print.tpl

+6-5
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@
55
<td>
66
<table width="100%" border="0" cellspacing="0" cellpadding="0">
77
<tr valign="top">
8-
<td align="left" width="400" class="title"><h1>{DISPLAY_DATE}</h1><span class="V9G">{CALENDAR_NAME} {L_CALENDAR}</span></td>
8+
<td align="left" width="400" class="title"><h1>{DISPLAY_DATE}</h1><span class="V9G">{CALENDAR_NAME} {L_CALENDAR}</span><br />
9+
<a class="psf" href="{DEFAULT_VIEW}.php?cal={CAL}&amp;getdate={GETDATE}&amp;cpath={CPATH}">{L_VIEW_CALENDARS}</a></td>
910
<td valign="top" align="right" width="120" class="navback">
1011
<div style="padding-top: 3px;">
1112
<table width="90" border="0" cellpadding="0" cellspacing="0">
1213
<tr valign="top">
13-
<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>
14-
<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>
15-
<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>
16-
<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>
14+
<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>
15+
<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>
16+
<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>
17+
<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>
1718
</tr>
1819
</table>
1920
</div>

templates/tan/print.tpl

+6-5
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@
55
<td>
66
<table width="100%" border="0" cellspacing="0" cellpadding="0">
77
<tr valign="top">
8-
<td align="left" width="400" class="title"><h1>{DISPLAY_DATE}</h1><span class="V9G">{CALENDAR_NAME} {L_CALENDAR}</span></td>
8+
<td align="left" width="400" class="title"><h1>{DISPLAY_DATE}</h1><span class="V9G">{CALENDAR_NAME} {L_CALENDAR}</span><br />
9+
<a class="psf" href="{DEFAULT_VIEW}.php?cal={CAL}&amp;getdate={GETDATE}&amp;cpath={CPATH}">Foo{L_VIEW_CALENDARS}</a></td>
910
<td valign="top" align="right" width="120" class="navback">
1011
<div style="padding-top: 3px;">
1112
<table width="90" border="0" cellpadding="0" cellspacing="0">
1213
<tr valign="top">
13-
<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>
14-
<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>
15-
<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>
16-
<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>
14+
<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>
15+
<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>
16+
<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>
17+
<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>
1718
</tr>
1819
</table>
1920
</div>

0 commit comments

Comments
 (0)