mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-21 23:43:17 +01:00
applied patch #280 from Sebastian Ebling: * removed the "About ..." menu entry from top and sidebox menu
* mostly rewritten the about.php page (added application list) * changed footer eGroupWare link to about.php * moved manual from application menu to top and sidebox menu preserving its special link target
This commit is contained in:
parent
2dce0de48b
commit
cbca417ee6
257
about.php
257
about.php
@ -20,87 +20,115 @@
|
||||
);
|
||||
include('header.inc.php');
|
||||
|
||||
$app = isset($_GET['app']) && $_GET['app'] != 'eGroupWare' ? basename($_GET['app']) : 'about';
|
||||
// create the about page
|
||||
$aboutPage = new about();
|
||||
|
||||
if ($app)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
$tpl =& CreateObject('phpgwapi.Template',$GLOBALS['egw']->common->get_tpl_dir('phpgwapi'));
|
||||
$tpl->set_file(array(
|
||||
class about
|
||||
{
|
||||
/**
|
||||
* template object
|
||||
*/
|
||||
var $tpl;
|
||||
|
||||
/**
|
||||
* constructor of class about
|
||||
* sets template and calls list or detail view
|
||||
*/
|
||||
function about()
|
||||
{
|
||||
// create template object
|
||||
$this->tpl =& CreateObject('phpgwapi.Template', $GLOBALS['egw']->common->get_tpl_dir('phpgwapi'));
|
||||
$this->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';
|
||||
$title = isset($GLOBALS['egw_info']['apps'][$_GET['app']]) ? $GLOBALS['egw_info']['apps'][$_GET['app']]['title'] : 'eGroupWare';
|
||||
$GLOBALS['egw_info']['flags']['app_header'] = lang('About %1',$title);
|
||||
$GLOBALS['egw']->common->egw_header();
|
||||
|
||||
$tpl->set_block('phpgw_about', 'egroupware','egroupware');
|
||||
$tpl->set_block('phpgw_about', 'application','application');
|
||||
|
||||
if ($included)
|
||||
{
|
||||
$tpl->set_var('phpgw_app_about', about_app());
|
||||
$tpl->pparse('phpgw_about', 'application', True);
|
||||
// list or detail view
|
||||
$app = isset($_GET['app']) && $_GET['app'] != 'eGroupWare' ? basename($_GET['app']) : 'about';
|
||||
if ($app) {
|
||||
if (!($included = $GLOBALS['egw']->hooks->single('about',$app))) {
|
||||
$detail = $included = file_exists(EGW_INCLUDE_ROOT . "/$app/setup/setup.inc.php");
|
||||
}
|
||||
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);
|
||||
}
|
||||
else
|
||||
{
|
||||
$tpl->set_var('app_header',$app);
|
||||
|
||||
$tpl->pparse('out','phpgw_about_unknown');
|
||||
} else {
|
||||
$detail = false;
|
||||
}
|
||||
if ($detail) {
|
||||
$this->_detailView();
|
||||
} else {
|
||||
$this->_listView();
|
||||
}
|
||||
|
||||
$GLOBALS['egw']->common->egw_footer();
|
||||
}
|
||||
|
||||
function about_app()
|
||||
|
||||
|
||||
/**
|
||||
* output of list view
|
||||
*/
|
||||
function _listView()
|
||||
{
|
||||
// eGW info
|
||||
$this->tpl->set_block('phpgw_about', 'egroupware','egroupware');
|
||||
$this->tpl->set_var('phpgw_logo',$GLOBALS['egw']->common->image('phpgwapi','logo.gif'));
|
||||
$this->tpl->set_var('phpgw_version',lang('eGroupWare API version %1',$GLOBALS['egw_info']['server']['versions']['phpgwapi']));
|
||||
$this->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>'));
|
||||
$this->tpl->pparse('overview', 'egroupware');
|
||||
|
||||
// app_list_tablestart
|
||||
$this->tpl->set_block('phpgw_about', 'app_list_tablestart','app_list_tablestart');
|
||||
$this->tpl->set_var('phpgw_app_listinfo', lang('List of your available applications'));
|
||||
$this->tpl->set_var('phpgw_about_th_name', lang('name'));
|
||||
$this->tpl->set_var('phpgw_about_th_author', lang('author'));
|
||||
$this->tpl->set_var('phpgw_about_th_maintainer', lang('maintainer'));
|
||||
$this->tpl->set_var('phpgw_about_th_version', lang('version'));
|
||||
$this->tpl->set_var('phpgw_about_th_license', lang('license'));
|
||||
$this->tpl->set_var('phpgw_about_th_details', lang('details'));
|
||||
$this->tpl->pparse('phpgw_about', 'app_list_tablestart', true);
|
||||
|
||||
// app_list_tablerows
|
||||
$this->tpl->set_block('phpgw_about', 'app_list_tablerow', 'app_list_tablerow');
|
||||
foreach ($GLOBALS['egw_info']['user']['apps'] as $app => $appinfo) {
|
||||
// get additional information about the application
|
||||
$info = $this->_getParsedAppInfo($app);
|
||||
|
||||
$this->tpl->set_var('phpgw_about_td_image', $GLOBALS['egw']->common->image($app,array('navbar','nonav')));
|
||||
$this->tpl->set_var('phpgw_about_td_title', $appinfo['title']);
|
||||
$this->tpl->set_var('phpgw_about_td_author', $info['author']);
|
||||
$this->tpl->set_var('phpgw_about_td_maintainer', $info['maintainer']);
|
||||
$this->tpl->set_var('phpgw_about_td_version', $info['version']);
|
||||
$this->tpl->set_var('phpgw_about_td_license', $info['license']);
|
||||
$this->tpl->set_var('phpgw_about_td_details_img', $GLOBALS['egw']->common->image('phpgwapi','view.png'));
|
||||
$this->tpl->set_var('phpgw_about_td_details_url', $GLOBALS['egw_info']['server']['webserver_url'].'/about.php?app='.$app);
|
||||
$this->tpl->pparse('phpgw_about', 'app_list_tablerow', true);
|
||||
}
|
||||
|
||||
// app_list_table_stop
|
||||
$this->tpl->set_block('phpgw_about', 'app_list_tablestop','app_list_tablestop');
|
||||
$this->tpl->pparse('phpgw_about', 'app_list_tablestop');
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* output of detail view
|
||||
*/
|
||||
function _detailView()
|
||||
{
|
||||
echo '<!-- _detailView -->';
|
||||
$app = basename($_GET['app']);
|
||||
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()
|
||||
{
|
||||
$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)
|
||||
{
|
||||
$s .= about_display($info);
|
||||
}
|
||||
return $s;
|
||||
}
|
||||
|
||||
function about_display($info)
|
||||
{
|
||||
$other_infos = array(
|
||||
'author' => lang('Author'),
|
||||
'maintainer' => lang('Maintainer'),
|
||||
@ -199,6 +227,117 @@
|
||||
|
||||
$s .= "</table>\n";
|
||||
|
||||
|
||||
$this->tpl->set_block('phpgw_about', 'application','application');
|
||||
$this->tpl->set_var('phpgw_app_about', $s);
|
||||
$this->tpl->pparse('phpgw_about', 'application', True);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* parse informations from setup.inc.php file
|
||||
*
|
||||
* @param string app application name
|
||||
* @return array html formated informations about author(s),
|
||||
* maintainer(s), version, license of the
|
||||
* given application
|
||||
*/
|
||||
function _getParsedAppInfo($app)
|
||||
{
|
||||
// define the return array
|
||||
$ret = array(
|
||||
'author' => '',
|
||||
'maintainer' => '',
|
||||
'version' => '',
|
||||
'license' => ''
|
||||
);
|
||||
|
||||
if (!file_exists(EGW_INCLUDE_ROOT . "/$app/setup/setup.inc.php")) {
|
||||
return $ret;
|
||||
}
|
||||
|
||||
include(EGW_INCLUDE_ROOT . "/$app/setup/setup.inc.php");
|
||||
|
||||
$ret['license'] = $setup_info[$app]['license'];
|
||||
$ret['version'] = $setup_info[$app]['version'];
|
||||
$ret['author'] = $this->_getHtmlPersonalInfo($setup_info, $app, 'author');
|
||||
$ret['maintainer'] = $this->_getHtmlPersonalInfo($setup_info, $app, 'maintainer');
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* helper to parse author and maintainer info
|
||||
*
|
||||
* @param array setup_info setup_info[$app] array
|
||||
* @param string app application name
|
||||
* @param string f 'author' or 'maintainer'
|
||||
*
|
||||
* @return string html formated informations of s
|
||||
*/
|
||||
function _getHtmlPersonalInfo($setup_info, $app, $f = 'author')
|
||||
{
|
||||
$authors = array();
|
||||
// get the author(s)
|
||||
if ($setup_info[$app][$f]) {
|
||||
// author is set
|
||||
if (!is_array($setup_info[$app][$f])) {
|
||||
// author is no array
|
||||
$authors[0]['name'] = $setup_info[$app][$f];
|
||||
if ($setup_info[$app][$f.'_email']) {
|
||||
$authors[0]['email'] = $setup_info[$app][$f.'_email'];
|
||||
}
|
||||
if ($setup_info[$app][$f.'_url']) {
|
||||
$authors[0]['url'] = $setup_info[$app][$f.'_url'];
|
||||
}
|
||||
|
||||
} else {
|
||||
// author is array
|
||||
if ($setup_info[$app][$f]['name']) {
|
||||
// only one author
|
||||
$authors[0]['name'] = $setup_info[$app][$f]['name'];
|
||||
if ($setup_info[$app][$f]['email']) {
|
||||
$authors[0]['email'] = $setup_info[$app][$f]['email'];
|
||||
}
|
||||
if ($setup_info[$app][$f]['url']) {
|
||||
$authors[0]['url'] = $setup_info[$app][$f]['url'];
|
||||
}
|
||||
} else {
|
||||
// may be more authors
|
||||
foreach ($setup_info[$app][$f] as $number => $values) {
|
||||
if ($setup_info[$app][$f][$number]['name']) {
|
||||
$authors[$number]['name'] = $setup_info[$app][$f][$number]['name'];
|
||||
}
|
||||
if ($setup_info[$app][$f][$number]['email']) {
|
||||
$authors[$number]['email'] = $setup_info[$app][$f][$number]['email'];
|
||||
}
|
||||
if ($setup_info[$app][$f][$number]['url']) {
|
||||
$authors[$number]['url'] = $setup_info[$app][$f][$number]['url'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// html format authors
|
||||
$s = '';
|
||||
foreach ($authors as $author) {
|
||||
if ($s != '') {
|
||||
$s .= '<br />';
|
||||
}
|
||||
$s .= lang('name').': '.$author['name'];
|
||||
if ($author['email']) {
|
||||
$s .= '<br />'.lang('email').': <a href="mailto:'.$author['email'].'">'.$author['email'].'</a>';
|
||||
}
|
||||
if ($author['url']) {
|
||||
$s .= '<br />'.lang('url').': <a href="'.$author['url'].'" target="_blank">'.$author['url'].'</a>';
|
||||
}
|
||||
}
|
||||
return $s;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user