‪TYPO3CMS  ‪main
AbstractPlugin.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
18 use Doctrine\DBAL\Result;
34 use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
36 
50 {
52 
53  protected ?ContentObjectRenderer ‪$cObj = null;
54 
60  public ‪$prefixId;
61 
67  public ‪$scriptRelPath;
68 
74  public ‪$extKey;
75 
83  public ‪$piVars = [
84  'pointer' => '',
85  // Used as a pointer for lists
86  'mode' => '',
87  // List mode
88  'sword' => '',
89  // Search word
90  'sort' => '',
91  ];
92 
100  public ‪$internal = ['res_count' => 0, 'results_at_a_time' => 20, 'maxPages' => 10, 'currentRow' => [], 'currentTable' => ''];
101 
107  public ‪$LOCAL_LANG = [];
108 
117  protected ‪$LOCAL_LANG_UNSET = [];
118 
125  public ‪$LOCAL_LANG_loaded = false;
126 
132  public ‪$LLkey = 'default';
133 
139  public ‪$altLLkey = '';
140 
147  public ‪$LLtestPrefix = '';
148 
155  public ‪$LLtestPrefixAlt = '';
156 
160  public ‪$pi_isOnlyFields = 'mode,pointer';
161 
165  public ‪$pi_alwaysPrev = 0;
166 
170  public ‪$pi_lowerThan = 5;
171 
175  public ‪$pi_moreParams = '';
176 
180  public ‪$pi_listFields = '*';
181 
185  public ‪$pi_autoCacheFields = [];
186 
190  public ‪$pi_autoCacheEn = false;
191 
200  public ‪$conf = [];
201 
205  public ‪$pi_tmpPageId = 0;
206 
212  protected ‪$frontendController;
213 
217  protected ‪$templateService;
218 
227  {
228  $this->frontendController = ‪$frontendController ?: ‪$GLOBALS['TSFE'];
229  $this->templateService = GeneralUtility::makeInstance(MarkerBasedTemplateService::class);
230  // Setting piVars:
231  if ($this->prefixId) {
232  $this->piVars = ‪self::getRequestPostOverGetParameterWithPrefix($this->prefixId);
233  }
234  $this->LLkey = $this->frontendController->getLanguage()->getTypo3Language();
235 
236  $locales = GeneralUtility::makeInstance(Locales::class);
237  if ($locales->isValidLanguageKey($this->LLkey)) {
238  $alternativeLanguageKeys = $locales->getLocaleDependencies($this->LLkey);
239  $alternativeLanguageKeys = array_reverse($alternativeLanguageKeys);
240  $this->altLLkey = implode(',', $alternativeLanguageKeys);
241  }
242  }
243 
248  public function ‪setContentObjectRenderer(ContentObjectRenderer ‪$cObj): void
249  {
250  $this->cObj = ‪$cObj;
251  }
252 
260  protected function ‪applyStdWrapRecursive(array ‪$conf, $level = 0)
261  {
262  foreach (‪$conf as $key => $confNextLevel) {
263  if (str_contains($key, '.')) {
264  $key = substr($key, 0, -1);
265 
266  // descend into all non-stdWrap-subelements first
267  foreach ($confNextLevel as $subKey => $subConfNextLevel) {
268  if (is_array($subConfNextLevel) && str_contains($subKey, '.') && $subKey !== 'stdWrap.') {
269  ‪$conf[$key . '.'] = $this->‪applyStdWrapRecursive($confNextLevel, $level + 1);
270  }
271  }
272 
273  // now for stdWrap
274  foreach ($confNextLevel as $subKey => $subConfNextLevel) {
275  if (is_array($subConfNextLevel) && $subKey === 'stdWrap.') {
276  ‪$conf[$key] = $this->cObj->stdWrap(‪$conf[$key] ?? '', ‪$conf[$key . '.']['stdWrap.'] ?? []);
277  unset(‪$conf[$key . '.']['stdWrap.']);
278  if (empty(‪$conf[$key . '.'])) {
279  unset(‪$conf[$key . '.']);
280  }
281  }
282  }
283  }
284  }
285  return ‪$conf;
286  }
287 
291  public function ‪pi_setPiVarDefaults()
292  {
293  if (isset($this->conf['_DEFAULT_PI_VARS.']) && is_array($this->conf['_DEFAULT_PI_VARS.'])) {
294  $this->conf['_DEFAULT_PI_VARS.'] = $this->‪applyStdWrapRecursive($this->conf['_DEFAULT_PI_VARS.']);
295  $typoScriptService = GeneralUtility::makeInstance(TypoScriptService::class);
296  $tmp = $typoScriptService->convertTypoScriptArrayToPlainArray($this->conf['_DEFAULT_PI_VARS.']);
297  ArrayUtility::mergeRecursiveWithOverrule($tmp, is_array($this->piVars) ? $this->piVars : []);
298  $tmp = $this->‪removeInternalNodeValue($tmp);
299  $this->piVars = $tmp;
300  }
301  }
302 
306  protected function ‪removeInternalNodeValue(array $typoscript): array
307  {
308  foreach ($typoscript as $key => $value) {
309  if ($key === '_typoScriptNodeValue') {
310  unset($typoscript[$key]);
311  }
312  if (is_array($value)) {
313  $typoscript[$key] = $this->‪removeInternalNodeValue($value);
314  }
315  }
316 
317  return $typoscript;
318  }
319 
320  /***************************
321  *
322  * Link functions
323  *
324  **************************/
339  public function ‪pi_getPageLink($id, $target = '', $urlParameters = [])
340  {
341  ‪$conf = [
342  'parameter' => $id,
343  ];
344  if ($target) {
345  ‪$conf['target'] = $target;
346  ‪$conf['extTarget'] = $target;
347  ‪$conf['fileTarget'] = $target;
348  }
349  if (is_array($urlParameters)) {
350  if (!empty($urlParameters)) {
351  ‪$conf['additionalParams'] = ‪HttpUtility::buildQueryString($urlParameters, '&');
352  }
353  } else {
354  ‪$conf['additionalParams'] = $urlParameters;
355  }
356  return $this->cObj->createUrl(‪$conf);
357  }
358 
372  public function ‪pi_linkToPage($str, $id, $target = '', $urlParameters = [])
373  {
374  ‪$conf = [
375  'parameter' => $id,
376  ];
377  if ($target) {
378  ‪$conf['target'] = $target;
379  ‪$conf['extTarget'] = $target;
380  ‪$conf['fileTarget'] = $target;
381  }
382  if (is_array($urlParameters)) {
383  if (!empty($urlParameters)) {
384  ‪$conf['additionalParams'] = ‪HttpUtility::buildQueryString($urlParameters, '&');
385  }
386  } else {
387  ‪$conf['additionalParams'] = $urlParameters;
388  }
389  return $this->cObj->typoLink((string)$str, ‪$conf);
390  }
391 
404  public function ‪pi_linkTP($str, $urlParameters = [], $cache = false, $altPageId = 0)
405  {
406  ‪$conf = [];
407  if (!$cache) {
408  ‪$conf['no_cache'] = true;
409  }
410  ‪$conf['parameter'] = $altPageId ?: ($this->pi_tmpPageId ?: 'current');
411  ‪$conf['additionalParams'] = ($this->conf['parent.']['addParams'] ?? '') . ‪HttpUtility::buildQueryString($urlParameters, '&', true) . ‪$this->pi_moreParams;
412  return $this->cObj->typoLink((string)$str, ‪$conf);
413  }
414 
428  public function ‪pi_linkTP_keepPIvars($str, $overrulePIvars = [], $cache = false, $clearAnyway = false, $altPageId = 0)
429  {
430  if (is_array($this->piVars) && is_array($overrulePIvars) && !$clearAnyway) {
432  unset(‪$piVars['DATA']);
433  ArrayUtility::mergeRecursiveWithOverrule(‪$piVars, $overrulePIvars);
434  $overrulePIvars = ‪$piVars;
435  if ($this->pi_autoCacheEn) {
436  $cache = (bool)$this->‪pi_autoCache($overrulePIvars);
437  }
438  }
439  return $this->‪pi_linkTP($str, [$this->prefixId => $overrulePIvars], $cache, $altPageId);
440  }
441 
453  public function ‪pi_linkTP_keepPIvars_url($overrulePIvars = [], $cache = false, $clearAnyway = false, $altPageId = 0)
454  {
455  $this->‪pi_linkTP_keepPIvars('|', $overrulePIvars, $cache, $clearAnyway, $altPageId);
456  return $this->cObj->lastTypoLinkResult->getUrl();
457  }
458 
473  public function ‪pi_list_linkSingle($str, ‪$uid, $cache = false, $mergeArr = [], $urlOnly = false, $altPageId = 0)
474  {
475  if ($this->prefixId) {
476  if ($cache) {
477  $overrulePIvars = ‪$uid ? ['showUid' => ‪$uid] : [];
478  $overrulePIvars = array_merge($overrulePIvars, (array)$mergeArr);
479  $str = $this->‪pi_linkTP($str, [$this->prefixId => $overrulePIvars], $cache, $altPageId);
480  } else {
481  $overrulePIvars = ['showUid' => ‪$uid ?: ''];
482  $overrulePIvars = array_merge($overrulePIvars, (array)$mergeArr);
483  $str = $this->‪pi_linkTP_keepPIvars($str, $overrulePIvars, $cache, false, $altPageId);
484  }
485  // If urlOnly flag, return only URL as it has recently been generated.
486  if ($urlOnly) {
487  $str = $this->cObj->lastTypoLinkResult->getUrl();
488  }
489  }
490  return $str;
491  }
492 
501  public function ‪pi_openAtagHrefInJSwindow($str, $winName = '', $winParams = 'width=670,height=500,status=0,menubar=0,scrollbars=1,resizable=1')
502  {
503  if (!preg_match('/(.*)(<a[^>]*>)(.*)/i', $str, $matches)) {
504  return $str;
505  }
506  // decode HTML entities, `href` is used as URL for the window to be opened
507  $href = GeneralUtility::get_tag_attributes($matches[2], true)['href'] ?? '';
508  if (empty($href)) {
509  return $str;
510  }
511 
513  return sprintf(
514  '%s<a href="#" %s>%s',
515  $matches[1],
516  GeneralUtility::implodeAttributes([
517  'data-window-url' => $this->frontendController->baseUrlWrap($href, true),
518  'data-window-target' => $winName ?: md5($href),
519  'data-window-features' => $winParams,
520  ], true),
521  $matches[3]
522  );
523  }
524 
525  /***************************
526  *
527  * Functions for listing, browsing, searching etc.
528  *
529  **************************/
554  public function ‪pi_list_browseresults($showResultCount = 1, $tableParams = '', $wrapArr = [], $pointerName = 'pointer', $hscText = true, $forceOutput = false)
555  {
556  $wrapper = [];
557  $markerArray = [];
558  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::class]['pi_list_browseresults'] ?? [] as $classRef) {
559  $hookObj = GeneralUtility::makeInstance($classRef);
560  if (method_exists($hookObj, 'pi_list_browseresults')) {
561  $pageBrowser = $hookObj->pi_list_browseresults($showResultCount, $tableParams, $wrapArr, $pointerName, $hscText, $forceOutput, $this);
562  if (is_string($pageBrowser) && trim($pageBrowser) !== '') {
563  return $pageBrowser;
564  }
565  }
566  }
567  // example $wrapArr-array how it could be traversed from an extension
568  /* $wrapArr = array(
569  'browseBoxWrap' => '<div class="browseBoxWrap">|</div>',
570  'showResultsWrap' => '<div class="showResultsWrap">|</div>',
571  'browseLinksWrap' => '<div class="browseLinksWrap">|</div>',
572  'showResultsNumbersWrap' => '<span class="showResultsNumbersWrap">|</span>',
573  'disabledLinkWrap' => '<span class="disabledLinkWrap">|</span>',
574  'inactiveLinkWrap' => '<span class="inactiveLinkWrap">|</span>',
575  'activeLinkWrap' => '<span class="activeLinkWrap">|</span>'
576  );*/
577  // Initializing variables:
578  $pointer = (int)($this->piVars[$pointerName] ?? 0);
579  $count = (int)($this->internal['res_count'] ?? 0);
580  $results_at_a_time = ‪MathUtility::forceIntegerInRange(($this->internal['results_at_a_time'] ?? 1), 1, 1000);
581  $totalPages = (int)ceil($count / $results_at_a_time);
582  $maxPages = ‪MathUtility::forceIntegerInRange($this->internal['maxPages'], 1, 100);
584  if (!$forceOutput && $count <= $results_at_a_time) {
585  return '';
586  }
587  // $showResultCount determines how the results of the pagerowser will be shown.
588  // If set to 0: only the result-browser will be shown
589  // 1: (default) the text "Displaying results..." and the result-browser will be shown.
590  // 2: only the text "Displaying results..." will be shown
591  $showResultCount = (int)$showResultCount;
592  // If this is set, two links named "<< First" and "LAST >>" will be shown and point to the very first or last page.
593  $showFirstLast = !empty($this->internal['showFirstLast']);
594  // If this has a value the "previous" button is always visible (will be forced if "showFirstLast" is set)
595  $alwaysPrev = $showFirstLast ? 1 : ‪$this->pi_alwaysPrev;
596  if (isset($this->internal['pagefloat'])) {
597  if (strtoupper($this->internal['pagefloat']) === 'CENTER') {
598  $pagefloat = ceil(($maxPages - 1) / 2);
599  } else {
600  // pagefloat set as integer. 0 = left, value >= $this->internal['maxPages'] = right
601  $pagefloat = ‪MathUtility::forceIntegerInRange($this->internal['pagefloat'], -1, $maxPages - 1);
602  }
603  } else {
604  // pagefloat disabled
605  $pagefloat = -1;
606  }
607  // Default values for "traditional" wrapping with a table. Can be overwritten by vars from $wrapArr
608  $wrapper['disabledLinkWrap'] = '<td class="nowrap"><p>|</p></td>';
609  $wrapper['inactiveLinkWrap'] = '<td class="nowrap"><p>|</p></td>';
610  $wrapper['activeLinkWrap'] = '<td' . $this->‪pi_classParam('browsebox-SCell') . ' class="nowrap"><p>|</p></td>';
611  $wrapper['browseLinksWrap'] = rtrim('<table ' . $tableParams) . '><tr>|</tr></table>';
612  $wrapper['showResultsWrap'] = '<p>|</p>';
613  $wrapper['browseBoxWrap'] = '
614  <!--
615  List browsing box:
616  -->
617  <div ' . $this->‪pi_classParam('browsebox') . '>
618  |
619  </div>';
620  // Now overwrite all entries in $wrapper which are also in $wrapArr
621  $wrapper = array_merge($wrapper, $wrapArr);
622  // Show pagebrowser
623  if ($showResultCount != 2) {
624  if ($pagefloat > -1) {
625  $lastPage = min($totalPages, max($pointer + 1 + $pagefloat, $maxPages));
626  $firstPage = max(0, $lastPage - $maxPages);
627  } else {
628  $firstPage = 0;
629  $lastPage = ‪MathUtility::forceIntegerInRange($totalPages, 1, $maxPages);
630  }
631  $links = [];
632  // Make browse-table/links:
633  // Link to first page
634  if ($showFirstLast) {
635  if ($pointer > 0) {
636  $label = $this->‪pi_getLL('pi_list_browseresults_first', '<< First');
637  $links[] = $this->cObj->wrap($this->‪pi_linkTP_keepPIvars($hscText ? htmlspecialchars($label) : $label, [$pointerName => null], ‪$pi_isOnlyFields), $wrapper['inactiveLinkWrap']);
638  } else {
639  $label = $this->‪pi_getLL('pi_list_browseresults_first', '<< First');
640  $links[] = $this->cObj->wrap($hscText ? htmlspecialchars($label) : $label, $wrapper['disabledLinkWrap']);
641  }
642  }
643  // Link to previous page
644  if ($alwaysPrev >= 0) {
645  if ($pointer > 0) {
646  $label = $this->‪pi_getLL('pi_list_browseresults_prev', '< Previous');
647  $links[] = $this->cObj->wrap($this->‪pi_linkTP_keepPIvars($hscText ? htmlspecialchars($label) : $label, [$pointerName => ($pointer - 1) ?: ''], ‪$pi_isOnlyFields), $wrapper['inactiveLinkWrap']);
648  } elseif ($alwaysPrev) {
649  $label = $this->‪pi_getLL('pi_list_browseresults_prev', '< Previous');
650  $links[] = $this->cObj->wrap($hscText ? htmlspecialchars($label) : $label, $wrapper['disabledLinkWrap']);
651  }
652  }
653  // Links to pages
654  for ($a = $firstPage; $a < $lastPage; $a++) {
655  if ($this->internal['showRange'] ?? false) {
656  $pageText = ($a * $results_at_a_time + 1) . '-' . min($count, ($a + 1) * $results_at_a_time);
657  } else {
658  $label = $this->‪pi_getLL('pi_list_browseresults_page', 'Page');
659  $pageText = trim(($hscText ? htmlspecialchars($label) : $label) . ' ' . ($a + 1));
660  }
661  // Current page
662  if ($pointer == $a) {
663  if ($this->internal['dontLinkActivePage'] ?? false) {
664  $links[] = $this->cObj->wrap($pageText, $wrapper['activeLinkWrap']);
665  } else {
666  $links[] = $this->cObj->wrap($this->‪pi_linkTP_keepPIvars($pageText, [$pointerName => $a ?: ''], ‪$pi_isOnlyFields), $wrapper['activeLinkWrap']);
667  }
668  } else {
669  $links[] = $this->cObj->wrap($this->‪pi_linkTP_keepPIvars($pageText, [$pointerName => $a ?: ''], ‪$pi_isOnlyFields), $wrapper['inactiveLinkWrap']);
670  }
671  }
672  if ($pointer < $totalPages - 1 || $showFirstLast) {
673  // Link to next page
674  if ($pointer >= $totalPages - 1) {
675  $label = $this->‪pi_getLL('pi_list_browseresults_next', 'Next >');
676  $links[] = $this->cObj->wrap($hscText ? htmlspecialchars($label) : $label, $wrapper['disabledLinkWrap']);
677  } else {
678  $label = $this->‪pi_getLL('pi_list_browseresults_next', 'Next >');
679  $links[] = $this->cObj->wrap($this->‪pi_linkTP_keepPIvars($hscText ? htmlspecialchars($label) : $label, [$pointerName => $pointer + 1], ‪$pi_isOnlyFields), $wrapper['inactiveLinkWrap']);
680  }
681  }
682  // Link to last page
683  if ($showFirstLast) {
684  if ($pointer < $totalPages - 1) {
685  $label = $this->‪pi_getLL('pi_list_browseresults_last', 'Last >>');
686  $links[] = $this->cObj->wrap($this->‪pi_linkTP_keepPIvars($hscText ? htmlspecialchars($label) : $label, [$pointerName => $totalPages - 1], ‪$pi_isOnlyFields), $wrapper['inactiveLinkWrap']);
687  } else {
688  $label = $this->‪pi_getLL('pi_list_browseresults_last', 'Last >>');
689  $links[] = $this->cObj->wrap($hscText ? htmlspecialchars($label) : $label, $wrapper['disabledLinkWrap']);
690  }
691  }
692  $theLinks = $this->cObj->wrap(implode(LF, $links), $wrapper['browseLinksWrap']);
693  } else {
694  $theLinks = '';
695  }
696  $pR1 = $pointer * $results_at_a_time + 1;
697  $pR2 = $pointer * $results_at_a_time + $results_at_a_time;
698  if ($showResultCount) {
699  if ($wrapper['showResultsNumbersWrap'] ?? false) {
700  // This will render the resultcount in a more flexible way using markers (new in TYPO3 3.8.0).
701  // The formatting string is expected to hold template markers (see function header). Example: 'Displaying results ###FROM### to ###TO### out of ###OUT_OF###'
702  $markerArray['###FROM###'] = $this->cObj->wrap(($this->internal['res_count'] ?? 0) > 0 ? $pR1 : 0, $wrapper['showResultsNumbersWrap']);
703  $markerArray['###TO###'] = $this->cObj->wrap(min(($this->internal['res_count'] ?? 0), $pR2), $wrapper['showResultsNumbersWrap']);
704  $markerArray['###OUT_OF###'] = $this->cObj->wrap(($this->internal['res_count'] ?? 0), $wrapper['showResultsNumbersWrap']);
705  $markerArray['###FROM_TO###'] = $this->cObj->wrap((($this->internal['res_count'] ?? 0) > 0 ? $pR1 : 0) . ' ' . $this->‪pi_getLL('pi_list_browseresults_to', 'to') . ' ' . min($this->internal['res_count'] ?? 0, $pR2), $wrapper['showResultsNumbersWrap']);
706  $markerArray['###CURRENT_PAGE###'] = $this->cObj->wrap($pointer + 1, $wrapper['showResultsNumbersWrap']);
707  $markerArray['###TOTAL_PAGES###'] = $this->cObj->wrap($totalPages, $wrapper['showResultsNumbersWrap']);
708  // Substitute markers
709  $resultCountMsg = $this->templateService->substituteMarkerArray($this->‪pi_getLL('pi_list_browseresults_displays', 'Displaying results ###FROM### to ###TO### out of ###OUT_OF###'), $markerArray);
710  } else {
711  // Render the resultcount in the "traditional" way using sprintf
712  $resultCountMsg = sprintf(str_replace('###SPAN_BEGIN###', '<span' . $this->‪pi_classParam('browsebox-strong') . '>', $this->‪pi_getLL('pi_list_browseresults_displays', 'Displaying results ###SPAN_BEGIN###%s to %s</span> out of ###SPAN_BEGIN###%s</span>')), $count > 0 ? $pR1 : 0, min($count, $pR2), $count);
713  }
714  $resultCountMsg = $this->cObj->wrap($resultCountMsg, $wrapper['showResultsWrap']);
715  } else {
716  $resultCountMsg = '';
717  }
718  $sTables = $this->cObj->wrap($resultCountMsg . $theLinks, $wrapper['browseBoxWrap']);
719  return $sTables;
720  }
721 
729  public function ‪pi_list_modeSelector($items = [], $tableParams = '')
730  {
731  $cells = [];
732  foreach ($items as $k => $v) {
733  $cells[] = '
734  <td' . ($this->piVars['mode'] == $k ? $this->‪pi_classParam('modeSelector-SCell') : '') . '><p>' . $this->‪pi_linkTP_keepPIvars(htmlspecialchars($v), ['mode' => $k], (bool)$this->‪pi_isOnlyFields($this->‪pi_isOnlyFields)) . '</p></td>';
735  }
736  $sTables = '
737 
738  <!--
739  Mode selector (menu for list):
740  -->
741  <div' . $this->‪pi_classParam('modeSelector') . '>
742  <' . rtrim('table ' . $tableParams) . '>
743  <tr>
744  ' . implode('', $cells) . '
745  </tr>
746  </table>
747  </div>';
748  return $sTables;
749  }
750 
764  public function ‪pi_list_makelist($statement, $tableParams = '')
765  {
766  // Make list table header:
767  $tRows = [];
768  $this->internal['currentRow'] = '';
769  $tRows[] = $this->‪pi_list_header();
770  // Make list table rows
771  $c = 0;
772  while ($this->internal['currentRow'] = $statement->fetchAssociative()) {
773  $tRows[] = $this->‪pi_list_row($c);
774  $c++;
775  }
776  $out = '
777 
778  <!--
779  Record list:
780  -->
781  <div' . $this->‪pi_classParam('listrow') . '>
782  <' . rtrim('table ' . $tableParams) . '>
783  ' . implode('', $tRows) . '
784  </table>
785  </div>';
786  return $out;
787  }
788 
797  public function ‪pi_list_row($c)
798  {
799  // Dummy
800  return '<tr' . ($c % 2 ? $this->‪pi_classParam('listrow-odd') : '') . '><td><p>[dummy row]</p></td></tr>';
801  }
802 
810  public function ‪pi_list_header()
811  {
812  return '<tr' . $this->‪pi_classParam('listrow-header') . '><td><p>[dummy header row]</p></td></tr>';
813  }
814 
815  /***************************
816  *
817  * Stylesheet, CSS
818  *
819  **************************/
826  public function ‪pi_getClassName($class)
827  {
828  return str_replace('_', '-', $this->prefixId) . ($this->prefixId ? '-' : '') . $class;
829  }
830 
840  public function ‪pi_classParam($class, $addClasses = '')
841  {
842  ‪$output = '';
843  $classNames = ‪GeneralUtility::trimExplode(',', $class);
844  foreach ($classNames as $className) {
845  ‪$output .= ' ' . $this->‪pi_getClassName($className);
846  }
847  $additionalClassNames = ‪GeneralUtility::trimExplode(',', $addClasses);
848  foreach ($additionalClassNames as $additionalClassName) {
849  ‪$output .= ' ' . $additionalClassName;
850  }
851  return ' class="' . trim(‪$output) . '"';
852  }
853 
861  public function ‪pi_wrapInBaseClass($str)
862  {
863  $content = '<div class="' . str_replace('_', '-', $this->prefixId) . '">
864  ' . $str . '
865  </div>
866  ';
867  if (!($this->frontendController->config['config']['disablePrefixComment'] ?? false)) {
868  $content = '
869 
870 
871  <!--
872 
873  BEGIN: Content of extension "' . $this->extKey . '", plugin "' . $this->prefixId . '"
874 
875  -->
876  ' . $content . '
877  <!-- END: Content of extension "' . $this->extKey . '", plugin "' . $this->prefixId . '" -->
878 
879  ';
880  }
881  return $content;
882  }
883 
884  /***************************
885  *
886  * Localization, locallang functions
887  *
888  **************************/
897  public function ‪pi_getLL($key, $alternativeLabel = '')
898  {
899  $word = null;
900  if (!empty($this->LOCAL_LANG[$this->LLkey][$key][0]['target'])
901  || isset($this->LOCAL_LANG_UNSET[$this->LLkey][$key])
902  ) {
903  $word = $this->LOCAL_LANG[‪$this->LLkey][$key][0]['target'];
904  } elseif ($this->altLLkey) {
905  $alternativeLanguageKeys = ‪GeneralUtility::trimExplode(',', $this->altLLkey, true);
906  foreach ($alternativeLanguageKeys as $languageKey) {
907  if (!empty($this->LOCAL_LANG[$languageKey][$key][0]['target'])
908  || isset($this->LOCAL_LANG_UNSET[$languageKey][$key])
909  ) {
910  // Alternative language translation for key exists
911  $word = $this->LOCAL_LANG[$languageKey][$key][0]['target'];
912  break;
913  }
914  }
915  }
916  if ($word === null) {
917  if (!empty($this->LOCAL_LANG['default'][$key][0]['target'])
918  || isset($this->LOCAL_LANG_UNSET['default'][$key])
919  ) {
920  // Get default translation (without charset conversion, english)
921  $word = $this->LOCAL_LANG['default'][$key][0]['target'];
922  } else {
923  // Return alternative string or empty
924  $word = !empty($this->LLtestPrefixAlt) ? $this->LLtestPrefixAlt . $alternativeLabel : $alternativeLabel;
925  }
926  }
927  return !empty($this->LLtestPrefix) ? $this->LLtestPrefix . $word : $word;
928  }
929 
940  public function ‪pi_loadLL($languageFilePath = '')
941  {
942  if ($this->LOCAL_LANG_loaded) {
943  return;
944  }
945 
946  if ($languageFilePath === '' && $this->scriptRelPath) {
947  $languageFilePath = 'EXT:' . $this->extKey . '/' . ‪PathUtility::dirname($this->scriptRelPath) . '/locallang.xlf';
948  }
949  if ($languageFilePath !== '') {
950  $languageFactory = GeneralUtility::makeInstance(LocalizationFactory::class);
951  $this->LOCAL_LANG = $languageFactory->getParsedData($languageFilePath, $this->LLkey);
952  $alternativeLanguageKeys = ‪GeneralUtility::trimExplode(',', $this->altLLkey, true);
953  foreach ($alternativeLanguageKeys as $languageKey) {
954  $tempLL = $languageFactory->getParsedData($languageFilePath, $languageKey);
955  if ($this->LLkey !== 'default' && isset($tempLL[$languageKey])) {
956  $this->LOCAL_LANG[$languageKey] = $tempLL[$languageKey];
957  }
958  }
959  // Overlaying labels from TypoScript (including fictitious language keys for non-system languages!):
960  if (isset($this->conf['_LOCAL_LANG.'])) {
961  // Clear the "unset memory"
962  $this->LOCAL_LANG_UNSET = [];
963  foreach ($this->conf['_LOCAL_LANG.'] as $languageKey => $languageArray) {
964  // Remove the dot after the language key
965  $languageKey = substr($languageKey, 0, -1);
966  // Don't process label if the language is not loaded
967  if (is_array($languageArray) && isset($this->LOCAL_LANG[$languageKey])) {
968  foreach ($languageArray as $labelKey => $labelValue) {
969  if (!is_array($labelValue)) {
970  $this->LOCAL_LANG[$languageKey][$labelKey][0]['target'] = $labelValue;
971  if ($labelValue === '') {
972  $this->LOCAL_LANG_UNSET[$languageKey][$labelKey] = '';
973  }
974  }
975  }
976  }
977  }
978  }
979  }
980  $this->LOCAL_LANG_loaded = true;
981  }
982 
983  /***************************
984  *
985  * Database, queries
986  *
987  **************************/
1002  public function ‪pi_exec_query($table, $count = false, $addWhere = '', $mm_cat = '', $groupBy = '', $orderBy = '', $query = '')
1003  {
1004  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($table);
1005  $queryBuilder->from($table);
1006 
1007  // Begin Query:
1008  if (!$query) {
1009  // This adds WHERE-clauses that ensures deleted, hidden, starttime/endtime/access records are NOT
1010  // selected, if they should not! Almost ALWAYS add this to your queries!
1011  $queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class));
1012 
1013  // Fetches the list of PIDs to select from.
1014  // TypoScript property .pidList is a comma list of pids. If blank, current page id is used.
1015  // TypoScript property .recursive is an int+ which determines how many levels down from the pids in the pid-list subpages should be included in the select.
1016  $pidList = ‪GeneralUtility::intExplode(',', $this->‪pi_getPidList($this->conf['pidList'] ?? '', (int)($this->conf['recursive'] ?? 0)), true);
1017  if (is_array($mm_cat)) {
1018  $queryBuilder->from($mm_cat['table'])
1019  ->from($mm_cat['mmtable'])
1020  ->where(
1021  $queryBuilder->expr()->eq($table . '.uid', $queryBuilder->quoteIdentifier($mm_cat['mmtable'] . '.uid_local')),
1022  $queryBuilder->expr()->eq($mm_cat['table'] . '.uid', $queryBuilder->quoteIdentifier($mm_cat['mmtable'] . '.uid_foreign')),
1023  $queryBuilder->expr()->in(
1024  $table . '.pid',
1025  $queryBuilder->createNamedParameter($pidList, Connection::PARAM_INT_ARRAY)
1026  )
1027  );
1028  $catUidList = (string)($mm_cat['catUidList'] ?? '');
1029  if ($catUidList !== '') {
1030  $queryBuilder->andWhere(
1031  $queryBuilder->expr()->in(
1032  $mm_cat['table'] . '.uid',
1033  $queryBuilder->createNamedParameter(
1034  ‪GeneralUtility::intExplode(',', $catUidList, true),
1035  Connection::PARAM_INT_ARRAY
1036  )
1037  )
1038  );
1039  }
1040  } else {
1041  $queryBuilder->where(
1042  $queryBuilder->expr()->in(
1043  'pid',
1044  $queryBuilder->createNamedParameter($pidList, Connection::PARAM_INT_ARRAY)
1045  )
1046  );
1047  }
1048  } else {
1049  // Restrictions need to be handled by the $query parameter!
1050  $queryBuilder->getRestrictions()->removeAll();
1051 
1052  // Split the "FROM ... WHERE" string so we get the WHERE part and TABLE names separated...:
1053  [$tableListFragment, $whereFragment] = preg_split('/WHERE/i', trim($query), 2);
1054  foreach (‪QueryHelper::parseTableList($tableListFragment) as $tableNameAndAlias) {
1055  [$tableName, $tableAlias] = $tableNameAndAlias;
1056  $queryBuilder->from($tableName, $tableAlias);
1057  }
1058  $queryBuilder->where(‪QueryHelper::stripLogicalOperatorPrefix($whereFragment));
1059  }
1060 
1061  // Add '$addWhere'
1062  if ($addWhere) {
1063  $queryBuilder->andWhere(‪QueryHelper::stripLogicalOperatorPrefix($addWhere));
1064  }
1065  // Search word:
1066  if ($this->piVars['sword'] && ($this->internal['searchFieldList'] ?? false)) {
1068  $this->cObj->searchWhere($this->piVars['sword'], $this->internal['searchFieldList'], $table)
1069  );
1070  if (!empty($searchWhere)) {
1071  $queryBuilder->andWhere($searchWhere);
1072  }
1073  }
1074 
1075  if ($count) {
1076  $queryBuilder->count('*');
1077  } else {
1078  // Add 'SELECT'
1079  ‪$fields = $this->‪pi_prependFieldsWithTable($table, $this->pi_listFields);
1080  $queryBuilder->select(...‪GeneralUtility::trimExplode(',', ‪$fields, true));
1081 
1082  // Order by data:
1083  if (!$orderBy && ($this->internal['orderBy'] ?? false)) {
1084  if (‪GeneralUtility::inList($this->internal['orderByList'], $this->internal['orderBy'])) {
1085  $sorting = ($this->internal['descFlag'] ?? false) ? ' DESC' : 'ASC';
1086  $queryBuilder->orderBy($table . '.' . $this->internal['orderBy'], $sorting);
1087  }
1088  } elseif ($orderBy) {
1089  foreach (‪QueryHelper::parseOrderBy($orderBy) as $fieldNameAndSorting) {
1090  [$fieldName, $sorting] = $fieldNameAndSorting;
1091  $queryBuilder->addOrderBy($fieldName, $sorting);
1092  }
1093  }
1094 
1095  // Limit data:
1096  $pointer = (int)$this->piVars['pointer'];
1097  $results_at_a_time = ‪MathUtility::forceIntegerInRange(($this->internal['results_at_a_time'] ?? 1), 1, 1000);
1098  $queryBuilder->setFirstResult($pointer * $results_at_a_time)
1099  ->setMaxResults($results_at_a_time);
1100 
1101  // Grouping
1102  if (!empty($groupBy)) {
1103  $queryBuilder->groupBy(...‪QueryHelper::parseGroupBy($groupBy));
1104  }
1105  }
1106 
1107  return $queryBuilder->executeQuery();
1108  }
1109 
1119  public function ‪pi_getRecord($table, ‪$uid, $checkPage = false)
1120  {
1121  return $this->frontendController->sys_page->checkRecord($table, ‪$uid, $checkPage);
1122  }
1123 
1131  public function ‪pi_getPidList($pid_list, $recursive = 0)
1132  {
1133  if (!strcmp($pid_list, '')) {
1134  $pid_list = (string)$this->frontendController->id;
1135  }
1136  $recursive = ‪MathUtility::forceIntegerInRange($recursive, 0);
1137  $pid_list_arr = array_unique(‪GeneralUtility::intExplode(',', $pid_list, true));
1138  $pid_list = GeneralUtility::makeInstance(PageRepository::class)->getPageIdsRecursive($pid_list_arr, $recursive);
1139  return implode(',', $pid_list);
1140  }
1141 
1149  public function ‪pi_prependFieldsWithTable($table, $fieldList)
1150  {
1151  $list = ‪GeneralUtility::trimExplode(',', $fieldList, true);
1152  $return = [];
1153  foreach ($list as $listItem) {
1154  $return[] = $table . '.' . $listItem;
1155  }
1156  return implode(',', $return);
1157  }
1158 
1170  public function ‪pi_getCategoryTableContents($table, $pid, $whereClause = '', $groupBy = '', $orderBy = '', $limit = '')
1171  {
1172  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($table);
1173  $queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class));
1174  $queryBuilder->select('*')
1175  ->from($table)
1176  ->where(
1177  $queryBuilder->expr()->eq(
1178  'pid',
1179  $queryBuilder->createNamedParameter($pid, ‪Connection::PARAM_INT)
1180  ),
1182  );
1183 
1184  if (!empty($orderBy)) {
1185  foreach (‪QueryHelper::parseOrderBy($orderBy) as $fieldNameAndSorting) {
1186  [$fieldName, $sorting] = $fieldNameAndSorting;
1187  $queryBuilder->addOrderBy($fieldName, $sorting);
1188  }
1189  }
1190 
1191  if (!empty($groupBy)) {
1192  $queryBuilder->groupBy(...‪QueryHelper::parseGroupBy($groupBy));
1193  }
1194 
1195  if (!empty($limit)) {
1196  $limitValues = ‪GeneralUtility::intExplode(',', (string)$limit, true);
1197  if (count($limitValues) === 1) {
1198  $queryBuilder->setMaxResults($limitValues[0]);
1199  } else {
1200  $queryBuilder->setFirstResult($limitValues[0])
1201  ->setMaxResults($limitValues[1]);
1202  }
1203  }
1204 
1205  $result = $queryBuilder->executeQuery();
1206  $outArr = [];
1207  while ($row = $result->fetchAssociative()) {
1208  $outArr[$row['uid']] = $row;
1209  }
1210  return $outArr;
1211  }
1212 
1213  /***************************
1214  *
1215  * Various
1216  *
1217  **************************/
1226  public function ‪pi_isOnlyFields($fList, $lowerThan = -1)
1227  {
1228  $lowerThan = $lowerThan == -1 ? $this->pi_lowerThan : $lowerThan;
1229  $fList = ‪GeneralUtility::trimExplode(',', $fList, true);
1230  $tempPiVars = ‪$this->piVars;
1231  foreach ($fList as $k) {
1232  if (isset($tempPiVars[$k]) && (!‪MathUtility::canBeInterpretedAsInteger($tempPiVars[$k]) || $tempPiVars[$k] < $lowerThan)) {
1233  unset($tempPiVars[$k]);
1234  }
1235  }
1236  if (empty($tempPiVars)) {
1237  // @TODO: How do we deal with this? return TRUE would be the right thing to do here but that might be breaking
1238  return 1;
1239  }
1240  return null;
1241  }
1242 
1252  public function ‪pi_autoCache($inArray)
1253  {
1254  if (is_array($inArray)) {
1255  foreach ($inArray as $fN => $fV) {
1256  if (!strcmp($inArray[$fN], '')) {
1257  unset($inArray[$fN]);
1258  } elseif (is_array($this->pi_autoCacheFields[$fN])) {
1259  if (is_array($this->pi_autoCacheFields[$fN]['range']) && (int)$inArray[$fN] >= (int)$this->pi_autoCacheFields[$fN]['range'][0] && (int)$inArray[$fN] <= (int)$this->pi_autoCacheFields[$fN]['range'][1]) {
1260  unset($inArray[$fN]);
1261  }
1262  if (is_array($this->pi_autoCacheFields[$fN]['list']) && in_array($inArray[$fN], $this->pi_autoCacheFields[$fN]['list'])) {
1263  unset($inArray[$fN]);
1264  }
1265  }
1266  }
1267  }
1268  if (empty($inArray)) {
1269  // @TODO: How do we deal with this? return TRUE would be the right thing to do here but that might be breaking
1270  return 1;
1271  }
1272  return null;
1273  }
1274 
1283  public function ‪pi_RTEcssText($str)
1284  {
1285  $str = $this->cObj->parseFunc($str, null, '< lib.parseFunc_RTE');
1286  return $str;
1287  }
1288 
1289  /*******************************
1290  *
1291  * FlexForms related functions
1292  *
1293  *******************************/
1299  public function ‪pi_initPIflexForm($field = 'pi_flexform')
1300  {
1301  // Converting flexform data into array
1302  $fieldData = $this->cObj->data[$field] ?? null;
1303  if (!is_array($fieldData) && $fieldData) {
1304  $this->cObj->data[$field] = ‪GeneralUtility::xml2array((string)$fieldData);
1305  if (!is_array($this->cObj->data[$field])) {
1306  $this->cObj->data[$field] = [];
1307  }
1308  }
1309  }
1310 
1321  public function ‪pi_getFFvalue($T3FlexForm_array, $fieldName, $sheet = 'sDEF', $lang = 'lDEF', $value = 'vDEF')
1322  {
1323  $sheetArray = $T3FlexForm_array['data'][$sheet][$lang] ?? '';
1324  if (is_array($sheetArray)) {
1325  return $this->‪pi_getFFvalueFromSheetArray($sheetArray, explode('/', $fieldName), $value);
1326  }
1327  return null;
1328  }
1329 
1340  public function ‪pi_getFFvalueFromSheetArray($sheetArray, $fieldNameArr, $value)
1341  {
1342  $tempArr = $sheetArray;
1343  foreach ($fieldNameArr as $k => $v) {
1345  if (is_array($tempArr)) {
1346  $c = 0;
1347  foreach ($tempArr as $values) {
1348  if ($c == $v) {
1349  $tempArr = $values;
1350  break;
1351  }
1352  $c++;
1353  }
1354  }
1355  } elseif (isset($tempArr[$v])) {
1356  $tempArr = $tempArr[$v];
1357  }
1358  }
1359  return $tempArr[$value] ?? '';
1360  }
1361 
1368  private static function ‪getRequestPostOverGetParameterWithPrefix($parameter)
1369  {
1370  $postParameter = isset($_POST[$parameter]) && is_array($_POST[$parameter]) ? $_POST[$parameter] : [];
1371  $getParameter = isset($_GET[$parameter]) && is_array($_GET[$parameter]) ? $_GET[$parameter] : [];
1372  $mergedParameters = $getParameter;
1373  ArrayUtility::mergeRecursiveWithOverrule($mergedParameters, $postParameter);
1374  return $mergedParameters;
1375  }
1376 }
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$templateService
‪MarkerBasedTemplateService $templateService
Definition: AbstractPlugin.php:193
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$altLLkey
‪string $altLLkey
Definition: AbstractPlugin.php:128
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\applyStdWrapRecursive
‪array applyStdWrapRecursive(array $conf, $level=0)
Definition: AbstractPlugin.php:236
‪TYPO3\CMS\Core\Database\Query\QueryHelper\parseOrderBy
‪static array array[] parseOrderBy(string $input)
Definition: QueryHelper.php:44
‪TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode
‪static list< string > trimExplode($delim, $string, $removeEmptyValues=false, $limit=0)
Definition: GeneralUtility.php:916
‪TYPO3\CMS\Core\Utility\GeneralUtility\xml2array
‪static mixed xml2array($string, $NSprefix='', $reportDocTag=false)
Definition: GeneralUtility.php:1363
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_linkToPage
‪string pi_linkToPage($str, $id, $target='', $urlParameters=[])
Definition: AbstractPlugin.php:348
‪TYPO3\CMS\Core\Utility\PathUtility
Definition: PathUtility.php:27
‪TYPO3\CMS\Core\Database\Connection\PARAM_INT
‪const PARAM_INT
Definition: Connection.php:47
‪TYPO3\CMS\Core\Database\Query\QueryHelper\parseTableList
‪static array array[] parseTableList(string $input)
Definition: QueryHelper.php:72
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\getRequestPostOverGetParameterWithPrefix
‪static array getRequestPostOverGetParameterWithPrefix($parameter)
Definition: AbstractPlugin.php:1344
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_list_header
‪string pi_list_header()
Definition: AbstractPlugin.php:786
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_list_modeSelector
‪string pi_list_modeSelector($items=[], $tableParams='')
Definition: AbstractPlugin.php:705
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_getPidList
‪string pi_getPidList($pid_list, $recursive=0)
Definition: AbstractPlugin.php:1107
‪TYPO3\CMS\Core\Localization\LocalizationFactory
Definition: LocalizationFactory.php:31
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_list_makelist
‪string pi_list_makelist($statement, $tableParams='')
Definition: AbstractPlugin.php:740
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_getClassName
‪string pi_getClassName($class)
Definition: AbstractPlugin.php:802
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_getLL
‪string pi_getLL($key, $alternativeLabel='')
Definition: AbstractPlugin.php:873
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_initPIflexForm
‪pi_initPIflexForm($field='pi_flexform')
Definition: AbstractPlugin.php:1275
‪TYPO3\CMS\Core\Database\Query\QueryHelper\parseGroupBy
‪static array string[] parseGroupBy(string $input)
Definition: QueryHelper.php:102
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$scriptRelPath
‪string $scriptRelPath
Definition: AbstractPlugin.php:64
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_prependFieldsWithTable
‪string pi_prependFieldsWithTable($table, $fieldList)
Definition: AbstractPlugin.php:1125
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin
Definition: AbstractPlugin.php:50
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$cObj
‪ContentObjectRenderer $cObj
Definition: AbstractPlugin.php:52
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$conf
‪array $conf
Definition: AbstractPlugin.php:179
‪TYPO3\CMS\Core\Localization\Locales
Definition: Locales.php:36
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$pi_autoCacheEn
‪bool $pi_autoCacheEn
Definition: AbstractPlugin.php:170
‪TYPO3\CMS\Frontend\Plugin
Definition: AbstractPlugin.php:16
‪$fields
‪$fields
Definition: pages.php:5
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$LOCAL_LANG_UNSET
‪array $LOCAL_LANG_UNSET
Definition: AbstractPlugin.php:109
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$pi_moreParams
‪string $pi_moreParams
Definition: AbstractPlugin.php:158
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_getCategoryTableContents
‪array pi_getCategoryTableContents($table, $pid, $whereClause='', $groupBy='', $orderBy='', $limit='')
Definition: AbstractPlugin.php:1146
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_linkTP
‪string pi_linkTP($str, $urlParameters=[], $cache=false, $altPageId=0)
Definition: AbstractPlugin.php:380
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$extKey
‪string $extKey
Definition: AbstractPlugin.php:70
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_getFFvalueFromSheetArray
‪mixed pi_getFFvalueFromSheetArray($sheetArray, $fieldNameArr, $value)
Definition: AbstractPlugin.php:1316
‪TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger
‪static bool canBeInterpretedAsInteger(mixed $var)
Definition: MathUtility.php:69
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_exec_query
‪Result pi_exec_query($table, $count=false, $addWhere='', $mm_cat='', $groupBy='', $orderBy='', $query='')
Definition: AbstractPlugin.php:978
‪TYPO3\CMS\Core\Utility\PathUtility\dirname
‪static dirname(string $path)
Definition: PathUtility.php:243
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_openAtagHrefInJSwindow
‪string pi_openAtagHrefInJSwindow($str, $winName='', $winParams='width=670, height=500, status=0, menubar=0, scrollbars=1, resizable=1')
Definition: AbstractPlugin.php:477
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$piVars
‪array $piVars
Definition: AbstractPlugin.php:78
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$prefixId
‪string $prefixId
Definition: AbstractPlugin.php:58
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$pi_tmpPageId
‪int $pi_tmpPageId
Definition: AbstractPlugin.php:183
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$internal
‪array $internal
Definition: AbstractPlugin.php:94
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_wrapInBaseClass
‪string pi_wrapInBaseClass($str)
Definition: AbstractPlugin.php:837
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_getPageLink
‪string pi_getPageLink($id, $target='', $urlParameters=[])
Definition: AbstractPlugin.php:315
‪TYPO3\CMS\Core\Database\Query\QueryHelper
Definition: QueryHelper.php:32
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_setPiVarDefaults
‪pi_setPiVarDefaults()
Definition: AbstractPlugin.php:267
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$pi_isOnlyFields
‪string $pi_isOnlyFields
Definition: AbstractPlugin.php:146
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$pi_alwaysPrev
‪int $pi_alwaysPrev
Definition: AbstractPlugin.php:150
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\__construct
‪__construct($_=null, TypoScriptFrontendController $frontendController=null)
Definition: AbstractPlugin.php:202
‪TYPO3\CMS\Core\Utility\HttpUtility\buildQueryString
‪static string buildQueryString(array $parameters, string $prependCharacter='', bool $skipEmptyParameters=false)
Definition: HttpUtility.php:124
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_getFFvalue
‪string null pi_getFFvalue($T3FlexForm_array, $fieldName, $sheet='sDEF', $lang='lDEF', $value='vDEF')
Definition: AbstractPlugin.php:1297
‪TYPO3\CMS\Core\Page\DefaultJavaScriptAssetTrait
Definition: DefaultJavaScriptAssetTrait.php:30
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_autoCache
‪bool null pi_autoCache($inArray)
Definition: AbstractPlugin.php:1228
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$pi_listFields
‪string $pi_listFields
Definition: AbstractPlugin.php:162
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_linkTP_keepPIvars
‪string pi_linkTP_keepPIvars($str, $overrulePIvars=[], $cache=false, $clearAnyway=false, $altPageId=0)
Definition: AbstractPlugin.php:404
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$pi_lowerThan
‪int $pi_lowerThan
Definition: AbstractPlugin.php:154
‪TYPO3\CMS\Core\TypoScript\TypoScriptService
Definition: TypoScriptService.php:27
‪$output
‪$output
Definition: annotationChecker.php:119
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_linkTP_keepPIvars_url
‪string pi_linkTP_keepPIvars_url($overrulePIvars=[], $cache=false, $clearAnyway=false, $altPageId=0)
Definition: AbstractPlugin.php:429
‪TYPO3\CMS\Core\Database\Connection
Definition: Connection.php:36
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_isOnlyFields
‪bool null pi_isOnlyFields($fList, $lowerThan=-1)
Definition: AbstractPlugin.php:1202
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\removeInternalNodeValue
‪removeInternalNodeValue(array $typoscript)
Definition: AbstractPlugin.php:282
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
Definition: TypoScriptFrontendController.php:105
‪TYPO3\CMS\Webhooks\Message\$uid
‪identifier readonly int $uid
Definition: PageModificationMessage.php:35
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_RTEcssText
‪string pi_RTEcssText($str)
Definition: AbstractPlugin.php:1259
‪TYPO3\CMS\Core\Database\Query\QueryHelper\stripLogicalOperatorPrefix
‪static string stripLogicalOperatorPrefix(string $constraint)
Definition: QueryHelper.php:171
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_loadLL
‪pi_loadLL($languageFilePath='')
Definition: AbstractPlugin.php:916
‪TYPO3\CMS\Core\Utility\ArrayUtility
Definition: ArrayUtility.php:26
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_classParam
‪string pi_classParam($class, $addClasses='')
Definition: AbstractPlugin.php:816
‪TYPO3\CMS\Core\Utility\GeneralUtility\intExplode
‪static int[] intExplode($delimiter, $string, $removeEmptyValues=false, $limit=0)
Definition: GeneralUtility.php:842
‪TYPO3\CMS\Core\Page\DefaultJavaScriptAssetTrait\addDefaultFrontendJavaScript
‪addDefaultFrontendJavaScript()
Definition: DefaultJavaScriptAssetTrait.php:32
‪TYPO3\CMS\Core\Utility\MathUtility
Definition: MathUtility.php:24
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$LOCAL_LANG_loaded
‪bool $LOCAL_LANG_loaded
Definition: AbstractPlugin.php:116
‪TYPO3\CMS\Core\Utility\GeneralUtility\inList
‪static bool inList($list, $item)
Definition: GeneralUtility.php:532
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$LLtestPrefixAlt
‪string $LLtestPrefixAlt
Definition: AbstractPlugin.php:142
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_list_row
‪string pi_list_row($c)
Definition: AbstractPlugin.php:773
‪TYPO3\CMS\Core\Utility\HttpUtility
Definition: HttpUtility.php:24
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$LOCAL_LANG
‪array $LOCAL_LANG
Definition: AbstractPlugin.php:100
‪TYPO3\CMS\Core\Domain\Repository\PageRepository
Definition: PageRepository.php:63
‪TYPO3\CMS\Core\Database\ConnectionPool
Definition: ConnectionPool.php:51
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_getRecord
‪array pi_getRecord($table, $uid, $checkPage=false)
Definition: AbstractPlugin.php:1095
‪TYPO3\CMS\Core\Utility\MathUtility\forceIntegerInRange
‪static int forceIntegerInRange(mixed $theInt, int $min, int $max=2000000000, int $defaultValue=0)
Definition: MathUtility.php:34
‪TYPO3\CMS\Core\Service\MarkerBasedTemplateService
Definition: MarkerBasedTemplateService.php:27
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:51
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$LLkey
‪string $LLkey
Definition: AbstractPlugin.php:122
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$LLtestPrefix
‪string $LLtestPrefix
Definition: AbstractPlugin.php:135
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\setContentObjectRenderer
‪setContentObjectRenderer(ContentObjectRenderer $cObj)
Definition: AbstractPlugin.php:224
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_list_browseresults
‪string pi_list_browseresults($showResultCount=1, $tableParams='', $wrapArr=[], $pointerName='pointer', $hscText=true, $forceOutput=false)
Definition: AbstractPlugin.php:530
‪TYPO3\CMS\Core\Database\Query\Restriction\FrontendRestrictionContainer
Definition: FrontendRestrictionContainer.php:30
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$pi_autoCacheFields
‪array $pi_autoCacheFields
Definition: AbstractPlugin.php:166
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$frontendController
‪TypoScriptFrontendController $frontendController
Definition: AbstractPlugin.php:189
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_list_linkSingle
‪string pi_list_linkSingle($str, $uid, $cache=false, $mergeArr=[], $urlOnly=false, $altPageId=0)
Definition: AbstractPlugin.php:449