From 7cade3b04274ecc2d3583a0602cc5de3643e81a6 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Sat, 31 Jan 2004 22:59:28 +0000 Subject: More template work. --- functions/error.php | 96 +++++++++------------- functions/list_functions.php | 2 + functions/list_icals.php | 12 --- functions/template.php | 2 +- languages/english.inc.php | 16 ++-- month.php | 3 +- preferences.php | 3 +- templates/default/error.tpl | 43 ++++++++++ templates/default/header.tpl | 3 + year.php | 184 ++++++++----------------------------------- 10 files changed, 133 insertions(+), 231 deletions(-) delete mode 100644 functions/list_icals.php create mode 100644 templates/default/error.tpl diff --git a/functions/error.php b/functions/error.php index 9633eb0..81c2013 100644 --- a/functions/error.php +++ b/functions/error.php @@ -1,69 +1,49 @@ + $page = new Page(BASE.'templates/'.$template.'/error.tpl'); -
- - - - -
- - - - - - - -
- - - - - - -
-
- - - - -
-
- -
-
- -
-
- -
-
-
-
-
-
-replace_tags(array( + 'header' => BASE.'templates/'.$template.'/header.tpl', + 'footer' => BASE.'templates/'.$template.'/footer.tpl', + 'calendar_nav' => BASE.'templates/'.$template.'/calendar_nav.tpl', + 'template' => $template, + 'cal' => $cal, + 'getdate' => $getdate, + 'calendar_name' => $calendar_name, + 'display_date' => $display_date, + 'rss_powered' => $rss_powered, + 'rss_available' => '', + 'todo_available' => '', + 'rss_valid' => '', + 'error_msg' => $error_msg, + 'error_calendar' => $error_calendar, + 'generated' => $generated + + )); + + $page->output(); - include (BASE.'includes/footer.inc.php'); + } diff --git a/functions/list_functions.php b/functions/list_functions.php index 8d4d3a6..c9ae6fd 100644 --- a/functions/list_functions.php +++ b/functions/list_functions.php @@ -1,5 +1,7 @@ "; - - // List the calendars. - display_ical_list(availableCalendars($username, $password, $ALL_CALENDARS_COMBINED)); - - print ""; -} -?> diff --git a/functions/template.php b/functions/template.php index 856d926..0a6d0cb 100644 --- a/functions/template.php +++ b/functions/template.php @@ -130,7 +130,7 @@ class Page { $data = (file_exists($data)) ? $this->parse($data) : $data; // This removes any unfilled tags - if ($data == '') { + if (!$data) { $this->page = ereg_replace('(.*)', '', $this->page); } diff --git a/languages/english.inc.php b/languages/english.inc.php index 4c8127b..2db3532 100644 --- a/languages/english.inc.php +++ b/languages/english.inc.php @@ -182,13 +182,13 @@ Notes about dateFormat_* */ // Error messages - %s will be replaced with a variable -$error_title_lang = 'Error!'; -$error_window_lang = 'There was an error!'; -$error_calendar_lang = 'The calendar "%s" was being processed when this error occurred.'; -$error_path_lang = 'Unable to open the path: "%s"'; -$error_back_lang = 'Please use the "Back" button to return.'; -$error_remotecal_lang = 'This server blocks remote calendars which have not been approved.'; -$error_restrictedcal_lang = 'You have tried to access a calendar that is restricted on this server.'; -$error_invalidcal_lang = 'Invalid calendar file. Please try a different calendar.'; +$lang['l_error_title'] = 'Error!'; +$lang['l_error_window'] = 'There was an error!'; +$lang['l_error_calendar'] = 'The calendar "%s" was being processed when this error occurred.'; +$lang['l_error_path'] = 'Unable to open the path: "%s"'; +$lang['l_error_back'] = 'Please use the "Back" button to return.'; +$lang['l_error_remotecal'] = 'This server blocks remote calendars which have not been approved.'; +$lang['l_error_restrictedcal'] = 'You have tried to access a calendar that is restricted on this server.'; +$lang['l_error_invalidcal'] = 'Invalid calendar file. Please try a different calendar.'; ?> diff --git a/month.php b/month.php index b87d662..9fb2cb1 100644 --- a/month.php +++ b/month.php @@ -50,6 +50,7 @@ $page->replace_tags(array( 'header' => BASE.'templates/'.$template.'/header.tpl', 'footer' => BASE.'templates/'.$template.'/footer.tpl', 'calendar_nav' => BASE.'templates/'.$template.'/calendar_nav.tpl', + 'event_js' => BASE.'functions/event.js', 'template' => $template, 'cal' => $cal, 'getdate' => $getdate, @@ -58,7 +59,7 @@ $page->replace_tags(array( 'rss_powered' => $rss_powered, 'rss_available' => '', 'rss_valid' => '', - 'todo_available' => '', + 'todo_js' => '', 'show_search' => '', 'next_month' => $next_month, 'prev_month' => $prev_month, diff --git a/preferences.php b/preferences.php index 6520331..7fa0e01 100644 --- a/preferences.php +++ b/preferences.php @@ -143,7 +143,8 @@ $page->replace_tags(array( 'rss_powered' => $rss_powered, 'rss_available' => '', 'rss_valid' => '', - 'todo_available' => '', + 'todo_js' => '', + 'event_js' => '', 'language_select' => $language_select, 'calendar_select' => $calendar_select, 'view_select' => $view_select, diff --git a/templates/default/error.tpl b/templates/default/error.tpl new file mode 100644 index 0000000..7cd193a --- /dev/null +++ b/templates/default/error.tpl @@ -0,0 +1,43 @@ +{HEADER} +
+ + + + +
+ + + + + + + +
+ + + + + + +
 {L_ERROR_WINDOW}
