egroupware_official/calendar/inc/hook_home.inc.php

78 lines
2.9 KiB
PHP
Raw Normal View History

2001-01-01 19:49:28 +01:00
<?php
/**************************************************************************\
* eGroupWare - Calendar on Homepage *
* http://www.egroupware.org *
* Written and (c) 2004 by Ralf Becker <RalfBecker@outdoor-training.de> *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
2001-01-17 13:35:43 +01:00
/* $Id$ */
2001-02-07 13:05:15 +01:00
if($GLOBALS['egw_info']['user']['preferences']['calendar']['mainscreen_showevents'])
{
$GLOBALS['egw']->translation->add_app('calendar');
$save_app_header = $GLOBALS['egw_info']['flags']['app_header'];
if ($GLOBALS['egw_info']['user']['preferences']['calendar']['defaultcalendar'] == 'listview')
2001-04-21 03:51:18 +02:00
{
2007-03-13 14:42:08 +01:00
if (!file_exists(EGW_SERVER_ROOT.($et_css_file ='/etemplate/templates/'.$GLOBALS['egw_info']['user']['preferences']['common']['template_set'].'/app.css')))
{
$et_css_file = '/etemplate/templates/default/app.css';
}
$content =& ExecMethod('calendar.uilist.home');
2001-04-21 03:51:18 +02:00
}
else
2001-04-21 03:51:18 +02:00
{
2007-03-13 14:42:08 +01:00
unset($et_css_file);
$content =& ExecMethod('calendar.uiviews.home');
}
$portalbox =& CreateObject('phpgwapi.listbox',array(
'title' => $GLOBALS['egw_info']['flags']['app_header'],
'primary' => $GLOBALS['egw_info']['theme']['navbar_bg'],
'secondary' => $GLOBALS['egw_info']['theme']['navbar_bg'],
'tertiary' => $GLOBALS['egw_info']['theme']['navbar_bg'],
'width' => '100%',
'outerborderwidth' => '0',
'header_background_image' => $GLOBALS['egw']->common->image('phpgwapi/templates/default','bg_filler')
));
$GLOBALS['egw_info']['flags']['app_header'] = $save_app_header;
unset($save_app_header);
$GLOBALS['portal_order'][] = $app_id = $GLOBALS['egw']->applications->name2id('calendar');
foreach(array('up','down','close','question','edit') as $key)
{
$portalbox->set_controls($key,Array('url' => '/set_box.php', 'app' => $app_id));
}
$portalbox->data = Array();
if (!file_exists(EGW_SERVER_ROOT.($css_file ='/calendar/templates/'.$GLOBALS['egw_info']['user']['preferences']['common']['template_set'].'/app.css')))
{
$css_file = '/calendar/templates/default/app.css';
}
echo '
<!-- BEGIN Calendar info -->
<style type="text/css">
2007-03-13 14:42:08 +01:00
<!--';
if ($et_css_file) // listview
{
echo '
@import url('.$GLOBALS['egw_info']['server']['webserver_url'].$et_css_file.');';
}
echo '
@import url('.$GLOBALS['egw_info']['server']['webserver_url'].$css_file.');
-->
</style>
'.$portalbox->draw($content)."\n".'<!-- END Calendar info -->'."\n";
2007-03-13 14:42:08 +01:00
unset($css_file); unset($et_css_file);
unset($key);
unset($app_id);
unset($content);
unset($portalbox);
}