Stud.IP  jlu_4.3 Revision 64286
GlobalSearchModule Class Reference
Inheritance diagram for GlobalSearchModule:
Inheritance graph
Collaboration diagram for GlobalSearchModule:
Collaboration graph

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=true)
 
static getInstituteIdsForSQL ($institute_id)
 
static getSeminarTypesForSQL ($sem_class)
 
static getCurrentSemester ()
 
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

Reimplemented in GlobalSearchMyCourses, GlobalSearchCourses, GlobalSearchFiles, GlobalSearchForum, GlobalSearchUsers, GlobalSearchInstitutes, GlobalSearchMessages, GlobalSearchModules, GlobalSearchResources, GlobalSearchRoomBookings, and GlobalSearchCalendar.

◆ 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:

◆ getCurrentSemester()

static getCurrentSemester ( )
static

Get the current semester considering the given SEMESTER_TIME_SWITCH in the CONFIG (n weeks before the next semester)

Returns
int The start time of the current semester.
Here is the call graph for this function:

◆ getFilters()

static getFilters ( )
static

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

Returns
array Filters for this class.

Reimplemented in GlobalSearchCourses, GlobalSearchForum, and GlobalSearchMyCourses.

◆ 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
$institute_idID of the given institute or faculty
Returns
mixed: a single institute as string if selected or an array of institute IDs if a faculty was selected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getName()

◆ 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
URL to the full search, containing the searchterm and the category

Reimplemented in GlobalSearchCalendar, GlobalSearchCourses, GlobalSearchFiles, GlobalSearchForum, GlobalSearchInstitutes, GlobalSearchMessages, GlobalSearchModules, GlobalSearchMyCourses, GlobalSearchResources, GlobalSearchRoomBookings, and GlobalSearchUsers.

◆ 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
$sem_classa single sem_type ID or a sem_class containing multiple sem_types
Returns
mixed: seminar class/types formatted for an SQL query
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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
$searchthe input query string
$filteran array with search limiting filter information (e.g. 'category', 'semester', etc.)
Returns
String SQL Query to discover elements for the search

Reimplemented in GlobalSearchCalendar, GlobalSearchCourses, GlobalSearchFiles, GlobalSearchForum, GlobalSearchInstitutes, GlobalSearchMessages, GlobalSearchModules, GlobalSearchMyCourses, GlobalSearchResources, GlobalSearchRoomBookings, and GlobalSearchUsers.

◆ 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
Here is the call graph for this function:
Here is the caller graph for this function:

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