source: trunk/calendar/inc/hook_home.inc.php @ 2

Revision 2, 3.8 KB checked in by niltonneto, 17 years ago (diff)

Removida todas as tags usadas pelo CVS ($Id, $Source).
Primeira versão no CVS externo.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
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
15
16        $d1 = strtolower(substr(PHPGW_APP_INC,0,3));
17        if($d1 == 'htt' || $d1 == 'ftp' )
18        {
19                echo 'Failed attempt to break in via an old Security Hole!<br>'."\n";
20                $GLOBALS['phpgw']->common->phpgw_exit();
21        }
22        unset($d1);
23
24        $showevents = (int)$GLOBALS['phpgw_info']['user']['preferences']['calendar']['mainscreen_showevents'];
25        if($showevents>0)
26        {
27                $GLOBALS['phpgw']->translation->add_app('calendar');
28                if(!is_object($GLOBALS['phpgw']->datetime))
29                {
30                        $GLOBALS['phpgw']->datetime = CreateObject('phpgwapi.date_time');
31                }
32
33                $GLOBALS['date'] = date('Ymd',$GLOBALS['phpgw']->datetime->users_localtime);
34                $GLOBALS['g_year'] = substr($GLOBALS['date'],0,4);
35                $GLOBALS['g_month'] = substr($GLOBALS['date'],4,2);
36                $GLOBALS['g_day'] = substr($GLOBALS['date'],6,2);
37                $GLOBALS['owner'] = $GLOBALS['phpgw_info']['user']['account_id'];
38                $GLOBALS['css'] = "\n".'<style type="text/css">'."\n".'<!--'."\n"
39                        . ExecMethod('calendar.uicalendar.css').'-->'."\n".'</style>';
40
41                if($showevents==2)
42                {
43                        $_page = "small";
44                }
45                else
46                {
47                        $page_ = explode('.',$GLOBALS['phpgw_info']['user']['preferences']['calendar']['defaultcalendar']);
48                        $_page = substr($page_[0],0,7); // makes planner from planner_{user|category}
49                        if ($_page=='index' || ($_page != 'day' && $_page != 'week' && $_page != 'month' && $_page != 'year' && $_page != 'planner'))
50                        {
51                                $_page = 'month';
52//                      $GLOBALS['phpgw']->preferences->add('calendar','defaultcalendar','month');
53//                      $GLOBALS['phpgw']->preferences->save_repository();
54                        }
55                }
56
57                if(!@file_exists(PHPGW_INCLUDE_ROOT.'/calendar/inc/hook_home_'.$_page.'.inc.php'))
58                {
59                        $_page = 'day';
60                }
61                include(PHPGW_INCLUDE_ROOT.'/calendar/inc/hook_home_'.$_page.'.inc.php');
62
63                $title = lang('Calendar');
64
65                $portalbox = CreateObject('phpgwapi.listbox',
66                        Array(
67                                'title' => $title,
68                                'primary'       => $GLOBALS['phpgw_info']['theme']['navbar_bg'],
69                                'secondary'     => $GLOBALS['phpgw_info']['theme']['navbar_bg'],
70                                'tertiary'      => $GLOBALS['phpgw_info']['theme']['navbar_bg'],
71                                'width' => '100%',
72                                'outerborderwidth'      => '0',
73                                'header_background_image'       => $GLOBALS['phpgw']->common->image('phpgwapi/templates/default','bg_filler')
74                        )
75                );
76
77                $app_id = $GLOBALS['phpgw']->applications->name2id('calendar');
78                $GLOBALS['portal_order'][] = $app_id;
79                $var = Array(
80                        'up'    => Array('url'  => '/set_box.php', 'app'        => $app_id),
81                        'down'  => Array('url'  => '/set_box.php', 'app'        => $app_id),
82                        'close' => Array('url'  => '/set_box.php', 'app'        => $app_id),
83                        'question'      => Array('url'  => '/set_box.php', 'app'        => $app_id),
84                        'edit'  => Array('url'  => '/set_box.php', 'app'        => $app_id)
85                );
86
87                while(list($key,$value) = each($var))
88                {
89                        $portalbox->set_controls($key,$value);
90                }
91
92                $portalbox->data = Array();
93
94                echo "\n".'<!-- BEGIN Calendar info -->'."\n".$portalbox->draw($GLOBALS['extra_data'])."\n".'<!-- END Calendar info -->'."\n";
95                unset($cal);
96        }
97        flush();
98        unset($showevents);
99?>
Note: See TracBrowser for help on using the repository browser.