[ Index ] |
|
Code source de eGroupWare 1.2.106-2 |
1 <?php 2 /**************************************************************************\ 3 * eGroupWare - E-Mail * 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: hook_home.inc.php 19909 2005-11-20 15:51:58Z lkneschke $ */ 13 14 $homedisplay = intval($GLOBALS['egw_info']['user']['preferences']['felamimail']['mainscreen_showmail']); 15 if($homedisplay>0) 16 { 17 18 $d1 = strtolower(substr(EGW_APP_INC,0,3)); 19 if($d1 == 'htt' || $d1 == 'ftp' ) 20 { 21 echo 'Failed attempt to break in via an old Security Hole!<br>'."\n"; 22 $GLOBALS['egw']->common->egw_exit(); 23 } 24 unset($d1); 25 26 $tmp_app_inc = $GLOBALS['egw']->common->get_inc_dir('felamimail'); 27 28 $GLOBALS['egw']->translation->add_app('felamimail'); 29 30 $title = lang('felamimail'); 31 32 $portalbox =& CreateObject('phpgwapi.listbox', 33 Array( 34 'title' => $title, 35 'primary' => $GLOBALS['egw_info']['theme']['navbar_bg'], 36 'secondary' => $GLOBALS['egw_info']['theme']['navbar_bg'], 37 'tertiary' => $GLOBALS['egw_info']['theme']['navbar_bg'], 38 'width' => '100%', 39 'outerborderwidth' => '0', 40 'header_background_image' => $GLOBALS['egw']->common->image('phpgwapi/templates/phpgw_website','bg_filler.gif') 41 ) 42 ); 43 44 $app_id = $GLOBALS['egw']->applications->name2id('felamimail'); 45 //$GLOBALS['portal_order'][] = $app_id; 46 $var = Array( 47 'up' => Array('url' => '/set_box.php', 'app' => $app_id), 48 'down' => Array('url' => '/set_box.php', 'app' => $app_id), 49 'close' => Array('url' => '/set_box.php', 'app' => $app_id), 50 'question' => Array('url' => '/set_box.php', 'app' => $app_id), 51 'edit' => Array('url' => '/set_box.php', 'app' => $app_id) 52 ); 53 54 while(list($key,$value) = each($var)) 55 { 56 $portalbox->set_controls($key,$value); 57 } 58 59 $portalbox->data = Array(); 60 61 62 if($data) 63 { 64 $portalbox->data = $data; 65 } 66 67 $this->displayCharset = $GLOBALS['egw']->translation->charset(); 68 $this->bofelamimail =& CreateObject('felamimail.bofelamimail',$this->displayCharset); 69 70 if(!$this->bofelamimail->openConnection('', OP_READONLY)) 71 { 72 $extra_data = lang("can't connect to INBOX!!"); 73 } 74 else 75 { 76 $folderList = $this->bofelamimail->getFolderObjects(true, true); 77 #_debug_array($folderList); 78 $extra_data = '<table border="0" cellspacing="0" cellpading="0" width="100%"> 79 <tr class="th"> 80 <td> 81 <b>'.lang('foldername').'</b> 82 </td> 83 <td> 84 <b>'.lang('total').'</b> 85 </td> 86 <td> 87 <b>'.lang('unseen').'</b> 88 </td> 89 <tr>'; 90 foreach($folderList as $key => $value) 91 { 92 if(is_object($value->counter)) 93 { 94 $messages = $value->counter->messages; 95 $unseen = $value->counter->unseen; 96 $recent = $value->counter->recent; 97 } 98 if($messages == 0) $messages = ' '; 99 100 if($recent > 0) 101 { 102 $newMessages = "$unseen($recent)"; 103 } 104 else 105 { 106 if($unseen == 0) $unseen = ' '; 107 $newMessages = "$unseen"; 108 } 109 110 111 $linkData = array 112 ( 113 'menuaction' => 'felamimail.uifelamimail.changeFolder', 114 'mailbox' => urlencode($key) 115 ); 116 $folderLink = $GLOBALS['egw']->link('/index.php',$linkData); 117 118 $extra_data .= "<tr><td><a href='$folderLink'>$key</a></td><td>$messages</td><td>$newMessages</td></tr>"; 119 } 120 $extra_data .= '</table>'; 121 } 122 123 // output the portalbox and below it (1) the folders listbox (if applicable) and (2) Compose New mail link 124 echo "\r\n".'<!-- start Mailbox info -->'."\r\n" 125 .$portalbox->draw($extra_data) 126 .'<!-- ends Mailox info -->'."\r\n"; 127 } 128 ?>
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 |