function delete_move_next_read($currloc) { global $delete_move_next_formATtop, $delete_move_next_formATbottom; global $color, $where, $what, $currentArrayIndex, $passed_id; global $urlMailbox, $sort, $startMessage, $delete_id, $move_id; global $imapConnection; if ($where && $what || $currentArrayIndex == -1) { return; } else { $next = findNextMessage(); if ($next == -1) { return; } } $location = get_location(); echo "<base href=\"{$location}/\">"; ?> <table cols=1 cellspacing=0 width=100% border=0 cellpadding=2> <tr> <td bgcolor="<?php echo $color[9]; ?> " width=100% align=center><small> <?php $prev = findPreviousMessage(); if ($prev != -1) { echo "<a href=\"read_body.php?passed_id={$prev}&mailbox={$urlMailbox}&sort={$sort}&startMessage={$startMessage}&show_more=0\">" . _("Previous") . "</A> | "; } else { echo _("Previous") . " | "; } echo "<a href=\"read_body.php?passed_id={$next}&mailbox={$urlMailbox}&sort={$sort}&startMessage={$startMessage}&show_more=0\">" . _("Next") . "</a> | "; if ($prev != -1) { echo "<a href=\"read_body.php?passed_id={$passed_id}&mailbox={$urlMailbox}&sort={$sort}&startMessage={$startMessage}&show_more=0&delete_id={$passed_id}\">" . _("Delete & Prev") . "</a>" . " | "; } else { echo _("Delete & Prev") . " | "; } echo "<a href=\"read_body.php?passed_id={$next}&mailbox={$urlMailbox}&sort={$sort}&startMessage={$startMessage}&show_more=0&delete_id={$passed_id}\">" . _("Delete & Next") . "</a>"; ?> </small></td> </tr> <?php if ($delete_move_next_formATtop == "on" && $currloc == "top") { delete_move_next_moveForm($next); } if ($delete_move_next_formATbottom != "off" && $currloc == "bottom") { delete_move_next_moveForm($next); } ?> </table><?php }
function formatMenubar($mailbox, $passed_id, $passed_ent_id, $message, $mbx_response) { global $base_uri, $draft_folder, $where, $what, $color, $sort, $startMessage, $PHP_SELF, $save_as_draft, $enable_forward_as_attachment; $topbar_delimiter = ' | '; $urlMailbox = urlencode($mailbox); $s = '<table width="100%" cellpadding="3" cellspacing="0" align="center"' . ' border="0" bgcolor="' . $color[9] . '"><tr>' . html_tag('td', '', 'left', '', 'width="33%"') . '<small>'; $msgs_url = $base_uri . 'src/'; if (isset($where) && isset($what)) { $msgs_url .= 'search.php?where=' . urlencode($where) . '&what=' . urlencode($what) . '&mailbox=' . $urlMailbox; $msgs_str = _("Search Results"); } else { $msgs_url .= 'right_main.php?sort=' . $sort . '&startMessage=' . $startMessage . '&mailbox=' . $urlMailbox; $msgs_str = _("Message List"); } $s .= '<a href="' . $msgs_url . '">' . $msgs_str . '</a>'; $delete_url = $base_uri . 'src/delete_message.php?mailbox=' . $urlMailbox . '&message=' . $passed_id . '&'; if (!(isset($passed_ent_id) && $passed_ent_id)) { if ($where && $what) { $delete_url .= 'where=' . urlencode($where) . '&what=' . urlencode($what); } else { $delete_url .= 'sort=' . $sort . '&startMessage=' . $startMessage; } $s .= $topbar_delimiter; $s .= '<a href="' . $delete_url . '">' . _("Delete") . '</a>'; } $comp_uri = 'src/compose.php' . '?passed_id=' . $passed_id . '&mailbox=' . $urlMailbox . '&startMessage=' . $startMessage . (isset($passed_ent_id) ? '&passed_ent_id=' . urlencode($passed_ent_id) : ''); if ($mailbox == $draft_folder && $save_as_draft) { $comp_alt_uri = $comp_uri . '&smaction=draft'; $comp_alt_string = _("Resume Draft"); } else { if (handleAsSent($mailbox)) { $comp_alt_uri = $comp_uri . '&smaction=edit_as_new'; $comp_alt_string = _("Edit Message as New"); } } if (isset($comp_alt_uri)) { $s .= $topbar_delimiter; $s .= makeComposeLink($comp_alt_uri, $comp_alt_string); } $s .= '</small></td><td align="center" width="33%"><small>'; if (!(isset($where) && isset($what)) && !$passed_ent_id) { $prev = findPreviousMessage($mbx_response['EXISTS'], $passed_id); $next = findNextMessage($passed_id); if ($prev != -1) { $uri = $base_uri . 'src/read_body.php?passed_id=' . $prev . '&mailbox=' . $urlMailbox . '&sort=' . $sort . '&startMessage=' . $startMessage . '&show_more=0'; $s .= '<a href="' . $uri . '">' . _("Previous") . '</a>'; } else { $s .= _("Previous"); } $s .= $topbar_delimiter; if ($next != -1) { $uri = $base_uri . 'src/read_body.php?passed_id=' . $next . '&mailbox=' . $urlMailbox . '&sort=' . $sort . '&startMessage=' . $startMessage . '&show_more=0'; $s .= '<a href="' . $uri . '">' . _("Next") . '</a>'; } else { $s .= _("Next"); } } else { if (isset($passed_ent_id) && $passed_ent_id) { /* code for navigating through attached message/rfc822 messages */ $url = set_url_var($PHP_SELF, 'passed_ent_id', 0); $s .= '<a href="' . $url . '">' . _("View Message") . '</a>'; $entities = array(); $entity_count = array(); $c = 0; foreach ($message->parent->entities as $ent) { if ($ent->type0 == 'message' && $ent->type1 == 'rfc822') { $c++; $entity_count[$c] = $ent->entity_id; $entities[$ent->entity_id] = $c; } } $prev_link = _("Previous"); if (!empty($entities[$passed_ent_id]) && $entities[$passed_ent_id] > 1) { $prev_ent_id = $entity_count[$entities[$passed_ent_id] - 1]; $prev_link = '<a href="' . set_url_var($PHP_SELF, 'passed_ent_id', $prev_ent_id) . '">' . $prev_link . '</a>'; } $next_link = _("Next"); if (!empty($entities[$passed_ent_id]) && $entities[$passed_ent_id] < $c) { $next_ent_id = $entity_count[$entities[$passed_ent_id] + 1]; $next_link = '<a href="' . set_url_var($PHP_SELF, 'passed_ent_id', $next_ent_id) . '">' . $next_link . '</a>'; } $s .= $topbar_delimiter . $prev_link; $par_ent_id = $message->parent->entity_id; if ($par_ent_id) { $par_ent_id = substr($par_ent_id, 0, -2); $s .= $topbar_delimiter; $url = set_url_var($PHP_SELF, 'passed_ent_id', $par_ent_id); $s .= '<a href="' . $url . '">' . _("Up") . '</a>'; } $s .= $topbar_delimiter . $next_link; } } $s .= '</small></td>' . "\n" . html_tag('td', '', 'right', '', 'width="33%" nowrap') . '<small>'; $comp_action_uri = $comp_uri . '&smaction=forward'; $s .= makeComposeLink($comp_action_uri, _("Forward")); if ($enable_forward_as_attachment) { $comp_action_uri = $comp_uri . '&smaction=forward_as_attachment'; $s .= $topbar_delimiter; $s .= makeComposeLink($comp_action_uri, _("Forward as Attachment")); } $comp_action_uri = $comp_uri . '&smaction=reply'; $s .= $topbar_delimiter; $s .= makeComposeLink($comp_action_uri, _("Reply")); $comp_action_uri = $comp_uri . '&smaction=reply_all'; $s .= $topbar_delimiter; $s .= makeComposeLink($comp_action_uri, _("Reply All")); $s .= '</small></td></tr></table>'; $ret = concat_hook_function('read_body_menu_top', $s); if ($ret != '') { $s = $ret; } echo $s; do_hook('read_body_menu_bottom'); }
function delete_move_next_read($currloc) { global $delete_move_next_formATtop, $delete_move_next_formATbottom, $color, $where, $what, $currentArrayIndex, $passed_id, $mailbox, $sort, $startMessage, $delete_id, $move_id, $imapConnection, $auto_expunge, $move_to_trash, $mbx_response, $uid_support, $passed_ent_id; $urlMailbox = urlencode($mailbox); if (!isset($passed_ent_id)) { $passed_ent_id = 0; } if (!($where && $what || $currentArrayIndex == -1) && !$passed_ent_id) { $next = findNextMessage($passed_id); $prev = findPreviousMessage($mbx_response['EXISTS'], $passed_id); $prev_if_del = $prev; $next_if_del = $next; if (!$uid_support && ($auto_expunge || $move_to_trash)) { if ($prev_if_del > $passed_id) { $prev_if_del--; } if ($next_if_del > $passed_id) { $next_if_del--; } } /* Base is illegal within documents * $location = get_location(); * echo "<base href=\"$location/\">" . */ echo '<table cellspacing="0" width="100%" border="0" cellpadding="2">' . '<tr>' . "<td bgcolor=\"{$color['9']}\" width=\"100%\" align=\"center\"><small>"; if ($prev > 0) { echo "<a href=\"read_body.php?passed_id={$prev_if_del}&mailbox={$urlMailbox}&sort={$sort}&startMessage={$startMessage}&show_more=0&delete_id={$passed_id}\">" . _("Delete & Prev") . "</a>" . " | \n"; } else { echo _("Delete & Prev") . " | "; } if ($next > 0) { echo "<a href=\"read_body.php?passed_id={$next_if_del}&mailbox={$urlMailbox}&sort={$sort}&startMessage={$startMessage}&show_more=0&delete_id={$passed_id}\">" . _("Delete & Next") . "</a>\n"; } else { echo _("Delete & Next"); } echo '</small></td></tr>'; if ($next_if_del < 0) { $next_if_del = $prev_if_del; } if ($delete_move_next_formATtop == 'on' && $currloc == 'top') { if ($next_if_del > 0) { delete_move_next_moveNextForm($next_if_del); } else { delete_move_next_moveRightMainForm(); } } if ($delete_move_next_formATbottom != 'off' && $currloc == 'bottom') { if ($next_if_del > 0) { delete_move_next_moveNextForm($next_if_del); } else { delete_move_next_moveRightMainForm(); } } echo '</table>'; } }
echo '<td class="ModuleIcons">'; echo "<a href=\"javascript:popup('properties.php?account_id=" . $account_id . "&uid=" . $uid . "&mailbox=" . urlencode($mailbox) . "','450','500')\"><img src=\"" . $GO_THEME->images['properties'] . "\" border=\"0\" height=\"32\" width=\"32\" /><br />" . $fbProperties . "</a></td>\n"; echo '<td class="ModuleIcons">'; echo '<a href="javascript:confirm_delete()"><img src="' . $GO_THEME->images['delete_big'] . '" border="0" height="32" width="32" /><br />' . $ml_delete . '</a></td>'; echo '<td class="ModuleIcons">'; echo '<a href="javascript:popup(\'message.php?account_id=' . $account_id . '&uid=' . $uid . '&mailbox=' . urlencode($mailbox) . '&print=true\',\'\',\'\')"><img src="' . $GO_THEME->images['print'] . '" border="0" height="32" width="32" /><br />' . $ml_print . '</a></td>'; if ($account['spam'] != '') { echo '<td class="ModuleIcons">'; echo '<a href="javascript:spam();"><img src="' . $GO_THEME->images['block'] . '" border="0" height="32" width="32" /><br />' . $ml_block . '</a></td>'; } $previous_id = findPreviousMessage($aMailbox['UIDSET'][0], $uid); if ($previous_id != -1) { echo '<td class="ModuleIcons">'; echo '<a href="javascript:get_message(' . $previous_id . ');"><img src="' . $GO_THEME->images['previous'] . '" border="0" height="32" width="32" /><br />' . $cmdPrevious . '</a></td>'; } $next_id = findNextMessage($aMailbox['UIDSET'][0], $uid); if ($next_id != -1) { echo '<td class="ModuleIcons">'; echo '<a href="javascript:get_message(' . $next_id . ');"><img src="' . $GO_THEME->images['next'] . '" border="0" height="32" width="32" /><br />' . $cmdNext . '</a></td>'; } echo '<td class="ModuleIcons">'; echo '<a href="javascript:_close();"><img src="' . $GO_THEME->images['close'] . '" border="0" height="32" width="32" /><br />' . $cmdClose . '</a></td>'; echo '</tr></table>'; } ?> <input type="hidden" name="empty_mailbox" /> <input type="hidden" name="link_back" value="<?php echo $link_back; ?> " /> <input type="hidden" name="mailbox" value="<?php
/** * Format message toolbar * * @param array $aMailbox Current mailbox information array * @param int $passed_id UID of current message * @param int $passed_ent_id Id of entity within message * @param object $message Current message object * @param void $removedVar This parameter is no longer used, but remains * so as not to break this function's prototype * (OPTIONAL) * @param boolean $nav_on_top When TRUE, the menubar is being constructed * for use at the top of the page, otherwise it * will be used for page bottom (OPTIONAL; * default = TRUE) */ function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message, $removedVar = FALSE, $nav_on_top = TRUE) { global $base_uri, $draft_folder, $where, $what, $sort, $startMessage, $PHP_SELF, $save_as_draft, $enable_forward_as_attachment, $imapConnection, $lastTargetMailbox, $delete_prev_next_display, $show_copy_buttons, $compose_new_win, $compose_width, $compose_height, $oTemplate; //FIXME cleanup argument list, use $aMailbox where possible $mailbox = $aMailbox['NAME']; $urlMailbox = urlencode($mailbox); // Create Prev & Next links // Handle nested entities first (i.e. Mime Attach parts) $prev_href = $next_href = $up_href = $del_href = $del_prev_href = $del_next_href = ''; $msg_list_href = $search_href = $view_msg_href = ''; if (isset($passed_ent_id) && $passed_ent_id) { // code for navigating through attached message/rfc822 messages $url = set_url_var($PHP_SELF, 'passed_ent_id', 0); $entities = array(); $entity_count = array(); $c = 0; foreach ($message->parent->entities as $ent) { if ($ent->type0 == 'message' && $ent->type1 == 'rfc822') { $c++; $entity_count[$c] = $ent->entity_id; $entities[$ent->entity_id] = $c; } } if (isset($entities[$passed_ent_id]) && $entities[$passed_ent_id] > 1) { $prev_ent_id = $entity_count[$entities[$passed_ent_id] - 1]; $prev_href = set_url_var($PHP_SELF, 'passed_ent_id', $prev_ent_id); } if (isset($entities[$passed_ent_id]) && $entities[$passed_ent_id] < $c) { $next_ent_id = $entity_count[$entities[$passed_ent_id] + 1]; $next_href = set_url_var($PHP_SELF, 'passed_ent_id', $next_ent_id); } $par_ent_id = $message->parent->entity_id; if ($par_ent_id) { $par_ent_id = substr($par_ent_id, 0, -2); if ($par_ent_id != 0) { $up_href = set_url_var($PHP_SELF, 'passed_ent_id', $par_ent_id); } } $view_msg_href = $url; // Prev/Next links for regular messages } else { if (true) { //!(isset($where) && isset($what)) ) { $prev = findPreviousMessage($aMailbox['UIDSET'][$what], $passed_id); $next = findNextMessage($aMailbox['UIDSET'][$what], $passed_id); if ($prev >= 0) { $prev_href = $base_uri . 'src/read_body.php?passed_id=' . $prev . '&mailbox=' . $urlMailbox . '&sort=' . $sort . "&where={$where}&what={$what}" . '&startMessage=' . $startMessage . '&show_more=0'; } if ($next >= 0) { $next_href = $base_uri . 'src/read_body.php?passed_id=' . $next . '&mailbox=' . $urlMailbox . '&sort=' . $sort . "&where={$where}&what={$what}" . '&startMessage=' . $startMessage . '&show_more=0'; } // Only bother with Delete & Prev and Delete & Next IF // top display is enabled. if ($delete_prev_next_display == 1 && in_array('\\deleted', $aMailbox['PERMANENTFLAGS'], true)) { if ($prev >= 0) { $del_prev_href = $base_uri . 'src/read_body.php?passed_id=' . $prev . '&mailbox=' . $urlMailbox . '&sort=' . $sort . '&startMessage=' . $startMessage . '&show_more=0' . "&where={$where}&what={$what}" . '&delete_id=' . $passed_id . '&smtoken=' . sm_generate_security_token(); } if ($next >= 0) { $del_next_href = $base_uri . 'src/read_body.php?passed_id=' . $next . '&mailbox=' . $urlMailbox . '&sort=' . $sort . '&startMessage=' . $startMessage . '&show_more=0' . "&where={$where}&what={$what}" . '&delete_id=' . $passed_id . '&smtoken=' . sm_generate_security_token(); } } } } $msg_list_href = get_message_list_uri($aMailbox['NAME'], $startMessage, $what); if ($where == 'search.php') { $search_href = str_replace('read_body.php', 'search.php', $msg_list_href); } else { $search_href = ''; } $comp_uri = $base_uri . 'src/compose.php' . '?passed_id=' . $passed_id . '&mailbox=' . $urlMailbox . '&startMessage=' . $startMessage . (isset($passed_ent_id) ? '&passed_ent_id=' . $passed_ent_id : ''); // Start form for reply/reply all/forward.. $target = ''; $on_click = ''; $method = 'post'; $onsubmit = ''; if ($compose_new_win == '1') { if (!preg_match("/^[0-9]{3,4}\$/", $compose_width)) { $compose_width = '640'; } if (!preg_match("/^[0-9]{3,4}\$/", $compose_height)) { $compose_height = '550'; } if (checkForJavascript()) { $on_click = 'comp_in_new_form(\'' . $comp_uri . '\', this, this.form,' . $compose_width . ',' . $compose_height . ')'; $comp_uri = 'javascript:void(0)'; $method = 'get'; $onsubmit = 'return false'; } else { $target = '_blank'; } } $oTemplate->assign('nav_on_top', $nav_on_top); $oTemplate->assign('prev_href', $prev_href); $oTemplate->assign('up_href', $up_href); $oTemplate->assign('next_href', $next_href); $oTemplate->assign('del_prev_href', $del_prev_href); $oTemplate->assign('del_next_href', $del_next_href); $oTemplate->assign('view_msg_href', $view_msg_href); $oTemplate->assign('message_list_href', $msg_list_href); $oTemplate->assign('search_href', $search_href); $oTemplate->assign('form_extra', ''); $oTemplate->assign('form_method', $method); $oTemplate->assign('form_target', $target); $oTemplate->assign('form_onsubmit', $onsubmit); $oTemplate->assign('compose_href', $comp_uri); $oTemplate->assign('button_onclick', $on_click); $oTemplate->assign('forward_as_attachment_enabled', $enable_forward_as_attachment == 1); //FIXME: I am surprised these aren't already given to the template; probably needs to be given at a higher level, so I have NO IDEA if this is the right place to do this... adding them so template can construct its own API calls... we can build those herein too if preferrable $oTemplate->assign('mailbox', $aMailbox['NAME']); $oTemplate->assign('passed_id', $passed_id); $oTemplate->assign('what', $what); // If Draft folder - create Resume link $resume_draft = $edit_as_new = false; if (isDraftMailbox($mailbox) && $save_as_draft) { $resume_draft = true; } else { if (handleAsSent($mailbox)) { $edit_as_new = true; } } $oTemplate->assign('can_resume_draft', $resume_draft); $oTemplate->assign('can_edit_as_new', $edit_as_new); $oTemplate->assign('mailboxes', sqimap_mailbox_option_array($imapConnection)); if (in_array('\\deleted', $aMailbox['PERMANENTFLAGS'], true)) { $delete_url = $base_uri . "src/{$where}"; $oTemplate->assign('can_be_deleted', true); $oTemplate->assign('move_delete_form_action', $base_uri . 'src/' . $where); $oTemplate->assign('delete_form_extra', addHidden('mailbox', $aMailbox['NAME']) . "\n" . addHidden('msg[0]', $passed_id) . "\n" . addHidden('startMessage', $startMessage) . "\n"); if (!(isset($passed_ent_id) && $passed_ent_id)) { $oTemplate->assign('can_be_moved', true); $oTemplate->assign('move_form_extra', addHidden('mailbox', $aMailbox['NAME']) . "\n" . addHidden('msg[0]', $passed_id) . "\n"); $oTemplate->assign('last_move_target', isset($lastTargetMailbox) && !empty($lastTargetMailbox) ? $lastTargetMailbox : ''); $oTemplate->assign('can_be_copied', $show_copy_buttons == 1); } else { $oTemplate->assign('can_be_moved', false); $oTemplate->assign('move_form_extra', ''); $oTemplate->assign('last_move_target', ''); $oTemplate->assign('can_be_copied', false); } } else { $oTemplate->assign('can_be_deleted', false); $oTemplate->assign('move_delete_form_action', ''); $oTemplate->assign('delete_form_extra', ''); $oTemplate->assign('can_be_moved', false); $oTemplate->assign('move_form_extra', ''); $oTemplate->assign('last_move_target', ''); $oTemplate->assign('can_be_copied', false); } // access keys... only add to the top menubar, because adding // them twice makes them less functional (press access key, *then* // press <enter> to make it work) // if ($nav_on_top) { global $accesskey_read_msg_reply, $accesskey_read_msg_reply_all, $accesskey_read_msg_forward, $accesskey_read_msg_as_attach, $accesskey_read_msg_delete, $accesskey_read_msg_bypass_trash, $accesskey_read_msg_move, $accesskey_read_msg_move_to, $accesskey_read_msg_copy; } else { $accesskey_read_msg_reply = $accesskey_read_msg_reply_all = $accesskey_read_msg_forward = $accesskey_read_msg_as_attach = $accesskey_read_msg_delete = $accesskey_read_msg_bypass_trash = $accesskey_read_msg_move = $accesskey_read_msg_move_to = $accesskey_read_msg_copy = 'NONE'; } $oTemplate->assign('accesskey_read_msg_reply', $accesskey_read_msg_reply); $oTemplate->assign('accesskey_read_msg_reply_all', $accesskey_read_msg_reply_all); $oTemplate->assign('accesskey_read_msg_forward', $accesskey_read_msg_forward); $oTemplate->assign('accesskey_read_msg_as_attach', $accesskey_read_msg_as_attach); $oTemplate->assign('accesskey_read_msg_delete', $accesskey_read_msg_delete); $oTemplate->assign('accesskey_read_msg_bypass_trash', $accesskey_read_msg_bypass_trash); $oTemplate->assign('accesskey_read_msg_move_to', $accesskey_read_msg_move_to); $oTemplate->assign('accesskey_read_msg_move', $accesskey_read_msg_move); $oTemplate->assign('accesskey_read_msg_copy', $accesskey_read_msg_copy); global $null; do_hook('read_body_menu', $null); if ($nav_on_top) { $oTemplate->display('read_menubar_nav.tpl'); $oTemplate->display('read_menubar_buttons.tpl'); } else { $oTemplate->display('read_menubar_buttons.tpl'); $oTemplate->display('read_menubar_nav.tpl'); } }
/** * Format message toolbar * * @param string $mailbox Name of current mailbox * @param int $passed_id UID of current message * @param int $passed_ent_id Id of entity within message * @param object $message Current message object * @param object $mbx_response */ function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message, $removedVar, $nav_on_top = TRUE) { global $base_uri, $draft_folder, $where, $what, $color, $sort, $startMessage, $PHP_SELF, $save_as_draft, $enable_forward_as_attachment, $imapConnection, $lastTargetMailbox, $data_dir, $username, $delete_prev_next_display, $compose_new_win, $javascript_on; //FIXME cleanup argument list, use $aMailbox where possible $mailbox = $aMailbox['NAME']; $topbar_delimiter = ' | '; $double_delimiter = ' '; $urlMailbox = urlencode($mailbox); $msgs_url = $base_uri . 'src/'; // BEGIN NAV ROW - PREV/NEXT, DEL PREV/NEXT, LINKS TO INDEX, etc. $nav_row = '<tr><td align="left" colspan="2" style="border: 1px solid ' . $color[9] . ';"><small>'; // Create Prev & Next links // Handle nested entities first (i.e. Mime Attach parts) if (isset($passed_ent_id) && $passed_ent_id) { // code for navigating through attached message/rfc822 messages $url = set_url_var($PHP_SELF, 'passed_ent_id', 0); $entities = array(); $entity_count = array(); $c = 0; foreach ($message->parent->entities as $ent) { if ($ent->type0 == 'message' && $ent->type1 == 'rfc822') { $c++; $entity_count[$c] = $ent->entity_id; $entities[$ent->entity_id] = $c; } } $prev_link = _("Previous"); if ($entities[$passed_ent_id] > 1) { $prev_ent_id = $entity_count[$entities[$passed_ent_id] - 1]; $prev_link = '<a href="' . set_url_var($PHP_SELF, 'passed_ent_id', $prev_ent_id) . '">' . $prev_link . '</a>'; } $next_link = _("Next"); if ($entities[$passed_ent_id] < $c) { $next_ent_id = $entity_count[$entities[$passed_ent_id] + 1]; $next_link = '<a href="' . set_url_var($PHP_SELF, 'passed_ent_id', $next_ent_id) . '">' . $next_link . '</a>'; } $par_ent_id = $message->parent->entity_id; $up_link = ''; if ($par_ent_id) { $par_ent_id = substr($par_ent_id, 0, -2); if ($par_ent_id != 0) { $up_link = $topbar_delimiter; $url = set_url_var($PHP_SELF, 'passed_ent_id', $par_ent_id); $up_link .= '<a href="' . $url . '">' . _("Up") . '</a>'; } } $nav_row .= $prev_link . $up_link . $topbar_delimiter . $next_link; $nav_row .= $double_delimiter . '[<a href="' . $url . '">' . _("View Message") . '</a>]'; // Prev/Next links for regular messages } else { if (true) { //!(isset($where) && isset($what)) ) { /** * Check if cache is still valid */ if (!is_array($aMailbox['UIDSET'][$what])) { fetchMessageHeaders($imapConnection, $aMailbox); } $prev = findPreviousMessage($aMailbox['UIDSET'][$what], $passed_id); $next = findNextMessage($aMailbox['UIDSET'][$what], $passed_id); $prev_link = _("Previous"); if ($prev >= 0) { $uri = $base_uri . 'src/read_body.php?passed_id=' . $prev . '&mailbox=' . $urlMailbox . '&sort=' . $sort . "&where={$where}&what={$what}" . '&startMessage=' . $startMessage . '&show_more=0'; $prev_link = '<a href="' . $uri . '">' . $prev_link . '</a>'; } $next_link = _("Next"); if ($next >= 0) { $uri = $base_uri . 'src/read_body.php?passed_id=' . $next . '&mailbox=' . $urlMailbox . '&sort=' . $sort . "&where={$where}&what={$what}" . '&startMessage=' . $startMessage . '&show_more=0'; $next_link = '<a href="' . $uri . '">' . $next_link . '</a>'; } // Only bother with Delete & Prev and Delete & Next IF // top display is enabled. if ($delete_prev_next_display == 1 && in_array('\\deleted', $aMailbox['PERMANENTFLAGS'], true)) { $del_prev_link = _("Delete & Prev"); if ($prev >= 0) { $uri = $base_uri . 'src/read_body.php?passed_id=' . $prev . '&mailbox=' . $urlMailbox . '&sort=' . $sort . '&startMessage=' . $startMessage . '&show_more=0' . "&where={$where}&what={$what}" . '&delete_id=' . $passed_id; $del_prev_link = '<a href="' . $uri . '">' . $del_prev_link . '</a>'; } $del_next_link = _("Delete & Next"); if ($next >= 0) { $uri = $base_uri . 'src/read_body.php?passed_id=' . $next . '&mailbox=' . $urlMailbox . '&sort=' . $sort . '&startMessage=' . $startMessage . '&show_more=0' . "&where={$where}&what={$what}" . '&delete_id=' . $passed_id; $del_next_link = '<a href="' . $uri . '">' . $del_next_link . '</a>'; } } $nav_row .= '[' . $prev_link . $topbar_delimiter . $next_link . ']'; if (isset($del_prev_link) && isset($del_next_link)) { $nav_row .= $double_delimiter . '[' . $del_prev_link . $topbar_delimiter . $del_next_link . ']'; } } } // Start with Search Results or Message List link. $msgs_url .= "{$where}?where=read_body.php&what={$what}&mailbox=" . $urlMailbox . "&startMessage={$startMessage}"; if ($where == 'search.php') { $msgs_str = _("Search Results"); } else { $msgs_str = _("Message List"); } $nav_row .= $double_delimiter . '[<a href="' . $msgs_url . '">' . $msgs_str . '</a>]'; $nav_row .= '</small></td></tr>'; // BEGIN MENU ROW - DELETE/REPLY/FORWARD/MOVE/etc. $menu_row = '<tr bgcolor="' . $color[0] . '"><td><small>'; $comp_uri = $base_uri . 'src/compose.php' . '?passed_id=' . $passed_id . '&mailbox=' . $urlMailbox . '&startMessage=' . $startMessage . (isset($passed_ent_id) ? '&passed_ent_id=' . $passed_ent_id : ''); // Start form for reply/reply all/forward.. $target = ''; $on_click = ''; $method = 'method="post" '; if ($compose_new_win == '1') { if ($javascript_on) { $on_click = ' onclick="comp_in_new_form(\'' . $comp_uri . '\', this, this.form)"'; $comp_uri = 'javascript:void(0)'; $method = 'method="get" '; } else { $target = 'target="_blank"'; } } $menu_row .= "\n" . '<form name="composeForm" action="' . $comp_uri . '" ' . $method . $target . ' style="display: inline">' . "\n"; // If Draft folder - create Resume link if ($mailbox == $draft_folder && $save_as_draft) { $new_button = 'smaction_draft'; $comp_alt_string = _("Resume Draft"); } else { if (handleAsSent($mailbox)) { // If in Sent folder, edit as new $new_button = 'smaction_edit_new'; $comp_alt_string = _("Edit Message as New"); } } // Show Alt URI for Draft/Sent if (isset($comp_alt_string)) { $menu_row .= getButton('submit', $new_button, $comp_alt_string, $on_click) . "\n"; } $menu_row .= getButton('submit', 'smaction_reply', _("Reply"), $on_click) . "\n"; $menu_row .= getButton('submit', 'smaction_reply_all', _("Reply All"), $on_click) . "\n"; $menu_row .= getButton('submit', 'smaction_forward', _("Forward"), $on_click); if ($enable_forward_as_attachment) { $menu_row .= '<input type="checkbox" name="smaction_attache" />' . _("As Attachment") . ' ' . "\n"; } $menu_row .= '</form> '; if (in_array('\\deleted', $aMailbox['PERMANENTFLAGS'], true)) { // Form for deletion. Form is handled by the originating display in $where. This is right_main.php or search.php $delete_url = $base_uri . "src/{$where}"; $menu_row .= '<form name="deleteMessageForm" action="' . $delete_url . '" method="post" style="display: inline">'; if (!(isset($passed_ent_id) && $passed_ent_id)) { $menu_row .= addHidden('mailbox', $aMailbox['NAME']); $menu_row .= addHidden('msg[0]', $passed_id); $menu_row .= addHidden('startMessage', $startMessage); $menu_row .= getButton('submit', 'delete', _("Delete")); $menu_row .= '<input type="checkbox" name="bypass_trash" />' . _("Bypass Trash"); } else { $menu_row .= getButton('submit', 'delete', _("Delete"), '', FALSE) . "\n"; // delete button is disabled } $menu_row .= '</form>'; } // Add top move link $menu_row .= '</small></td><td align="right">'; if (!(isset($passed_ent_id) && $passed_ent_id) && in_array('\\deleted', $aMailbox['PERMANENTFLAGS'], true)) { $menu_row .= '<form name="moveMessageForm" action="' . $base_uri . 'src/' . $where . '?' . '" method="post" style="display: inline">' . '<small>' . addHidden('mailbox', $aMailbox['NAME']) . addHidden('msg[0]', $passed_id) . _("Move to:") . '<select name="targetMailbox" style="padding: 0px; margin: 0px">'; if (isset($lastTargetMailbox) && !empty($lastTargetMailbox)) { $menu_row .= sqimap_mailbox_option_list($imapConnection, array(strtolower($lastTargetMailbox))); } else { $menu_row .= sqimap_mailbox_option_list($imapConnection); } $menu_row .= '</select> '; $menu_row .= getButton('submit', 'moveButton', _("Move")) . "\n" . '</form>'; } $menu_row .= '</td></tr>'; // echo rows, with hooks $ret = do_hook_function('read_body_menu_top', array($nav_row, $menu_row)); if (is_array($ret)) { if (isset($ret[0]) && !empty($ret[0])) { $nav_row = $ret[0]; } if (isset($ret[1]) && !empty($ret[1])) { $menu_row = $ret[1]; } } echo '<table width="100%" cellpadding="3" cellspacing="0" align="center" border="0">'; echo $nav_on_top ? $nav_row . $menu_row : $menu_row . $nav_row; echo '</table>' . "\n"; do_hook('read_body_menu_bottom'); }