CWIS Developer Documentation
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$SearchTermsThe string(s) to highlight, optionally array of strings
string$LabelForFormattingThe 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$FieldIdThe FieldId for the form element to assign
int$CurrentValueThe option's Id value, not for user display
string$CurrentDisplayValueThe value to initially populate the field with
boolean$CloneAfterWhether to place a clone after this field
string$FormFieldNameValue 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$FieldMetadata field.
string$SearchStringSearch string.
array$IdExclusionsArray of IDs for values to exclude.
array$ValueExclusionsArray 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$SearchStringSearch string.
int$MaxResultsThe maximum number of search results.
array$IdExclusionsArray of user IDs for users to exclude.
array$ValueExclusionsArray 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: