source: companies/serpro/about.php @ 903

Revision 903, 4.9 KB checked in by niltonneto, 15 years ago (diff)

Importacao inicial do Expresso do Serpro

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                           // as linhas aabaixo foram comentariadas para nao mostrar dados do autor/administrador na aba "sobre".
33                           //'author'     => lang('Author'),
34                           //'maintainer' => lang('Maintainer'),
35                           'version'    => lang('Version'),
36                           'license'    => lang('License')
37                        );
38
39                        $s = "<table width='70%' cellpadding='4'>\n<tr>
40                                  <td align='left'><img src='$icon' alt=\"$info[title]\" /></td><td align='left'><h2>$info[title]</h2></td></tr>";
41
42                           if ($info['description'])
43                           {
44                                  $info['description'] = lang($info['description']);
45                                  $s .= "<tr><td colspan='2' align='left'>$info[description]</td></tr>\n";
46                                  if ($info['note'])
47                                  {
48                                         $info['note'] = lang($info['note']);
49                                         $s .= "<tr><td colspan='2' align='left'><i>$info[note]</i></td></tr>\n";
50                                  }
51
52                           }
53                           
54
55                           foreach ($other_infos as $key => $val)
56                           {
57                                  if (isset($info[$key]))
58                                  {
59                                         $s .= "<tr><td width='1%' align='left'>$val</td><td>";
60                                                   $infos = $info[$key];
61                                                   for ($n = 0; is_array($info[$key][$n]) && ($infos = $info[$key][$n]) || !$n; ++$n)
62                                                   {
63                                                          if (!is_array($infos) && isset($info[$key.'_email']))
64                                                          {
65                                                                 $infos = array('email' => $info[$key.'_email'],'name' => $infos);
66                                                          }
67                                                          if (is_array($infos))
68                                                          {
69                                                                 $names = explode('<br>',$infos['name']);
70                                                                 $emails = split('@|<br>',$infos['email']);
71                                                                 if (count($names) < count($emails)/2)
72                                                                 {
73                                                                        $names = '';
74                                                                 }
75                                                                 $infos = '';
76                                                                 while (list($user,$domain) = $emails)
77                                                                 {
78                                                                        if ($infos) $infos .= '<br>';
79                                                                        $name = $names ? array_shift($names) : $user;
80                                                                        $infos .= "<a href='mailto:$user at $domain'><span onClick=\"document.location='mailto:$user'+'@'+'$domain'; return false;\">$name</span></a>";
81                                                                        array_shift($emails); array_shift($emails);
82                                                                 }
83                                                          }
84                                                          $s .= ($n ? '<br>' : '') . $infos;
85                                                   }
86                                                   $s .= "</td></tr>\n";
87                                  }
88                           }
89
90                           if ($info['extra_untranslated'])
91                           {
92                                  $s .= "<tr><td colspan='2' align='left'>$info[extra_untranslated]</td></tr>\n";
93                           }
94                           
95                           $s .= "</table>\n";
96
97                        return $s;
98                 }
99                 $api_only = !($included = file_exists(PHPGW_INCLUDE_ROOT . "/$app/setup/setup.inc.php"));
100          }
101   }
102   else
103   {
104          $api_only = True;
105   }
106
107   $tpl = CreateObject('phpgwapi.Template',$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi'));
108   $tpl->set_file(array(
109          'phpgw_about'         => 'about.tpl',
110          'phpgw_about_unknown' => 'about_unknown.tpl'
111   ));
112
113   $tpl->set_var('phpgw_logo',$GLOBALS['phpgw']->common->image('phpgwapi','logo.gif'));
114   $tpl->set_var('phpgw_version',lang('eGroupWare API version %1',$GLOBALS['phpgw_info']['server']['versions']['phpgwapi']));
115   $tpl->set_var('phpgw_message',lang('%1eGroupWare%2 is a multi-user, web-based groupware suite written in %3PHP%4.',
116   '<a href="http://www.eGroupWare.org" target="_blank">','</a>','<a href="http://www.php.net" target="_blank">','</a>'));
117
118   if ($included)
119   {
120          $tpl->set_var('phpgw_app_about',about_app('',''));
121          //about_app($tpl,"phpgw_app_about");
122   }
123   else
124   {
125          if ($api_only)
126          {
127                 $tpl->set_var('phpgw_app_about','');
128          }
129          else
130          {
131                 $tpl->set_var('app_header',$app);
132                 $tpl->parse('phpgw_app_about','phpgw_about_unknown');
133          }
134   }
135
136   $title = isset($GLOBALS['phpgw_info']['apps'][$app]) ? $GLOBALS['phpgw_info']['apps'][$app]['title'] : 'eGroupWare';
137   $GLOBALS['phpgw_info']['flags']['app_header'] = lang('About %1',$title);
138   $GLOBALS['phpgw']->common->phpgw_header();
139   $tpl->pparse('out','phpgw_about');
140   $GLOBALS['phpgw']->common->phpgw_footer();
141?>
Note: See TracBrowser for help on using the repository browser.