TYPO3  7.6
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SuggestWizardDefaultReceiver Class Reference

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)
 
 getLanguageService ()
 

Protected Attributes

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

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.

Definition at line 29 of file SuggestWizardDefaultReceiver.php.

Constructor & Destructor Documentation

__construct (   $table,
  $config 
)

The constructor of this class

Parameters
string$tableThe table to query
array$configThe configuration (TCA overlayed with TSconfig) to use for this selector

Definition at line 105 of file SuggestWizardDefaultReceiver.php.

References SuggestWizardDefaultReceiver\$allowedPages, SuggestWizardDefaultReceiver\$config, $GLOBALS, SuggestWizardDefaultReceiver\$table, SuggestWizardDefaultReceiver\getAllSubpagesOfPage(), GeneralUtility\makeInstance(), and GeneralUtility\trimExplode().

Member Function Documentation

checkRecordAccess (   $row,
  $uid 
)
protected

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

Parameters
array$row
int$uid
Returns
bool

Definition at line 309 of file SuggestWizardDefaultReceiver.php.

References $GLOBALS, SuggestWizardDefaultReceiver\$table, elseif, and BackendUtility\readPageAccess().

Referenced by SuggestWizardDefaultReceiver\queryTable().

getAllSubpagesOfPage (   $uid,
  $depth = 99 
)
protected

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

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

Definition at line 260 of file SuggestWizardDefaultReceiver.php.

References $GLOBALS.

Referenced by SuggestWizardDefaultReceiver\__construct().

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
Deprecated:
since TYPO3 CMS 7, will be removed with TYPO3 CMS 8, use IconFactory::getIconForRecord() directly

Definition at line 348 of file SuggestWizardDefaultReceiver.php.

References GeneralUtility\logDeprecatedFunction(), and Icon\SIZE_SMALL.

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 384 of file SuggestWizardDefaultReceiver.php.

References BackendUtility\getRecordTitle().

Referenced by SuggestWizardDefaultReceiver\queryTable().

getLanguageService ( )
protected
Returns
LanguageService

Definition at line 416 of file SuggestWizardDefaultReceiver.php.

References $GLOBALS.

Referenced by SuggestWizardDefaultReceiver\queryTable().

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 364 of file SuggestWizardDefaultReceiver.php.

References BackendUtility\getRecordPath().

Referenced by SuggestWizardDefaultReceiver\queryTable().

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 333 of file SuggestWizardDefaultReceiver.php.

References $GLOBALS, and BackendUtility\workspaceOL().

Referenced by SuggestWizardDefaultReceiver\queryTable().

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 298 of file SuggestWizardDefaultReceiver.php.

Referenced by SuggestWizardDefaultReceiver\queryTable().

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 286 of file SuggestWizardDefaultReceiver.php.

References $GLOBALS, and SuggestWizardDefaultReceiver\$table.

Referenced by SuggestWizardDefaultReceiver\queryTable().

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 215 of file SuggestWizardDefaultReceiver.php.

References SuggestWizardDefaultReceiver\$addWhere, $GLOBALS, SuggestWizardDefaultReceiver\$table, and GeneralUtility\trimExplode().

Referenced by SuggestWizardDefaultReceiver\queryTable().

queryTable ( $params,
  $recursionCounter = 0 
)

Queries a table for records and completely processes them

Returns a two-dimensional array of almost finished records; the only need to be put into a -structure

If you subclass this class, you will most likely only want to overwrite the functions called from here, but not this function itself

Parameters
array$params
int$recursionCounterThe parent object
Returns
array Array of rows or FALSE if nothing found

Definition at line 149 of file SuggestWizardDefaultReceiver.php.

References $GLOBALS, SuggestWizardDefaultReceiver\$params, SuggestWizardDefaultReceiver\checkRecordAccess(), SuggestWizardDefaultReceiver\getLabel(), SuggestWizardDefaultReceiver\getLanguageService(), SuggestWizardDefaultReceiver\getRecordPath(), SuggestWizardDefaultReceiver\makeWorkspaceOverlay(), SuggestWizardDefaultReceiver\manipulateRecord(), SuggestWizardDefaultReceiver\prepareOrderByStatement(), SuggestWizardDefaultReceiver\prepareSelectStatement(), SuggestWizardDefaultReceiver\renderRecord(), and Icon\SIZE_SMALL.

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 398 of file SuggestWizardDefaultReceiver.php.

References SuggestWizardDefaultReceiver\$params, and GeneralUtility\callUserFunction().

Referenced by SuggestWizardDefaultReceiver\queryTable().

Member Data Documentation

$addWhere = ''
protected
$allowedPages = array()
protected
$config = array()
protected
$iconFactory
protected

Definition at line 97 of file SuggestWizardDefaultReceiver.php.

$maxItems = 10
protected

Definition at line 87 of file SuggestWizardDefaultReceiver.php.

$mmForeignTable = ''
protected

Definition at line 44 of file SuggestWizardDefaultReceiver.php.

$orderByStatement = ''
protected

Definition at line 59 of file SuggestWizardDefaultReceiver.php.

$params = array()
protected
$selectClause = ''
protected

Definition at line 52 of file SuggestWizardDefaultReceiver.php.

$table = ''
protected