/src/search.php

Description

search.php

IMAP search page

Subfolder search idea from Patch #806075 by Thomas Pohl xraven at users.sourceforge.net. Thanks Thomas!

Includes
require ('../include/init.php') (line 23)

Include the SquirrelMail initialization file.

require_once (SM_PATH.'functions/date.php') (line 33)
require_once (SM_PATH.'functions/forms.php') (line 32)
require_once (SM_PATH.'functions/imap_asearch.php') (line 27)

SquirrelMail required files.

require_once (SM_PATH.'functions/mime.php') (line 30)
Constants
ASEARCH_BIOP = 4 (line 41)
ASEARCH_CRITERIA = 'criteria' (line 48)

Name of session var

ASEARCH_EXCLUDE = 5 (line 42)
ASEARCH_MAILBOX = 1 (line 38)
ASEARCH_MAX = 7 (line 44)
ASEARCH_SUB = 6 (line 43)
ASEARCH_UNOP = 3 (line 40)
ASEARCH_WHAT = 2 (line 39)
ASEARCH_WHERE = 0 (line 37)

Prefs array ordinals. Must match $recent_prefkeys and $saved_prefkeys

Variables
array $biop_array (line 1033)

Binary operators

array $exclude_array (line 1075)

Whether to exclude this criteria from search

array $mailbox_array (line 1002)

Searched mailboxes

array $recent_prefkeys (line 963)

Set recent prefkeys according to $search_advanced

array $saved_prefkeys (line 968)

Set saved prefkeys according to $search_advanced

integer $search_advanced (line 955)

If 1, show advanced search interface

Default from allow_advanced_search pref

integer $search_memory (line 934)

Maximum number of recent searches to handle

Default 0

bool $search_silent (line 1152)

If TRUE, do not show search interface

Default FALSE

string $submit (line 995)

How we did enter the form

  • unset : Enter key, or called from outside (eg read_body)
  • $search_button_text : Search button
  • 'Search_no_update' : Search but don't update recent
  • 'Search_last' : Same as no_update but reload and search last
  • 'Search_silent' : Same as no_update but only display results
  • $add_criteria_button_text : Add New Criteria button
  • $del_excluded_button_text : Remove Excluded Criteria button
  • $del_all_button_text : Remove All Criteria button
  • 'save_recent'
  • 'search_recent'
  • 'forget_recent'
  • 'edit_saved'
  • 'search_saved'
  • 'delete_saved'

array $sub_array (line 1083)

Search within subfolders

array $unop_array (line 1043)

Unary operators

array $what_array (line 1064)

What to search

array $where_array (line 1053)

Where to search

Functions
asearch_check_query (line 168)

Sanity checks, done before running the imap command and before calling push_recent

  • return: error message or empty string
  • private:
  • since: 1.5.0
string asearch_check_query ( &$where_array,  &$what_array,  &$exclude_array, array $where_array, array $what_array, array $exclude_array)
  • array $where_array: search location data
  • array $what_array: search criteria data
  • array $exclude_array: excluded criteria data
  • &$where_array
  • &$what_array
  • &$exclude_array
asearch_delete_saved (line 518)

Delete a saved search from the prefs

Function arguments are different in 1.5.0

  • private:
  • since: 1.5.0
void asearch_delete_saved (integer $saved_index)
  • integer $saved_index
asearch_edit_last (line 441)

Get last search criteria from session or prefs

Function arguments are different in 1.5.0 FIXME, try to avoid globals

  • private:
  • since: 1.5.0
void asearch_edit_last (mixed $index)
  • mixed $index
asearch_edit_recent (line 415)

Edit a recent search

Function arguments are different in 1.5.0

  • global: array $recent_prefkeys: mailbox_array searched mailboxes
  • private:
  • since: 1.5.0
void asearch_edit_recent (mixed $index)
  • mixed $index
asearch_edit_saved (line 470)

Edit a saved search

Function arguments are different in 1.5.0

  • private:
  • since: 1.5.0
void asearch_edit_saved (mixed $index)
  • mixed $index
asearch_find_recent (line 332)

Find a recent search in the prefs (used to avoid saving duplicates)

  • private:
  • since: 1.5.0
