Class IMP_Search

Description

The IMP_Search:: class contains all code related to mailbox searching in IMP.

The class uses the $_SESSION['imp']['search'] variable to store information across page accesses. The format of that entry is as follows:

$_SESSION['imp']['search'] = array( 'q' => array( 'id_1' => array( 'query' => IMAP_Search_Query object (serialized), 'folders' => array (List of folders to search), 'uiinfo' => array (Info used by search.php to render page), 'label' => string (Description of search), 'vfolder' => boolean (True if this is a Virtual Folder) ), 'id_2' => array( .... ), .... ), 'vtrash_id' => string (The Virtual Trash query ID), 'vinbox_id' => string (The Virtual Inbox query ID) );

$Horde: imp/lib/Search.php,v 1.37.10.47 2009/01/06 15:24:04 jan Exp $

Copyright 2002-2009 The Horde Project (http://www.horde.org/)

See the enclosed file COPYING for license information (GPL). If you did not receive this file, see http://www.fsf.org/copyleft/gpl.html.

Located in /lib/Search.php (line 53)


	
			
Variable Summary
 string $_id
 boolean $_saveVFolder
Method Summary
 IMP_Search IMP_Search ([array $params = array()])
 string addVFolder (IMAP_Search_Query $query, array $folders, array $search, string $label, [string $id = null])
 IMP_IMAP_Search_Query createQuery ( $search, array $uiinfo)
 string createSearchID (string $id)
 string createSearchQuery (IMAP_Search_Query $query, array $folders, array $search, string $label, [string $id = null])
 string deleteSearchQuery ([string $id = null], [boolean $no_delete = false])
 string deleteURL ([string $id = null])
 string editURL ([string $id = null])
 array flagFields ()
 string getLabel ([string $id = null])
 array getSearchFolders ([string $id = null])
 array getSearchQueries ()
 boolean isEditableVFolder ([string $id = null])
 boolean isSearchMbox ([string $id = null])
 boolean isVFolder ([string $id = null])
 boolean isVINBOXFolder ([string $id = null])
 boolean isVTrashFolder ([string $id = null])
 array listQueries ([boolean $vfolder = false])
 array retrieveUIQuery ([string $id = null])
 array runSearch (IMAP_Search_Query &$ob, [string $id = null])
 array runSearchQuery (IMAP_Search_Query $ob,  $mailbox,  $sortby,  $sortdir)
 array searchFields ()
 mixed searchMboxID ()
 array searchQueryText ([string $id = null])
 void sessionSetup ([boolean $no_vf = false])
Variables
string $_id = null (line 60)

The ID of the current search query in use.

boolean $_saveVFolder = true (line 67)

Save Virtual Folder information when adding entries?

Methods
Constructor IMP_Search (line 77)

Constructor.

IMP_Search IMP_Search ([array $params = array()])
  • array $params: Available parameters:
     'id'  --  The ID of the search query in use.
addVFolder (line 342)

Add a virtual folder for the current user.

  • return: The virtual folder ID.
string addVFolder (IMAP_Search_Query $query, array $folders, array $search, string $label, [string $id = null])
  • IMAP_Search_Query $query: The search query object.
  • array $folders: The list of folders to search.
  • array $search: The search array used to build the search UI screen.
  • string $label: The label to use for the search results.
  • string $id: The virtual folder id.
createQuery (line 887)

Creates a search query.

  • return: A search object.
  • since: IMP 4.2.1
IMP_IMAP_Search_Query createQuery ( $search, array $uiinfo)
  • array $uiinfo: An uiinfo array (see imp/search.php).
  • $search
createSearchID (line 697)

Create the canonical search ID for a given search query.

  • return: The canonical search query ID.
  • since: IMP 4.1.2
  • access: public
string createSearchID (string $id)
  • string $id: The mailbox query ID.
createSearchQuery (line 191)

Creates the IMAP search query in the IMP session.

  • return: Returns the search query id.
string createSearchQuery (IMAP_Search_Query $query, array $folders, array $search, string $label, [string $id = null])
  • IMAP_Search_Query $query: The search query object.
  • array $folders: The list of folders to search.
  • array $search: The search array used to build the search UI screen.
  • string $label: The label to use for the search results.
  • string $id: The query id to use (or else one is automatically generated).
createVINBOXFolder (line 417)

Add a virtual INBOX folder for the current user.

void createVINBOXFolder ()
createVTrashFolder (line 358)

Add a virtual trash folder for the current user.

void createVTrashFolder ()
deleteSearchQuery (line 215)

Deletes an IMAP search query.

  • return: Returns the search query id.
string deleteSearchQuery ([string $id = null], [boolean $no_delete = false])
  • string $id: The search query id to use (by default, will use the current ID set in the object).
  • boolean $no_delete: Don't delete the entry in the tree object.
deleteURL (line 623)

Returns a link to delete a given search query.

  • return: The URL to allow deletion of the search query.
string deleteURL ([string $id = null])
  • string $id: The search query id to use (by default, will use the current ID set in the object).
editURL (line 609)

Returns a link to edit a given search query.

  • return: The URL to the search page.
string editURL ([string $id = null])
  • string $id: The search query id to use (by default, will use the current ID set in the object).
flagFields (line 782)

Return the base flag fields.

  • return: The base flag fields.
  • since: IMP 4.2.1
array flagFields ()
getLabel (line 255)

Generates the label to use for search results.

  • return: The search results label.
string getLabel ([string $id = null])
  • string $id: The search query id to use (by default, will use the current ID set in the object).
getSearchFolders (line 519)

Get the list of searchable folders for the given search query.

  • return: The list of searchable folders.
array getSearchFolders ([string $id = null])
  • string $id: The search query id to use (by default, will use the current ID set in the object).
getSearchQueries (line 532)

Return a list of search queries valid only for the current session (i.e. no virtual folders).

  • return: Keys are the search ids, values are a textual description of the search.
array getSearchQueries ()
isEditableVFolder (line 479)

Is the current active folder an editable Virtual Folder?

  • return: True if the current folder is both a virtual folder and can be edited.
boolean isEditableVFolder ([string $id = null])
  • string $id: The search query id to use (by default, will use the current ID set in the object).
isSearchMbox (line 641)

Is the given mailbox a search mailbox?

  • return: Whether the given mailbox name is a search mailbox.
boolean isSearchMbox ([string $id = null])
  • string $id: The search query id to use (by default, will use the current ID set in the object).
isVFolder (line 654)

Is the given mailbox a virtual folder?

  • return: Whether the given mailbox name is a virtual folder.
boolean isVFolder ([string $id = null])
  • string $id: The search query id to use (by default, will use the current ID set in the object).
isVINBOXFolder (line 463)

Determines whether a virtual folder ID is the Virtual INBOX Folder.

  • return: True if the virutal folder ID is the Virtual INBOX folder.
boolean isVINBOXFolder ([string $id = null])
  • string $id: The search query id to use (by default, will use the current ID set in the object).
isVTrashFolder (line 407)

Determines whether a virtual folder ID is the Virtual Trash Folder.

  • return: True if the virutal folder ID is the Virtual Trash folder.
boolean isVTrashFolder ([string $id = null])
  • string $id: The search query id to use (by default, will use the current ID set in the object).
listQueries (line 493)

Return a list of IDs and query labels, sorted by the label.

  • return: An array with the folder IDs as the key and the labels as the value.
array listQueries ([boolean $vfolder = false])
  • boolean $vfolder: If true, only return Virtual Folders?
retrieveUIQuery (line 239)

Retrieves the previously stored search UI information.

  • return: The array necessary to rebuild the search UI page.
array retrieveUIQuery ([string $id = null])
  • string $id: The search query id to use (by default, will use the current ID set in the object).
runSearch (line 119)

Run a search.

  • return: The sorted list.
array runSearch (IMAP_Search_Query &$ob, [string $id = null])
  • IMAP_Search_Query &$ob: An optional search query to add (via 'AND') to the active search.
  • string $id: The search query id to use (by default, will use the current ID set in the object).
runSearchQuery (line 171)

Run a search query not stored in the current session. Allows custom queries with custom sorts to be used without affecting cached mailboxes.

  • return: The sorted list.
  • since: IMP 4.2
array runSearchQuery (IMAP_Search_Query $ob,  $mailbox,  $sortby,  $sortdir)
  • IMAP_Search_Query $ob: The search query.
  • $mailbox
  • $sortby
  • $sortdir
searchFields (line 707)

Return the base search fields.

  • return: The base search fields.
array searchFields ()
searchMboxID (line 666)

Get the ID for the search mailbox, if we are currently in a search mailbox.

  • return: The search ID if in a mailbox, else false.
mixed searchMboxID ()
searchQueryText (line 556)

Return search query text representation for a given search ID.

  • return: The textual description of the search.
  • since: IMP 4.2
array searchQueryText ([string $id = null])
  • string $id: The search query id to use (by default, will use the current ID set in the object).
sessionSetup (line 89)

Set up IMP_Search variables for the current session.

void sessionSetup ([boolean $no_vf = false])
  • boolean $no_vf: Don't readd the Virtual Folders.

Documentation generated on Sun, 30 Jan 2011 05:28:16 +0000 by phpDocumentor 1.4.3