[ Index ] |
|
Code source de eGroupWare 1.2.106-2 |
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 /* $Id: about.php 20295 2006-02-15 12:31:25Z $ */ 13 14 $GLOBALS['egw_info'] = array(); 15 $app = $_GET['app']; 16 if(isset($app) && $_GET['app'] != 'eGroupWare') 17 { 18 $GLOBALS['egw_info']['flags']['currentapp'] = $app; 19 } 20 else 21 { 22 $GLOBALS['egw_info']['flags']['currentapp'] = 'about'; 23 } 24 25 $GLOBALS['egw_info']['flags']['disable_Template_class'] = True; 26 $GLOBALS['egw_info']['flags']['noheader'] = True; 27 include('header.inc.php'); 28 29 if ($app) 30 { 31 if (!($included = $GLOBALS['egw']->hooks->single('about',$app))) 32 { 33 $api_only = !($included = file_exists(EGW_INCLUDE_ROOT . "/$app/setup/setup.inc.php")); 34 } 35 } 36 else 37 { 38 $api_only = True; 39 } 40 41 $tpl = CreateObject('phpgwapi.Template',$GLOBALS['egw']->common->get_tpl_dir('phpgwapi')); 42 $tpl->set_file(array( 43 'phpgw_about' => 'about.tpl', 44 'phpgw_about_unknown' => 'about_unknown.tpl' 45 )); 46 47 $title = isset($GLOBALS['egw_info']['apps'][$app]) ? $GLOBALS['egw_info']['apps'][$app]['title'] : 'eGroupWare'; 48 $GLOBALS['egw_info']['flags']['app_header'] = lang('About %1',$title); 49 $GLOBALS['egw']->common->phpgw_header(); 50 51 $tpl->set_block('phpgw_about', 'egroupware','egroupware'); 52 $tpl->set_block('phpgw_about', 'application','application'); 53 54 if ($included) 55 { 56 $tpl->set_var('phpgw_app_about', about_app()); 57 $tpl->pparse('phpgw_about', 'application', True); 58 } 59 else 60 { 61 if ($api_only) 62 { 63 $tpl->set_var('phpgw_logo',$GLOBALS['egw']->common->image('phpgwapi','logo.gif')); 64 $tpl->set_var('phpgw_version',lang('eGroupWare API version %1',$GLOBALS['egw_info']['server']['versions']['phpgwapi'])); 65 $tpl->set_var('phpgw_message',lang('%1eGroupWare%2 is a multi-user, web-based groupware suite written in %3PHP%4.', 66 '<a href="http://www.eGroupWare.org" target="_blank">','</a>','<a href="http://www.php.net" target="_blank">','</a>')); 67 $tpl->pparse('out', 'egroupware'); 68 69 $tpl->set_var('phpgw_app_about',about_template()); 70 $tpl->pparse('phpgw_about', 'application', True); 71 } 72 else 73 { 74 $tpl->set_var('app_header',$app); 75 76 $tpl->pparse('out','phpgw_about_unknown'); 77 } 78 } 79 80 $GLOBALS['egw']->common->phpgw_footer(); 81 82 function about_app() 83 { 84 global $app; 85 include(EGW_INCLUDE_ROOT . "/$app/setup/setup.inc.php"); 86 $info = $setup_info[$app]; 87 $info['icon'] = $GLOBALS['egw']->common->image($app,array('navbar','nonav')); 88 $info['title'] = $GLOBALS['egw_info']['apps'][$app]['title']; 89 return about_display($info); 90 } 91 92 function about_template() 93 { 94 $template = $GLOBALS['egw']->common->get_tpl_dir('phpgwapi'); 95 96 include ($template . "/setup/setup.inc.php"); 97 $s = ""; 98 $template_info[] = $GLOBALS['egw_info']['template'][$GLOBALS['egw_info']['user']['preferences']['common']['template_set']]; 99 foreach($template_info as $info) 100 { 101 $s .= about_display($info); 102 } 103 return $s; 104 } 105 106 function about_display($info) 107 { 108 $other_infos = array( 109 'author' => lang('Author'), 110 'maintainer' => lang('Maintainer'), 111 'version' => lang('Version'), 112 'license' => lang('License'), 113 ); 114 if($info[icon]) 115 { 116 $icon = $info[icon]; 117 } 118 $s = "<table width='70%' cellpadding='4'>\n"; 119 if(trim($icon) != "") 120 { 121 $s.= "<tr> 122 <td align='left'><img src='$icon' alt=\"$info[title]\" /></td><td align='left'><h2>$info[title]</h2></td></tr>"; 123 } 124 else 125 { 126 $s .= "<tr> 127 <td align='left'></td><td align='left'><h2>$info[title]</h2></td></tr>"; 128 } 129 if ($info['description']) 130 { 131 $info['description'] = lang($info['description']); 132 $s .= "<tr><td colspan='2' align='left'>$info[description]</td></tr>\n"; 133 if ($info['note']) 134 { 135 $info['note'] = lang($info['note']); 136 $s .= "<tr><td colspan='2' align='left'><i>$info[note]</i></td></tr>\n"; 137 } 138 139 } 140 foreach ($other_infos as $key => $val) 141 { 142 if (isset($info[$key])) 143 { 144 $s .= "<tr><td width='1%' align='left'>$val</td><td>"; 145 $infos = $info[$key]; 146 for ($n = 0; is_array($info[$key][$n]) && ($infos = $info[$key][$n]) || !$n; ++$n) 147 { 148 if (!is_array($infos) && isset($info[$key.'_email'])) 149 { 150 $infos = array('email' => $info[$key.'_email'],'name' => $infos); 151 } 152 elseif(!is_array($infos) && isset($info[$key.'_url'])) 153 { 154 $infos = array('url' => $info[$key.'_url'],'name' => $infos); 155 } 156 if (is_array($infos)) 157 { 158 if ($infos['email']) 159 { 160 $names = explode('<br>',$infos['name']); 161 $emails = split('@|<br>',$infos['email']); 162 if (count($names) < count($emails)/2) 163 { 164 $names = ''; 165 } 166 $infos = ''; 167 while (list($user,$domain) = $emails) 168 { 169 if ($infos) $infos .= '<br>'; 170 $name = $names ? array_shift($names) : $user; 171 $infos .= "<a href='mailto:$user at $domain'><span onClick=\"document.location='mailto:$user'+'@'+'$domain'; return false;\">$name</span></a>"; 172 array_shift($emails); array_shift($emails); 173 } 174 } 175 elseif($infos['url']) 176 { 177 $img = $info[$key.'_img']; 178 if ($img) 179 { 180 $img_url = $GLOBALS['egw']->common->image('phpgwapi',$img); 181 if (!$img_url) 182 { 183 $img_url = $GLOBALS['egw']->common->image($info['name'],$img); 184 } 185 $infos = '<table border="0"><tr><td style="text-align:center;"><a href="'.$infos['url'].'"><img src="'.$img_url.'" border="0"><br>'.$infos['name'].'</a></td></tr></table>'; 186 } 187 else 188 { 189 $infos = '<a href="'.$infos['url'].'">'.$infos['name'].'</a>'; 190 } 191 } 192 } 193 $s .= ($n ? '<br>' : '') . $infos; 194 } 195 $s .= "</td></tr>\n"; 196 } 197 } 198 199 if ($info['extra_untranslated']) 200 { 201 $s .= "<tr><td colspan='2' align='left'>$info[extra_untranslated]</td></tr>\n"; 202 } 203 204 $s .= "</table>\n"; 205 206 return $s; 207 } 208 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 17:20:01 2007 | par Balluche grâce à PHPXref 0.7 |