[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] phpgroupware/home.php, 1.29
From: |
nomail |
Subject: |
[Phpgroupware-cvs] phpgroupware/home.php, 1.29 |
Date: |
Thu, 30 Dec 2004 11:46:22 +0100 |
Update of /phpgroupware
Modified Files:
Branch:
home.php
date: 2004/12/30 10:46:22; author: skwashd; state: Exp; lines: +114 -68
Log Message:
create new head
=====================================================================
Index: phpgroupware/home.php
diff -u phpgroupware/home.php:1.28 phpgroupware/home.php:1.29
--- phpgroupware/home.php:1.28 Sun May 18 00:13:02 2003
+++ phpgroupware/home.php Thu Dec 30 10:46:22 2004
@@ -15,84 +15,135 @@
$phpgw_info = array();
if (!is_file('header.inc.php'))
{
- echo '<center>It appears that phpGroupWare is not setup yet,
please click <a href="setup/index.php">'
- . 'here</a>.</center>';
+ echo '<p style="{text-align: center; font-weight: bold;}"><a
href="setup/index.php>"';
+ echo lang('It appears that phpGroupWare is not setup yet,
please run setup.');
+ echo '</a></p>';
exit;
}
- $GLOBALS['sessionid'] = $GLOBALS['HTTP_GET_VARS']['sessionid'] ?
$GLOBALS['HTTP_GET_VARS']['sessionid'] :
$GLOBALS['HTTP_COOKIE_VARS']['sessionid'];
+ $GLOBALS['sessionid'] = @$_GET['sessionid'] ? $_GET['sessionid'] :
$_COOKIE['sessionid'];
if (!isset($GLOBALS['sessionid']) || !$GLOBALS['sessionid'])
{
Header('Location: login.php');
exit;
}
- if ($GLOBALS['phpgw_info']['server']['force_default_app'] &&
$GLOBALS['phpgw_info']['server']['force_default_app'] != 'user_choice')
- {
-
$GLOBALS['phpgw_info']['user']['preferences']['common']['default_app'] =
$GLOBALS['phpgw_info']['server']['force_default_app'];
- }
-
- if ($GLOBALS['HTTP_GET_VARS']['cd']=='yes' &&
$GLOBALS['phpgw_info']['user']['preferences']['common']['default_app']
- &&
$GLOBALS['phpgw_info']['user']['apps'][$GLOBALS['phpgw_info']['user']['preferences']['common']['default_app']])
- {
- //$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/' .
$GLOBALS['phpgw_info']['user']['preferences']['common']['default_app'] . '/' .
'index.php'));
- Header('Location: ' . $GLOBALS['phpgw']->link('/' .
$GLOBALS['phpgw_info']['user']['preferences']['common']['default_app'] . '/' .
'index.php'));
- }
- else
- {
- $GLOBALS['phpgw_info']['flags'] = array
- (
- 'noheader' => True,
- 'nonavbar' => True,
- 'currentapp' => 'home',
- 'enable_network_class' => True,
- 'enable_contacts_class' => True,
- 'enable_nextmatchs_class' => True
+ $GLOBALS['phpgw_info']['flags'] = array(
+ 'noheader' => True,
+ 'nonavbar' => True,
+ 'currentapp' => 'home',
+ 'enable_network_class' => True,
+ 'enable_contacts_class' => True,
+ 'enable_nextmatchs_class' => True
);
include('header.inc.php');
- if ($GLOBALS['phpgw_forward'])
+ // check if forward parameter is set
+ if (@$_GET['phpgw_forward'])
{
- while (list($name,$value) = each($GLOBALS['HTTP_GET_VARS']))
+ foreach($_GET as $name => $value)
{
- if (ereg('phpgw_',$name))
+ // find phpgw_ in the $_GET parameters but skip
phpgw_forward because of redirect call below
+ if (ereg('phpgw_', $name) && ($name != 'phpgw_forward'))
{
- $extra_vars .= '&' . $name . '=' .
urlencode($value);
+ $name = substr($name, 6); // cut 'phpgw_'
+ $extra_vars[$name] = $value;
}
}
-
$GLOBALS['phpgw']->redirect_link($GLOBALS['phpgw_forward'],$extra_vars);
+
+ $GLOBALS['phpgw']->redirect_link($_GET['phpgw_forward'],
$extra_vars);
+ exit;
}
- $GLOBALS['phpgw']->translation->add_app('mainscreen');
- if (lang('mainscreen_message') != 'mainscreen_message'.lang_char())
+ if ($GLOBALS['phpgw_info']['server']['force_default_app']
+ && $GLOBALS['phpgw_info']['server']['force_default_app'] !=
'user_choice')
{
- $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array(
- 'mainscreen_message' =>
stripslashes(lang('mainscreen_message'))
- ));
+
$GLOBALS['phpgw_info']['user']['preferences']['common']['default_app'] =
$GLOBALS['phpgw_info']['server']['force_default_app'];
}
- if ((isset($GLOBALS['phpgw_info']['user']['apps']['admin']) &&
- $GLOBALS['phpgw_info']['user']['apps']['admin']) &&
- (isset($GLOBALS['phpgw_info']['server']['checkfornewversion'])
&&
- $GLOBALS['phpgw_info']['server']['checkfornewversion']))
- {
- $GLOBALS['phpgw']->network->set_addcrlf(False);
- $lines =
$GLOBALS['phpgw']->network->gethttpsocketfile('http://www.phpgroupware.org/currentversion');
- for ($i=0; $i<count($lines); $i++)
+ if
(($GLOBALS['phpgw_info']['user']['preferences']['common']['useframes'] &&
+ $GLOBALS['phpgw_info']['server']['useframes'] == 'allowed') ||
+ ($GLOBALS['phpgw_info']['server']['useframes'] == 'always'))
{
- if(@ereg('currentversion',$lines[$i]))
+ if ($_GET['cd'] == 'yes')
{
- $line_found = explode(':',chop($lines[$i]));
+ if (! $navbarframe && ! $framebody)
+ {
+ $tpl = new Template(PHPGW_TEMPLATE_DIR);
+ $tpl->set_file(array(
+ 'frames' => 'frames.tpl',
+ 'frame_body' =>
'frames_body.tpl',
+ 'frame_navbar' =>
'frames_navbar.tpl'
+ ));
+
$tpl->set_var('navbar_link',$GLOBALS['phpgw']->link('index.php','navbarframe=True&cd=yes'));
+ if ($GLOBALS['forward'])
+ {
+
$tpl->set_var('body_link',$GLOBALS['phpgw']->link($GLOBALS['forward']));
+ }
+ else
+ {
+
$tpl->set_var('body_link',$GLOBALS['phpgw']->link('index.php','framebody=True&cd=yes'));
+ }
+
+ if
($GLOBALS['phpgw_info']['user']['preferences']['common']['frame_navbar_location']
== 'bottom')
+ {
+
$tpl->set_var('frame_size','*,60');
+
$tpl->parse('frames_','frame_body',True);
+
$tpl->parse('frames_','frame_navbar',True);
+ }
+ else
+ {
+
$tpl->set_var('frame_size','60,*');
+
$tpl->parse('frames_','frame_navbar',True);
+
$tpl->parse('frames_','frame_body',True);
+ }
+ $tpl->pparse('out','frames');
+ }
+ if ($navbarframe)
+ {
+
$GLOBALS['phpgw']->common->phpgw_header();
+ echo parse_navbar();
+ }
}
}
-
if($GLOBALS['phpgw']->common->cmp_version($GLOBALS['phpgw_info']['server']['versions']['phpgwapi'],$line_found[1]))
+ elseif ($_GET['cd']=='yes' &&
$GLOBALS['phpgw_info']['user']['preferences']['common']['default_app']
+ &&
$GLOBALS['phpgw_info']['user']['apps'][$GLOBALS['phpgw_info']['user']['preferences']['common']['default_app']])
{
- $message = '<p>There is a new version of phpGroupWare
available. <a href="'
- .
'http://www.phpgroupware.org">http://www.phpgroupware.org</a>';
-
$GLOBALS['phpgw_info']['flags']['msgbox_data'][$message]=True;
+ $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/'
. $GLOBALS['phpgw_info']['user']['preferences']['common']['default_app'] . '/'
. 'index.php'));
}
+ else
+ {
+ $GLOBALS['phpgw']->common->phpgw_header();
+ echo parse_navbar();
+ }
+
+ $GLOBALS['phpgw']->translation->add_app('mainscreen');
+ if (lang('mainscreen_message') != 'mainscreen_message*')
+ {
+ echo '<center>' .
stripslashes(lang('mainscreen_message')) . '</center>';
+ }
+
+ if ((isset($GLOBALS['phpgw_info']['user']['apps']['admin']) &&
+ $GLOBALS['phpgw_info']['user']['apps']['admin']) &&
+
(isset($GLOBALS['phpgw_info']['server']['checkfornewversion']) &&
+ $GLOBALS['phpgw_info']['server']['checkfornewversion']))
+ {
+ $GLOBALS['phpgw']->network->set_addcrlf(False);
+ $lines =
$GLOBALS['phpgw']->network->gethttpsocketfile('http://www.phpgroupware.org/currentversion');
+ for ($i=0; $i<count($lines); $i++)
+ {
+ if (ereg('currentversion',$lines[$i]))
+ {
+ $line_found =
explode(':',chop($lines[$i]));
+ }
+ }
+
if($GLOBALS['phpgw']->common->cmp_version($GLOBALS['phpgw_info']['server']['versions']['phpgwapi'],$line_found[1]))
+ {
+ echo '<p>There is a new version of phpGroupWare
available. <a href="'
+ .
'http://www.phpgroupware.org">http://www.phpgroupware.org</a>';
+ }
- $_found = False;
+ $_found = False;
$GLOBALS['phpgw']->db->query("select
app_name,app_version from phpgw_applications",__LINE__,__FILE__);
while($GLOBALS['phpgw']->db->next_record())
{
@@ -103,26 +154,25 @@
{
include($_versionfile);
$_file_version =
$setup_info[$_app_name]['version'];
+ $_app_title =
$GLOBALS['phpgw_info']['apps'][$_app_name]['title'];
unset($setup_info);
if($GLOBALS['phpgw']->common->cmp_version_long($_db_version,$_file_version))
{
$_found = True;
- $_app_string .= '<br>' .
$GLOBALS['phpgw_info']['apps'][$_app_name]['title'];
+ $_app_string .= '<br>' .
$_app_title;
}
unset($_file_version);
+ unset($_app_title);
}
unset($_db_version);
unset($_versionfile);
}
if($_found)
{
- $message = '<br>' . lang('The following
applications require upgrades') . ':' . "\n";
- $message .= $_app_string . "\n";
- $message .= '<br>' . lang('Please run setup to
become current') . '.' . "\n";
-
-
$GLOBALS['phpgw_info']['flags']['msgbox_data'][$message]=False;
- unset($message);
+ echo '<br>' . lang('The following applications
require upgrades') . ':' . "\n";
+ echo $_app_string . "\n";
+ echo '<br>' . lang('Please run setup to become
current') . '.' . "\n";
unset($_app_string);
}
}
@@ -130,7 +180,7 @@
if (isset($GLOBALS['phpgw_info']['user']['apps']['notifywindow']) &&
$GLOBALS['phpgw_info']['user']['apps']['notifywindow'])
{
-/* need to figure out how to implement this properly
+?>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
var NotifyWindow;
@@ -152,8 +202,8 @@
}
</SCRIPT>
+<?php
echo '<a href="javascript:opennotifywindow()">' . lang('Open
notify window') . '</a>';
-*/
}
/* This initializes the users portal_order preference if it does not
exist. */
@@ -187,19 +237,15 @@
}
else
{
- $sorted_apps = Array
- (
+ $sorted_apps = Array(
'email',
'calendar',
- 'news',
+ 'news_admin',
'addressbook',
'squirrelmail'
);
}
@reset($sorted_apps);
-
- $GLOBALS['phpgw']->portalbox = CreateObject('phpgwapi.listbox');
-
$GLOBALS['phpgw']->hooks->process('home',$sorted_apps);
if($GLOBALS['portal_order'])
@@ -212,8 +258,8 @@
}
$GLOBALS['phpgw']->preferences->save_repository();
}
- $GLOBALS['phpgw_info']['flags']['currentapp'] = 'home'; // has been
changed by hook_home's
-
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',$GLOBALS['phpgw']->portalbox->output);
- }
+ //$phpgw->common->debug_phpgw_info();
+ //$phpgw->common->debug_list_core_functions();
+ $GLOBALS['phpgw']->common->phpgw_footer();
?>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] phpgroupware/home.php, 1.29,
nomail <=