integer asearch_find_recent ( &$recent_array,  &$mailbox_array,  &$biop_array,  &$unop_array,  &$where_array,  &$what_array,  &$exclude_array,  &$sub_array, array $recent_array, array $mailbox_array, array $biop_array, array $unop_array, array $where_array, array $what_array, array $exclude_array, array $sub_array)
  • array $recent_array
  • array $mailbox_array
  • array $biop_array
  • array $unop_array
  • array $where_array
  • array $what_array
  • array $exclude_array
  • array $sub_array
  • &$recent_array
  • &$mailbox_array
  • &$biop_array
  • &$unop_array
  • &$where_array
  • &$what_array
  • &$exclude_array
  • &$sub_array
asearch_forget_recent (line 307)

Remove a recent search from prefs

Function arguments are different in 1.5.0

  • private:
  • since: 1.5.0
void asearch_forget_recent (integer $forget_index)
  • integer $forget_index: removed search number
asearch_getPref (line 120)

Gets user's advanced search preferences

Arguments are different in 1.5.0.

  • return: pref value
  • private:
  • since: 1.5.0
string asearch_getPref ( &$key, integer $index, [string $default = ''], string $key)
  • string $key: the pref key
  • integer $index: the pref key index
  • string $default: default value
  • &$key
asearch_get_date_display (line 537)

Translate the input date to imap date to local date display,

so the user can know if the date is wrong or illegal

  • return: locally formatted date or error text
  • private:
  • since: 1.5.0
string asearch_get_date_display ( &$what, string $what)
  • string $what: date string
  • &$what
asearch_get_mailbox_display (line 71)
  • return: mailbox name ready to display (utf7 decoded or localized 'All Folders')
  • private:
  • since: 1.5.0
string asearch_get_mailbox_display (string $mailbox)
  • string $mailbox: mailbox name or special case 'All Folders'
asearch_get_query_display (line 563)

Translate the query to rough natural display

  • return: rough natural query ready to display
  • private:
  • since: 1.5.0
string asearch_get_query_display ( &$color,  &$mailbox_array,  &$biop_array,  &$unop_array,  &$where_array,  &$what_array,  &$exclude_array,  &$sub_array, array $color, array $mailbox_array, array $biop_array, array $unop_array, array $where_array, array $what_array, array $exclude_array, array $sub_array)
  • array $color
  • array $mailbox_array
  • array $biop_array
  • array $unop_array
  • array $where_array
  • array $what_array
  • array $exclude_array
  • array $sub_array
  • &$color
  • &$mailbox_array
  • &$biop_array
  • &$unop_array
  • &$where_array
  • &$what_array
  • &$exclude_array
  • &$sub_array
asearch_mailbox_exists (line 755)

Verify that a mailbox exists

  • return: mailbox exists
  • private:
  • since: 1.5.0
  • deprecated: FIXME use standard functions
bool asearch_mailbox_exists (string $mailbox,  &$boxes, array $boxes)
  • string $mailbox
  • array $boxes
  • &$boxes
asearch_print_form (line 777)

Print the advanced search form

  • private:
  • since: 1.5.0
void asearch_print_form (stream $imapConnection,  &$boxes, array $mailbox_array, array $biop_array, array $unop_array, array $where_array, array $what_array, array $exclude_array, array $sub_array, array $boxes)
  • stream $imapConnection
  • array $boxes
  • array $mailbox_array
  • array $biop_array
  • array $unop_array
  • array $where_array
  • array $what_array
  • array $exclude_array
  • array $sub_array
  • &$boxes
asearch_print_form_basic (line 843)

Print the basic search form

  • private:
  • since: 1.5.1
void asearch_print_form_basic (stream $imapConnection,  &$boxes, array $mailbox_array, array $biop_array, array $unop_array, array $where_array, array $what_array, array $exclude_array, array $sub_array, array $boxes)
  • stream $imapConnection
  • array $boxes
  • array $mailbox_array
  • array $biop_array
  • array $unop_array
  • array $where_array
  • array $what_array
  • array $exclude_array
  • array $sub_array
  • &$boxes
asearch_print_query_array (line 657)

Print a whole query array, recent or saved

Function arguments are different in 1.5.0

  • private:
  • since: 1.5.0
void asearch_print_query_array ( &$boxes,  &$query_array,  &$query_keys,  &$action_array, mixed $title, string $show_pref, array $boxes, array $query_array, mixed $query_keys, array $action_array)
  • array $boxes: (unused)
  • array $query_array
  • mixed $query_keys
  • array $action_array
  • mixed $title
  • string $show_pref
  • &$boxes
  • &$query_array
  • &$query_keys
  • &$action_array
asearch_print_recent (line 733)

Print the recent array

