From e459af407cd8d5cacf90e9cb60731e14005280dc Mon Sep 17 00:00:00 2001 From: Pim Snel Date: Wed, 15 Jun 2005 10:36:58 +0000 Subject: [PATCH] add extra info about the current template set in the about screen --- about.php | 213 +++++++++++++++---------- phpgwapi/templates/default/about.tpl | 31 +++- phpgwapi/templates/edge-it/about.tpl | 14 +- phpgwapi/templates/idots/about.tpl | 14 +- phpgwapi/templates/idsociety/about.tpl | 31 +++- phpgwapi/templates/jerryr/about.tpl | 14 +- 6 files changed, 207 insertions(+), 110 deletions(-) diff --git a/about.php b/about.php index 0143cdafd2..d387207f62 100644 --- a/about.php +++ b/about.php @@ -12,12 +12,20 @@ /* $Id$ */ $GLOBALS['phpgw_info'] = array(); - $GLOBALS['phpgw_info']['flags']['currentapp'] = 'about'; + $app = $_GET['app']; + if(isset($app) && $_GET['app'] != "eGroupWare") + { + $GLOBALS['phpgw_info']['flags']['currentapp'] = $app; + } + else { + $GLOBALS['phpgw_info']['flags']['currentapp'] = 'about'; + } + $GLOBALS['phpgw_info']['flags']['disable_Template_class'] = True; $GLOBALS['phpgw_info']['flags']['noheader'] = True; include('header.inc.php'); - $app = $_GET['app']; + if ($app) { if (!($included = $GLOBALS['phpgw']->hooks->single('about',$app))) @@ -29,75 +37,8 @@ include (PHPGW_INCLUDE_ROOT . "/$app/setup/setup.inc.php"); $info = $setup_info[$app]; $info['title'] = $GLOBALS['phpgw_info']['apps'][$app]['title']; - $other_infos = array( - 'author' => lang('Author'), - 'maintainer' => lang('Maintainer'), - 'version' => lang('Version'), - 'license' => lang('License') - ); - - $applink=$GLOBALS['phpgw']->link('/'.$app); - - $s = "\n - "; - - if ($info['description']) - { - $info['description'] = lang($info['description']); - $s .= "\n"; - if ($info['note']) - { - $info['note'] = lang($info['note']); - $s .= "\n"; - } - - } - - - foreach ($other_infos as $key => $val) - { - if (isset($info[$key])) - { - $s .= "\n"; - } - } - - if ($info['extra_untranslated']) - { - $s .= "\n"; - } - - $s .= "
\"$info[title]\"

$info[title]

$info[description]
$info[note]
$val"; - $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); - } - if (is_array($infos)) - { - $names = explode('
',$infos['name']); - $emails = split('@|
',$infos['email']); - if (count($names) < count($emails)/2) - { - $names = ''; - } - $infos = ''; - while (list($user,$domain) = $emails) - { - if ($infos) $infos .= '
'; - $name = $names ? array_shift($names) : $user; - $infos .= "$name"; - array_shift($emails); array_shift($emails); - } - } - $s .= ($n ? '
' : '') . $infos; - } - $s .= "
$info[extra_untranslated]
\n"; - - return $s; - } + return about_display($info); + } $api_only = !($included = file_exists(PHPGW_INCLUDE_ROOT . "/$app/setup/setup.inc.php")); } } @@ -111,33 +52,135 @@ 'phpgw_about' => 'about.tpl', 'phpgw_about_unknown' => 'about_unknown.tpl' )); + + $title = isset($GLOBALS['phpgw_info']['apps'][$app]) ? $GLOBALS['phpgw_info']['apps'][$app]['title'] : 'eGroupWare'; + $GLOBALS['phpgw_info']['flags']['app_header'] = lang('About %1',$title); + $GLOBALS['phpgw']->common->phpgw_header(); + + $tpl->set_block('phpgw_about', 'egroupware','egroupware'); + $tpl->set_block('phpgw_about', 'application','application'); + - $tpl->set_var('phpgw_logo',$GLOBALS['phpgw']->common->image('phpgwapi','logo.gif')); - $tpl->set_var('phpgw_version',lang('eGroupWare API version %1',$GLOBALS['phpgw_info']['server']['versions']['phpgwapi'])); - $tpl->set_var('phpgw_message',lang('%1eGroupWare%2 is a multi-user, web-based groupware suite written in %3PHP%4.', - '','','','')); - - if ($included) + if ($included) { - $tpl->set_var('phpgw_app_about',about_app('','')); - //about_app($tpl,"phpgw_app_about"); + $tpl->set_var('phpgw_app_about', about_app()); + $tpl->pparse('phpgw_about', 'application', True); } else { if ($api_only) { - $tpl->set_var('phpgw_app_about',''); + $tpl->set_var('phpgw_logo',$GLOBALS['phpgw']->common->image('phpgwapi','logo.gif')); + $tpl->set_var('phpgw_version',lang('eGroupWare API version %1',$GLOBALS['phpgw_info']['server']['versions']['phpgwapi'])); + $tpl->set_var('phpgw_message',lang('%1eGroupWare%2 is a multi-user, web-based groupware suite written in %3PHP%4.', + '','','','')); + $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->parse('phpgw_app_about','phpgw_about_unknown'); + + $tpl->pparse('out','phpgw_about_unknown'); } } - $title = isset($GLOBALS['phpgw_info']['apps'][$app]) ? $GLOBALS['phpgw_info']['apps'][$app]['title'] : 'eGroupWare'; - $GLOBALS['phpgw_info']['flags']['app_header'] = lang('About %1',$title); - $GLOBALS['phpgw']->common->phpgw_header(); - $tpl->pparse('out','phpgw_about'); $GLOBALS['phpgw']->common->phpgw_footer(); + + +function about_template() +{ + $template = $GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi'); + + include ($template . "/settings/settings.inc.php"); + $s = ""; + foreach($template_info as $info) + { + $s .= about_display($info); + } + return $s; +} + + +function about_display($info) +{ + $other_infos = array( + 'author' => lang('Author'), + 'maintainer' => lang('Maintainer'), + 'version' => lang('Version'), + 'license' => lang('License'), + ); + if($info[icon]) + { + $icon = $info[icon]; + } + $s = "\n"; + if(trim($icon) != "") + { + $s.= " + "; + } + else + { + $s .= " + "; + } + if ($info['description']) + { + $info['description'] = lang($info['description']); + $s .= "\n"; + if ($info['note']) + { + $info['note'] = lang($info['note']); + $s .= "\n"; + } + + } + foreach ($other_infos as $key => $val) + { + if (isset($info[$key])) + { + $s .= "\n"; + } + } + + if ($info['extra_untranslated']) + { + $s .= "\n"; + } + + $s .= "
\"$info[title]\"

$info[title]

$info[title]

$info[description]
$info[note]
$val"; + $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); + } + if (is_array($infos)) + { + $names = explode('
',$infos['name']); + $emails = split('@|
',$infos['email']); + if (count($names) < count($emails)/2) + { + $names = ''; + } + $infos = ''; + while (list($user,$domain) = $emails) + { + if ($infos) $infos .= '
'; + $name = $names ? array_shift($names) : $user; + $infos .= "$name"; + array_shift($emails); array_shift($emails); + } + } + $s .= ($n ? '
' : '') . $infos; + } + $s .= "
$info[extra_untranslated]
\n"; + + return $s; +} ?> diff --git a/phpgwapi/templates/default/about.tpl b/phpgwapi/templates/default/about.tpl index cffcf556ab..9a6c7d2ef3 100644 --- a/phpgwapi/templates/default/about.tpl +++ b/phpgwapi/templates/default/about.tpl @@ -1,26 +1,41 @@ - - + - + - + - - --> + + + + + + + + + - + + + + + +
- logo + eGroupWare
 
{phpgw_version}{phpgw_version}
{phpgw_message}{phpgw_message}

spacer
+ spacer
{phpgw_app_about}
diff --git a/phpgwapi/templates/edge-it/about.tpl b/phpgwapi/templates/edge-it/about.tpl index 0640fe3993..9a6c7d2ef3 100755 --- a/phpgwapi/templates/edge-it/about.tpl +++ b/phpgwapi/templates/edge-it/about.tpl @@ -1,5 +1,7 @@ - + @@ -18,8 +20,11 @@ - - --> + + + + + @@ -30,4 +35,7 @@ + + +
eGroupWare
spacer
diff --git a/phpgwapi/templates/idots/about.tpl b/phpgwapi/templates/idots/about.tpl index 0640fe3993..9a6c7d2ef3 100755 --- a/phpgwapi/templates/idots/about.tpl +++ b/phpgwapi/templates/idots/about.tpl @@ -1,5 +1,7 @@ - + @@ -18,8 +20,11 @@ - - --> + + + + + @@ -30,4 +35,7 @@ + + +
eGroupWare
spacer
diff --git a/phpgwapi/templates/idsociety/about.tpl b/phpgwapi/templates/idsociety/about.tpl index f0b9bbfbe0..9a6c7d2ef3 100644 --- a/phpgwapi/templates/idsociety/about.tpl +++ b/phpgwapi/templates/idsociety/about.tpl @@ -1,26 +1,41 @@ - - +
+ + + - + - + - - + + + + + + + + + - + + + + + +
- + eGroupWare
 
{phpgw_version}{phpgw_version}
eGroupWare is a multi-user, web-based groupware suite written in PHP.{phpgw_message}

spacer
+ spacer
{phpgw_app_about}
diff --git a/phpgwapi/templates/jerryr/about.tpl b/phpgwapi/templates/jerryr/about.tpl index 0640fe3993..9a6c7d2ef3 100755 --- a/phpgwapi/templates/jerryr/about.tpl +++ b/phpgwapi/templates/jerryr/about.tpl @@ -1,5 +1,7 @@ - + @@ -18,8 +20,11 @@ - - --> + + + + + @@ -30,4 +35,7 @@ + + +
eGroupWare
spacer