From 9cb898201e967cc6775ffef9f894e0fd91165693 Mon Sep 17 00:00:00 2001 From: Pim Snel Date: Wed, 23 Jun 2004 20:01:34 +0000 Subject: [PATCH] add extra [setup][info][extra_untranslated] field for storing data which does not get translated, see 'About JiNN' why --- about.php | 251 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 130 insertions(+), 121 deletions(-) diff --git a/about.php b/about.php index ae52566ab9..2d9153ab30 100644 --- a/about.php +++ b/about.php @@ -1,132 +1,141 @@ hooks->single('about',$app))) - { -function about_app() -{ - global $app; - $icon = $GLOBALS['phpgw']->common->image($app,array('navbar','nonav')); - 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') - ); + $app = $_GET['app']; + if ($app) + { + if (!($included = $GLOBALS['phpgw']->hooks->single('about',$app))) + { + function about_app() + { + global $app; + $icon = $GLOBALS['phpgw']->common->image($app,array('navbar','nonav')); + 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') + ); - $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"; - } - } - $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 .= "
\n"; + $s = "\n + "; - return $s; -} - $api_only = !($included = file_exists(PHPGW_INCLUDE_ROOT . "/$app/setup/setup.inc.php")); - } - } - else - { - $api_only = True; - } + if ($info['description']) + { + $info['description'] = lang($info['description']); + $s .= "\n"; + if ($info['note']) + { + $info['note'] = lang($info['note']); + $s .= "\n"; + } - $tpl = CreateObject('phpgwapi.Template',$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi')); - $tpl->set_file(array( - 'phpgw_about' => 'about.tpl', - 'phpgw_about_unknown' => 'about_unknown.tpl' - )); + } + - $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.', - '','','','')); + foreach ($other_infos as $key => $val) + { + if (isset($info[$key])) + { + $s .= "\n"; + } + } - if ($included) - { - $tpl->set_var('phpgw_app_about',about_app('','')); - //about_app($tpl,"phpgw_app_about"); - } - else - { - if ($api_only) - { - $tpl->set_var('phpgw_app_about',''); - } - else - { - $tpl->set_var('app_header',$app); - $tpl->parse('phpgw_app_about','phpgw_about_unknown'); - } - } + 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"; - $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(); + return $s; + } + $api_only = !($included = file_exists(PHPGW_INCLUDE_ROOT . "/$app/setup/setup.inc.php")); + } + } + else + { + $api_only = True; + } + + $tpl = CreateObject('phpgwapi.Template',$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi')); + $tpl->set_file(array( + 'phpgw_about' => 'about.tpl', + 'phpgw_about_unknown' => 'about_unknown.tpl' + )); + + $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) + { + $tpl->set_var('phpgw_app_about',about_app('','')); + //about_app($tpl,"phpgw_app_about"); + } + else + { + if ($api_only) + { + $tpl->set_var('phpgw_app_about',''); + } + else + { + $tpl->set_var('app_header',$app); + $tpl->parse('phpgw_app_about','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(); ?>