CWIS Developer Documentation

- Home
- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Static Public Member Functions | List of all members
QuickSearchHelper Class Reference

Convenience class for QuickSearch responses, making it easy to share functions common to different types of QuickSearch objects. More...

## Static Public Member Functions
static | SearchField (MetadataField $Field, $SearchString, array $IdExclusions=array(), array $ValueExclusions=array())
| Search a field for values matching a specified search string. More...
static | HighlightSearchString ($SearchTerms, $LabelForFormatting)
| Highlight all instances of the search string in the result label. More...
static | PrintQuickSearchField ($FieldId, $CurrentValue, $CurrentDisplayValue, $CloneAfter=FALSE, $FormFieldName=NULL)
| Print the blank text field quick search field for the QuickSearch JS object. More...
static | SearchForUsers ($SearchString, $MaxResults=15, array $IdExclusions=array(), array $ValueExclusions=array())
| Perform a search for users. More...

## Detailed Description

Convenience class for QuickSearch responses, making it easy to share functions common to different types of QuickSearch objects.

Definition at line 14 of file QuickSearchHelper.php.

## Member Function Documentation

static QuickSearchHelper::HighlightSearchString | ( |  | $SearchTerms,
|  |  | $LabelForFormatting
| ) |  |
| static

Highlight all instances of the search string in the result label.

Parameters

  string | $SearchTerms | The string(s) to highlight, optionally array of strings
  string | $LabelForFormatting | The label in which to highlight the search string

Returns
  Returns the formatted label string

Definition at line 63 of file QuickSearchHelper.php.

static QuickSearchHelper::PrintQuickSearchField | ( |  | $FieldId,
|  |  | $CurrentValue,
|  |  | $CurrentDisplayValue,
|  |  | $CloneAfter = `FALSE`,
|  |  | $FormFieldName = `NULL`
| ) |  |
| static

Print the blank text field quick search field for the QuickSearch JS object.

Parameters

  int | $FieldId | The FieldId for the form element to assign
  int | $CurrentValue | The option's Id value, not for user display
  string | $CurrentDisplayValue | The value to initially populate the field with
  boolean | $CloneAfter | Whether to place a clone after this field
  string | $FormFieldName | Value to use for the input name attribute in the generated html (OPTIONAL, defaults to field name)

Definition at line 141 of file QuickSearchHelper.php.

References ApplicationFramework\ORDER_FIRST, and PHP.

Referenced by FormUI\DisplayFormField().

Here is the caller graph for this function:

static QuickSearchHelper::SearchField | ( | MetadataField | $Field,
|  |  | $SearchString,
|  | array | $IdExclusions = `array()`,
|  | array | $ValueExclusions = `array()`
| ) |  |
| static

Search a field for values matching a specified search string.

Parameters

  MetadataField | $Field | Metadata field.
  string | $SearchString | Search string.
  array | $IdExclusions | Array of IDs for values to exclude.
  array | $ValueExclusions | Array of values to exclude.

Returns
  Returns an array containing the number of search results, the number of additional search results available, and the search results.

Definition at line 26 of file QuickSearchHelper.php.

References MetadataSchema\MDFTYPE_REFERENCE, MetadataSchema\MDFTYPE_USER, MetadataField\NumAjaxResults(), and MetadataField\Type().

static QuickSearchHelper::SearchForUsers | ( |  | $SearchString,
|  |  | $MaxResults = `15`,
|  | array | $IdExclusions = `array()`,
|  | array | $ValueExclusions = `array()`
| ) |  |
| static

Perform a search for users.

Parameters

  string | $SearchString | Search string.
  int | $MaxResults | The maximum number of search results.
  array | $IdExclusions | Array of user IDs for users to exclude.
  array | $ValueExclusions | Array of values to exclude.

Returns
  array giving the number of results displayed number of additional results available, and the results to display.

Definition at line 213 of file QuickSearchHelper.php.

References MetadataField\GetFactory().

The documentation for this class was generated from the following file:

- interface/default/objects/QuickSearchHelper.php