X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fsearch.php;h=20e624a2a2aaca9b24cb58923c022060b8207705;hb=5d26624e53d0eae77a3cd630afc5b58d4bc8a1ba;hp=1df52ae0ac576b141ce5931d649a2afb417a6e3c;hpb=475bfbc017bcb0fbd4cec5bdde3debff1e58a747;p=squirrelmail.git diff --git a/src/search.php b/src/search.php index 1df52ae0..20e624a2 100644 --- a/src/search.php +++ b/src/search.php @@ -8,7 +8,7 @@ * Subfolder search idea from Patch #806075 by Thomas Pohl xraven at users.sourceforge.net. Thanks Thomas! * * @author Alex Lemaresquier - Brainstorm - * @copyright © 1999-2006 The SquirrelMail Project Team + * @copyright © 1999-2007 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package squirrelmail @@ -17,6 +17,9 @@ * @todo explain why references are used in function calls */ +/** This is the search page */ +define('PAGE_NAME', 'search'); + /** * Include the SquirrelMail initialization file. */ @@ -28,7 +31,7 @@ require_once(SM_PATH . 'functions/imap_asearch.php'); require_once(SM_PATH . 'functions/imap_messages.php'); require_once(SM_PATH . 'functions/imap_general.php'); require_once(SM_PATH . 'functions/mime.php'); -require_once(SM_PATH . 'functions/mailbox_display.php'); //getButton() +require_once(SM_PATH . 'functions/mailbox_display.php'); //sqm_api_mailbox_select require_once(SM_PATH . 'functions/forms.php'); require_once(SM_PATH . 'functions/date.php'); require_once(SM_PATH . 'functions/compose.php'); @@ -622,26 +625,6 @@ function asearch_get_query_display(&$color, &$mailbox_array, &$biop_array, &$uno return $query_display; } -/** - * Creates button - * - * @deprecated see form functions available in 1.5.1 and 1.4.3. - * @param string $type - * @param string $name - * @param string $value - * @param string $js - * @param bool $enabled - */ -function getButton($type, $name, $value, $js = '', $enabled = TRUE) { - $disabled = ( $enabled ? '' : 'disabled ' ); - $js = ( $js ? $js.' ' : '' ); - return ''; -} - /** * Print a whole query array, recent or saved * @@ -910,8 +893,14 @@ function sqimap_asearch_get_selectable_unformatted_mailboxes(&$boxes) /* get globals we will need */ sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION); -if ( sqgetGlobalVar('checkall', $temp, SQ_GET) ) { - $checkall = (int) $temp; +if (!sqgetGlobalVar('checkall',$checkall,SQ_GET)) { + $checkall = false; +} + +if (!sqgetGlobalVar('preselected', $preselected, SQ_GET) || !is_array($preselected)) { + $preselected = array(); +} else { + $preselected = array_keys($preselected); } /** @@ -1332,7 +1321,7 @@ $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, $boxes = sqimap_mailbox_list($imapConnection); /* ensure we have a valid default mailbox name */ $mailbox = asearch_nz($mailbox_array[0]); -if (($mailbox == '') || ($mailbox == 'None')) //Workaround for sm quirk IMHO (what if I really have a mailbox called None?) +if ($mailbox == '') $mailbox = $boxes[0]['unformatted']; //Usually INBOX ;) @@ -1633,6 +1622,8 @@ if ($submit == $search_button_text) { $oTemplate->assign('alt_index_colors', isset($alt_index_colors) ? $alt_index_colors: false); $oTemplate->assign('color', $color); $oTemplate->assign('align', $align); + $oTemplate->assign('checkall', $checkall); + $oTemplate->assign('preselected', $preselected); $oTemplate->display('message_list.tpl'); } @@ -1654,4 +1645,3 @@ sqimap_logout($imapConnection); $oTemplate->display('footer.tpl'); sqsession_register($mailbox_cache,'mailbox_cache'); -?>