diff --git a/about.php b/about.php index 780af5ef14..48a88e9b53 100644 --- a/about.php +++ b/about.php @@ -1,204 +1,343 @@ array( - 'currentapp' => isset($_GET['app']) && $_GET['app'] != 'eGroupWare' ? $_GET['app'] : 'about', - 'disable_Template_class' => True, - 'noheader' => True, - ) - ); - include('header.inc.php'); +$GLOBALS['egw_info'] = array( + 'flags' => array( + 'currentapp' => isset($_GET['app']) && $_GET['app'] != 'eGroupWare' ? $_GET['app'] : 'about', + 'disable_Template_class' => True, + 'noheader' => True, + ) +); +include('header.inc.php'); - $app = isset($_GET['app']) && $_GET['app'] != 'eGroupWare' ? basename($_GET['app']) : 'about'; +// create the about page +$aboutPage = new about(); - if ($app) + +class about +{ + /** + * template object + */ + var $tpl; + + /** + * constructor of class about + * sets template and calls list or detail view + */ + function about() { - if (!($included = $GLOBALS['egw']->hooks->single('about',$app))) - { - $api_only = !($included = file_exists(EGW_INCLUDE_ROOT . "/$app/setup/setup.inc.php")); + // 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'][$_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(); + + // 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 { + $detail = false; } - } - else - { - $api_only = True; - } - - $tpl =& CreateObject('phpgwapi.Template',$GLOBALS['egw']->common->get_tpl_dir('phpgwapi')); - $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); - $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); - } - 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.', - '','','','')); - $tpl->pparse('out', 'egroupware'); - - $tpl->set_var('phpgw_app_about',about_template()); - $tpl->pparse('phpgw_about', 'application', True); + if ($detail) { + $this->_detailView(); + } else { + $this->_listView(); } - else - { - $tpl->set_var('app_header',$app); - $tpl->pparse('out','phpgw_about_unknown'); - } + $GLOBALS['egw']->common->egw_footer(); } - $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.', + '','','','')); + $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 ''; $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) - { + 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']; + $other_infos = array( - 'author' => lang('Author'), - 'maintainer' => lang('Maintainer'), - 'version' => lang('Version'), - 'license' => lang('License'), + 'author' => lang('Author'), + 'maintainer' => lang('Maintainer'), + 'version' => lang('Version'), + 'license' => lang('License'), + ); + if($info[icon]) + { + $icon = $info[icon]; + } + $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);
+ }
+ elseif(!is_array($infos) && isset($info[$key.'_url']))
+ {
+ $infos = array('url' => $info[$key.'_url'],'name' => $infos);
+ }
+ if (is_array($infos))
+ {
+ if ($infos['email'])
+ {
+ $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); + } + } + elseif($infos['url']) + { + $img = $info[$key.'_img']; + if ($img) + { + $img_url = $GLOBALS['egw']->common->image('phpgwapi',$img); + if (!$img_url) + { + $img_url = $GLOBALS['egw']->common->image($info['name'],$img); + } + $infos = '
' : '') . $infos; + } + $s .= " | |
$info[extra_untranslated] |
$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);
- }
- elseif(!is_array($infos) && isset($info[$key.'_url']))
- {
- $infos = array('url' => $info[$key.'_url'],'name' => $infos);
- }
- if (is_array($infos))
- {
- if ($infos['email'])
- {
- $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); - } - } - elseif($infos['url']) - { - $img = $info[$key.'_img']; - if ($img) - { - $img_url = $GLOBALS['egw']->common->image('phpgwapi',$img); - if (!$img_url) - { - $img_url = $GLOBALS['egw']->common->image($info['name'],$img); - } - $infos = '
' : '') . $infos; - } - $s .= " | |
$info[extra_untranslated] |