X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Fdelete_move_next%2Fsetup.php;h=fdaf954bfe506b0e1fe1041f7ce3258eef7306b2;hp=f73b5d22b5eea42b657f2cbc189eaa7091a2d0b1;hb=7af2f95f1eae98ebd964b197e8601a6fad7a63fe;hpb=4366bea4d3f56fc017f649e1abcb0e7b761e0c9b diff --git a/plugins/delete_move_next/setup.php b/plugins/delete_move_next/setup.php index f73b5d22..fdaf954b 100644 --- a/plugins/delete_move_next/setup.php +++ b/plugins/delete_move_next/setup.php @@ -26,6 +26,22 @@ function squirrelmail_plugin_init_delete_move_next() { } +/* fixes the sort_array for the prev_del/next_del links when + * using server side sorting or thread sorting + */ + +function fix_sort_array () { + global $username, $data_dir, $allow_server_sort, $allow_thread_sort, + $mailbox, $imapConnection, $sort; + if ($allow_server_sort == true) { + $server_sort_array = sqimap_get_sort_order($imapConnection, $sort); + } + $thread_sort_messages = getPref($username, $data_dir, "thread_$mailbox"); + if ($allow_thread_sort == true && $thread_sort_messages == 1) { + $server_sort_array = get_thread_sort($imapConnection); + } +} + /* * Warning: this function relies on the internal representation of * of the message cache for the current mailbox. As such, it is fragile @@ -34,6 +50,7 @@ function squirrelmail_plugin_init_delete_move_next() { * perhaps even as inline code to sqimap_mailbox_expunge(). In the * meantime, you have been warned. [alane@geeksrus.net 2001/05/06] */ + function delete_move_del_arr_elem($arr, $index) { $tmp = array(); $lim = count($arr); @@ -91,8 +108,10 @@ function delete_move_next_action() { if ($delete_id) { delete_move_next_delete(); + fix_sort_array(); } elseif ($move_id) { delete_move_next_move(); + fix_sort_array(); } } @@ -123,7 +142,6 @@ function delete_move_next_read($currloc) { $imapConnection, $auto_expunge, $move_to_trash; if (!(($where && $what) || ($currentArrayIndex == -1))) { - $next = findNextMessage(); $prev = findPreviousMessage(); $prev_if_del = $prev; @@ -137,30 +155,32 @@ function delete_move_next_read($currloc) { } } - $location = get_location(); - echo "" . - ''. - ''. - "'. - "'. - '' . - ''; + ''; } function delete_move_next_moveRightMainForm() { @@ -235,10 +255,10 @@ function delete_move_next_moveRightMainForm() { $urlMailbox, $sort, $startMessage, $delete_id, $move_id, $imapConnection; - echo '' . - '' . - "'. - '' . - ''; + ''; } @@ -282,32 +302,33 @@ function delete_move_next_display_inside() { $delete_move_next_t, $delete_move_next_formATtop, $delete_move_next_b, $delete_move_next_formATbottom; - echo "\n". - "\n"; } @@ -357,4 +378,4 @@ function delete_move_next_loading_prefs() { } -?> \ No newline at end of file +?>
"; + /* Base is illegal within documents + * $location = get_location(); + * echo "" . */ + echo html_tag( 'table', '', '', '', 'cellspacing="0" width="100%" border="0" cellpadding="2"' ) . + html_tag( 'tr' ) . + html_tag( 'td', '', 'center', $color[9], 'width="100%"' ) . + ''; if ($prev > 0) { - echo "" . _("Previous") . " | "; + echo "" . _("Previous") . " | \n"; } else { echo _("Previous") . " | "; } if ($next > 0) { - echo "" . _("Next") . " | "; + echo "" . _("Next") . " | \n"; } else { echo _("Next") . " | "; } if ($prev > 0){ - echo "" . _("Delete & Prev") . "" . " | "; + echo "" . _("Delete & Prev") . "" . " | \n"; } else { echo _("Delete & Prev") . " | "; } if ($next > 0){ - echo "" . _("Delete & Next") . ""; + echo "" . _("Delete & Next") . "\n"; } else { echo _("Delete & Next"); } @@ -209,11 +229,11 @@ function delete_move_next_moveNextForm($next) { $urlMailbox, $sort, $startMessage, $delete_id, $move_id, $imapConnection; - echo '
'. - '
". + echo html_tag( 'tr' ) . + html_tag( 'td', '', 'center', $color[9], 'width="100%"' ) . + ''. "". - "". + "". "". "". "". @@ -224,9 +244,9 @@ function delete_move_next_moveNextForm($next) { echo ' '. ''. ''. + ''. '
". - "". + echo html_tag( 'tr' ) . + html_tag( 'td', '', 'center', $color[9], 'width="100%"' ) . + '' . + "". "". "". "". @@ -248,9 +268,9 @@ function delete_move_next_moveRightMainForm() { echo ' ' . ''. ''. + '' . '
\n". - _("delete_move_next:") . " <- ' . _("display at top"). + echo '> ' . _("Display at top"). " <- ' . _("with move option") . '
'; + echo '> ' . _("with move option") . '
'; echo ' <- ' . _("display at bottom") . + echo '> ' . _("Display at bottom") . ' <- ' . _("with move option") . '
'. + echo '> ' . _("with move option") . '
'. "