/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 26)

Include the SquirrelMail initialization file.

require_once (SM_PATH.'functions/imap_asearch.php') (line 30)

SquirrelMail required files.

require_once (SM_PATH.'functions/date.php') (line 36)
require_once (SM_PATH.'functions/compose.php') (line 37)
require_once (SM_PATH.'functions/mime.php') (line 33)
require_once (SM_PATH.'functions/forms.php') (line 35)
Constants
ASEARCH_BIOP = 4 (line 45)
ASEARCH_CRITERIA = 'criteria' (line 52)

Name of session var

ASEARCH_EXCLUDE = 5 (line 46)
ASEARCH_MAILBOX = 1 (line 42)
ASEARCH_MAX = 7 (line 48)
ASEARCH_SUB = 6 (line 47)
ASEARCH_UNOP = 3 (line 44)
ASEARCH_WHAT = 2 (line 43)
ASEARCH_WHERE = 0 (line 41)

Prefs array ordinals. Must match $recent_prefkeys and $saved_prefkeys

Variables
array $recent_prefkeys (line 956)

Set recent prefkeys according to $search_advanced

array $saved_prefkeys (line 961)

Set saved prefkeys according to $search_advanced

integer $search_advanced (line 948)

If 1, show advanced search interface

Default from allow_advanced_search pref

integer $search_memory (line 927)

Maximum number of recent searches to handle

Default 0

bool $search_silent (line 1162)

If TRUE, do not show search interface

Default FALSE

Functions
asearch_check_query (line 172)

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 522)

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 445)

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 419)

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 474)

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 336)

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 311)

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 124)

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 541)

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 75)
  • 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 567)

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 739)

Verify that a mailbox exists

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

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 828)

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 641)

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 717)

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 695)

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 381)

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 197)

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 229)

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 157)

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 256)

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 91)
  • 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 141)

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 63)

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 105)
  • private:
  • since: 1.5.0
array asearch_unserialize (string $input_string)
  • string $input_string: string to unserialize
asearch_write_recent (line 286)

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 499)

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
sqimap_asearch_get_selectable_unformatted_mailboxes (line 883)
  • 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 Mon, 22 Dec 2014 04:19:19 +0100 by phpDocumentor 1.4.3