‪TYPO3CMS  ‪main
TYPO3\CMS\Frontend\Plugin\AbstractPlugin Class Reference
Inheritance diagram for TYPO3\CMS\Frontend\Plugin\AbstractPlugin:
TYPO3\CMS\Core\Page\DefaultJavaScriptAssetTrait

Public Member Functions

 __construct ($_=null, TypoScriptFrontendController $frontendController=null)
 
 setContentObjectRenderer (ContentObjectRenderer $cObj)
 
 pi_setPiVarDefaults ()
 
string pi_getPageLink ($id, $target='', $urlParameters=[])
 
string pi_linkToPage ($str, $id, $target='', $urlParameters=[])
 
string pi_linkTP ($str, $urlParameters=[], $cache=false, $altPageId=0)
 
string pi_linkTP_keepPIvars ($str, $overrulePIvars=[], $cache=false, $clearAnyway=false, $altPageId=0)
 
string pi_linkTP_keepPIvars_url ($overrulePIvars=[], $cache=false, $clearAnyway=false, $altPageId=0)
 
string pi_list_linkSingle ($str, $uid, $cache=false, $mergeArr=[], $urlOnly=false, $altPageId=0)
 
string pi_openAtagHrefInJSwindow ($str, $winName='', $winParams='width=670, height=500, status=0, menubar=0, scrollbars=1, resizable=1')
 
string pi_list_browseresults ($showResultCount=1, $tableParams='', $wrapArr=[], $pointerName='pointer', $hscText=true, $forceOutput=false)
 
string pi_list_modeSelector ($items=[], $tableParams='')
 
string pi_list_makelist ($statement, $tableParams='')
 
string pi_list_row ($c)
 
string pi_list_header ()
 
string pi_getClassName ($class)
 
string pi_classParam ($class, $addClasses='')
 
string pi_wrapInBaseClass ($str)
 
string pi_getLL ($key, $alternativeLabel='')
 
 pi_loadLL ($languageFilePath='')
 
Result pi_exec_query ($table, $count=false, $addWhere='', $mm_cat='', $groupBy='', $orderBy='', $query='')
 
array pi_getRecord ($table, $uid, $checkPage=false)
 
string pi_getPidList ($pid_list, $recursive=0)
 
string pi_prependFieldsWithTable ($table, $fieldList)
 
array pi_getCategoryTableContents ($table, $pid, $whereClause='', $groupBy='', $orderBy='', $limit='')
 
bool null pi_isOnlyFields ($fList, $lowerThan=-1)
 
bool null pi_autoCache ($inArray)
 
string pi_RTEcssText ($str)
 
 pi_initPIflexForm ($field='pi_flexform')
 
string null pi_getFFvalue ($T3FlexForm_array, $fieldName, $sheet='sDEF', $lang='lDEF', $value='vDEF')
 
mixed pi_getFFvalueFromSheetArray ($sheetArray, $fieldNameArr, $value)
 

Public Attributes

string $prefixId
 
string $scriptRelPath
 
string $extKey
 
array $piVars
 
array $internal = array( 'res_count' => 0, 'results_at_a_time' => 20, 'maxPages' => 10, 'currentRow' => [], 'currentTable' => '' )
 
array $LOCAL_LANG = array( )
 
bool $LOCAL_LANG_loaded = false
 
string $LLkey = 'default'
 
string $altLLkey = ''
 
string $LLtestPrefix = ''
 
string $LLtestPrefixAlt = ''
 
string $pi_isOnlyFields = 'mode,pointer'
 
int $pi_alwaysPrev = 0
 
int $pi_lowerThan = 5
 
string $pi_moreParams = ''
 
string $pi_listFields = '*'
 
array $pi_autoCacheFields = array( )
 
bool $pi_autoCacheEn = false
 
array $conf = array( )
 
int $pi_tmpPageId = 0
 

Protected Member Functions

array applyStdWrapRecursive (array $conf, $level=0)
 
 removeInternalNodeValue (array $typoscript)
 
- ‪Protected Member Functions inherited from ‪TYPO3\CMS\Core\Page\DefaultJavaScriptAssetTrait
 addDefaultFrontendJavaScript ()
 
 shallRemoveDefaultFrontendJavaScript ()
 
 shallExportDefaultFrontendJavaScript ()
 

Protected Attributes

ContentObjectRenderer $cObj = null
 
array $LOCAL_LANG_UNSET = array( )
 
TypoScriptFrontendController $frontendController
 
MarkerBasedTemplateService $templateService
 
- ‪Protected Attributes inherited from ‪TYPO3\CMS\Core\Page\DefaultJavaScriptAssetTrait
string $defaultFrontendJavaScriptFile = 'EXT:frontend/Resources/Public/JavaScript/default_frontend.js'
 

Static Private Member Functions

static array getRequestPostOverGetParameterWithPrefix ($parameter)
 

Detailed Description

Old school base class of frontend plugins.

Various legacy frontend plugins extend this "abstract".

The class comes with a series of helper methods which assist plugins in creating lists, searching, displaying menus, page-browsing (next/previous/1/2/3) and handling links. Functions are all prefixed "pi_" which is reserved for this class. Those functions can of course be overridden in the extension classes (that is the point...)

