Changeset 139 for trunk/expressoMail1_2/inc/hook_home.inc.php
- Timestamp:
- 01/03/08 14:09:58 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/inc/hook_home.inc.php
r2 r139 1 1 <?php 2 2 3 $current_app = 'expressoMail1_2'; 3 4 $current_name = 'ExpressoMail 1.2'; 4 5 $homedisplay = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['mainscreen_showmail']; 5 6 $homedisplay = 'True'; 6 7 if($homedisplay=='True') 7 8 { … … 22 23 $expressoMail = CreateObject($current_app.'.imap_functions'); 23 24 $mbox_stream = $expressoMail-> open_mbox(); 24 $messages = imap_sort($mbox_stream, SORTARRIVAL, false, SE_UID);25 $messages = imap_sort($mbox_stream, SORTARRIVAL, true, SE_UID); 25 26 $num_new_messages = 0; 26 27 $subjects = array(); 28 27 29 for ($i = 0; $i < count($messages);$i++) 28 30 { … … 36 38 $new_m++; 37 39 if($new_m <= 10) { 38 $subject = $expressoMail->decode_string($header->fetchsubject); 39 if(strlen($subject) > 65) 40 $subject = substr($subject,0,65).' ...'; 40 $date_msg = date("d/m/Y",$header->udate); 41 if (date("d/m/Y") == $date_msg) 42 $date = date("H:i",$header->udate); 43 else 44 $date = $date_msg; 45 $subject = $expressoMail->decode_string($header->fetchsubject); 46 $text = "<div style='overflow:hidden;white-space:nowrap'>".$date." .: ".$subject."</div>"; 47 if(strlen($text) > 105) 48 $text = substr($text,0,105).' ...'; 41 49 42 50 $link_msg = $GLOBALS['phpgw']->link( 43 51 '/'.$current_app.'/index.php', 44 52 'msgball[msgnum]='.$msg_number.'&msgball[folder]=INBOX'); 45 $data[] = array('text' => $ subject, 'link' => $link_msg);46 } 53 $data[] = array('text' => $text, 'link' => $link_msg); 54 } 47 55 } 48 56 49 57 imap_close($mbox_stream); 50 51 $title = $current_name." - ".($new_m > 1 ? lang(" you have %1 new messages!",$new_m) : ($new_m == 1 ? lang("you have 1 new message!") : lang("you have no new messages")));58 59 $title = $current_name." - ".($new_m > 1 ? lang("You have %1 new messages!","<font color=red>".$new_m."</font>") : ($new_m == 1 ? str_replace("1","<font color=red>1</font>",lang("you have 1 new message!")) : lang("you have no new messages"))); 52 60 $GLOBALS['phpgw']->translation->add_app($current_app); 53 61 … … 81 89 $portalbox->set_controls($key,$value); 82 90 83 $portalbox->data = $data; 91 $portalbox->data = $data; 92 84 93 echo "\n".'<!-- BEGIN Mailbox info -->'."\n".$portalbox->draw($extra_data).'<!-- END Mailbox info -->'."\n"; 85 94 }
Note: See TracChangeset
for help on using the changeset viewer.