function logout_error( $errString, $errTitle = '' ) {
GLOBAL $frame_top, $org_logo, $org_name, $org_logo_width, $org_logo_height,
- $hide_sm_attributions, $version, $DOCUMENT_ROOT;
+ $hide_sm_attributions, $version, $DOCUMENT_ROOT,
+ $squirrelmail_language;
$base_uri = sqm_baseuri();
include_once($DOCUMENT_ROOT . $base_uri . 'functions/page_header.php' );
if ( !isset( $org_logo ) ) {
} else {
echo ' <TD WIDTH="25%"><B>' . _("From") . '</B>';
}
- if ($thread_sort_messages != 1) {
+ if ($allow_thread_sort != 'true' || $thread_sort_messages != 1) {
ShowSortButton($sort, $mailbox, 2, 3);
}
echo "</TD>\n";
break;
case 3: /* date */
echo ' <TD NOWRAP WIDTH="5%"><B>' . _("Date") . '</B>';
- if ($thread_sort_messages != 1) {
+ if ($allow_thread_sort != 'true' || $thread_sort_messages != 1) {
ShowSortButton($sort, $mailbox, 0, 1);
}
echo "</TD>\n";
break;
case 4: /* subject */
echo ' <TD><B>' . _("Subject") . '</B> ';
- if ($thread_sort_messages != 1) {
+ if ($allow_thread_sort != 'true' || $thread_sort_messages != 1) {
ShowSortButton($sort, $mailbox, 4, 5);
}
echo "</TD>\n";
. '&what=' . urlencode($what);
}
- if ($PG_SHOWNUM == 999999) {
- $result .= '&PG_SHOWNUM=999999';
- }
-
$result .= "\">";
if (isset($checkall) && ($checkall == '1')) {
}
}
} else if ($PG_SHOWNUM == 999999) {
- $pg_str = "<A HREF=\"right_main.php?use_mailbox_cache=$use"
- . "&startMessage=1&mailbox=$box\" TARGET=\"right\">"
- . _("Paginate") . '</A>' . $spc;
+ $pg_str = "<A HREF=\"right_main.php?PG_SHOWALL=0"
+ . "&use_mailbox_cache=$use&startMessage=1&mailbox=$box\" "
+ . "TARGET=\"right\">" ._("Paginate") . '</A>' . $spc;
}
/* If necessary, compute the 'show all' string. */
if (($prv_str != '') || ($nxt_str != '')) {
- $all_str = "<A HREF=\"right_main.php?PG_SHOWNUM=999999"
+ $all_str = "<A HREF=\"right_main.php?PG_SHOWALL=1"
. "&use_mailbox_cache=$use&startMessage=1&mailbox=$box\" "
. "TARGET=\"right\">" . _("Show All") . '</A>';
}
if ($unseen > 0) { $line .= '<B>'; }
/* Crate the link for this folder. */
- $line .= "<A HREF=\"right_main.php?sort=0&startMessage=1&mailbox=$mailboxURL\" TARGET=\"right\" STYLE=\"text-decoration:none\">";
+ $line .= "<A HREF=\"right_main.php?PG_SHOWALL=0&sort=0&startMessage=1&mailbox=$mailboxURL\" TARGET=\"right\" STYLE=\"text-decoration:none\">";
if ($special_color) {
$line .= "<FONT COLOR=\"$color[11]\">";
}
'type' => SMOPT_TYPE_BOOLEAN,
'refresh' => SMOPT_REFRESH_ALL
);
- if ($allow_thread_sort == 'TRUE') {
+ if ($allow_thread_sort == 'true') {
$optvals[SMOPT_GRP_MESSAGE][] = array(
'name' => 'sort_by_ref',
'caption' => _("Use References header for thread sort"),
*/
function findNextMessage() {
global $msort, $currentArrayIndex, $msgs, $sort,
- $allow_thread_sort, $allow_server_sort,
+ $thread_sort_messages, $allow_server_sort,
$server_sort_array;
$result = -1;
- if ($allow_thread_sort == true || $allow_server_sort == true) {
+ if ($thread_sort_messages == 1 || $allow_server_sort == 'true') {
reset($server_sort_array);
while(list($key, $value) = each ($server_sort_array)) {
if ($currentArrayIndex == $value) {
}
}
}
- elseif ($sort == 6 && $allow_server_sort != true &&
- $allow_thread_sort != true) {
+ elseif ($sort == 6 && $allow_server_sort != 'true' &&
+ $thread_sort_messages != 1) {
if ($currentArrayIndex != 1) {
$result = $currentArrayIndex - 1;
}
}
- elseif ($allow_server_sort != true && $allow_thread_sort != true) {
+ elseif ($allow_server_sort != 'true' && $thread_sort_messages != 1 ) {
if (!is_array($msort)) {
return -1;
}
/** returns the index of the previous message from the array. */
function findPreviousMessage() {
global $msort, $currentArrayIndex, $sort, $msgs, $imapConnection,
- $mailbox, $data_dir, $username, $allow_thread_sort,
+ $mailbox, $data_dir, $username, $thread_sort_messages,
$allow_server_sort, $server_sort_array;
$result = -1;
- if ($allow_thread_sort == true || $allow_server_sort == TRUE) {
+ if ($thread_sort_messages == 1 || $allow_server_sort == 'true') {
reset($server_sort_array);
while(list($key, $value) = each ($server_sort_array)) {
if ($currentArrayIndex == $value) {
}
}
}
- elseif ($sort == 6 && $allow_server_sort != TRUE &&
- $allow_thread_sort != true) {
+ elseif ($sort == 6 && $allow_server_sort != 'true' &&
+ $thread_sort_messages != 1) {
$numMessages = sqimap_get_num_messages($imapConnection, $mailbox);
if ($currentArrayIndex != $numMessages) {
$result = $currentArrayIndex + 1;
}
}
- elseif ($allow_thread_sort != true && $allow_server_sort != TRUE) {
+ elseif ($thread_sort_messages != 1 && $allow_server_sort != 'true') {
if (!is_array($msort)) {
return -1;
}
$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
-if( isset( $PG_SHOWNUM ) ) {
+global $PG_SHOWNUM;
+if (isset($PG_SHOWALL)) {
+ if ($PG_SHOWALL) {
+ $PG_SHOWNUM=999999;
+ $show_num=$PG_SHOWNUM;
+ session_register('PG_SHOWNUM');
+ }
+ else {
+ session_unregister('PG_SHOWNUM');
+ unset($PG_SHOWNUM);
+ }
+}
+else if( isset( $PG_SHOWNUM ) ) {
$show_num = $PG_SHOWNUM;
}
/* decide if we are thread sorting or not */
global $allow_thread_sort;
-if ($allow_thread_sort == TRUE) {
+if ($allow_thread_sort == 'true') {
if (isset($set_thread)) {
if ($set_thread == 1) {
setPref($data_dir, $username, "thread_$mailbox", 1);