This class is not maintained anymore and may be removed in future versions.

Definition at line 49 of file AbstractPlugin.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Frontend\Plugin\AbstractPlugin::__construct (   $_ = null,
TypoScriptFrontendController  $frontendController = null 
)

Class Constructor (true constructor) Initializes $this->piVars if $this->prefixId is set to any value Will also set $this->LLkey based on the config.language setting.

Parameters
null$_‪unused,

Definition at line 202 of file AbstractPlugin.php.

References TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$frontendController, $GLOBALS, and TYPO3\CMS\Frontend\Plugin\AbstractPlugin\getRequestPostOverGetParameterWithPrefix().

Member Function Documentation

◆ applyStdWrapRecursive()

array TYPO3\CMS\Frontend\Plugin\AbstractPlugin::applyStdWrapRecursive ( array  $conf,
  $level = 0 
)
protected

Recursively looks for stdWrap and executes it

Parameters
array$conf‪Current section of configuration to work on
int$level‪Current level being processed (currently just for tracking; no limit enforced)
Returns
‪array Current section of configuration after stdWrap applied

Definition at line 236 of file AbstractPlugin.php.

References TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$conf.

Referenced by TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_setPiVarDefaults().

◆ getRequestPostOverGetParameterWithPrefix()

static array TYPO3\CMS\Frontend\Plugin\AbstractPlugin::getRequestPostOverGetParameterWithPrefix (   $parameter)
staticprivate

Returns the global arrays $_GET and $_POST merged with $_POST taking precedence.

Parameters
string$parameter‪Key (variable name) from GET or POST vars
Returns
‪array Returns the GET vars merged recursively onto the POST vars.

Definition at line 1344 of file AbstractPlugin.php.

Referenced by TYPO3\CMS\Frontend\Plugin\AbstractPlugin\__construct().

◆ pi_autoCache()

bool null TYPO3\CMS\Frontend\Plugin\AbstractPlugin::pi_autoCache (   $inArray)

Returns TRUE if the array $inArray contains only values allowed to be cached based on the configuration in $this->pi_autoCacheFields Used by ->pi_linkTP_keepPIvars This is an advanced form of evaluation of whether a URL should be cached or not.

Parameters
array$inArray‪An array with piVars values to evaluate
Returns
‪bool|null Returns TRUE (1) if conditions are met.
See also
pi_linkTP_keepPIvars()

Definition at line 1228 of file AbstractPlugin.php.

Referenced by TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_linkTP_keepPIvars().

◆ pi_classParam()

string TYPO3\CMS\Frontend\Plugin\AbstractPlugin::pi_classParam (   $class,
  $addClasses = '' 
)

Returns the class-attribute with the correctly prefixed classname Using pi_getClassName()

Parameters
string$class‪The class name(s) (suffix) - separate multiple classes with commas
string$addClasses‪Additional class names which should not be prefixed - separate multiple classes with commas
Returns
‪string A "class" attribute with value and a single space char before it.
See also
pi_getClassName()

Definition at line 816 of file AbstractPlugin.php.

