TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch Class Reference
Inheritance diagram for TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch:
t3lib_search_liveSearch

Public Member Functions

 __construct ()
 
 findPage ($searchQuery)
 
 find ($searchQuery)
 
 getRecordTitlePrep ($title, $titleLength=0)
 
 getQueryString ($tableName='')
 
 setLimitCount ($limitCount)
 
 setStartCount ($startCount)
 
 setQueryString ($queryString)
 

Public Attributes

const PAGE_JUMP_TABLE = 'pages'
 
const RECURSIVE_PAGE_LEVEL = 99
 
const GROUP_TITLE_MAX_LENGTH = 15
 
const RECORD_TITLE_MAX_LENGTH = 28
 

Protected Member Functions

 findPageById ($id)
 
 findByGlobalTableList ($pageIdList)
 
 findByTable ($tableName, $pageIdList, $limit)
 
 getRecordArray ($tableName, $where, $orderBy, $limit)
 
 getEditLink ($tableName, $row)
 
 getTitleOfCurrentRecordType ($tableName)
 
 makeQuerySearchByTable ($tableName, array $fieldsToSearchWithin)
 
 makeOrderByTable ($tableName)
 
 extractSearchableFieldsFromTable ($tableName)
 
 getAvailablePageIds ($id, $depth)
 

Protected Attributes

 $userPermissions = ''
 
 $queryParser = NULL
 

Private Attributes

 $queryString = ''
 
 $startCount = 0
 
 $limitCount = 5
 

Detailed Description

Class for handling backend live search.

Author
Michael Klapper micha.nosp@m.el.k.nosp@m.lappe.nosp@m.r@ao.nosp@m.emedi.nosp@m.a.de
Jeff Segars jeff@.nosp@m.webe.nosp@m.mpowe.nosp@m.redc.nosp@m.hurch.nosp@m..org

Definition at line 28 of file LiveSearch.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::__construct ( )

Initialize access settings

Definition at line 74 of file LiveSearch.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

Member Function Documentation

◆ extractSearchableFieldsFromTable()

TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::extractSearchableFieldsFromTable (   $tableName)
protected

Get all fields from given table where we can search for.

Parameters
string$tableNameName of the table for which to get the searchable fields
Returns
array

Definition at line 367 of file LiveSearch.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\findByTable().

◆ find()

TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::find (   $searchQuery)

◆ findByGlobalTableList()

TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::findByGlobalTableList (   $pageIdList)
protected

Find records from all registered TCA table & column values.

Parameters
string$pageIdListComma separated list of page IDs
Returns
array Records found in the database matching the searchQuery

Definition at line 145 of file LiveSearch.php.

References $GLOBALS, TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\$limitCount, and TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\findByTable().

Referenced by TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\find().

◆ findByTable()

TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::findByTable (   $tableName,
  $pageIdList,
  $limit 
)
protected

◆ findPage()

TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::findPage (   $searchQuery)

Find records from database based on the given $searchQuery.

Parameters
string$searchQuery
Returns
string Edit link to an page record if exists. Otherwise an empty string will returned

Definition at line 85 of file LiveSearch.php.

References TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\findPageById(), and TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\getEditLink().

◆ findPageById()

TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::findPageById (   $id)
protected

Retrieve the page record from given $id.

Parameters
integer$id
Returns
array

Definition at line 130 of file LiveSearch.php.

Referenced by TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\findPage().

◆ getAvailablePageIds()

TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::getAvailablePageIds (   $id,
  $depth 
)
protected

Creates an instance of which will select a page tree to $depth and return the object. In that object we will find the ids of the tree.

Parameters
integer$idPage id.
integer$depthDepth to go down.
Returns
string Comma separated list of uids

Definition at line 434 of file LiveSearch.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

Referenced by TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\find().

◆ getEditLink()

TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::getEditLink (   $tableName,
  $row 
)
protected

Build a backend edit link based on given record.

Parameters
string$tableNameRecord table name
array$rowCurrent record row from database.
Returns
string Link to open an edit window for record.
See also
::readPageAccess()

Definition at line 232 of file LiveSearch.php.

References $GLOBALS, TYPO3\CMS\Backend\Utility\BackendUtility\getModuleUrl(), and TYPO3\CMS\Backend\Utility\BackendUtility\readPageAccess().

Referenced by TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\findPage(), and TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\getRecordArray().