+
+ + + + +
+
+ {ERROR_MSG} +
+
+ {ERROR_CALENDAR} +
+
+ {L_ERROR_BACK} +
+
+
+
+
+
+{FOOTER} \ No newline at end of file diff --git a/templates/default/header.tpl b/templates/default/header.tpl index 9f680e1..59aae9a 100644 --- a/templates/default/header.tpl +++ b/templates/default/header.tpl @@ -8,6 +8,9 @@ + + {EVENT_JS} + {TODO_JS} diff --git a/year.php b/year.php index 13755f7..60401cd 100644 --- a/year.php +++ b/year.php @@ -1,7 +1,9 @@ replace_tags(array( + 'header' => BASE.'templates/'.$template.'/header.tpl', + 'footer' => BASE.'templates/'.$template.'/footer.tpl', + 'template' => $template, + 'cal' => $cal, + 'getdate' => $getdate, + 'calendar_name' => $calendar_name, + 'display_date' => $display_date, + 'rss_powered' => $rss_powered, + 'rss_available' => '', + 'rss_valid' => '', + 'todo_available' => '', + 'show_search' => '', + 'next_month' => $next_month, + 'prev_month' => $prev_month, + 'show_goto' => '', + 'is_logged_in' => '', + 'list_icals' => $list_icals, + 'list_years' => $list_years, + 'list_months' => $list_months, + 'list_weeks' => $list_weeks, + 'style_select' => $style_select, + 'generated' => $generated + + )); + +$page->output(); -?> -
- - - - -
- - - - - - -
-
-
- - - - -  '; - $m++; - $n++; - if (($m == 3) && ($n < 12)) { - $m = 0; - echo ''; - echo ''; - echo ''; - } - } while (($m < 3) && ($n < 12)); - ?> - -
- - - - - - ' . $day . '' . "\n"; - $start_day = strtotime("+1 day", $start_day); - } - ?> - - - - -
- - - - - - - -
 '; ?>
-
- - $day"; - if ($i == 0) echo ''; - if (isset($master_array[("$daylink")]) && ($check_month == $minical_month)) { - foreach ($master_array[("$daylink")] as $event_times) { - foreach ($event_times as $val) { - if (!isset($val["event_start"])) $image1 = ' '; - if (isset($val["event_start"])) $image2 = ' '; - } - } - if (isset($master_array[("$daylink")][-1])) $image2 = ' '; - echo '' . "\n"; - } else { - echo '' . "\n"; - } - $start_day = strtotime("+1 day", $start_day); - $i++; - $image1 = ''; - $image2 = ''; - if ($i == 7) { - echo ''; - $i = 0; - $checkagain = date ("m", $start_day); - if ($checkagain != $minical_month) $whole_month = FALSE; - } - } while ($whole_month == TRUE); - $startYear = strtotime ("+1 month", $startYear); - ?> -
' . "\n"; - echo '' . "\n"; - echo '' . "\n"; - echo '' . "\n"; - echo '' . "\n"; - echo '' . "\n"; - echo '' . "\n"; - echo '' . "\n"; - echo '
' . "\n"; - echo '' . $day . '' . "\n"; - echo '
' . $image1 . $image2 . '
' . "\n"; - } elseif ($check_month == $minical_month) { - echo '
' . "\n"; - echo '' . $day . '' . "\n"; - echo '' . $day . '
-
-
-
- +?> \ No newline at end of file -- cgit v1.2.3