References $output, TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_getClassName(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_list_browseresults(), TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_list_header(), TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_list_makelist(), TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_list_modeSelector(), and TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_list_row().

◆ pi_exec_query()

Result TYPO3\CMS\Frontend\Plugin\AbstractPlugin::pi_exec_query (   $table,
  $count = false,
  $addWhere = '',
  $mm_cat = '',
  $groupBy = '',
  $orderBy = '',
  $query = '' 
)

Executes a standard SELECT query for listing of records based on standard input vars from the 'browser' ($this->internal['results_at_a_time'] and $this->piVars['pointer']) and 'searchbox' ($this->piVars['sword'] and $this->internal['searchFieldList']) Set $count to 1 if you wish to get a count(*) query for selecting the number of results. Notice that the query will use $this->conf['pidList'] and $this->conf['recursive'] to generate a PID list within which to search for records.

Parameters
string$table‪The table name to make the query for.
bool$count‪If set, you will get a "count(*)" query back instead of field selecting
string$addWhere‪Additional WHERE clauses (should be starting with " AND ....")
mixed$mm_cat‪If an array, then it must contain the keys "table", "mmtable" and (optionally) "catUidList" defining a table to make a MM-relation to in the query (based on fields uid_local and uid_foreign). If not array, the query will be a plain query looking up data in only one table.
string$groupBy‪If set, this is added as a " GROUP BY ...." part of the query.
string$orderBy‪If set, this is added as a " ORDER BY ...." part of the query. The default is that an ORDER BY clause is made based on $this->internal['orderBy'] and $this->internal['descFlag'] where the orderBy field must be found in $this->internal['orderByList']
string$query‪If set, this is taken as the first part of the query instead of what is created internally. Basically this should be a query starting with "FROM [table] WHERE ... AND ...". The $addWhere clauses and all the other stuff is still added. Only the tables and PID selecting clauses are bypassed. May be deprecated in the future!
Returns
‪Result

Definition at line 978 of file AbstractPlugin.php.

References $fields, TYPO3\CMS\Core\Utility\MathUtility\forceIntegerInRange(), TYPO3\CMS\Core\Utility\GeneralUtility\inList(), TYPO3\CMS\Core\Utility\GeneralUtility\intExplode(), TYPO3\CMS\Core\Database\Query\QueryHelper\parseGroupBy(), TYPO3\CMS\Core\Database\Query\QueryHelper\parseOrderBy(), TYPO3\CMS\Core\Database\Query\QueryHelper\parseTableList(), TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_getPidList(), TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_prependFieldsWithTable(), TYPO3\CMS\Core\Database\Query\QueryHelper\stripLogicalOperatorPrefix(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

◆ pi_getCategoryTableContents()

array TYPO3\CMS\Frontend\Plugin\AbstractPlugin::pi_getCategoryTableContents (   $table,
  $pid,
  $whereClause = '',
  $groupBy = '',
  $orderBy = '',
  $limit = '' 
)

Will select all records from the "category table", $table, and return them in an array.

Parameters
string$table‪The name of the category table to select from.
int$pid‪The page from where to select the category records.
string$whereClause‪Optional additional WHERE clauses put in the end of the query. DO NOT PUT IN GROUP BY, ORDER BY or LIMIT!
string$groupBy‪Optional GROUP BY field(s), if none, supply blank string.
string$orderBy‪Optional ORDER BY field(s), if none, supply blank string.
string$limit‪Optional LIMIT value ([begin,]max), if none, supply blank string.
Returns
‪array The array with the category records in.

Definition at line 1146 of file AbstractPlugin.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\intExplode(), TYPO3\CMS\Core\Database\Connection\PARAM_INT, TYPO3\CMS\Core\Database\Query\QueryHelper\parseGroupBy(), TYPO3\CMS\Core\Database\Query\QueryHelper\parseOrderBy(), and TYPO3\CMS\Core\Database\Query\QueryHelper\stripLogicalOperatorPrefix().

◆ pi_getClassName()

string TYPO3\CMS\Frontend\Plugin\AbstractPlugin::pi_getClassName (   $class)

Returns a class-name prefixed with $this->prefixId and with all underscores substituted to dashes (-)

Parameters
string$class‪The class name (or the END of it since it will be prefixed by $this->prefixId.'-')
Returns
‪string The combined class name (with the correct prefix)

Definition at line 802 of file AbstractPlugin.php.

Referenced by TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_classParam().

◆ pi_getFFvalue()

string null TYPO3\CMS\Frontend\Plugin\AbstractPlugin::pi_getFFvalue (   $T3FlexForm_array,
  $fieldName,
  $sheet = 'sDEF',
  $lang = 'lDEF',
  $value = 'vDEF' 
)

Return value from somewhere inside a FlexForm structure

Parameters
array$T3FlexForm_array‪FlexForm data
string$fieldName‪Field name to extract. Can be given like "test/el/2/test/el/field_templateObject" where each part will dig a level deeper in the FlexForm data.
string$sheet‪Sheet pointer, eg. "sDEF @param string $lang Language pointer, eg. "lDEF
string$value‪Value pointer, eg. "vDEF
Returns
‪string|null The content.

Definition at line 1297 of file AbstractPlugin.php.

References TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_getFFvalueFromSheetArray().

◆ pi_getFFvalueFromSheetArray()

mixed TYPO3\CMS\Frontend\Plugin\AbstractPlugin::pi_getFFvalueFromSheetArray (   $sheetArray,
  $fieldNameArr,
  $value 
)

Returns part of $sheetArray pointed to by the keys in $fieldNameArray

Parameters
array$sheetArray‪Multidimensional array, typically FlexForm contents
array$fieldNameArr‪Array where each value points to a key in the FlexForms content - the input array will have the value returned pointed to by these keys. All integer keys will not take their integer counterparts, but rather traverse the current position in the array and return element number X (whether this is right behavior is not settled yet...)
string$value‪Value for outermost key, typ. "vDEF" depending on language.
Returns
‪mixed The value, typ. string.
See also
pi_getFFvalue()

Definition at line 1316 of file AbstractPlugin.php.

References TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger().

Referenced by TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_getFFvalue().

◆ pi_getLL()

string TYPO3\CMS\Frontend\Plugin\AbstractPlugin::pi_getLL (   $key,
  $alternativeLabel = '' 
)

Returns the localized label of the LOCAL_LANG key, $key Notice that for debugging purposes prefixes for the output values can be set with the internal vars ->LLtestPrefixAlt and ->LLtestPrefix

Parameters
string$key‪The key from the LOCAL_LANG array for which to return the value.
string$alternativeLabel‪Alternative string to return IF no value is found set for the key, neither for the local language nor the default.
Returns
‪string The value from LOCAL_LANG.

Definition at line 873 of file AbstractPlugin.php.

References TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$LLkey, and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_list_browseresults().

◆ pi_getPageLink()

string TYPO3\CMS\Frontend\Plugin\AbstractPlugin::pi_getPageLink (   $id,
  $target = '',
  $urlParameters = [] 
)

Get URL to some page. Returns the URL to page $id with $target and an array of additional url-parameters, $urlParameters Simple example: $this->pi_getPageLink(123) to get the URL for page-id 123.

The function basically calls $this->cObj->getTypoLink_URL()

Parameters
int$idPage id
string$target‪Target value to use. Affects the &type-value of the URL, defaults to current.
array | string$urlParameters‪As an array key/value pairs represent URL parameters to set. Values NOT URL-encoded yet, keys should be URL-encoded if needed. As a string the parameter is expected to be URL-encoded already.
Returns
‪string The resulting URL
See also
pi_linkToPage()
‪ContentObjectRenderer::createUrl()

Definition at line 315 of file AbstractPlugin.php.

References TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$conf, and TYPO3\CMS\Core\Utility\HttpUtility\buildQueryString().

◆ pi_getPidList()

string TYPO3\CMS\Frontend\Plugin\AbstractPlugin::pi_getPidList (   $pid_list,
  $recursive = 0 
)

Returns a commalist of page ids for a query (eg. 'WHERE pid IN (...)')

Parameters
string$pid_list‪A comma list of page ids (if empty current page is used)
int$recursive‪An integer >=0 telling how deep to dig for pids under each entry in $pid_list
Returns
‪string List of PID values (comma separated)

Definition at line 1107 of file AbstractPlugin.php.

References TYPO3\CMS\Core\Utility\MathUtility\forceIntegerInRange(), and TYPO3\CMS\Core\Utility\GeneralUtility\intExplode().

Referenced by TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_exec_query().

◆ pi_getRecord()

array TYPO3\CMS\Frontend\Plugin\AbstractPlugin::pi_getRecord (   $table,
  $uid,
  $checkPage = false 
)

Returns the row $uid from $table (Simply calling $this->frontendEngine->sys_page->checkRecord())

Parameters
string$table‪The table name
int$uid‪The uid of the record from the table
bool$checkPage‪If $checkPage is set, it's required that the page on which the record resides is accessible
Returns
‪array If record is found, an array. Otherwise FALSE.

Definition at line 1095 of file AbstractPlugin.php.

References TYPO3\CMS\Webhooks\Message\$uid.

◆ pi_initPIflexForm()

TYPO3\CMS\Frontend\Plugin\AbstractPlugin::pi_initPIflexForm (   $field = 'pi_flexform')

Converts $this->cObj->data['pi_flexform'] from XML string to flexForm array.

Parameters
string$field‪Field name to convert

Definition at line 1275 of file AbstractPlugin.php.

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

◆ pi_isOnlyFields()

bool null TYPO3\CMS\Frontend\Plugin\AbstractPlugin::pi_isOnlyFields (   $fList,
  $lowerThan = -1 
)

Returns TRUE if the piVars array has ONLY those fields entered that is set in the $fList (commalist) AND if none of those fields value is greater than $lowerThan field if they are integers. Notice that this function will only work as long as values are integers.

Parameters
string$fList‪List of fields (keys from piVars) to evaluate on
int$lowerThan‪Limit for the values.
Returns
‪bool|null Returns TRUE (1) if conditions are met.

Definition at line 1202 of file AbstractPlugin.php.

References TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$piVars, TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_list_browseresults(), and TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_list_modeSelector().

◆ pi_linkToPage()

string TYPO3\CMS\Frontend\Plugin\AbstractPlugin::pi_linkToPage (   $str,
  $id,
  $target = '',
  $urlParameters = [] 
)

Link a string to some page. Like pi_getPageLink() but takes a string as first parameter which will in turn be wrapped with the URL including target attribute Simple example: $this->pi_linkToPage('My link', 123) to get something like My link

Parameters
string$str‪The content string to wrap in tags
int$idPage id
string$target‪Target value to use. Affects the &type-value of the URL, defaults to current.
array | string$urlParameters‪As an array key/value pairs represent URL parameters to set. Values NOT URL-encoded yet, keys should be URL-encoded if needed. As a string the parameter is expected to be URL-encoded already.
Returns
‪string The input string wrapped in tags with the URL and target set.
See also
pi_getPageLink()
‪ContentObjectRenderer::typoLink()

Definition at line 348 of file AbstractPlugin.php.

References TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$conf, and TYPO3\CMS\Core\Utility\HttpUtility\buildQueryString().

◆ pi_linkTP()

string TYPO3\CMS\Frontend\Plugin\AbstractPlugin::pi_linkTP (   $str,
  $urlParameters = [],
  $cache = false,
  $altPageId = 0 
)

Link string to the current page. Returns the $str wrapped in -tags with a link to the CURRENT page, but with $urlParameters set as extra parameters for the page.

Parameters
string$str‪The content string to wrap in tags
array$urlParameters‪Array with URL parameters as key/value pairs. They will be "imploded" and added to the list of parameters defined in the plugins TypoScript property "parent.addParams" plus $this->pi_moreParams.
bool$cache‪If $cache is set (0/1), the page is asked to be cached by a &cHash value (unless the current plugin using this class is a USER_INT). Otherwise the no_cache-parameter will be a part of the link.
int$altPageId‪Alternative page ID for the link. (By default this function links to the SAME page!)
Returns
‪string The input string wrapped in tags
See also
pi_linkTP_keepPIvars()
‪ContentObjectRenderer::typoLink()

Definition at line 380 of file AbstractPlugin.php.

References TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$conf, TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$pi_moreParams, and TYPO3\CMS\Core\Utility\HttpUtility\buildQueryString().

Referenced by TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_linkTP_keepPIvars(), and TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_list_linkSingle().

◆ pi_linkTP_keepPIvars()

string TYPO3\CMS\Frontend\Plugin\AbstractPlugin::pi_linkTP_keepPIvars (   $str,
  $overrulePIvars = [],
  $cache = false,
  $clearAnyway = false,
  $altPageId = 0 
)

Link a string to the current page while keeping currently set values in piVars. Like pi_linkTP, but $urlParameters is by default set to $this->piVars with $overrulePIvars overlaid. This means any current entries from this->piVars are passed on (except the key "DATA" which will be unset before!) and entries in $overrulePIvars will OVERRULE the current in the link.

Parameters
string$str‪The content string to wrap in tags
array$overrulePIvars‪Array of values to override in the current piVars. Contrary to pi_linkTP the keys in this array must correspond to the real piVars array and therefore NOT be prefixed with the $this->prefixId string. Further, if a value is a blank string it means the piVar key will not be a part of the link (unset)
bool$cache‪If $cache is set, the page is asked to be cached by a &cHash value (unless the current plugin using this class is a USER_INT). Otherwise the no_cache-parameter will be a part of the link.
bool$clearAnyway‪If set, then the current values of piVars will NOT be preserved anyways... Practical if you want an easy way to set piVars without having to worry about the prefix, "tx_xxxxx[]
int$altPageId‪Alternative page ID for the link. (By default this function links to the SAME page!)
Returns
‪string The input string wrapped in tags
See also
pi_linkTP()

Definition at line 404 of file AbstractPlugin.php.

References TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$piVars, TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_autoCache(), and TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_linkTP().

Referenced by TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_linkTP_keepPIvars_url(), TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_list_browseresults(), TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_list_linkSingle(), and TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_list_modeSelector().

◆ pi_linkTP_keepPIvars_url()

string TYPO3\CMS\Frontend\Plugin\AbstractPlugin::pi_linkTP_keepPIvars_url (   $overrulePIvars = [],
  $cache = false,
  $clearAnyway = false,
  $altPageId = 0 
)

Get URL to the current page while keeping currently set values in piVars. Same as pi_linkTP_keepPIvars but returns only the URL from the link.

Parameters
array$overrulePIvars‪See pi_linkTP_keepPIvars
bool$cache‪See pi_linkTP_keepPIvars
bool$clearAnyway‪See pi_linkTP_keepPIvars
int$altPageId‪See pi_linkTP_keepPIvars
Returns
‪string The URL ($this->cObj->lastTypoLinkResult)
See also
pi_linkTP_keepPIvars()

Definition at line 429 of file AbstractPlugin.php.

References TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_linkTP_keepPIvars().

◆ pi_list_browseresults()

string TYPO3\CMS\Frontend\Plugin\AbstractPlugin::pi_list_browseresults (   $showResultCount = 1,
  $tableParams = '',
  $wrapArr = [],
  $pointerName = 'pointer',
  $hscText = true,
  $forceOutput = false 
)

Returns a results browser. This means a bar of page numbers plus a "previous" and "next" link. For each entry in the bar the piVars "pointer" will be pointing to the "result page" to show. Using $this->piVars['pointer'] as pointer to the page to display. Can be overwritten with another string ($pointerName) to make it possible to have more than one pagebrowser on a page) Using $this->internal['res_count'], $this->internal['results_at_a_time'] and $this->internal['maxPages'] for count number, how many results to show and the max number of pages to include in the browse bar. Using $this->internal['dontLinkActivePage'] as switch if the active (current) page should be displayed as pure text or as a link to itself Using $this->internal['showFirstLast'] as switch if the two links named "<< First" and "LAST >>" will be shown and point to the first or last page. Using $this->internal['pagefloat']: this defines were the current page is shown in the list of pages in the Pagebrowser. If this var is an integer it will be interpreted as position in the list of pages. If its value is the keyword "center" the current page will be shown in the middle of the pagelist. Using $this->internal['showRange']: this var switches the display of the pagelinks from pagenumbers to ranges f.e.: 1-5 6-10 11-15... instead of 1 2 3... Using $this->pi_isOnlyFields: this holds a comma-separated list of fieldnames which - if they are among the GETvars - will not disable caching for the page with pagebrowser.

The third parameter is an array with several wraps for the parts of the pagebrowser. The following elements will be recognized: disabledLinkWrap, inactiveLinkWrap, activeLinkWrap, browseLinksWrap, showResultsWrap, showResultsNumbersWrap, browseBoxWrap.

If $wrapArr['showResultsNumbersWrap'] is set, the formatting string is expected to hold template markers (###FROM###, ###TO###, ###OUT_OF###, ###FROM_TO###, ###CURRENT_PAGE###, ###TOTAL_PAGES###) otherwise the formatting string is expected to hold sprintf-markers (s) for from, to, outof (in that sequence)

Parameters
int$showResultCount‪Determines how the results of the page browser will be shown. See description below
string$tableParams‪Attributes for the table tag which is wrapped around the table cells containing the browse links
array$wrapArr‪Array with elements to overwrite the default $wrapper-array.
string$pointerName‪varname for the pointer.
bool$hscText‪Enable htmlspecialchars() on language labels
bool$forceOutput‪Forces the output of the page browser if you set this option to "TRUE" (otherwise it's only drawn if enough entries are available)
Returns
‪string Output HTML-Table, wrapped in
-tags with a class attribute (if $wrapArr is not passed,

Definition at line 530 of file AbstractPlugin.php.

References $GLOBALS, TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$pi_alwaysPrev, TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$pi_isOnlyFields, TYPO3\CMS\Core\Utility\MathUtility\forceIntegerInRange(), TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_classParam(), TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_getLL(), TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_isOnlyFields(), and TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_linkTP_keepPIvars().

◆ pi_list_header()

string TYPO3\CMS\Frontend\Plugin\AbstractPlugin::pi_list_header ( )

Returns a list header row. (Dummy) Notice: This function should ALWAYS be defined in the extension class of the plugin since it is directly concerned with the specific layout of the listing for your plugins purpose.

Returns
‪string HTML output, a table row with a class attribute set

Definition at line 786 of file AbstractPlugin.php.

References TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_classParam().

Referenced by TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_list_makelist().

◆ pi_list_linkSingle()

string TYPO3\CMS\Frontend\Plugin\AbstractPlugin::pi_list_linkSingle (   $str,
  $uid,
  $cache = false,
  $mergeArr = [],
  $urlOnly = false,
  $altPageId = 0 
)

Wraps the $str in a link to a single display of the record (using piVars[showUid]) Uses pi_linkTP for the linking

Parameters
string$str‪The content string to wrap in tags
int$uid‪UID of the record for which to display details (basically this will become the value of [showUid]
bool$cache‪See pi_linkTP_keepPIvars
array$mergeArr‪Array of values to override in the current piVars. Same as $overrulePIvars in pi_linkTP_keepPIvars
bool$urlOnly‪If TRUE, only the URL is returned, not a full link
int$altPageId‪Alternative page ID for the link. (By default this function links to the SAME page!)
Returns
‪string The input string wrapped in tags
See also
pi_linkTP()
pi_linkTP_keepPIvars()

Definition at line 449 of file AbstractPlugin.php.

References TYPO3\CMS\Webhooks\Message\$uid, TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_linkTP(), and TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_linkTP_keepPIvars().

◆ pi_list_makelist()

string TYPO3\CMS\Frontend\Plugin\AbstractPlugin::pi_list_makelist (   $statement,
  $tableParams = '' 
)

Returns the list of items based on the input SQL result pointer For each result row the internal var, $this->internal['currentRow'], is set with the row returned. $this->pi_list_header() makes the header row for the list $this->pi_list_row() is used for rendering each row Notice that these two functions are typically ALWAYS defined in the extension class of the plugin since they are directly concerned with the specific layout for that plugins purpose.

Parameters
Result$statement‪Result pointer to a SQL result which can be traversed.
string$tableParams‪Attributes for the table tag which is wrapped around the table rows containing the list
Returns
‪string Output HTML, wrapped in
-tags with a class attribute
See also

Definition at line 740 of file AbstractPlugin.php.

References TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_classParam(), TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_list_header(), and TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_list_row().

◆ pi_list_modeSelector()

string TYPO3\CMS\Frontend\Plugin\AbstractPlugin::pi_list_modeSelector (   $items = [],
  $tableParams = '' 
)

Returns a mode selector; a little menu in a table normally put in the top of the page/list.

Parameters
array$items‪Key/Value pairs for the menu; keys are the piVars[mode] values and the "values" are the labels for them.
string$tableParams‪Attributes for the table tag which is wrapped around the table cells containing the menu
Returns
‪string Output HTML, wrapped in
-tags with a class attribute

Definition at line 705 of file AbstractPlugin.php.

References TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_classParam(), TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_isOnlyFields(), and TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_linkTP_keepPIvars().

◆ pi_list_row()

string TYPO3\CMS\Frontend\Plugin\AbstractPlugin::pi_list_row (   $c)

Returns a list row. Get data from $this->internal['currentRow']; (Dummy) Notice: This function should ALWAYS be defined in the extension class of the plugin since it is directly concerned with the specific layout of the listing for your plugins purpose.

Parameters
int$c‪Row counting. Starts at 0 (zero). Used for alternating class values in the output rows.
Returns
‪string HTML output, a table row with a class attribute set (alternative based on odd/even rows)

Definition at line 773 of file AbstractPlugin.php.

References TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_classParam().

Referenced by TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_list_makelist().

◆ pi_loadLL()

TYPO3\CMS\Frontend\Plugin\AbstractPlugin::pi_loadLL (   $languageFilePath = '')

Loads local-language values from the file passed as a parameter or by looking for a "locallang" file in the plugin class directory ($this->scriptRelPath). Also locallang values set in the TypoScript property "_LOCAL_LANG" are merged onto the values found in the "locallang" file. Supported file extensions xlf

Parameters
string$languageFilePath‪path to the plugin language file in format EXT:....

Definition at line 916 of file AbstractPlugin.php.

References TYPO3\CMS\Core\Utility\PathUtility\dirname(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

◆ pi_openAtagHrefInJSwindow()

string TYPO3\CMS\Frontend\Plugin\AbstractPlugin::pi_openAtagHrefInJSwindow (   $str,
  $winName = '',
  $winParams = 'width=670,
height  = 500,
status  = 0,
menubar  = 0,
scrollbars  = 1,
resizable  = 1' 
)

Will change the href value from in the input string and turn it into markup that will open a new window with the URL

Parameters
string$str‪The string to process. This should be a string already wrapped/including a tag, only the href attribute will be used
string$winName‪Window name for the pop-up window
string$winParams‪Window parameters, see the default list for inspiration
Returns
‪string The processed input string, modified IF a tag was found

Definition at line 477 of file AbstractPlugin.php.

References TYPO3\CMS\Core\Page\DefaultJavaScriptAssetTrait\addDefaultFrontendJavaScript().

◆ pi_prependFieldsWithTable()

string TYPO3\CMS\Frontend\Plugin\AbstractPlugin::pi_prependFieldsWithTable (   $table,
  $fieldList 
)

Having a comma list of fields ($fieldList) this is prepended with the $table.'.' name

Parameters
string$table‪Table name to prepend
string$fieldList‪List of fields where each element will be prepended with the table name given.
Returns
‪string List of fields processed.

Definition at line 1125 of file AbstractPlugin.php.

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

Referenced by TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_exec_query().

◆ pi_RTEcssText()

string TYPO3\CMS\Frontend\Plugin\AbstractPlugin::pi_RTEcssText (   $str)

Will process the input string with the parseFunc function from ContentObjectRenderer based on configuration set in "lib.parseFunc_RTE" in the current TypoScript template.

Parameters
string$str‪The input text string to process
Returns
‪string The processed string
See also
‪ContentObjectRenderer::parseFunc()

Definition at line 1259 of file AbstractPlugin.php.

◆ pi_setPiVarDefaults()

TYPO3\CMS\Frontend\Plugin\AbstractPlugin::pi_setPiVarDefaults ( )

If internal TypoScript property "_DEFAULT_PI_VARS." is set then it will merge the current $this->piVars array onto these default values.

Definition at line 267 of file AbstractPlugin.php.

References TYPO3\CMS\Frontend\Plugin\AbstractPlugin\applyStdWrapRecursive(), and TYPO3\CMS\Frontend\Plugin\AbstractPlugin\removeInternalNodeValue().

◆ pi_wrapInBaseClass()

string TYPO3\CMS\Frontend\Plugin\AbstractPlugin::pi_wrapInBaseClass (   $str)

Wraps the input string in a

tag with the class attribute set to the prefixId. All content returned from your plugins should be returned through this function so all content from your plugin is encapsulated in a
-tag nicely identifying the content of your plugin.
Parameters
string$str‪HTML content to wrap in the div-tags with the "main class" of the plugin
Returns
‪string HTML content wrapped, ready to return to the parent object.

Definition at line 837 of file AbstractPlugin.php.

◆ removeInternalNodeValue()

TYPO3\CMS\Frontend\Plugin\AbstractPlugin::removeInternalNodeValue ( array  $typoscript)
protected

Remove the internal array key _typoScriptNodeValue

Definition at line 282 of file AbstractPlugin.php.

Referenced by TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_setPiVarDefaults().

◆ setContentObjectRenderer()

TYPO3\CMS\Frontend\Plugin\AbstractPlugin::setContentObjectRenderer ( ContentObjectRenderer  $cObj)

This setter is called when the plugin is called from UserContentObject (USER) via ContentObjectRenderer->callUserFunction().

Definition at line 224 of file AbstractPlugin.php.

References TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$cObj.

Member Data Documentation

◆ $altLLkey

string TYPO3\CMS\Frontend\Plugin\AbstractPlugin::$altLLkey = ''

Pointer to alternative fall-back language to use.

Definition at line 128 of file AbstractPlugin.php.

◆ $cObj

ContentObjectRenderer TYPO3\CMS\Frontend\Plugin\AbstractPlugin::$cObj = null
protected

◆ $conf

array TYPO3\CMS\Frontend\Plugin\AbstractPlugin::$conf = array( )

Should normally be set in the main function with the TypoScript content passed to the method.

$conf[LOCAL_LANG][key] is reserved for Local Language overrides. $conf[userFunc] reserved for setting up the USER / USER_INT object. See TSref

Definition at line 179 of file AbstractPlugin.php.

Referenced by TYPO3\CMS\Frontend\Plugin\AbstractPlugin\applyStdWrapRecursive(), TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_getPageLink(), TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_linkToPage(), and TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_linkTP().

◆ $extKey

string TYPO3\CMS\Frontend\Plugin\AbstractPlugin::$extKey

Extension key.

Definition at line 70 of file AbstractPlugin.php.

◆ $frontendController

TypoScriptFrontendController TYPO3\CMS\Frontend\Plugin\AbstractPlugin::$frontendController
protected

Property for accessing TypoScriptFrontendController centrally

Definition at line 189 of file AbstractPlugin.php.

Referenced by TYPO3\CMS\Frontend\Plugin\AbstractPlugin\__construct().

◆ $internal

array TYPO3\CMS\Frontend\Plugin\AbstractPlugin::$internal = array( 'res_count' => 0, 'results_at_a_time' => 20, 'maxPages' => 10, 'currentRow' => [], 'currentTable' => '' )

Local pointer variable array. Holds pointer information for the MVC like approach Kasper initially proposed.

Definition at line 94 of file AbstractPlugin.php.

◆ $LLkey

string TYPO3\CMS\Frontend\Plugin\AbstractPlugin::$LLkey = 'default'

Pointer to the language to use.

Definition at line 122 of file AbstractPlugin.php.

Referenced by TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_getLL().

◆ $LLtestPrefix

string TYPO3\CMS\Frontend\Plugin\AbstractPlugin::$LLtestPrefix = ''

You can set this during development to some value that makes it easy for you to spot all labels that ARe delivered by the getLL function.

Definition at line 135 of file AbstractPlugin.php.

◆ $LLtestPrefixAlt

string TYPO3\CMS\Frontend\Plugin\AbstractPlugin::$LLtestPrefixAlt = ''

Save as LLtestPrefix, but additional prefix for the alternative value in getLL() function calls

Definition at line 142 of file AbstractPlugin.php.

◆ $LOCAL_LANG

array TYPO3\CMS\Frontend\Plugin\AbstractPlugin::$LOCAL_LANG = array( )

Local Language content

Definition at line 100 of file AbstractPlugin.php.

◆ $LOCAL_LANG_loaded

bool TYPO3\CMS\Frontend\Plugin\AbstractPlugin::$LOCAL_LANG_loaded = false

Flag that tells if the locallang file has been fetch (or tried to be fetched) already.

Definition at line 116 of file AbstractPlugin.php.

◆ $LOCAL_LANG_UNSET

array TYPO3\CMS\Frontend\Plugin\AbstractPlugin::$LOCAL_LANG_UNSET = array( )
protected

Contains those LL keys, which have been set to (empty) in TypoScript. This is necessary, as we cannot distinguish between a nonexisting translation and a label that has been cleared by TS. In both cases ['key'][0]['target'] is "".

Definition at line 109 of file AbstractPlugin.php.

◆ $pi_alwaysPrev

int TYPO3\CMS\Frontend\Plugin\AbstractPlugin::$pi_alwaysPrev = 0

◆ $pi_autoCacheEn

bool TYPO3\CMS\Frontend\Plugin\AbstractPlugin::$pi_autoCacheEn = false

Definition at line 170 of file AbstractPlugin.php.

◆ $pi_autoCacheFields

array TYPO3\CMS\Frontend\Plugin\AbstractPlugin::$pi_autoCacheFields = array( )

Definition at line 166 of file AbstractPlugin.php.

◆ $pi_isOnlyFields

string TYPO3\CMS\Frontend\Plugin\AbstractPlugin::$pi_isOnlyFields = 'mode,pointer'

◆ $pi_listFields

string TYPO3\CMS\Frontend\Plugin\AbstractPlugin::$pi_listFields = '*'

Definition at line 162 of file AbstractPlugin.php.

◆ $pi_lowerThan

int TYPO3\CMS\Frontend\Plugin\AbstractPlugin::$pi_lowerThan = 5

Definition at line 154 of file AbstractPlugin.php.

◆ $pi_moreParams

string TYPO3\CMS\Frontend\Plugin\AbstractPlugin::$pi_moreParams = ''

◆ $pi_tmpPageId

int TYPO3\CMS\Frontend\Plugin\AbstractPlugin::$pi_tmpPageId = 0

Definition at line 183 of file AbstractPlugin.php.

◆ $piVars

array TYPO3\CMS\Frontend\Plugin\AbstractPlugin::$piVars
Initial value:
= array(
'pointer' => '',
'mode' => '',
'sword' => '',
'sort' => '',
)

This is the incoming array by name $this->prefixId merged between POST and GET, POST taking precedence. Eg. if the class name is 'tx_myext' then the content of this array will be whatever comes into &tx_myext[...]=...

Definition at line 78 of file AbstractPlugin.php.

Referenced by TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_isOnlyFields(), and TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_linkTP_keepPIvars().

◆ $prefixId

string TYPO3\CMS\Frontend\Plugin\AbstractPlugin::$prefixId

Should be same as classname of the plugin, used for CSS classes, variables

Definition at line 58 of file AbstractPlugin.php.

◆ $scriptRelPath

string TYPO3\CMS\Frontend\Plugin\AbstractPlugin::$scriptRelPath

Path to the plugin class script relative to extension directory, eg. 'pi1/class.tx_newfaq_pi1.php'

Definition at line 64 of file AbstractPlugin.php.

◆ $templateService

MarkerBasedTemplateService TYPO3\CMS\Frontend\Plugin\AbstractPlugin::$templateService
protected

Definition at line 193 of file AbstractPlugin.php.