Add radio button group widget type SMOPT_TYPE_STRLIST_RADIO
[squirrelmail.git] / src / search.php
index 1606105d3caeeee5185daea19c3618e392659fe5..20e624a2a2aaca9b24cb58923c022060b8207705 100644 (file)
@@ -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.
  */
@@ -890,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);
 }
 
 /**
@@ -1613,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');
                     }
@@ -1634,4 +1645,3 @@ sqimap_logout($imapConnection);
 
 $oTemplate->display('footer.tpl');
 sqsession_register($mailbox_cache,'mailbox_cache');
-?>