Stud.IP  4.2 Revision
GlobalSearchModule Class Reference
Inheritance diagram for GlobalSearchModule:
Inheritance graph
Collaboration diagram for GlobalSearchModule:
Collaboration graph

Static Public Member Functions

static getName ()
 
static getSQL ($search)
 
static filter ($data, $search)
 
static getSearchURL ($searchterm)
 
static mark ($string, $query, $longtext=false, $filename=true)
 
static getActiveSearchModules ()
 

Member Function Documentation

◆ filter()

static filter (   $data,
  $search 
)
staticabstract

Returns an array of information for the found element. Following informations (key: description) are necessary

  • name: The name of the object
  • url: The url to send the user to when he clicks the link

Additional informations are:

  • additional: Subtitle for the hit
  • expand: Url if the user further expands the search
  • img: Avatar for the
Parameters
$dataOne row returned from getSQL SQL Query
$searchThe searchstring (Use for markup e.g. self::mark)
Returns
mixed Information Array

◆ getActiveSearchModules()

static getActiveSearchModules ( )
static

Returns a list of all active search modules

Returns
array search_class => data
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getName()

static getName ( )
staticabstract

Returns the displayname for this module

Returns
mixed

◆ getSearchURL()

static getSearchURL (   $searchterm)
static

Returns the URL that can be called for a full search.

This could become obsolete when we have a real global search page. Overwrite this method in your subclass to provide the category specific search page.

Parameters
string$searchtermwhat to search for?

◆ getSQL()

static getSQL (   $search)
staticabstract

Has to return a SQL Query that discovers all objects. All retrieved data is passed row by row to getGlobalSearchFilter

Parameters
$searchthe input query string
Returns
String SQL Query to discover elements for the search

◆ mark()

static mark (   $string,
  $query,
  $longtext = false,
  $filename = true 
)
static

Function to mark a querystring in a resultstring

Parameters
$string
$query
bool | true$filename
Returns
mixed

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