aboutsummaryrefslogtreecommitdiffstats
path: root/error.php
blob: 35e9e19e701a627014a8c1eb025522a9bb695409 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?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', $error_base='./') {
	global $language, $enable_rss, $lang, $charset, $phpiCal_config;
	if (!isset($template))					$template = $phpiCal_config->template;
	if (!isset($lang['l_powered_by']))		$lang['l_powered_by'] = 'Powered by';
	if (!isset($lang['l_error_title']))		$lang['l_error_title'] = 'Error!';
	if (!isset($lang['l_error_window']))	$lang['l_error_window'] = 'There was an error!';
	if (!isset($lang['l_error_calendar']))	$lang['l_error_calendar'] = 'The calendar "%s" was being processed when this error occurred.';
	if (!isset($lang['l_error_back']))		$lang['l_error_back'] = 'Please use the "Back" button to return.';
	if (!isset($lang['l_this_site_is']))	$lang['l_this_site_is'] = 'This site is';
	if (!isset($enable_rss))				$enable_rss = 'no';
		
	$error_calendar 	= sprintf($lang['l_error_calendar'], $file);
	$current_view 		= 'error';
	$display_date 		= $lang['l_error_title'];
	$calendar_name 		= $lang['l_error_title'];
	
	$default_path = $phpiCal_config->default_path;
	if (empty($phpiCal_config->default_path)) {
		if (isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) == 'on' ) {
			$default_path = 'https://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].substr($_SERVER['PHP_SELF'],0,strpos($_SERVER['PHP_SELF'],'/rss/'));
		} else {
			$default_path = 'http://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].substr($_SERVER['PHP_SELF'],0,strpos($_SERVER['PHP_SELF'],'/rss/'));
		}
	}
	
	$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(
		'version'			=> $phpicalendar_version,
		'default_path'		=> $default_path.'/',
		'template'			=> $template,
		'cal'				=> $cal,
		'getdate'			=> $getdate,
		'charset'			=> $charset,
		'calendar_name'		=> $calendar_name,
		'display_date'		=> $display_date,
		'rss_powered'	 	=> $rss_powered,
		'rss_available' 	=> '',
		'event_js'			=> '',
		'todo_js'			=> '',
		'todo_available' 	=> '',
		'rss_valid' 		=> '',
		'error_msg'	 		=> $error_msg,
		'error_calendar' 	=> $error_calendar,
		'generated'	 		=> $generated,
		'l_powered_by'		=> $lang['l_powered_by'],
		'l_error_back'		=> $lang['l_error_back'],
		'l_error_window'	=> $lang['l_error_window']
				
		));
		
	$page->output();

	

}

?>

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