X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Foptions_highlight.php;h=fe5b24dba7fadc7b656e2ae82674af956fb3ea06;hb=c3ccfa1912b4ca47279d259bb587ceb293ce5d83;hp=6e12c60dec40c1b2ef1dd2f0543f9e71a19f9767;hpb=89465360c61675e2fa88b719f9178f11d7476eef;p=squirrelmail.git diff --git a/src/options_highlight.php b/src/options_highlight.php index 6e12c60d..fe5b24db 100644 --- a/src/options_highlight.php +++ b/src/options_highlight.php @@ -3,7 +3,7 @@ /** * options_highlight.php * - * Copyright (c) 1999-2002 The SquirrelMail Project Team + * Copyright (c) 1999-2003 The SquirrelMail Project Team * Licensed under the GNU GPL. For full terms see the file COPYING. * * Displays message highlighting options @@ -64,13 +64,34 @@ if (! isset($message_highlight_list)) { $message_highlight_list = array(); } -if ($action == 'delete' && isset($theid)) { - +if (isset($theid) && ($action == 'delete') || + ($action == 'up') || + ($action == 'down')) { $new_rules = array(); - foreach($message_highlight_list as $rid => $rule) { - if($rid != $theid) { - $new_rules[] = $rule; - } + switch($action) { + case('delete'): + foreach($message_highlight_list as $rid => $rule) { + if($rid != $theid) { + $new_rules[] = $rule; + } + } + break; + case('down'): + $theid++; + case('up'): + foreach($message_highlight_list as $rid => $rule) { + if($rid == $theid) { + $temp_rule = $new_rules[$rid-1]; + $new_rules[$rid-1] = $rule; + $new_rules[$rid] = $temp_rule; + } else { + $new_rules[$rid] = $rule; + } + } + break; + default: + $new_rules = $message_highlight_list; + break; } $message_highlight_list = $new_rules; @@ -108,16 +129,17 @@ html_tag( 'table', "\n" . html_tag( 'tr', "\n" . html_tag( 'td', '
' . _("Options") . ' - ' . _("Message Highlighting") . '
', 'left') ), - 'center', $color[9], 'width="95% border="0" cellpadding="1" cellspacing="0"' ) . "
\n" . -html_tag( 'table', '', '', '', 'width="100% border="0" cellpadding="1" cellspacing="0"' ) . + 'center', $color[9], 'width="95%" border="0" cellpadding="1" cellspacing="0"' ) . "
\n" . +html_tag( 'table', '', '', '', 'width="100%" border="0" cellpadding="1" cellspacing="0"' ) . html_tag( 'tr' ) . "\n" . html_tag( 'td', '', 'left' ); echo '
[' . _("New") . ']'. ' - ['._("Done").']

'."\n"; -if (count($message_highlight_list) >= 1) { - echo html_tag( 'table', '', 'center', '', 'width="80% border="0" cellpadding="3" cellspacing="0"' ) . "\n"; - for ($i=0; $i < count($message_highlight_list); $i++) { +$mhl_count = count($message_highlight_list); +if ($mhl_count > 0) { + echo html_tag( 'table', '', 'center', '', 'width="80%" border="0" cellpadding="3" cellspacing="0"' ) . "\n"; + for ($i=0; $i < $mhl_count; $i++) { $match_type = ''; switch ($message_highlight_list[$i]['match_type'] ) { case 'from' : @@ -137,12 +159,21 @@ if (count($message_highlight_list) >= 1) { break; } + $links = '[' . + _("Edit") . + '] [' . + _("Delete"); + if($i > 0) { + $links .= '] [' . _("Up"); + } + if($i+1 < $mhl_count) { + $links .= '] [' . _("Down"); + } + $links .= ']'; + echo html_tag( 'tr', html_tag( 'td', - '[' . - _("Edit") . - '] [' . _("Delete") . ']' , + $links, 'left', $color[4], 'width="20%" nowrap' ) . html_tag( 'td', htmlspecialchars($message_highlight_list[$i]['name']) , @@ -436,4 +467,4 @@ if ($action == 'edit' || $action == 'add') { } do_hook('options_highlight_bottom'); ?> - +