2000-12-23 01:45:58 +01:00
|
|
|
<?php
|
2004-06-23 22:01:34 +02:00
|
|
|
/**************************************************************************\
|
|
|
|
* eGroupWare *
|
|
|
|
* http://www.egroupware.org *
|
|
|
|
* -------------------------------------------- *
|
|
|
|
* 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. *
|
|
|
|
\**************************************************************************/
|
2003-08-28 16:16:30 +02:00
|
|
|
|
2004-06-23 22:01:34 +02:00
|
|
|
/* $Id$ */
|
2000-12-23 01:45:58 +01:00
|
|
|
|
2006-10-03 17:18:03 +02:00
|
|
|
$GLOBALS['egw_info'] = array(
|
|
|
|
'flags' => array(
|
|
|
|
'currentapp' => isset($_GET['app']) && $_GET['app'] != 'eGroupWare' ? $_GET['app'] : 'about',
|
|
|
|
'disable_Template_class' => True,
|
|
|
|
'noheader' => True,
|
|
|
|
)
|
|
|
|
);
|
2005-07-08 07:00:14 +02:00
|
|
|
include('header.inc.php');
|
2005-06-15 12:36:58 +02:00
|
|
|
|
2006-10-03 17:18:03 +02:00
|
|
|
$app = isset($_GET['app']) && $_GET['app'] != 'eGroupWare' ? basename($_GET['app']) : 'about';
|
|
|
|
|
2005-07-08 07:00:14 +02:00
|
|
|
if ($app)
|
2005-06-15 12:36:58 +02:00
|
|
|
{
|
2005-07-08 07:00:14 +02:00
|
|
|
if (!($included = $GLOBALS['egw']->hooks->single('about',$app)))
|
|
|
|
{
|
|
|
|
$api_only = !($included = file_exists(EGW_INCLUDE_ROOT . "/$app/setup/setup.inc.php"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$api_only = True;
|
2005-06-15 12:36:58 +02:00
|
|
|
}
|
2005-07-08 07:00:14 +02:00
|
|
|
|
2006-10-03 17:18:03 +02:00
|
|
|
$tpl =& CreateObject('phpgwapi.Template',$GLOBALS['egw']->common->get_tpl_dir('phpgwapi'));
|
2005-07-08 07:00:14 +02:00
|
|
|
$tpl->set_file(array(
|
|
|
|
'phpgw_about' => 'about.tpl',
|
|
|
|
'phpgw_about_unknown' => 'about_unknown.tpl'
|
|
|
|
));
|
|
|
|
|
|
|
|
$title = isset($GLOBALS['egw_info']['apps'][$app]) ? $GLOBALS['egw_info']['apps'][$app]['title'] : 'eGroupWare';
|
|
|
|
$GLOBALS['egw_info']['flags']['app_header'] = lang('About %1',$title);
|
2006-10-03 17:18:03 +02:00
|
|
|
$GLOBALS['egw']->common->egw_header();
|
2005-07-08 07:00:14 +02:00
|
|
|
|
|
|
|
$tpl->set_block('phpgw_about', 'egroupware','egroupware');
|
|
|
|
$tpl->set_block('phpgw_about', 'application','application');
|
|
|
|
|
|
|
|
if ($included)
|
2005-06-15 12:36:58 +02:00
|
|
|
{
|
2005-07-08 07:00:14 +02:00
|
|
|
$tpl->set_var('phpgw_app_about', about_app());
|
|
|
|
$tpl->pparse('phpgw_about', 'application', True);
|
2005-06-15 12:36:58 +02:00
|
|
|
}
|
2005-07-08 07:00:14 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
if ($api_only)
|
|
|
|
{
|
|
|
|
$tpl->set_var('phpgw_logo',$GLOBALS['egw']->common->image('phpgwapi','logo.gif'));
|
|
|
|
$tpl->set_var('phpgw_version',lang('eGroupWare API version %1',$GLOBALS['egw_info']['server']['versions']['phpgwapi']));
|
|
|
|
$tpl->set_var('phpgw_message',lang('%1eGroupWare%2 is a multi-user, web-based groupware suite written in %3PHP%4.',
|
|
|
|
'<a href="http://www.eGroupWare.org" target="_blank">','</a>','<a href="http://www.php.net" target="_blank">','</a>'));
|
|
|
|
$tpl->pparse('out', 'egroupware');
|
|
|
|
|
|
|
|
$tpl->set_var('phpgw_app_about',about_template());
|
|
|
|
$tpl->pparse('phpgw_about', 'application', True);
|
2005-06-15 12:36:58 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2005-07-08 07:00:14 +02:00
|
|
|
$tpl->set_var('app_header',$app);
|
|
|
|
|
|
|
|
$tpl->pparse('out','phpgw_about_unknown');
|
2005-06-15 12:36:58 +02:00
|
|
|
}
|
2005-07-08 07:00:14 +02:00
|
|
|
}
|
|
|
|
|
2006-10-03 17:18:03 +02:00
|
|
|
$GLOBALS['egw']->common->egw_footer();
|
2005-07-08 07:00:14 +02:00
|
|
|
|
|
|
|
function about_app()
|
|
|
|
{
|
2006-10-03 17:18:03 +02:00
|
|
|
$app = basename($_GET['app']);
|
2005-07-08 07:00:14 +02:00
|
|
|
include(EGW_INCLUDE_ROOT . "/$app/setup/setup.inc.php");
|
|
|
|
$info = $setup_info[$app];
|
|
|
|
$info['icon'] = $GLOBALS['egw']->common->image($app,array('navbar','nonav'));
|
|
|
|
$info['title'] = $GLOBALS['egw_info']['apps'][$app]['title'];
|
|
|
|
return about_display($info);
|
|
|
|
}
|
|
|
|
|
|
|
|
function about_template()
|
2005-06-15 12:36:58 +02:00
|
|
|
{
|
2005-07-08 07:00:14 +02:00
|
|
|
$template = $GLOBALS['egw']->common->get_tpl_dir('phpgwapi');
|
|
|
|
|
|
|
|
include ($template . "/setup/setup.inc.php");
|
|
|
|
$s = "";
|
|
|
|
$template_info[] = $GLOBALS['egw_info']['template'][$GLOBALS['egw_info']['user']['preferences']['common']['template_set']];
|
|
|
|
foreach($template_info as $info)
|
2005-06-15 12:36:58 +02:00
|
|
|
{
|
2005-07-08 07:00:14 +02:00
|
|
|
$s .= about_display($info);
|
2005-06-15 12:36:58 +02:00
|
|
|
}
|
2005-07-08 07:00:14 +02:00
|
|
|
return $s;
|
2005-06-15 12:36:58 +02:00
|
|
|
}
|
2005-07-08 07:00:14 +02:00
|
|
|
|
|
|
|
function about_display($info)
|
2005-06-15 12:36:58 +02:00
|
|
|
{
|
2005-07-08 07:00:14 +02:00
|
|
|
$other_infos = array(
|
|
|
|
'author' => lang('Author'),
|
|
|
|
'maintainer' => lang('Maintainer'),
|
|
|
|
'version' => lang('Version'),
|
|
|
|
'license' => lang('License'),
|
|
|
|
);
|
|
|
|
if($info[icon])
|
|
|
|
{
|
|
|
|
$icon = $info[icon];
|
|
|
|
}
|
|
|
|
$s = "<table width='70%' cellpadding='4'>\n";
|
|
|
|
if(trim($icon) != "")
|
|
|
|
{
|
|
|
|
$s.= "<tr>
|
|
|
|
<td align='left'><img src='$icon' alt=\"$info[title]\" /></td><td align='left'><h2>$info[title]</h2></td></tr>";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$s .= "<tr>
|
|
|
|
<td align='left'></td><td align='left'><h2>$info[title]</h2></td></tr>";
|
|
|
|
}
|
|
|
|
if ($info['description'])
|
|
|
|
{
|
|
|
|
$info['description'] = lang($info['description']);
|
|
|
|
$s .= "<tr><td colspan='2' align='left'>$info[description]</td></tr>\n";
|
|
|
|
if ($info['note'])
|
|
|
|
{
|
|
|
|
$info['note'] = lang($info['note']);
|
|
|
|
$s .= "<tr><td colspan='2' align='left'><i>$info[note]</i></td></tr>\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
foreach ($other_infos as $key => $val)
|
2005-06-15 12:36:58 +02:00
|
|
|
{
|
2005-07-08 07:00:14 +02:00
|
|
|
if (isset($info[$key]))
|
|
|
|
{
|
|
|
|
$s .= "<tr><td width='1%' align='left'>$val</td><td>";
|
2005-06-15 12:36:58 +02:00
|
|
|
$infos = $info[$key];
|
|
|
|
for ($n = 0; is_array($info[$key][$n]) && ($infos = $info[$key][$n]) || !$n; ++$n)
|
|
|
|
{
|
|
|
|
if (!is_array($infos) && isset($info[$key.'_email']))
|
|
|
|
{
|
|
|
|
$infos = array('email' => $info[$key.'_email'],'name' => $infos);
|
|
|
|
}
|
2005-07-08 07:00:14 +02:00
|
|
|
elseif(!is_array($infos) && isset($info[$key.'_url']))
|
|
|
|
{
|
2005-06-18 22:29:17 +02:00
|
|
|
$infos = array('url' => $info[$key.'_url'],'name' => $infos);
|
2005-07-08 07:00:14 +02:00
|
|
|
}
|
2005-06-15 12:36:58 +02:00
|
|
|
if (is_array($infos))
|
|
|
|
{
|
2005-06-18 22:29:17 +02:00
|
|
|
if ($infos['email'])
|
2005-06-15 12:36:58 +02:00
|
|
|
{
|
2005-06-18 22:29:17 +02:00
|
|
|
$names = explode('<br>',$infos['name']);
|
|
|
|
$emails = split('@|<br>',$infos['email']);
|
|
|
|
if (count($names) < count($emails)/2)
|
|
|
|
{
|
2005-07-08 07:00:14 +02:00
|
|
|
$names = '';
|
2005-06-18 22:29:17 +02:00
|
|
|
}
|
|
|
|
$infos = '';
|
|
|
|
while (list($user,$domain) = $emails)
|
|
|
|
{
|
2005-07-08 07:00:14 +02:00
|
|
|
if ($infos) $infos .= '<br>';
|
|
|
|
$name = $names ? array_shift($names) : $user;
|
|
|
|
$infos .= "<a href='mailto:$user at $domain'><span onClick=\"document.location='mailto:$user'+'@'+'$domain'; return false;\">$name</span></a>";
|
|
|
|
array_shift($emails); array_shift($emails);
|
2005-06-18 22:29:17 +02:00
|
|
|
}
|
2005-06-15 12:36:58 +02:00
|
|
|
}
|
2005-07-08 07:00:14 +02:00
|
|
|
elseif($infos['url'])
|
|
|
|
{
|
2005-06-18 22:29:17 +02:00
|
|
|
$img = $info[$key.'_img'];
|
|
|
|
if ($img)
|
|
|
|
{
|
2005-07-08 07:00:14 +02:00
|
|
|
$img_url = $GLOBALS['egw']->common->image('phpgwapi',$img);
|
2005-06-18 22:29:17 +02:00
|
|
|
if (!$img_url)
|
|
|
|
{
|
2005-07-08 07:00:14 +02:00
|
|
|
$img_url = $GLOBALS['egw']->common->image($info['name'],$img);
|
2005-06-18 22:29:17 +02:00
|
|
|
}
|
|
|
|
$infos = '<table border="0"><tr><td style="text-align:center;"><a href="'.$infos['url'].'"><img src="'.$img_url.'" border="0"><br>'.$infos['name'].'</a></td></tr></table>';
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$infos = '<a href="'.$infos['url'].'">'.$infos['name'].'</a>';
|
|
|
|
}
|
2005-06-15 12:36:58 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
$s .= ($n ? '<br>' : '') . $infos;
|
|
|
|
}
|
|
|
|
$s .= "</td></tr>\n";
|
2005-07-08 07:00:14 +02:00
|
|
|
}
|
2005-06-15 12:36:58 +02:00
|
|
|
}
|
|
|
|
|
2005-07-08 07:00:14 +02:00
|
|
|
if ($info['extra_untranslated'])
|
|
|
|
{
|
|
|
|
$s .= "<tr><td colspan='2' align='left'>$info[extra_untranslated]</td></tr>\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
$s .= "</table>\n";
|
2005-06-15 12:36:58 +02:00
|
|
|
|
2005-07-08 07:00:14 +02:00
|
|
|
return $s;
|
|
|
|
}
|
2001-04-08 09:50:20 +02:00
|
|
|
?>
|