Stud.IP  5.4
GlobalSearchModule Class Reference
Inheritance diagram for GlobalSearchModule:
GlobalSearchBlubber GlobalSearchCalendar GlobalSearchCourses GlobalSearchCourseware GlobalSearchFiles GlobalSearchForum GlobalSearchInstitutes GlobalSearchMessages GlobalSearchModules GlobalSearchMyCourses GlobalSearchResources GlobalSearchRoomBookings GlobalSearchUsers

Static Public Member Functions

static getName ()
 
static getSQL ($search, $filter, $limit)
 
static filter ($data, $search)
 
static getFilters ()
 
static getSearchURL ($searchterm)
 
static mark ($string, $query, $longtext=false, $filename=false)
 
static getInstituteIdsForSQL ($institute_id)
 
static getSeminarTypesForSQL ($sem_class)
 
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
array$dataOne row returned from getSQL SQL Query
string$searchThe searchstring (Use for markup e.g. self::mark)
Returns
array Information Array

◆ getActiveSearchModules()

static getActiveSearchModules ( )
static

Returns a list of all active search modules

Returns
array search_class => data

◆ getFilters()

static getFilters ( )
static

Returns the filters that are displayed in the sidebar of the global search.

Returns
array Filters for this class.

◆ getInstituteIdsForSQL()

static getInstituteIdsForSQL (   $institute_id)
static

Get the selected institute with sub-institutes as an array of IDs or a single institute as a string to use in the SQL query.

Parameters
string$institute_idID of the given institute or faculty
Returns
array: a single institute as string if selected or an array of institute IDs if a faculty was selected

◆ getName()

static getName ( )
staticabstract

Returns the displayname for this module

Returns
string

◆ getSearchURL()

static getSearchURL (   $searchterm)
static

Returns the URL that can be called for a full search, containing the specified category and the searchterm.

Overwrite this method in your subclass to provide the category specific search.

Parameters
string$searchtermwhat to search for?
Returns
string URL to the full search, containing the searchterm and the category

◆ getSeminarTypesForSQL()

static getSeminarTypesForSQL (   $sem_class)
static

Get the selected seminar class with sub-types as an array or a single seminar type as a string to use in an SQL query.

Parameters
string$sem_classa single sem_type ID or a sem_class containing multiple sem_types
Returns
string: seminar class/types formatted for an SQL query

◆ getSQL()

static getSQL (   $search,
  $filter,
  $limit 
)
staticabstract

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

Parameters
string$searchthe input query string
array$filteran array with search limiting filter information (e.g. 'category', 'semester', etc.)
Returns
string SQL Query to discover elements for the search

◆ mark()

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

Function to mark a querystring in a resultstring

Parameters
string$stringResult string that should be displayed
string$queryQuery string to mark up
bool$longtextIndicates whether result might be a longer text
bool | true$filenameIndicates whether the query string might denote a file.
Returns
string

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