1 | <?php |
---|
2 | /**************************************************************************\ |
---|
3 | * eGroupWare - Calendar * |
---|
4 | * http://www.egroupware.org * |
---|
5 | * Based on Webcalendar by Craig Knudsen <cknudsen@radix.net> * |
---|
6 | * http://www.radix.net/~cknudsen * |
---|
7 | * Written by Mark Peters <skeeter@phpgroupware.org> * |
---|
8 | * -------------------------------------------- * |
---|
9 | * This program is free software; you can redistribute it and/or modify it * |
---|
10 | * under the terms of the GNU General Public License as published by the * |
---|
11 | * Free Software Foundation; either version 2 of the License, or (at your * |
---|
12 | * option) any later version. * |
---|
13 | \**************************************************************************/ |
---|
14 | $phpgw_flags = Array( |
---|
15 | 'currentapp' => 'calendar', |
---|
16 | //'noheader' => True, |
---|
17 | //'nonavbar' => True, |
---|
18 | 'noappheader' => True, |
---|
19 | 'noappfooter' => True, |
---|
20 | 'nofooter' => True |
---|
21 | ); |
---|
22 | |
---|
23 | $GLOBALS['phpgw_info']['flags'] = $phpgw_flags; |
---|
24 | |
---|
25 | $d1 = strtolower(substr(PHPGW_APP_INC,0,3)); |
---|
26 | if($d1 == 'htt' || $d1 == 'ftp' ) |
---|
27 | { |
---|
28 | echo 'Failed attempt to break in via an old Security Hole!<br>'."\n"; |
---|
29 | $GLOBALS['phpgw']->common->phpgw_exit(); |
---|
30 | } |
---|
31 | unset($d1); |
---|
32 | |
---|
33 | $showevents = (int)$GLOBALS['phpgw_info']['user']['preferences']['calendar']['mainscreen_showevents']; |
---|
34 | if($showevents>0) |
---|
35 | { |
---|
36 | $GLOBALS['phpgw']->translation->add_app('calendar'); |
---|
37 | if(!is_object($GLOBALS['phpgw']->datetime)) |
---|
38 | { |
---|
39 | $GLOBALS['phpgw']->datetime = CreateObject('phpgwapi.date_time'); |
---|
40 | } |
---|
41 | |
---|
42 | $GLOBALS['date'] = date('Ymd',$GLOBALS['phpgw']->datetime->users_localtime); |
---|
43 | $GLOBALS['g_year'] = substr($GLOBALS['date'],0,4); |
---|
44 | $GLOBALS['g_month'] = substr($GLOBALS['date'],4,2); |
---|
45 | $GLOBALS['g_day'] = substr($GLOBALS['date'],6,2); |
---|
46 | $GLOBALS['owner'] = $GLOBALS['phpgw_info']['user']['account_id']; |
---|
47 | $GLOBALS['css'] = "\n".'<style type="text/css">'."\n".'<!--'."\n" |
---|
48 | . ExecMethod('calendar.uicalendar.css').'-->'."\n".'</style>'; |
---|
49 | |
---|
50 | if($showevents==2) |
---|
51 | { |
---|
52 | $_page = "small"; |
---|
53 | } |
---|
54 | else |
---|
55 | { |
---|
56 | $page_ = explode('.',$GLOBALS['phpgw_info']['user']['preferences']['calendar']['defaultcalendar']); |
---|
57 | $_page = substr($page_[0],0,7); // makes planner from planner_{user|category} |
---|
58 | if ($_page=='index' || ($_page != 'day' && $_page != 'week' && $_page != 'month' && $_page != 'year' && $_page != 'planner')) |
---|
59 | { |
---|
60 | $_page = 'month'; |
---|
61 | // $GLOBALS['phpgw']->preferences->add('calendar','defaultcalendar','month'); |
---|
62 | // $GLOBALS['phpgw']->preferences->save_repository(); |
---|
63 | } |
---|
64 | } |
---|
65 | |
---|
66 | if(!@file_exists(PHPGW_INCLUDE_ROOT.'/calendar/inc/hook_home_'.$_page.'.inc.php')) |
---|
67 | { |
---|
68 | $_page = 'day'; |
---|
69 | } |
---|
70 | include(PHPGW_INCLUDE_ROOT.'/calendar/inc/hook_home_'.$_page.'.inc.php'); |
---|
71 | |
---|
72 | $title = lang('Calendar'); |
---|
73 | |
---|
74 | $portalbox = CreateObject('phpgwapi.listbox', |
---|
75 | Array( |
---|
76 | 'title' => $title, |
---|
77 | 'primary' => $GLOBALS['phpgw_info']['theme']['navbar_bg'], |
---|
78 | 'secondary' => $GLOBALS['phpgw_info']['theme']['navbar_bg'], |
---|
79 | 'tertiary' => $GLOBALS['phpgw_info']['theme']['navbar_bg'], |
---|
80 | 'width' => '100%', |
---|
81 | 'outerborderwidth' => '0', |
---|
82 | 'header_background_image' => $GLOBALS['phpgw']->common->image('phpgwapi/templates/default','bg_filler') |
---|
83 | ) |
---|
84 | ); |
---|
85 | |
---|
86 | $app_id = $GLOBALS['phpgw']->applications->name2id('calendar'); |
---|
87 | $GLOBALS['portal_order'][] = $app_id; |
---|
88 | $var = Array( |
---|
89 | 'up' => Array('url' => '/set_box.php', 'app' => $app_id), |
---|
90 | 'down' => Array('url' => '/set_box.php', 'app' => $app_id), |
---|
91 | 'close' => Array('url' => '/set_box.php', 'app' => $app_id), |
---|
92 | 'question' => Array('url' => '/set_box.php', 'app' => $app_id), |
---|
93 | 'edit' => Array('url' => '/set_box.php', 'app' => $app_id) |
---|
94 | ); |
---|
95 | |
---|
96 | while(list($key,$value) = each($var)) |
---|
97 | { |
---|
98 | $portalbox->set_controls($key,$value); |
---|
99 | } |
---|
100 | |
---|
101 | $portalbox->data = Array(); |
---|
102 | |
---|
103 | echo "\n".'<!-- BEGIN Calendar info -->'."\n".$portalbox->draw($GLOBALS['extra_data'])."\n".'<!-- END Calendar info -->'."\n"; |
---|
104 | unset($cal); |
---|
105 | } |
---|
106 | flush(); |
---|
107 | unset($showevents); |
---|
108 | ?> |
---|