◆ getQueryString()

TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::getQueryString (   $tableName = '')

Safely retrieve the queryString.

Parameters
string$tableName
Returns
string

Definition at line 388 of file LiveSearch.php.

References $GLOBALS.

◆ getRecordArray()

TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::getRecordArray (   $tableName,
  $where,
  $orderBy,
  $limit 
)
protected

Process the Database operation to get the search result.

Parameters
string$tableNameDatabase table name
string$where
string$orderBy
string$limitMySql Limit notation
Returns
array
See also
::getSpriteIconForRecord()
getTitleFromCurrentRow()
getEditLink()

Definition at line 197 of file LiveSearch.php.

References $GLOBALS, $result, TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\getEditLink(), TYPO3\CMS\Backend\Utility\BackendUtility\getRecordTitle(), TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\getRecordTitlePrep(), TYPO3\CMS\Backend\Utility\IconUtility\getSpriteIconForRecord(), and TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\getTitleOfCurrentRecordType().

Referenced by TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\findByTable().

◆ getRecordTitlePrep()

TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::getRecordTitlePrep (   $title,
  $titleLength = 0 
)

Crops a title string to a limited length and if it really was cropped, wrap it in a |, which offers a tooltip with the original title when moving mouse over it.

Parameters
string$titleThe title string to be cropped
integer$titleLengthCrop title after this length - if not set, BE_USER->uc['titleLen'] is used
Returns
string The processed title string, wrapped in | if cropped

Definition at line 270 of file LiveSearch.php.

References $GLOBALS, TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger(), and TYPO3\CMS\Core\Utility\GeneralUtility\fixed_lgd_cs().

Referenced by TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\getRecordArray().

◆ getTitleOfCurrentRecordType()

TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::getTitleOfCurrentRecordType (   $tableName)
protected

Retrieve the record name

Parameters
string$tableNameRecord table name
Returns
string

Definition at line 257 of file LiveSearch.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\getRecordArray().

◆ makeOrderByTable()

TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::makeOrderByTable (   $tableName)
protected

Build the MySql ORDER BY statement.

Parameters
string$tableNameRecord table name
Returns
string

Definition at line 348 of file LiveSearch.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\findByTable().

◆ makeQuerySearchByTable()

TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::makeQuerySearchByTable (   $tableName,
array  $fieldsToSearchWithin 
)
protected

◆ setLimitCount()

TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::setLimitCount (   $limitCount)

Setter for limit value.

Parameters
integer$limitCount
Returns
void

Definition at line 398 of file LiveSearch.php.

References TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\$limitCount, and TYPO3\CMS\Core\Utility\MathUtility\convertToPositiveInteger().

◆ setQueryString()

TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::setQueryString (   $queryString)

Setter for the search query string.

Parameters
string$queryString
Returns
void
See also
::removeXSS()

Definition at line 422 of file LiveSearch.php.

References TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\$queryString, and TYPO3\CMS\Core\Utility\GeneralUtility\removeXSS().

Referenced by TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\find().

◆ setStartCount()

TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::setStartCount (   $startCount)

Setter for start count value.

Parameters
integer$startCount
Returns
void

Definition at line 411 of file LiveSearch.php.

References TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\$startCount, and TYPO3\CMS\Core\Utility\MathUtility\convertToPositiveInteger().

Member Data Documentation

◆ $limitCount

◆ $queryParser

TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::$queryParser = NULL
protected

Definition at line 69 of file LiveSearch.php.

◆ $queryString

TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::$queryString = ''
private

◆ $startCount

TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::$startCount = 0
private

◆ $userPermissions

TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::$userPermissions = ''
protected

Definition at line 64 of file LiveSearch.php.

◆ GROUP_TITLE_MAX_LENGTH

const TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::GROUP_TITLE_MAX_LENGTH = 15

Definition at line 41 of file LiveSearch.php.

◆ PAGE_JUMP_TABLE

const TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::PAGE_JUMP_TABLE = 'pages'

Definition at line 33 of file LiveSearch.php.

◆ RECORD_TITLE_MAX_LENGTH

const TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::RECORD_TITLE_MAX_LENGTH = 28

Definition at line 45 of file LiveSearch.php.

◆ RECURSIVE_PAGE_LEVEL

const TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::RECURSIVE_PAGE_LEVEL = 99

Definition at line 37 of file LiveSearch.php.