From 8933f4144fa0fe022d9939ed2e2f31743f6de939 Mon Sep 17 00:00:00 2001 From: Jim Hu Date: Sun, 28 Dec 2008 00:46:49 +0000 Subject: add back link to print view --- config.inc.php | 8 +++++--- index.php | 9 ++++----- languages/english.inc.php | 1 + print.php | 5 ++++- templates/default/print.tpl | 11 ++++++----- templates/tan/print.tpl | 11 ++++++----- 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 @@ - +

{DISPLAY_DATE}

{CALENDAR_NAME} {L_CALENDAR}

{DISPLAY_DATE}

{CALENDAR_NAME} {L_CALENDAR}
+ {L_VIEW_CALENDARS}
- +

{DISPLAY_DATE}

{CALENDAR_NAME} {L_CALENDAR}

{DISPLAY_DATE}

{CALENDAR_NAME} {L_CALENDAR}
+ Foo{L_VIEW_CALENDARS}