getProfileList(); $_SESSION['phpgw_info']['expressomail']['email_server'] = $boemailadmin->getProfile($emailadmin_profile[0]['profileID']); $_SESSION['phpgw_info']['expressomail']['user'] = $GLOBALS['phpgw_info']['user']; $_SESSION['phpgw_info']['expressomail']['server'] = $GLOBALS['phpgw_info']['server']; $expressoMail = CreateObject($current_app.'.imap_functions'); $mbox_stream = $expressoMail-> open_mbox(); $messages = imap_sort($mbox_stream, SORTARRIVAL, true, SE_UID); $num_new_messages = 0; $subjects = array(); for ($i = 0; $i < count($messages);$i++) { $msg_number = $messages[$i]; $header = @imap_headerinfo($mbox_stream, imap_msgno($mbox_stream, $msg_number), 80, 255); if (!is_object($header)) return false; if($header->Recent != 'N' && $header->Unseen != 'U') continue; $new_m++; if($new_m <= 10) { $date_msg = date("d/m/Y",$header->udate); if (date("d/m/Y") == $date_msg) $date = date("H:i",$header->udate); else $date = $date_msg; $subject = $expressoMail->decode_string($header->fetchsubject); $text = "
"; if(strlen($text) > 105) $text = substr($text,0,105).' ...'; $link_msg = $GLOBALS['phpgw']->link( '/'.$current_app.'/index.php', 'msgball[msgnum]='.$msg_number.'&msgball[folder]=INBOX'); $data[] = array('text' => $text, 'link' => $link_msg); } } imap_close($mbox_stream); $title = $current_name." - ".($new_m > 1 ? lang("You have %1 new messages!","".$new_m."") : ($new_m == 1 ? str_replace("1","1",lang("you have 1 new message!")) : lang("you have no new messages"))); $GLOBALS['phpgw']->translation->add_app($current_app); if ((isset($prev_currentapp)) && ($prev_currentapp) && ($GLOBALS['phpgw_info']['flags']['currentapp'] != $prev_currentapp)) $GLOBALS['phpgw_info']['flags']['currentapp'] = $prev_currentapp; $portalbox = CreateObject('phpgwapi.listbox', Array( 'title' => $title, 'primary' => $GLOBALS['phpgw_info']['theme']['navbar_bg'], 'secondary' => $GLOBALS['phpgw_info']['theme']['navbar_bg'], 'tertiary' => $GLOBALS['phpgw_info']['theme']['navbar_bg'], 'width' => '100%', 'outerborderwidth' => '0', 'header_background_image' => $GLOBALS['phpgw']->common->image('phpgwapi/templates/phpgw_website','bg_filler') ) ); $app_id = $GLOBALS['phpgw']->applications->name2id('expressoMail'); $GLOBALS['portal_order'][] = $app_id; $var = Array( 'up' => Array('url' => '/set_box.php', 'app' => $app_id), 'down' => Array('url' => '/set_box.php', 'app' => $app_id), 'close' => Array('url' => '/set_box.php', 'app' => $app_id), 'question' => Array('url' => '/set_box.php', 'app' => $app_id), 'edit' => Array('url' => '/set_box.php', 'app' => $app_id) ); while(list($key,$value) = each($var)) $portalbox->set_controls($key,$value); $portalbox->data = $data; echo "\n".''."\n".$portalbox->draw($extra_data).''."\n"; }