Function arguments are different in 1.5.0

  • private:
  • since: 1.5.0
void asearch_print_recent ( &$boxes, array $boxes)
  • array $boxes: (unused, see asearch_print_query_array())
  • &$boxes
asearch_print_saved (line 711)

Print the saved array

Function arguments are different in 1.5.0

  • private:
  • since: 1.5.0
void asearch_print_saved ( &$boxes, array $boxes)
  • array $boxes: (unused, see asearch_print_query_array())
  • &$boxes
asearch_push_recent (line 377)

Push a recent search into the prefs

  • private:
  • since: 1.5.0
void asearch_push_recent ( &$mailbox_array,  &$biop_array,  &$unop_array,  &$where_array,  &$what_array,  &$exclude_array,  &$sub_array, array $recent_array, array $mailbox_array, array $biop_array, array $unop_array, array $where_array, array $what_array, array $exclude_array, array $sub_array)
  • array $recent_array
  • array $mailbox_array
  • array $biop_array
  • array $unop_array
  • array $where_array
  • array $what_array
  • array $exclude_array
  • array $sub_array
  • &$mailbox_array
  • &$biop_array
  • &$unop_array
  • &$where_array
  • &$what_array
  • &$exclude_array
  • &$sub_array
asearch_read_recent (line 193)

Read the recent searches from the prefs

Function arguments are different in 1.5.0

  • return: recent searches
  • private:
  • since: 1.5.0
array asearch_read_recent ()
asearch_read_saved (line 225)

Read the saved searches from the prefs

Function arguments are different in 1.5.0

  • return: saved searches
  • private:
  • since: 1.5.0
array asearch_read_saved ()
asearch_removePref (line 153)

Deletes user's advanced search preferences

Arguments are different in 1.5.0.

  • return: status
  • private:
  • since: 1.5.0
bool asearch_removePref ( &$key, integer $index, string $key)
  • string $key: the pref key
  • integer $index: the pref key index
  • &$key
asearch_save_recent (line 252)

Save a recent search to the prefs

Function arguments are different in 1.5.0

  • private:
  • since: 1.5.0
void asearch_save_recent (integer $recent_index)
  • integer $recent_index
asearch_serialize (line 87)
  • return: a string containing a byte-stream representation of value that can be stored anywhere
  • private:
  • since: 1.5.0
string asearch_serialize ( &$input_array, array $input_array)
  • array $input_array: array to serialize
  • &$input_array
asearch_setPref (line 137)

Sets user's advanced search preferences

Arguments are different in 1.5.0.

  • return: status
  • private:
  • since: 1.5.0
bool asearch_setPref ( &$key, integer $index, string $value, string $key)
  • string $key: the pref key
  • integer $index: the pref key index
  • string $value: pref value to set
  • &$key
asearch_unhtml_strcoll (line 59)

Array sort callback used to sort $imap_asearch_options

  • return: strcoll()-like result
  • private:
  • since: 1.5.0
bool asearch_unhtml_strcoll (string $a, string $b)
  • string $a
  • string $b
asearch_unserialize (line 101)
  • private:
  • since: 1.5.0
array asearch_unserialize (string $input_string)
  • string $input_string: string to unserialize
asearch_write_recent (line 282)

Write a recent search to prefs

Function arguments are different in 1.5.0

  • private:
  • since: 1.5.0
void asearch_write_recent ( &$recent_array, array $recent_array)
  • array $recent_array
  • &$recent_array
asearch_write_saved (line 495)

Write a saved search to the prefs

Function arguments are different in 1.5.0

  • private:
  • since: 1.5.0
void asearch_write_saved ( &$saved_array, array $saved_array)
  • array $saved_array
  • &$saved_array
getButton (line 634)

Creates button

  • deprecated: see form functions available in 1.5.1 and 1.4.3.
void getButton (string $type, string $name, string $value, [string $js = ''], [bool $enabled = TRUE])
  • string $type
  • string $name
  • string $value
  • string $js
  • bool $enabled
sqimap_asearch_get_selectable_unformatted_mailboxes (line 897)
  • return: selectable unformatted mailboxes names
  • private:
  • since: 1.5.0
array sqimap_asearch_get_selectable_unformatted_mailboxes ( &$boxes, array $boxes)
  • array $boxes: mailboxes array (reference)
  • &$boxes

Documentation generated on Sat, 07 Oct 2006 16:13:23 +0300 by phpDocumentor 1.3.0RC6