aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChad Little <clittle@users.sourceforge.net>2004-10-25 02:21:26 +0000
committerChad Little <clittle@users.sourceforge.net>2004-10-25 02:21:26 +0000
commite481bdad8a23e896643b867a6d5bb2d0f91fea0f (patch)
treee23e3d9dad4318010269a18ccc670d1cae2a71cf
parent3a5691369c5012eb14609d225b41a4b90e1e3e20 (diff)
downloadphpicalendar-e481bdad8a23e896643b867a6d5bb2d0f91fea0f.tar.gz
phpicalendar-e481bdad8a23e896643b867a6d5bb2d0f91fea0f.tar.bz2
phpicalendar-e481bdad8a23e896643b867a6d5bb2d0f91fea0f.zip
Errors now seem to all work!
-rw-r--r--config.inc.php2
-rw-r--r--error.php (renamed from functions/error.php)13
-rw-r--r--functions/calendar_functions.php10
-rw-r--r--functions/init.inc.php2
-rw-r--r--templates/default/error.tpl6
-rw-r--r--templates/default/footer.tpl6
6 files changed, 19 insertions, 20 deletions
diff --git a/config.inc.php b/config.inc.php
index 3dc4512..4c890d6 100644
--- a/config.inc.php
+++ b/config.inc.php
@@ -20,7 +20,7 @@ $tomorrows_events_lines = '1'; // Number of lines to wrap each event title in
$allday_week_lines = '1'; // Number of lines to wrap each event title in all-day events in week view, 0 means display all lines.
$week_events_lines = '1'; // Number of lines to wrap each event title in the 'Tommorrow's events' box, 0 means display all lines.
$timezone = ''; // Set timezone. Read TIMEZONES file for more information
-$calendar_path = ''; // Leave this blank on most installs, place your full path to calendars if they are outside the phpicalendar folder.
+$calendar_path = ''; // Leave this blank on most installs, place your FULL FILE PATH to calendars if they are outside the phpicalendar folder.
$second_offset = ''; // The time in seconds between your time and your server's time.
$bleed_time = ''; // This allows events past midnight to just be displayed on the starting date, only good up to 24 hours. Range from '0000' to '2359', or '-1' for no bleed time. Is automatically set to $day_start if left blank.
$cookie_uri = ''; // The HTTP URL to the PHP iCalendar directory, ie. http://www.example.com/phpicalendar -- AUTO SETTING -- Only set if you are having cookie issues.
diff --git a/functions/error.php b/error.php
index e69c020..845a23e 100644
--- a/functions/error.php
+++ b/error.php
@@ -1,9 +1,8 @@
<?php
-if (!defined('BASE')) define('BASE','../');
-require_once(BASE.'config.inc.php');
-require_once(BASE.'functions/init.inc.php');
+if (!defined('BASE')) define('BASE','./');
require_once(BASE.'functions/template.php');
+
function error($error_msg='There was an error processing the request.', $file='NONE') {
global $template, $language, $enable_rss, $lang;
if (!isset($template)) $template = 'default';
@@ -21,11 +20,13 @@ function error($error_msg='There was an error processing the request.', $file='N
$calendar_name = $lang['l_error_title'];
$page = new Page(BASE.'templates/'.$template.'/error.tpl');
+
+ $page->replace_files(array(
+ 'header' => BASE.'templates/'.$template.'/header.tpl',
+ 'footer' => BASE.'templates/'.$template.'/footer.tpl',
+ ));
$page->replace_tags(array(
- 'header' => BASE.'templates/'.$template.'/header.tpl',
- 'footer' => BASE.'templates/'.$template.'/footer.tpl',
- 'calendar_nav' => BASE.'templates/'.$template.'/calendar_nav.tpl',
'default_path' => '',
'template' => $template,
'cal' => $cal,
diff --git a/functions/calendar_functions.php b/functions/calendar_functions.php
index 79883d8..e04883d 100644
--- a/functions/calendar_functions.php
+++ b/functions/calendar_functions.php
@@ -14,7 +14,7 @@
// returned.
function availableCalendars($username, $password, $cal_filename, $admin = false) {
// Import globals.
- global $allow_login, $calendar_path, $blacklisted_cals, $list_webcals, $locked_cals, $locked_map, $apache_map, $error_path_lang, $error_restrictedcal_lang, $error_invalidcal_lang, $ALL_CALENDARS_COMBINED, $_SERVER;
+ global $allow_login, $calendar_path, $blacklisted_cals, $list_webcals, $locked_cals, $locked_map, $apache_map, $lang, $ALL_CALENDARS_COMBINED, $_SERVER;
// Create the list of available calendars.
$calendars = array();
@@ -36,7 +36,7 @@ function availableCalendars($username, $password, $cal_filename, $admin = false)
if ($cal_filename == $ALL_CALENDARS_COMBINED || $admin) {
// Add local calendars.
$dir_handle = @opendir($calendar_path)
- or die(error(sprintf($error_path_lang, $calendar_path), $cal_filename));
+ or die(error(sprintf($lang['l_error_path'], $calendar_path), $cal_filename));
while (($file = readdir($dir_handle)) != false) {
// Make sure this is not a dot file and it ends with .ics,
// and that it is not blacklisted.
@@ -80,7 +80,7 @@ function availableCalendars($username, $password, $cal_filename, $admin = false)
// to remove a .ics suffix because it would not have been passed
// in the argument.
if (in_array($cal_filename, $blacklisted_cals))
- exit(error($error_restrictedcal_lang, $cal_filename));
+ exit(error($lang['l_error_restrictedcal'], $cal_filename));
// If HTTP authenticated, make sure this calendar is available
// to the user.
@@ -88,7 +88,7 @@ function availableCalendars($username, $password, $cal_filename, $admin = false)
if (!in_array($cal_filename, $apache_map[$http_user])) {
// Use the invalid calendar message so that the user is
// not made aware of locked calendars.
- exit(error($error_invalidcal_lang, $cal_filename));
+ exit(error($lang['l_error_invalidcal'], $cal_filename));
}
}
@@ -98,7 +98,7 @@ function availableCalendars($username, $password, $cal_filename, $admin = false)
{
// Use the invalid calendar message so that the user is
// not made aware of locked calendars.
- exit(error($error_invalidcal_lang, $cal_filename));
+ exit(error($lang['l_error_invalidcal'], $cal_filename));
}
// Add this calendar.
diff --git a/functions/init.inc.php b/functions/init.inc.php
index d5843ed..6f21282 100644
--- a/functions/init.inc.php
+++ b/functions/init.inc.php
@@ -14,7 +14,7 @@ $ALL_CALENDARS_COMBINED = 'all_calendars_combined971';
// Pull in the configuration and some functions.
if (!defined('BASE')) define('BASE', './');
include_once(BASE.'config.inc.php');
-include_once(BASE.'functions/error.php');
+include_once(BASE.'error.php');
include_once(BASE.'functions/calendar_functions.php');
include_once(BASE.'functions/userauth_functions.php');
if (isset($_COOKIE['phpicalendar'])) {
diff --git a/templates/default/error.tpl b/templates/default/error.tpl
index b4eaa9c..e2ec36e 100644
--- a/templates/default/error.tpl
+++ b/templates/default/error.tpl
@@ -17,10 +17,9 @@
</tr>
<tr>
<td>
- <table width="100%" border="0" cellspacing="0" cellpadding="0" class="G10B">
+ <table width="100%" border="0" cellspacing="0" cellpadding="10" class="G10B">
<tr>
- <td align="center" valign="top">
- <br />
+ <td align="center" valign="top" class="V12">
{ERROR_MSG}
<br />
<br />
@@ -29,7 +28,6 @@
<br />
{L_ERROR_BACK}
<br />
- <br />
</td>
</tr>
</table>
diff --git a/templates/default/footer.tpl b/templates/default/footer.tpl
index 24347af..e1ff9f6 100644
--- a/templates/default/footer.tpl
+++ b/templates/default/footer.tpl
@@ -1,4 +1,4 @@
-<center class="V9"><br />{L_POWERED_BY} <a class="psf" href="http://phpicalendar.net/">PHP iCalendar 2.0 beta</a><br />
+<center class="V9"><br />{L_POWERED_BY} <a class="psf" href="http://phpicalendar.net/">PHP iCalendar 2.0</a><br />
<!-- switch rss_valid on -->
<p>
<a style="color:gray" href="http://feeds.archive.org/validator/check?url={FOOTER_CHECK}">
@@ -8,8 +8,8 @@
<!-- switch rss_powered on -->
{L_THIS_SITE_IS} <a class="psf" href="{BASE}rss/index.php?cal={CAL}&amp;getdate={GETDATE}">RSS-Enabled</a><br />
<!-- switch rss_powered off -->
-Page generated in {GENERATED1} seconds.<br />
-Template generated in {GENERATED2} seconds.
+<!--Page generated in {GENERATED1} seconds.<br />
+Template generated in {GENERATED2} seconds.-->
</center>
</body>
</html>

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