TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver Class Reference
Inheritance diagram for TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver:
t3lib_TCEforms_Suggest_DefaultReceiver

Public Member Functions

 __construct ($table, $config)
 
 queryTable (&$params, $recursionCounter=0)
 

Protected Member Functions

 prepareSelectStatement ()
 
 getAllSubpagesOfPage ($uid, $depth=99)
 
 prepareOrderByStatement ()
 
 manipulateRecord (&$row)
 
 checkRecordAccess ($row, $uid)
 
 makeWorkspaceOverlay (&$row)
 
 getIcon ($row)
 
 getRecordPath (&$row, $uid)
 
 getLabel ($row)
 
 renderRecord ($row, $entry)
 

Protected Attributes

 $table = ''
 
 $mmForeignTable = ''
 
 $selectClause = ''
 
 $orderByStatement = ''
 
 $addWhere = ''
 
 $config = array()
 
 $allowedPages = array()
 
 $maxItems = 10
 
 $params = array()
 

Detailed Description

Default implementation of a handler class for an ajax record selector.

Normally other implementations should be inherited from this one. queryTable() should not be overwritten under normal circumstances.

Author
Andreas Wolf andre.nosp@m.as.w.nosp@m.olf@i.nosp@m.kt-w.nosp@m.erk.d.nosp@m.e
Benjamin Mack benni.nosp@m.@typ.nosp@m.o3.or.nosp@m.g

Definition at line 30 of file SuggestDefaultReceiver.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver::__construct (   $table,
  $config 
)

Member Function Documentation

◆ checkRecordAccess()

TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver::checkRecordAccess (   $row,
  $uid 
)
protected

Selects whether the logged in Backend User is allowed to read a specific record

Parameters
array$row
integer$uid
Returns
boolean

Definition at line 295 of file SuggestDefaultReceiver.php.

References $GLOBALS, TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver\$table, $uid, and TYPO3\CMS\Backend\Utility\BackendUtility\readPageAccess().

Referenced by TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver\queryTable().

◆ getAllSubpagesOfPage()

TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver::getAllSubpagesOfPage (   $uid,
  $depth = 99 
)
protected

Selects all subpages of one page, optionally only upto a certain level

Parameters
integer$uidThe uid of the page
integer$depthThe depth to select upto. Defaults to 99
Returns
array of page IDs

Definition at line 248 of file SuggestDefaultReceiver.php.

References $GLOBALS, and $uid.

Referenced by TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver\__construct().

◆ getIcon()

TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver::getIcon (   $row)
protected

Return the icon for a record - just a wrapper for two functions from

Parameters
array$rowThe record to get the icon for
Returns
string The path to the icon

Definition at line 331 of file SuggestDefaultReceiver.php.

References TYPO3\CMS\Backend\Utility\IconUtility\getIcon(), and TYPO3\CMS\Backend\Utility\IconUtility\skinImg().

◆ getLabel()

TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver::getLabel (   $row)
protected

Returns a label for a given record; usually only a wrapper for ::getRecordTitle

Parameters
array$rowThe record to get the label for
Returns
string The label

Definition at line 365 of file SuggestDefaultReceiver.php.

References TYPO3\CMS\Backend\Utility\BackendUtility\getRecordTitle().

Referenced by TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver\queryTable().

◆ getRecordPath()

TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver::getRecordPath ( $row,
  $uid 
)
protected

Returns the path for a record. Is the whole path for all records except pages - for these the last part is cut off, because it contains the pagetitle itself, which would be double information

The path is returned uncut, cutting has to be done by calling function.

Parameters
array$rowThe row
array$recordThe record
Returns
string The record-path

Definition at line 346 of file SuggestDefaultReceiver.php.

References $uid, and TYPO3\CMS\Backend\Utility\BackendUtility\getRecordPath().

Referenced by TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver\queryTable().

◆ makeWorkspaceOverlay()

TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver::makeWorkspaceOverlay ( $row)
protected

Overlay the given record with its workspace-version, if any

Parameters
arrayThe record to get the workspace version for
Returns
void (passed by reference)

Definition at line 318 of file SuggestDefaultReceiver.php.

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

Referenced by TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver\queryTable().

◆ manipulateRecord()

TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver::manipulateRecord ( $row)
protected

Manipulate a record before using it to render the selector; may be used to replace a MM-relation etc.

Parameters
array$row

Definition at line 284 of file SuggestDefaultReceiver.php.

Referenced by TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver\queryTable().

◆ prepareOrderByStatement()

TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver::prepareOrderByStatement ( )
protected

Prepares the clause by which the result elements are sorted. See description of ORDER BY in SQL standard for reference.

Returns
void

Definition at line 273 of file SuggestDefaultReceiver.php.

References $GLOBALS, and TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver\$table.

Referenced by TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver\queryTable().

◆ prepareSelectStatement()

TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver::prepareSelectStatement ( )
protected

Prepare the statement for selecting the records which will be returned to the selector. May also return some other records (e.g. from a mm-table) which will be used later on to select the real records

Returns
void

Definition at line 204 of file SuggestDefaultReceiver.php.

References TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver\$addWhere, $GLOBALS, TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver\$table, and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver\queryTable().

◆ queryTable()

TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver::queryTable ( $params,
  $recursionCounter = 0 
)

◆ renderRecord()

TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver::renderRecord (   $row,
  $entry 
)
protected

Calls a user function for rendering the page.

This user function should manipulate $entry, especially $entry['text'].

Parameters
array$rowThe row
array$entryThe entry to render
Returns
array The rendered entry (will be put into a later on

Definition at line 378 of file SuggestDefaultReceiver.php.

References TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver\$params, and TYPO3\CMS\Core\Utility\GeneralUtility\callUserFunction().

Referenced by TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver\queryTable().

Member Data Documentation

◆ $addWhere

TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver::$addWhere = ''
protected

◆ $allowedPages

TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver::$allowedPages = array()
protected

◆ $config

TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver::$config = array()
protected

◆ $maxItems

TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver::$maxItems = 10
protected

Definition at line 88 of file SuggestDefaultReceiver.php.

◆ $mmForeignTable

TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver::$mmForeignTable = ''
protected

Definition at line 45 of file SuggestDefaultReceiver.php.

◆ $orderByStatement

TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver::$orderByStatement = ''
protected

Definition at line 60 of file SuggestDefaultReceiver.php.

◆ $params

TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver::$params = array()
protected

◆ $selectClause

TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver::$selectClause = ''
protected

Definition at line 53 of file SuggestDefaultReceiver.php.

◆ $table