phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] phpgroupware/about.php, 1.25


From: nomail
Subject: [Phpgroupware-cvs] phpgroupware/about.php, 1.25
Date: Thu, 30 Dec 2004 11:46:22 +0100

Update of /phpgroupware
Modified Files:
        Branch: 
          about.php

date: 2004/12/30 10:46:22;  author: skwashd;  state: Exp;  lines: +103 -53

Log Message:
create new head
=====================================================================
Index: phpgroupware/about.php
diff -u phpgroupware/about.php:1.24 phpgroupware/about.php:1.25
--- phpgroupware/about.php:1.24 Sat Nov 16 01:33:18 2002
+++ phpgroupware/about.php      Thu Dec 30 10:46:22 2004
@@ -10,69 +10,119 @@
        
\**************************************************************************/
        /* $Id$ */
 
-       $GLOBALS['phpgw_info'] = array();
        $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 = $HTTP_GET_VARS['app'];
-
-       $GLOBALS['phpgw']->xslttpl->add_file(array('about'));
-
-       if ($app == 'phpGroupWare' || $app == 'about')
-       {
-               $app = 'phpgwapi';
-       }
-
-       $setup_file = PHPGW_INCLUDE_ROOT . '/' . $app . '/setup/setup.inc.php';
-
-       if (@file_exists($setup_file))
+       $app = $_GET['app'];
+       if ($app)
        {
-               include($setup_file);
-               
-               $fields = array
-               (
-                       'version',
-                       'description',
-                       'note',
-                       'author',
-                       'license',
-                       'based_on',
-                       'maintainer'
-               );
-               while (list(,$field) = each($fields))
+               if (!($included = 
$GLOBALS['phpgw']->hooks->single('about',$app)))
                {
-                       $app_data[$field] = $setup_info[$app][$field];
-
-                       if ($field == 'description')
+                       function about_app()
                        {
-                               $app_data[$field] = 
lang($setup_info[$app][$field]);
+                               global $app;
+                               $icon = 
$GLOBALS['phpgw']->common->image($app,'navbar');
+                               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 = "<table width=\"70%\" cellpadding=\"4\">\n"
+                                       . "<tr><td align=\"right\"><img 
src=\"$icon\"></td>"
+                                       . "<td 
align=\"left\"><b>$info[title]</b></td></tr>";
+
+                               if ($info['description'])
+                               {
+                                       $info['description'] = 
lang($info['description']);
+                                       $s .= "<tr><td colspan='2' 
align='center'>$info[description]</td></tr>\n";
+                                       if ($info['note'])
+                                       {
+                                               $info['note'] = 
lang($info['note']);
+                                               $s .= "<tr><td colspan='2' 
align='center'><i>$info[note]</i></td></tr>\n";
+                                       }
+                               }
+                               foreach ($other_infos as $key => $val)
+                               {
+                                       if (isset($info[$key]))
+                                       {
+                                               $s .= "<tr><td width='50%' 
align='right'>$val</td><td>";
+                                               $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('<br>',$infos['name']);
+                                                               $emails = 
split('@|<br>',$infos['email']);
+                                                               if 
(count($names) < count($emails)/2)
+                                                               {
+                                                                       $names 
= '';
+                                                               }
+                                                               $infos = '';
+                                                               while 
(list($user,$domain) = $emails)
+                                                               {
+                                                                       if 
($infos) $infos .= '<br>';
+                                                                       $name = 
$names ? array_shift($names) : $user;
+                                                                       $infos 
.= "<a href='mailto:$user at $domain' 
onClick=\"document.location='mailto:$user'+'@'+'$domain'; return 
false;\">$name</a>";
+                                                                       
array_shift($emails); array_shift($emails);
+                                                               }
+                                                       }
+                                                       $s .= ($n ? '<br>' : 
'') . $infos;
+                                               }
+                                               $s .= "</td></tr>\n";
+                                       }
+                               }
+                               $s .= "</table>\n";
+                               
+                               return $s;
                        }
+                       $api_only = !($included = 
file_exists(PHPGW_INCLUDE_ROOT . "/$app/setup/setup.inc.php"));
                }
+       }
+       else
+       {
+               $api_only = True;
+       }
 
-               if (isset($app_data['note']) && !empty($app_data['note']))
+       $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'));
+       $tpl->set_var('phpgw_version','phpGroupWare API version ' . 
$GLOBALS['phpgw_info']['server']['versions']['phpgwapi']);
+       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
                {
-                       $app_data['note'] = lang($app_data['note']);
+                       $tpl->set_var('app_header',$app);
+                       $tpl->parse('phpgw_app_about','phpgw_about_unknown');
                }
        }
 
-       $data = array
-       (
-               'phpgw_logo'                    => 
$GLOBALS['phpgw']->common->get_image_path('phpgwapi'),
-               'lang_url_statustext'   => lang('phpGroupWare --> homepage'),
-               'lang_version'                  => lang('version'),
-               'phpgw_version'                 => 'phpGroupWare API ' . 
$GLOBALS['phpgw_info']['server']['versions']['phpgwapi'],
-               'phpgw_descr'                   => lang('is a multi-user, 
web-based groupware suite written in PHP'), 
-               'about_app'                             => $app_data + array
-               (
-                       'title'                         => lang($app),
-                       'icon'                          => 
$GLOBALS['phpgw']->common->image($app,'navbar','',True),
-                       'lang_version'          => lang('version'),
-                       'lang_author'           => lang('author'),
-                       'lang_based_on'         => lang('based on'),
-                       'lang_maintainer'       => lang('maintainer'),
-                       'lang_license'          => lang('license')
-               )
-       );
-
-       $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('about_data' => 
$data));
+       $title = isset($GLOBALS['phpgw_info']['apps'][$app]) ? 
$GLOBALS['phpgw_info']['apps'][$app]['title'] : 'phpGroupWare';
+       $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();
 ?>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]