source: branches/2.4/about.php @ 6057

Revision 6057, 4.8 KB checked in by marcosw, 12 years ago (diff)

Ticket #2398 - Compatibilizacao com PHP-5.3 em alguns módulos do expresso

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1<?php
2   /**************************************************************************\
3   * eGroupWare                                                               *
4   * http://www.egroupware.org                                                *
5   * --------------------------------------------                             *
6   *  This program is free software; you can redistribute it and/or modify it *
7   *  under the terms of the GNU General Public License as published by the   *
8   *  Free Software Foundation; either version 2 of the License, or (at your  *
9   *  option) any later version.                                              *
10   \**************************************************************************/
11
12
13   $GLOBALS['phpgw_info'] = array();
14   $GLOBALS['phpgw_info']['flags']['currentapp'] = 'about';
15   $GLOBALS['phpgw_info']['flags']['disable_Template_class'] = True;
16   $GLOBALS['phpgw_info']['flags']['noheader'] = True;
17   include('header.inc.php');
18
19   $app = $_GET['app'];
20   if ($app)
21   {
22          if (!($included = $GLOBALS['phpgw']->hooks->single('about',$app)))
23          {
24                 function about_app()
25                 {
26                        global $app;
27                        $icon = $GLOBALS['phpgw']->common->image($app,array('navbar','nonav'));
28                        include (PHPGW_INCLUDE_ROOT . "/$app/setup/setup.inc.php");
29                        $info = $setup_info[$app];
30                        $info['title'] = $GLOBALS['phpgw_info']['apps'][$app]['title'];
31                        $other_infos = array(
32                           'author'     => lang('Author'),
33                           'maintainer' => lang('Maintainer'),
34                           'version'    => lang('Version'),
35                           'license'    => lang('License')
36                        );
37
38                        $s = "<table width='70%' cellpadding='4'>\n<tr>
39                                  <td align='left'><img src='$icon' alt=\"$info[title]\" /></td><td align='left'><h2>$info[title]</h2></td></tr>";
40
41                           if ($info['description'])
42                           {
43                                  $info['description'] = lang($info['description']);
44                                  $s .= "<tr><td colspan='2' align='left'>$info[description]</td></tr>\n";
45                                  if ($info['note'])
46                                  {
47                                         $info['note'] = lang($info['note']);
48                                         $s .= "<tr><td colspan='2' align='left'><i>$info[note]</i></td></tr>\n";
49                                  }
50
51                           }
52                           
53
54                           foreach ($other_infos as $key => $val)
55                           {
56                                  if (isset($info[$key]))
57                                  {
58                                         $s .= "<tr><td width='1%' align='left'>$val</td><td>";
59                                                   $infos = $info[$key];
60                                                   for ($n = 0; is_array($info[$key][$n]) && ($infos = $info[$key][$n]) || !$n; ++$n)
61                                                   {
62                                                          if (!is_array($infos) && isset($info[$key.'_email']))
63                                                          {
64                                                                 $infos = array('email' => $info[$key.'_email'],'name' => $infos);
65                                                          }
66                                                          if (is_array($infos))
67                                                          {
68                                                                 $names = explode('<br>',$infos['name']);
69                                                                 $emails = preg_split('/@|<br>/',$infos['email']);
70                                                                 if (count($names) < count($emails)/2)
71                                                                 {
72                                                                        $names = '';
73                                                                 }
74                                                                 $infos = '';
75                                                                 while (list($user,$domain) = $emails)
76                                                                 {
77                                                                        if ($infos) $infos .= '<br>';
78                                                                        $name = $names ? array_shift($names) : $user;
79                                                                        $infos .= "<a href='mailto:$user at $domain'><span onClick=\"document.location='mailto:$user'+'@'+'$domain'; return false;\">$name</span></a>";
80                                                                        array_shift($emails); array_shift($emails);
81                                                                 }
82                                                          }
83                                                          $s .= ($n ? '<br>' : '') . $infos;
84                                                   }
85                                                   $s .= "</td></tr>\n";
86                                  }
87                           }
88
89                           if ($info['extra_untranslated'])
90                           {
91                                  $s .= "<tr><td colspan='2' align='left'>$info[extra_untranslated]</td></tr>\n";
92                           }
93                           
94                           $s .= "</table>\n";
95
96                        return $s;
97                 }
98                 $api_only = !($included = file_exists(PHPGW_INCLUDE_ROOT . "/$app/setup/setup.inc.php"));
99          }
100   }
101   else
102   {
103          $api_only = True;
104   }
105
106   $tpl = CreateObject('phpgwapi.Template',$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi'));
107   $tpl->set_file(array(
108          'phpgw_about'         => 'about.tpl',
109          'phpgw_about_unknown' => 'about_unknown.tpl'
110   ));
111
112   $tpl->set_var('phpgw_logo',$GLOBALS['phpgw']->common->image('phpgwapi','logo.gif'));
113   $tpl->set_var('phpgw_version',lang('eGroupWare API version %1',$GLOBALS['phpgw_info']['server']['versions']['phpgwapi']));
114   $tpl->set_var('phpgw_message',lang('%1eGroupWare%2 is a multi-user, web-based groupware suite written in %3PHP%4.',
115   '<a href="http://www.eGroupWare.org" target="_blank">','</a>','<a href="http://www.php.net" target="_blank">','</a>'));
116
117   if ($included)
118   {
119          $tpl->set_var('phpgw_app_about',about_app('',''));
120          //about_app($tpl,"phpgw_app_about");
121   }
122   else
123   {
124          if ($api_only)
125          {
126                 $tpl->set_var('phpgw_app_about','');
127          }
128          else
129          {
130                 $tpl->set_var('app_header',$app);
131                 $tpl->parse('phpgw_app_about','phpgw_about_unknown');
132          }
133   }
134
135   $title = isset($GLOBALS['phpgw_info']['apps'][$app]) ? $GLOBALS['phpgw_info']['apps'][$app]['title'] : 'eGroupWare';
136   $GLOBALS['phpgw_info']['flags']['app_header'] = lang('About %1',$title);
137   $GLOBALS['phpgw']->common->phpgw_header();
138   $tpl->pparse('out','phpgw_about');
139   $GLOBALS['phpgw']->common->phpgw_footer();
140?>
Note: See TracBrowser for help on using the repository browser.