\n"
- . " \n"
- . " $paginator\n";
+ echo " | \n"
+ . html_tag( 'td', '', 'right', '', 'nowrap' );
+
+ if (!$auto_expunge) {
+ echo getButton('SUBMIT', 'expungeButton',_("Expunge"))
+ .' ' . _("mailbox") . "\n";
+ }
+
+ echo getButton('SUBMIT', 'markRead',_("Read"));
+ echo getButton('SUBMIT', 'markUnread',_("Unread"));
+ echo getButton('SUBMIT', 'delete',_("Delete")) ." \n";
+ if (!strpos($PHP_SELF,'mailbox')) {
+ $location = $PHP_SELF.'?mailbox=INBOX&startMessage=1';
+ } else {
+ $location = $PHP_SELF;
+ }
+ echo '';
+ echo "\n"
+ . " \n";
+
+ /* draws thread sorting links */
if ($allow_thread_sort == TRUE) {
if ($thread_sort_messages == 1 ) {
$set_thread = 2;
- $thread_name = 'Unthread View';
- } elseif ($thread_sort_messages == 0) {
+ $thread_name = _("Unthread View");
+ }
+ elseif ($thread_sort_messages == 0) {
$set_thread = 1;
- $thread_name = 'Thread View';
+ $thread_name = _("Thread View");
}
- echo '| ' . _("$thread_name")
- . ' ';
+ echo html_tag( 'tr' ,
+ html_tag( 'td' ,
+ ' ' . $thread_name
+ . ' '
+ , '', '', '' )
+ , '', '', '' );
}
- echo " $msg_cnt_str | \n"
- . " \n"
- . ' |
'
- . "\n"
- . "\n"
- . " \n"
- . " \n"
- . ' ' . _("Move Selected To:") . "\n"
- . " | \n"
- . " \n"
- . ' ' . _("Transform Selected Messages")
- . ": \n"
- . " | \n"
- . " \n"
- . " \n"
- . " \n"
- . ' | \n";
- $boxes = sqimap_mailbox_list($imapConnection);
- foreach ($boxes as $boxes_part) {
- if (!in_array('noselect', $boxes_part['flags'])) {
- $box = $boxes_part['unformatted'];
- $box2 = str_replace(' ', ' ', $boxes_part['unformatted-disp']);
- if( $box2 == 'INBOX' ) {
- $box2 = _("INBOX");
- }
- echo " \n";
+ echo " |
\n";
+
+ do_hook('mailbox_form_before');
+
+ echo ''
+ . html_tag( 'tr' )
+ . html_tag( 'td' ,'' , '', $color[0], '' );
+
+ /* if using server sort we highjack the
+ * the $sort var and use $server_sort_order
+ * instead. but here we reset sort for a bit
+ * since its easy
+ */
+ if ($allow_server_sort == TRUE) {
+ $sort = $server_sort_order;
}
- }
- echo ' '
- . '"
- . '"
- . "";
-
- /* Print the headers. */
- for ($i=1; $i <= count($index_order); $i++) {
- switch ($index_order[$i]) {
- case 1: /* checkbox */
- case 5: /* flags */
- echo ' | ';
- break;
- case 2: /* from */
- if (handleAsSent($mailbox)) {
- echo ' ' . _("To") . '';
- } else {
- echo ' | ' . _("From") . '';
- }
- if ($thread_sort_messages != 1) {
- ShowSortButton($sort, $mailbox, 2, 3);
- }
- echo " | \n";
- break;
- case 3: /* date */
- echo ' ' . _("Date") . '';
- if ($thread_sort_messages != 1) {
- ShowSortButton($sort, $mailbox, 0, 1);
- }
- echo " | \n";
- break;
- case 4: /* subject */
- echo ' ' . _("Subject") . ' ';
- if ($thread_sort_messages != 1) {
- ShowSortButton($sort, $mailbox, 4, 5);
- }
- echo " | \n";
- break;
- case 6: /* size */
- echo ' ' . _("Size") . " | \n";
- break;
+ /* End of message-list table */
+
+ do_hook('mailbox_index_after');
+ echo "\n";
+
+}
+
+function printHeader($mailbox, $sort, $color, $showsort=true) {
+ global $index_order;
+ echo html_tag( 'table' ,'' , '', $color[4], 'border="0" width="100%" cellpadding="1" cellspacing="0"' );
+ echo html_tag( 'tr' ,'' , 'center', $color[5] );
+ for ($i=1; $i <= count($index_order); $i++) {
+ switch ($index_order[$i]) {
+ case 1: /* checkbox */
+ case 5: /* flags */
+ echo html_tag( 'td' ,' ' , '', '', 'width="1%"' );
+ break;
+ case 2: /* from */
+ if (handleAsSent($mailbox)) {
+ echo html_tag( 'td' ,'' , 'left', '', 'width="25%"' )
+ . '' . _("To") . '';
+ } else {
+ echo html_tag( 'td' ,'' , 'left', '', 'width="25%"' )
+ . '' . _("From") . '';
+ }
+ if ($showsort) {
+ ShowSortButton($sort, $mailbox, 2, 3);
+ }
+ echo "\n";
+ break;
+ case 3: /* date */
+ echo html_tag( 'td' ,'' , 'left', '', 'width="5%" nowrap' )
+ . '' . _("Date") . '';
+ if ($showsort) {
+ ShowSortButton($sort, $mailbox, 0, 1);
+ }
+ echo "\n";
+ break;
+ case 4: /* subject */
+ echo html_tag( 'td' ,'' , 'left', '', '' )
+ . '' . _("Subject") . '';
+ if ($showsort) {
+ ShowSortButton($sort, $mailbox, 4, 5);
+ }
+ echo "\n";
+ break;
+ case 6: /* size */
+ echo html_tag( 'td', '' . _("Size") . '', 'center', '', 'width="5%"' );
+ break;
+ }
}
- }
- echo " \n";
+ echo "\n";
}
+
/*
* This function shows the sort button. Isn't this a good comment?
*/
-function ShowSortButton($sort, $mailbox, $Up, $Down) {
+function ShowSortButton($sort, $mailbox, $Up, $Down ) {
+ global $PHP_SELF;
/* Figure out which image we want to use. */
if ($sort != $Up && $sort != $Down) {
$img = 'sort_none.png';
@@ -711,11 +861,17 @@ function ShowSortButton($sort, $mailbox, $Up, $Down) {
$which = 6;
}
+ if (preg_match('/^(.+)\?.+$/',$PHP_SELF,$regs)) {
+ $source_url = $regs[1];
+ } else {
+ $source_url = $PHP_SELF;
+ }
+
/* Now that we have everything figured out, show the actual button. */
- echo ' ';
+ . '" BORDER=0 WIDTH=12 HEIGHT=10 ALT="sort">';
}
function get_selectall_link($start_msg, $sort) {
@@ -757,10 +913,6 @@ function get_selectall_link($start_msg, $sort) {
. '&what=' . urlencode($what);
}
- if ($PG_SHOWNUM == 999999) {
- $result .= '&PG_SHOWNUM=999999';
- }
-
$result .= "\">";
if (isset($checkall) && ($checkall == '1')) {
@@ -790,7 +942,6 @@ function get_msgcnt_str($start_msg, $end_msg, $num_msgs) {
} else {
$result = ' ';
}
-
/* Return our result string. */
return ($result);
}
@@ -799,10 +950,24 @@ function get_msgcnt_str($start_msg, $end_msg, $num_msgs) {
* Generate a paginator link.
*/
function get_paginator_link($box, $start_msg, $use, $text) {
+ global $PHP_SELF;
+
$result = "$text";
return ($result);
+/*
+ if (preg_match('/^(.+)\?.+$/',$PHP_SELF,$regs)) {
+ $source_url = $regs[1];
+ } else {
+ $source_url = $PHP_SELF;
+ }
+
+ $result = '$text";
+ return ($result);
+*/
}
/*
@@ -819,6 +984,8 @@ function get_paginator_str($box, $start_msg, $end_msg, $num_msgs,
$all_str = '';
$tgl_str = '';
+ $box = urlencode($box);
+
/* Create simple strings that will be creating the paginator. */
$spc = ' '; /* This will be used as a space. */
$sep = '|'; /* This will be used as a seperator. */
@@ -968,14 +1135,14 @@ function get_paginator_str($box, $start_msg, $end_msg, $num_msgs,
}
}
} else if ($PG_SHOWNUM == 999999) {
- $pg_str = ""
- . _("Paginate") . '' . $spc;
+ $pg_str = "" ._("Paginate") . '' . $spc;
}
/* If necessary, compute the 'show all' string. */
if (($prv_str != '') || ($nxt_str != '')) {
- $all_str = "" . _("Show All") . '';
}
@@ -1005,6 +1172,7 @@ function get_paginator_str($box, $start_msg, $end_msg, $num_msgs,
}
function processSubject($subject) {
+ global $languages, $squirrelmail_language;
/* Shouldn't ever happen -- caught too many times in the IMAP functions */
if ($subject == '')
return _("(no subject)");
@@ -1032,9 +1200,64 @@ function processSubject($subject) {
return $subject;
}
+ if (isset($languages[$squirrelmail_language]['XTRA_CODE']) &&
+ function_exists($languages[$squirrelmail_language]['XTRA_CODE'])) {
+ return $languages[$squirrelmail_language]['XTRA_CODE']('strimwidth', $subject, $trim_val);
+ }
+
return substr($subject, 0, $trim_val) . '...';
}
+function getMbxList($imapConnection) {
+ global $lastTargetMailbox;
+ echo ' ';
+}
+
+function getButton($type, $name, $value) {
+return '';
+}
+
+function getSmallStringCell($string, $align) {
+ return html_tag( 'td',
+ '' . $string . ': ',
+ $align,
+ '',
+ 'nowrap' );
+}
+
+function getEndMessage($start_msg, $show_num, $num_msgs) {
+ if ($start_msg + ($show_num - 1) < $num_msgs){
+ $end_msg = $start_msg + ($show_num - 1);
+ } else {
+ $end_msg = $num_msgs;
+ }
+
+ if ($end_msg < $start_msg) {
+ $start_msg = $start_msg - $show_num;
+ if ($start_msg < 1) {
+ $start_msg = 1;
+ }
+ }
+ return (array($start_msg,$end_msg));
+}
+
function handleAsSent($mailbox) {
global $sent_folder, $draft_folder, $handleAsSent_result;
|