‪TYPO3CMS  11.5
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;
33 use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
35 
43 {
45 
53  public ‪$cObj;
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 
186 
190  public ‪$pi_autoCacheEn = false;
191 
200  public ‪$conf = [];
201 
208  public ‪$pi_EPtemp_cObj;
209 
213  public ‪$pi_tmpPageId = 0;
214 
220  protected ‪$frontendController;
221 
225  protected ‪$templateService;
226 
236  {
237  $this->frontendController = ‪$frontendController ?: ‪$GLOBALS['TSFE'];
238  $this->templateService = GeneralUtility::makeInstance(MarkerBasedTemplateService::class);
239  // Setting piVars:
240  if ($this->prefixId) {
241  $this->piVars = GeneralUtility::_GPmerged($this->prefixId);
242  }
243  $this->LLkey = $this->frontendController->getLanguage()->getTypo3Language();
244 
245  $locales = GeneralUtility::makeInstance(Locales::class);
246  if (in_array($this->LLkey, $locales->getLocales())) {
247  foreach ($locales->getLocaleDependencies($this->LLkey) as $language) {
248  $this->altLLkey .= $language . ',';
249  }
250  $this->altLLkey = rtrim($this->altLLkey, ',');
251  }
252  }
253 
260  public function ‪setContentObjectRenderer(ContentObjectRenderer ‪$cObj): void
261  {
262  $this->cObj = ‪$cObj;
263  }
264 
272  protected function ‪applyStdWrapRecursive(array ‪$conf, $level = 0)
273  {
274  foreach (‪$conf as $key => $confNextLevel) {
275  if (str_contains($key, '.')) {
276  $key = substr($key, 0, -1);
277 
278  // descend into all non-stdWrap-subelements first
279  foreach ($confNextLevel as $subKey => $subConfNextLevel) {
280  if (is_array($subConfNextLevel) && str_contains($subKey, '.') && $subKey !== 'stdWrap.') {
281  ‪$conf[$key . '.'] = $this->‪applyStdWrapRecursive($confNextLevel, $level + 1);
282  }
283  }
284 
285  // now for stdWrap
286  foreach ($confNextLevel as $subKey => $subConfNextLevel) {
287  if (is_array($subConfNextLevel) && $subKey === 'stdWrap.') {
288  ‪$conf[$key] = $this->cObj->stdWrap(‪$conf[$key] ?? '', ‪$conf[$key . '.']['stdWrap.'] ?? []);
289  unset(‪$conf[$key . '.']['stdWrap.']);
290  if (empty(‪$conf[$key . '.'])) {
291  unset(‪$conf[$key . '.']);
292  }
293  }
294  }
295  }
296  }
297  return ‪$conf;
298  }
299 
303  public function ‪pi_setPiVarDefaults()
304  {
305  if (isset($this->conf['_DEFAULT_PI_VARS.']) && is_array($this->conf['_DEFAULT_PI_VARS.'])) {
306  $this->conf['_DEFAULT_PI_VARS.'] = $this->‪applyStdWrapRecursive($this->conf['_DEFAULT_PI_VARS.']);
307  $typoScriptService = GeneralUtility::makeInstance(TypoScriptService::class);
308  $tmp = $typoScriptService->convertTypoScriptArrayToPlainArray($this->conf['_DEFAULT_PI_VARS.']);
309  ‪ArrayUtility::mergeRecursiveWithOverrule($tmp, is_array($this->piVars) ? $this->piVars : []);
310  $tmp = $this->‪removeInternalNodeValue($tmp);
311  $this->piVars = $tmp;
312  }
313  }
314 
321  protected function ‪removeInternalNodeValue(array $typoscript): array
322  {
323  foreach ($typoscript as $key => $value) {
324  if ($key === '_typoScriptNodeValue') {
325  unset($typoscript[$key]);
326  }
327  if (is_array($value)) {
328  $typoscript[$key] = $this->‪removeInternalNodeValue($value);
329  }
330  }
331 
332  return $typoscript;
333  }
334 
335  /***************************
336  *
337  * Link functions
338  *
339  **************************/
354  public function ‪pi_getPageLink($id, $target = '', $urlParameters = [])
355  {
356  return $this->cObj->getTypoLink_URL($id, $urlParameters, $target);
357  }
358 
372  public function ‪pi_linkToPage($str, $id, $target = '', $urlParameters = [])
373  {
374  return $this->cObj->getTypoLink($str, $id, $urlParameters, $target);
375  }
376 
389  public function ‪pi_linkTP($str, $urlParameters = [], $cache = false, $altPageId = 0)
390  {
391  ‪$conf = [];
392  if (!$cache) {
393  ‪$conf['no_cache'] = true;
394  }
395  ‪$conf['parameter'] = $altPageId ?: ($this->pi_tmpPageId ?: 'current');
396  ‪$conf['additionalParams'] = ($this->conf['parent.']['addParams'] ?? '') . ‪HttpUtility::buildQueryString($urlParameters, '&', true) . ‪$this->pi_moreParams;
397  return $this->cObj->typoLink($str, ‪$conf);
398  }
399 
413  public function ‪pi_linkTP_keepPIvars($str, $overrulePIvars = [], $cache = false, $clearAnyway = false, $altPageId = 0)
414  {
415  if (is_array($this->piVars) && is_array($overrulePIvars) && !$clearAnyway) {
417  unset(‪$piVars['DATA']);
419  $overrulePIvars = ‪$piVars;
420  if ($this->pi_autoCacheEn) {
421  $cache = (bool)$this->‪pi_autoCache($overrulePIvars);
422  }
423  }
424  return $this->‪pi_linkTP($str, [$this->prefixId => $overrulePIvars], $cache, $altPageId);
425  }
426 
438  public function ‪pi_linkTP_keepPIvars_url($overrulePIvars = [], $cache = false, $clearAnyway = false, $altPageId = 0)
439  {
440  $this->‪pi_linkTP_keepPIvars('|', $overrulePIvars, $cache, $clearAnyway, $altPageId);
441  return $this->cObj->lastTypoLinkUrl;
442  }
443 
458  public function ‪pi_list_linkSingle($str, $uid, $cache = false, $mergeArr = [], $urlOnly = false, $altPageId = 0)
459  {
460  if ($this->prefixId) {
461  if ($cache) {
462  $overrulePIvars = $uid ? ['showUid' => $uid] : [];
463  $overrulePIvars = array_merge($overrulePIvars, (array)$mergeArr);
464  $str = $this->‪pi_linkTP($str, [$this->prefixId => $overrulePIvars], $cache, $altPageId);
465  } else {
466  $overrulePIvars = ['showUid' => $uid ?: ''];
467  $overrulePIvars = array_merge($overrulePIvars, (array)$mergeArr);
468  $str = $this->‪pi_linkTP_keepPIvars($str, $overrulePIvars, $cache, false, $altPageId);
469  }
470  // If urlOnly flag, return only URL as it has recently be generated.
471  if ($urlOnly) {
472  $str = $this->cObj->lastTypoLinkUrl;
473  }
474  }
475  return $str;
476  }
477 
486  public function ‪pi_openAtagHrefInJSwindow($str, $winName = '', $winParams = 'width=670,height=500,status=0,menubar=0,scrollbars=1,resizable=1')
487  {
488  if (!preg_match('/(.*)(<a[^>]*>)(.*)/i', $str, $matches)) {
489  return $str;
490  }
491  // decode HTML entities, `href` is used as URL for the window to be opened
492  $href = GeneralUtility::get_tag_attributes($matches[2], true)['href'] ?? '';
493  if (empty($href)) {
494  return $str;
495  }
496 
498  return sprintf(
499  '%s<a href="#" %s>%s',
500  $matches[1],
501  GeneralUtility::implodeAttributes([
502  'data-window-url' => $this->frontendController->baseUrlWrap($href),
503  'data-window-target' => $winName ?: md5($href),
504  'data-window-features' => $winParams,
505  ], true),
506  $matches[3]
507  );
508  }
509 
510  /***************************
511  *
512  * Functions for listing, browsing, searching etc.
513  *
514  **************************/
539  public function ‪pi_list_browseresults($showResultCount = 1, $tableParams = '', $wrapArr = [], $pointerName = 'pointer', $hscText = true, $forceOutput = false)
540  {
541  $wrapper = [];
542  $markerArray = [];
543  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::class]['pi_list_browseresults'] ?? [] as $classRef) {
544  $hookObj = GeneralUtility::makeInstance($classRef);
545  if (method_exists($hookObj, 'pi_list_browseresults')) {
546  $pageBrowser = $hookObj->pi_list_browseresults($showResultCount, $tableParams, $wrapArr, $pointerName, $hscText, $forceOutput, $this);
547  if (is_string($pageBrowser) && trim($pageBrowser) !== '') {
548  return $pageBrowser;
549  }
550  }
551  }
552  // example $wrapArr-array how it could be traversed from an extension
553  /* $wrapArr = array(
554  'browseBoxWrap' => '<div class="browseBoxWrap">|</div>',
555  'showResultsWrap' => '<div class="showResultsWrap">|</div>',
556  'browseLinksWrap' => '<div class="browseLinksWrap">|</div>',
557  'showResultsNumbersWrap' => '<span class="showResultsNumbersWrap">|</span>',
558  'disabledLinkWrap' => '<span class="disabledLinkWrap">|</span>',
559  'inactiveLinkWrap' => '<span class="inactiveLinkWrap">|</span>',
560  'activeLinkWrap' => '<span class="activeLinkWrap">|</span>'
561  );*/
562  // Initializing variables:
563  $pointer = (int)($this->piVars[$pointerName] ?? 0);
564  $count = (int)($this->internal['res_count'] ?? 0);
565  $results_at_a_time = ‪MathUtility::forceIntegerInRange(($this->internal['results_at_a_time'] ?? 1), 1, 1000);
566  $totalPages = (int)ceil($count / $results_at_a_time);
567  $maxPages = ‪MathUtility::forceIntegerInRange($this->internal['maxPages'], 1, 100);
569  if (!$forceOutput && $count <= $results_at_a_time) {
570  return '';
571  }
572  // $showResultCount determines how the results of the pagerowser will be shown.
573  // If set to 0: only the result-browser will be shown
574  // 1: (default) the text "Displaying results..." and the result-browser will be shown.
575  // 2: only the text "Displaying results..." will be shown
576  $showResultCount = (int)$showResultCount;
577  // If this is set, two links named "<< First" and "LAST >>" will be shown and point to the very first or last page.
578  $showFirstLast = !empty($this->internal['showFirstLast']);
579  // If this has a value the "previous" button is always visible (will be forced if "showFirstLast" is set)
580  $alwaysPrev = $showFirstLast ? 1 : ‪$this->pi_alwaysPrev;
581  if (isset($this->internal['pagefloat'])) {
582  if (strtoupper($this->internal['pagefloat']) === 'CENTER') {
583  $pagefloat = ceil(($maxPages - 1) / 2);
584  } else {
585  // pagefloat set as integer. 0 = left, value >= $this->internal['maxPages'] = right
586  $pagefloat = ‪MathUtility::forceIntegerInRange($this->internal['pagefloat'], -1, $maxPages - 1);
587  }
588  } else {
589  // pagefloat disabled
590  $pagefloat = -1;
591  }
592  // Default values for "traditional" wrapping with a table. Can be overwritten by vars from $wrapArr
593  $wrapper['disabledLinkWrap'] = '<td class="nowrap"><p>|</p></td>';
594  $wrapper['inactiveLinkWrap'] = '<td class="nowrap"><p>|</p></td>';
595  $wrapper['activeLinkWrap'] = '<td' . $this->‪pi_classParam('browsebox-SCell') . ' class="nowrap"><p>|</p></td>';
596  $wrapper['browseLinksWrap'] = rtrim('<table ' . $tableParams) . '><tr>|</tr></table>';
597  $wrapper['showResultsWrap'] = '<p>|</p>';
598  $wrapper['browseBoxWrap'] = '
599  <!--
600  List browsing box:
601  -->
602  <div ' . $this->‪pi_classParam('browsebox') . '>
603  |
604  </div>';
605  // Now overwrite all entries in $wrapper which are also in $wrapArr
606  $wrapper = array_merge($wrapper, $wrapArr);
607  // Show pagebrowser
608  if ($showResultCount != 2) {
609  if ($pagefloat > -1) {
610  $lastPage = min($totalPages, max($pointer + 1 + $pagefloat, $maxPages));
611  $firstPage = max(0, $lastPage - $maxPages);
612  } else {
613  $firstPage = 0;
614  $lastPage = ‪MathUtility::forceIntegerInRange($totalPages, 1, $maxPages);
615  }
616  $links = [];
617  // Make browse-table/links:
618  // Link to first page
619  if ($showFirstLast) {
620  if ($pointer > 0) {
621  $label = $this->‪pi_getLL('pi_list_browseresults_first', '<< First');
622  $links[] = $this->cObj->wrap($this->‪pi_linkTP_keepPIvars($hscText ? htmlspecialchars($label) : $label, [$pointerName => null], ‪$pi_isOnlyFields), $wrapper['inactiveLinkWrap']);
623  } else {
624  $label = $this->‪pi_getLL('pi_list_browseresults_first', '<< First');
625  $links[] = $this->cObj->wrap($hscText ? htmlspecialchars($label) : $label, $wrapper['disabledLinkWrap']);
626  }
627  }
628  // Link to previous page
629  if ($alwaysPrev >= 0) {
630  if ($pointer > 0) {
631  $label = $this->‪pi_getLL('pi_list_browseresults_prev', '< Previous');
632  $links[] = $this->cObj->wrap($this->‪pi_linkTP_keepPIvars($hscText ? htmlspecialchars($label) : $label, [$pointerName => ($pointer - 1) ?: ''], ‪$pi_isOnlyFields), $wrapper['inactiveLinkWrap']);
633  } elseif ($alwaysPrev) {
634  $label = $this->‪pi_getLL('pi_list_browseresults_prev', '< Previous');
635  $links[] = $this->cObj->wrap($hscText ? htmlspecialchars($label) : $label, $wrapper['disabledLinkWrap']);
636  }
637  }
638  // Links to pages
639  for ($a = $firstPage; $a < $lastPage; $a++) {
640  if ($this->internal['showRange'] ?? false) {
641  $pageText = ($a * $results_at_a_time + 1) . '-' . min($count, ($a + 1) * $results_at_a_time);
642  } else {
643  $label = $this->‪pi_getLL('pi_list_browseresults_page', 'Page');
644  $pageText = trim(($hscText ? htmlspecialchars($label) : $label) . ' ' . ($a + 1));
645  }
646  // Current page
647  if ($pointer == $a) {
648  if ($this->internal['dontLinkActivePage'] ?? false) {
649  $links[] = $this->cObj->wrap($pageText, $wrapper['activeLinkWrap']);
650  } else {
651  $links[] = $this->cObj->wrap($this->‪pi_linkTP_keepPIvars($pageText, [$pointerName => $a ?: ''], ‪$pi_isOnlyFields), $wrapper['activeLinkWrap']);
652  }
653  } else {
654  $links[] = $this->cObj->wrap($this->‪pi_linkTP_keepPIvars($pageText, [$pointerName => $a ?: ''], ‪$pi_isOnlyFields), $wrapper['inactiveLinkWrap']);
655  }
656  }
657  if ($pointer < $totalPages - 1 || $showFirstLast) {
658  // Link to next page
659  if ($pointer >= $totalPages - 1) {
660  $label = $this->‪pi_getLL('pi_list_browseresults_next', 'Next >');
661  $links[] = $this->cObj->wrap($hscText ? htmlspecialchars($label) : $label, $wrapper['disabledLinkWrap']);
662  } else {
663  $label = $this->‪pi_getLL('pi_list_browseresults_next', 'Next >');
664  $links[] = $this->cObj->wrap($this->‪pi_linkTP_keepPIvars($hscText ? htmlspecialchars($label) : $label, [$pointerName => $pointer + 1], ‪$pi_isOnlyFields), $wrapper['inactiveLinkWrap']);
665  }
666  }
667  // Link to last page
668  if ($showFirstLast) {
669  if ($pointer < $totalPages - 1) {
670  $label = $this->‪pi_getLL('pi_list_browseresults_last', 'Last >>');
671  $links[] = $this->cObj->wrap($this->‪pi_linkTP_keepPIvars($hscText ? htmlspecialchars($label) : $label, [$pointerName => $totalPages - 1], ‪$pi_isOnlyFields), $wrapper['inactiveLinkWrap']);
672  } else {
673  $label = $this->‪pi_getLL('pi_list_browseresults_last', 'Last >>');
674  $links[] = $this->cObj->wrap($hscText ? htmlspecialchars($label) : $label, $wrapper['disabledLinkWrap']);
675  }
676  }
677  $theLinks = $this->cObj->wrap(implode(LF, $links), $wrapper['browseLinksWrap']);
678  } else {
679  $theLinks = '';
680  }
681  $pR1 = $pointer * $results_at_a_time + 1;
682  $pR2 = $pointer * $results_at_a_time + $results_at_a_time;
683  if ($showResultCount) {
684  if ($wrapper['showResultsNumbersWrap'] ?? false) {
685  // This will render the resultcount in a more flexible way using markers (new in TYPO3 3.8.0).
686  // The formatting string is expected to hold template markers (see function header). Example: 'Displaying results ###FROM### to ###TO### out of ###OUT_OF###'
687  $markerArray['###FROM###'] = $this->cObj->wrap(($this->internal['res_count'] ?? 0) > 0 ? $pR1 : 0, $wrapper['showResultsNumbersWrap']);
688  $markerArray['###TO###'] = $this->cObj->wrap(min(($this->internal['res_count'] ?? 0), $pR2), $wrapper['showResultsNumbersWrap']);
689  $markerArray['###OUT_OF###'] = $this->cObj->wrap(($this->internal['res_count'] ?? 0), $wrapper['showResultsNumbersWrap']);
690  $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']);
691  $markerArray['###CURRENT_PAGE###'] = $this->cObj->wrap($pointer + 1, $wrapper['showResultsNumbersWrap']);
692  $markerArray['###TOTAL_PAGES###'] = $this->cObj->wrap($totalPages, $wrapper['showResultsNumbersWrap']);
693  // Substitute markers
694  $resultCountMsg = $this->templateService->substituteMarkerArray($this->‪pi_getLL('pi_list_browseresults_displays', 'Displaying results ###FROM### to ###TO### out of ###OUT_OF###'), $markerArray);
695  } else {
696  // Render the resultcount in the "traditional" way using sprintf
697  $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);
698  }
699  $resultCountMsg = $this->cObj->wrap($resultCountMsg, $wrapper['showResultsWrap']);
700  } else {
701  $resultCountMsg = '';
702  }
703  $sTables = $this->cObj->wrap($resultCountMsg . $theLinks, $wrapper['browseBoxWrap']);
704  return $sTables;
705  }
706 
714  public function ‪pi_list_modeSelector($items = [], $tableParams = '')
715  {
716  $cells = [];
717  foreach ($items as $k => $v) {
718  $cells[] = '
719  <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>';
720  }
721  $sTables = '
722 
723  <!--
724  Mode selector (menu for list):
725  -->
726  <div' . $this->‪pi_classParam('modeSelector') . '>
727  <' . rtrim('table ' . $tableParams) . '>
728  <tr>
729  ' . implode('', $cells) . '
730  </tr>
731  </table>
732  </div>';
733  return $sTables;
734  }
735 
749  public function ‪pi_list_makelist($statement, $tableParams = '')
750  {
751  // Make list table header:
752  $tRows = [];
753  $this->internal['currentRow'] = '';
754  $tRows[] = $this->‪pi_list_header();
755  // Make list table rows
756  $c = 0;
757  while ($this->internal['currentRow'] = $statement->fetchAssociative()) {
758  $tRows[] = $this->‪pi_list_row($c);
759  $c++;
760  }
761  $out = '
762 
763  <!--
764  Record list:
765  -->
766  <div' . $this->‪pi_classParam('listrow') . '>
767  <' . rtrim('table ' . $tableParams) . '>
768  ' . implode('', $tRows) . '
769  </table>
770  </div>';
771  return $out;
772  }
773 
782  public function ‪pi_list_row($c)
783  {
784  // Dummy
785  return '<tr' . ($c % 2 ? $this->‪pi_classParam('listrow-odd') : '') . '><td><p>[dummy row]</p></td></tr>';
786  }
787 
795  public function ‪pi_list_header()
796  {
797  return '<tr' . $this->‪pi_classParam('listrow-header') . '><td><p>[dummy header row]</p></td></tr>';
798  }
799 
800  /***************************
801  *
802  * Stylesheet, CSS
803  *
804  **************************/
811  public function ‪pi_getClassName($class)
812  {
813  return str_replace('_', '-', $this->prefixId) . ($this->prefixId ? '-' : '') . $class;
814  }
815 
825  public function ‪pi_classParam($class, $addClasses = '')
826  {
827  ‪$output = '';
828  $classNames = ‪GeneralUtility::trimExplode(',', $class);
829  foreach ($classNames as $className) {
830  ‪$output .= ' ' . $this->‪pi_getClassName($className);
831  }
832  $additionalClassNames = ‪GeneralUtility::trimExplode(',', $addClasses);
833  foreach ($additionalClassNames as $additionalClassName) {
834  ‪$output .= ' ' . $additionalClassName;
835  }
836  return ' class="' . trim(‪$output) . '"';
837  }
838 
846  public function ‪pi_wrapInBaseClass($str)
847  {
848  $content = '<div class="' . str_replace('_', '-', $this->prefixId) . '">
849  ' . $str . '
850  </div>
851  ';
852  if (!($this->frontendController->config['config']['disablePrefixComment'] ?? false)) {
853  $content = '
854 
855 
856  <!--
857 
858  BEGIN: Content of extension "' . $this->extKey . '", plugin "' . $this->prefixId . '"
859 
860  -->
861  ' . $content . '
862  <!-- END: Content of extension "' . $this->extKey . '", plugin "' . $this->prefixId . '" -->
863 
864  ';
865  }
866  return $content;
867  }
868 
869  /***************************
870  *
871  * Frontend editing: Edit panel, edit icons
872  *
873  **************************/
885  public function ‪pi_getEditPanel($row = [], $tablename = '', $label = '', ‪$conf = [])
886  {
887  trigger_error('Method ' . __METHOD__ . ' is deprecated and will be removed in TYPO3 12.0.', E_USER_DEPRECATED);
888  $panel = '';
889  if (!$row || !$tablename) {
890  $row = $this->internal['currentRow'];
891  $tablename = $this->internal['currentTable'];
892  }
893  if ($this->frontendController->isBackendUserLoggedIn()) {
894  // Create local cObj if not set:
895  if (!is_object($this->pi_EPtemp_cObj)) {
896  $this->pi_EPtemp_cObj = GeneralUtility::makeInstance(ContentObjectRenderer::class);
897  $this->pi_EPtemp_cObj->setParent($this->cObj->data, $this->cObj->currentRecord);
898  }
899  // Initialize the cObj object with current row
900  $this->pi_EPtemp_cObj->start($row, $tablename);
901  // Setting TypoScript values in the $conf array. See documentation in TSref for the EDITPANEL cObject.
902  ‪$conf['allow'] = 'edit,new,delete,move,hide';
903  $panel = $this->pi_EPtemp_cObj->cObjGetSingle('EDITPANEL', ‪$conf, 'editpanel');
904  }
905  if ($panel) {
906  if ($label) {
907  return '<!-- BEGIN: EDIT PANEL --><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td valign="top">' . $label . '</td><td valign="top" align="right">' . $panel . '</td></tr></table><!-- END: EDIT PANEL -->';
908  }
909  return '<!-- BEGIN: EDIT PANEL -->' . $panel . '<!-- END: EDIT PANEL -->';
910  }
911  return $label;
912  }
913 
928  public function ‪pi_getEditIcon($content, ‪$fields, $title = '', $row = [], $tablename = '', $oConf = [])
929  {
930  trigger_error('Method ' . __METHOD__ . ' is deprecated and will be removed in TYPO3 12.0.', E_USER_DEPRECATED);
931  if ($this->frontendController->isBackendUserLoggedIn()) {
932  if (!$row || !$tablename) {
933  $row = $this->internal['currentRow'];
934  $tablename = $this->internal['currentTable'];
935  }
936  $conf = array_merge([
937  'beforeLastTag' => 1,
938  'iconTitle' => $title,
939  ], $oConf);
940  $content = $this->cObj->editIcons($content, $tablename . ':' . ‪$fields, ‪$conf, $tablename . ':' . $row['uid'], $row, '&viewUrl=' . rawurlencode($this->cObj->getRequest()->getAttribute('normalizedParams')->getRequestUri()));
941  }
942  return $content;
943  }
944 
945  /***************************
946  *
947  * Localization, locallang functions
948  *
949  **************************/
958  public function ‪pi_getLL($key, $alternativeLabel = '')
959  {
960  $word = null;
961  if (!empty($this->LOCAL_LANG[$this->LLkey][$key][0]['target'])
962  || isset($this->LOCAL_LANG_UNSET[$this->LLkey][$key])
963  ) {
964  $word = $this->LOCAL_LANG[‪$this->LLkey][$key][0]['target'];
965  } elseif ($this->altLLkey) {
966  $alternativeLanguageKeys = ‪GeneralUtility::trimExplode(',', $this->altLLkey, true);
967  $alternativeLanguageKeys = array_reverse($alternativeLanguageKeys);
968  foreach ($alternativeLanguageKeys as $languageKey) {
969  if (!empty($this->LOCAL_LANG[$languageKey][$key][0]['target'])
970  || isset($this->LOCAL_LANG_UNSET[$languageKey][$key])
971  ) {
972  // Alternative language translation for key exists
973  $word = $this->LOCAL_LANG[$languageKey][$key][0]['target'];
974  break;
975  }
976  }
977  }
978  if ($word === null) {
979  if (!empty($this->LOCAL_LANG['default'][$key][0]['target'])
980  || isset($this->LOCAL_LANG_UNSET['default'][$key])
981  ) {
982  // Get default translation (without charset conversion, english)
983  $word = $this->LOCAL_LANG['default'][$key][0]['target'];
984  } else {
985  // Return alternative string or empty
986  $word = isset($this->LLtestPrefixAlt) ? $this->LLtestPrefixAlt . $alternativeLabel : $alternativeLabel;
987  }
988  }
989  return isset($this->LLtestPrefix) ? $this->LLtestPrefix . $word : $word;
990  }
991 
1002  public function ‪pi_loadLL($languageFilePath = '')
1003  {
1004  if ($this->LOCAL_LANG_loaded) {
1005  return;
1006  }
1007 
1008  if ($languageFilePath === '' && $this->scriptRelPath) {
1009  $languageFilePath = 'EXT:' . $this->extKey . '/' . ‪PathUtility::dirname($this->scriptRelPath) . '/locallang.xlf';
1010  }
1011  if ($languageFilePath !== '') {
1012  $languageFactory = GeneralUtility::makeInstance(LocalizationFactory::class);
1013  $this->LOCAL_LANG = $languageFactory->getParsedData($languageFilePath, $this->LLkey);
1014  $alternativeLanguageKeys = ‪GeneralUtility::trimExplode(',', $this->altLLkey, true);
1015  foreach ($alternativeLanguageKeys as $languageKey) {
1016  $tempLL = $languageFactory->getParsedData($languageFilePath, $languageKey);
1017  if ($this->LLkey !== 'default' && isset($tempLL[$languageKey])) {
1018  $this->LOCAL_LANG[$languageKey] = $tempLL[$languageKey];
1019  }
1020  }
1021  // Overlaying labels from TypoScript (including fictitious language keys for non-system languages!):
1022  if (isset($this->conf['_LOCAL_LANG.'])) {
1023  // Clear the "unset memory"
1024  $this->LOCAL_LANG_UNSET = [];
1025  foreach ($this->conf['_LOCAL_LANG.'] as $languageKey => $languageArray) {
1026  // Remove the dot after the language key
1027  $languageKey = substr($languageKey, 0, -1);
1028  // Don't process label if the language is not loaded
1029  if (is_array($languageArray) && isset($this->LOCAL_LANG[$languageKey])) {
1030  foreach ($languageArray as $labelKey => $labelValue) {
1031  if (!is_array($labelValue)) {
1032  $this->LOCAL_LANG[$languageKey][$labelKey][0]['target'] = $labelValue;
1033  if ($labelValue === '') {
1034  $this->LOCAL_LANG_UNSET[$languageKey][$labelKey] = '';
1035  }
1036  }
1037  }
1038  }
1039  }
1040  }
1041  }
1042  $this->LOCAL_LANG_loaded = true;
1043  }
1044 
1045  /***************************
1046  *
1047  * Database, queries
1048  *
1049  **************************/
1064  public function ‪pi_exec_query($table, $count = false, $addWhere = '', $mm_cat = '', $groupBy = '', $orderBy = '', $query = '')
1065  {
1066  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($table);
1067  $queryBuilder->from($table);
1068 
1069  // Begin Query:
1070  if (!$query) {
1071  // This adds WHERE-clauses that ensures deleted, hidden, starttime/endtime/access records are NOT
1072  // selected, if they should not! Almost ALWAYS add this to your queries!
1073  $queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class));
1074 
1075  // Fetches the list of PIDs to select from.
1076  // TypoScript property .pidList is a comma list of pids. If blank, current page id is used.
1077  // 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.
1078  $pidList = ‪GeneralUtility::intExplode(',', $this->‪pi_getPidList($this->conf['pidList'] ?? '', (int)($this->conf['recursive'] ?? 0)), true);
1079  if (is_array($mm_cat)) {
1080  $queryBuilder->from($mm_cat['table'])
1081  ->from($mm_cat['mmtable'])
1082  ->where(
1083  $queryBuilder->expr()->eq($table . '.uid', $queryBuilder->quoteIdentifier($mm_cat['mmtable'] . '.uid_local')),
1084  $queryBuilder->expr()->eq($mm_cat['table'] . '.uid', $queryBuilder->quoteIdentifier($mm_cat['mmtable'] . '.uid_foreign')),
1085  $queryBuilder->expr()->in(
1086  $table . '.pid',
1087  $queryBuilder->createNamedParameter($pidList, Connection::PARAM_INT_ARRAY)
1088  )
1089  );
1090  $catUidList = (string)($mm_cat['catUidList'] ?? '');
1091  if ($catUidList !== '') {
1092  $queryBuilder->andWhere(
1093  $queryBuilder->expr()->in(
1094  $mm_cat['table'] . '.uid',
1095  $queryBuilder->createNamedParameter(
1096  ‪GeneralUtility::intExplode(',', $catUidList, true),
1097  Connection::PARAM_INT_ARRAY
1098  )
1099  )
1100  );
1101  }
1102  } else {
1103  $queryBuilder->where(
1104  $queryBuilder->expr()->in(
1105  'pid',
1106  $queryBuilder->createNamedParameter($pidList, Connection::PARAM_INT_ARRAY)
1107  )
1108  );
1109  }
1110  } else {
1111  // Restrictions need to be handled by the $query parameter!
1112  $queryBuilder->getRestrictions()->removeAll();
1113 
1114  // Split the "FROM ... WHERE" string so we get the WHERE part and TABLE names separated...:
1115  [$tableListFragment, $whereFragment] = preg_split('/WHERE/i', trim($query), 2);
1116  foreach (‪QueryHelper::parseTableList($tableListFragment) as $tableNameAndAlias) {
1117  [$tableName, $tableAlias] = $tableNameAndAlias;
1118  $queryBuilder->from($tableName, $tableAlias);
1119  }
1120  $queryBuilder->where(‪QueryHelper::stripLogicalOperatorPrefix($whereFragment));
1121  }
1122 
1123  // Add '$addWhere'
1124  if ($addWhere) {
1125  $queryBuilder->andWhere(‪QueryHelper::stripLogicalOperatorPrefix($addWhere));
1126  }
1127  // Search word:
1128  if ($this->piVars['sword'] && ($this->internal['searchFieldList'] ?? false)) {
1130  $this->cObj->searchWhere($this->piVars['sword'], $this->internal['searchFieldList'], $table)
1131  );
1132  if (!empty($searchWhere)) {
1133  $queryBuilder->andWhere($searchWhere);
1134  }
1135  }
1136 
1137  if ($count) {
1138  $queryBuilder->count('*');
1139  } else {
1140  // Add 'SELECT'
1141  ‪$fields = $this->‪pi_prependFieldsWithTable($table, $this->pi_listFields);
1142  $queryBuilder->select(...‪GeneralUtility::trimExplode(',', ‪$fields, true));
1143 
1144  // Order by data:
1145  if (!$orderBy && ($this->internal['orderBy'] ?? false)) {
1146  if (GeneralUtility::inList($this->internal['orderByList'], $this->internal['orderBy'])) {
1147  $sorting = ($this->internal['descFlag'] ?? false) ? ' DESC' : 'ASC';
1148  $queryBuilder->orderBy($table . '.' . $this->internal['orderBy'], $sorting);
1149  }
1150  } elseif ($orderBy) {
1151  foreach (‪QueryHelper::parseOrderBy($orderBy) as $fieldNameAndSorting) {
1152  [$fieldName, $sorting] = $fieldNameAndSorting;
1153  $queryBuilder->addOrderBy($fieldName, $sorting);
1154  }
1155  }
1156 
1157  // Limit data:
1158  $pointer = (int)$this->piVars['pointer'];
1159  $results_at_a_time = ‪MathUtility::forceIntegerInRange(($this->internal['results_at_a_time'] ?? 1), 1, 1000);
1160  $queryBuilder->setFirstResult($pointer * $results_at_a_time)
1161  ->setMaxResults($results_at_a_time);
1162 
1163  // Grouping
1164  if (!empty($groupBy)) {
1165  $queryBuilder->groupBy(...‪QueryHelper::parseGroupBy($groupBy));
1166  }
1167  }
1168 
1169  return $queryBuilder->executeQuery();
1170  }
1171 
1181  public function ‪pi_getRecord($table, $uid, $checkPage = false)
1182  {
1183  return $this->frontendController->sys_page->checkRecord($table, $uid, $checkPage);
1184  }
1185 
1193  public function ‪pi_getPidList($pid_list, $recursive = 0)
1194  {
1195  if (!strcmp($pid_list, '')) {
1196  $pid_list = (string)$this->frontendController->id;
1197  }
1198  $recursive = ‪MathUtility::forceIntegerInRange($recursive, 0);
1199  $pid_list_arr = array_unique(‪GeneralUtility::intExplode(',', $pid_list, true));
1200  $pid_list = [];
1201  foreach ($pid_list_arr as $val) {
1202  $val = ‪MathUtility::forceIntegerInRange($val, 0);
1203  if ($val) {
1204  $_list = $this->cObj->getTreeList(-1 * $val, $recursive);
1205  if ($_list) {
1206  $pid_list[] = $_list;
1207  }
1208  }
1209  }
1210  return implode(',', $pid_list);
1211  }
1212 
1220  public function ‪pi_prependFieldsWithTable($table, $fieldList)
1221  {
1222  $list = ‪GeneralUtility::trimExplode(',', $fieldList, true);
1223  $return = [];
1224  foreach ($list as $listItem) {
1225  $return[] = $table . '.' . $listItem;
1226  }
1227  return implode(',', $return);
1228  }
1229 
1241  public function ‪pi_getCategoryTableContents($table, $pid, $whereClause = '', $groupBy = '', $orderBy = '', $limit = '')
1242  {
1243  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($table);
1244  $queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class));
1245  $queryBuilder->select('*')
1246  ->from($table)
1247  ->where(
1248  $queryBuilder->expr()->eq(
1249  'pid',
1250  $queryBuilder->createNamedParameter($pid, ‪Connection::PARAM_INT)
1251  ),
1253  );
1254 
1255  if (!empty($orderBy)) {
1256  foreach (‪QueryHelper::parseOrderBy($orderBy) as $fieldNameAndSorting) {
1257  [$fieldName, $sorting] = $fieldNameAndSorting;
1258  $queryBuilder->addOrderBy($fieldName, $sorting);
1259  }
1260  }
1261 
1262  if (!empty($groupBy)) {
1263  $queryBuilder->groupBy(...‪QueryHelper::parseGroupBy($groupBy));
1264  }
1265 
1266  if (!empty($limit)) {
1267  $limitValues = ‪GeneralUtility::intExplode(',', (string)$limit, true);
1268  if (count($limitValues) === 1) {
1269  $queryBuilder->setMaxResults($limitValues[0]);
1270  } else {
1271  $queryBuilder->setFirstResult($limitValues[0])
1272  ->setMaxResults($limitValues[1]);
1273  }
1274  }
1275 
1276  $result = $queryBuilder->executeQuery();
1277  $outArr = [];
1278  while ($row = $result->fetchAssociative()) {
1279  $outArr[$row['uid']] = $row;
1280  }
1281  return $outArr;
1282  }
1283 
1284  /***************************
1285  *
1286  * Various
1287  *
1288  **************************/
1297  public function ‪pi_isOnlyFields($fList, $lowerThan = -1)
1298  {
1299  $lowerThan = $lowerThan == -1 ? $this->pi_lowerThan : $lowerThan;
1300  $fList = ‪GeneralUtility::trimExplode(',', $fList, true);
1301  $tempPiVars = ‪$this->piVars;
1302  foreach ($fList as $k) {
1303  if (isset($tempPiVars[$k]) && (!‪MathUtility::canBeInterpretedAsInteger($tempPiVars[$k]) || $tempPiVars[$k] < $lowerThan)) {
1304  unset($tempPiVars[$k]);
1305  }
1306  }
1307  if (empty($tempPiVars)) {
1308  // @TODO: How do we deal with this? return TRUE would be the right thing to do here but that might be breaking
1309  return 1;
1310  }
1311  return null;
1312  }
1313 
1323  public function ‪pi_autoCache($inArray)
1324  {
1325  if (is_array($inArray)) {
1326  foreach ($inArray as $fN => $fV) {
1327  if (!strcmp($inArray[$fN], '')) {
1328  unset($inArray[$fN]);
1329  } elseif (is_array($this->pi_autoCacheFields[$fN])) {
1330  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]) {
1331  unset($inArray[$fN]);
1332  }
1333  if (is_array($this->pi_autoCacheFields[$fN]['list']) && in_array($inArray[$fN], $this->pi_autoCacheFields[$fN]['list'])) {
1334  unset($inArray[$fN]);
1335  }
1336  }
1337  }
1338  }
1339  if (empty($inArray)) {
1340  // @TODO: How do we deal with this? return TRUE would be the right thing to do here but that might be breaking
1341  return 1;
1342  }
1343  return null;
1344  }
1345 
1354  public function ‪pi_RTEcssText($str)
1355  {
1356  $str = $this->cObj->parseFunc($str, [], '< lib.parseFunc_RTE');
1357  return $str;
1358  }
1359 
1360  /*******************************
1361  *
1362  * FlexForms related functions
1363  *
1364  *******************************/
1370  public function ‪pi_initPIflexForm($field = 'pi_flexform')
1371  {
1372  // Converting flexform data into array
1373  $fieldData = $this->cObj->data[$field] ?? null;
1374  if (!is_array($fieldData) && $fieldData) {
1375  $this->cObj->data[$field] = ‪GeneralUtility::xml2array((string)$fieldData);
1376  if (!is_array($this->cObj->data[$field])) {
1377  $this->cObj->data[$field] = [];
1378  }
1379  }
1380  }
1381 
1392  public function ‪pi_getFFvalue($T3FlexForm_array, $fieldName, $sheet = 'sDEF', $lang = 'lDEF', $value = 'vDEF')
1393  {
1394  $sheetArray = $T3FlexForm_array['data'][$sheet][$lang] ?? '';
1395  if (is_array($sheetArray)) {
1396  return $this->‪pi_getFFvalueFromSheetArray($sheetArray, explode('/', $fieldName), $value);
1397  }
1398  return null;
1399  }
1400 
1411  public function ‪pi_getFFvalueFromSheetArray($sheetArray, $fieldNameArr, $value)
1412  {
1413  $tempArr = $sheetArray;
1414  foreach ($fieldNameArr as $k => $v) {
1416  if (is_array($tempArr)) {
1417  $c = 0;
1418  foreach ($tempArr as $values) {
1419  if ($c == $v) {
1420  $tempArr = $values;
1421  break;
1422  }
1423  $c++;
1424  }
1425  }
1426  } elseif (isset($tempArr[$v])) {
1427  $tempArr = $tempArr[$v];
1428  }
1429  }
1430  return $tempArr[$value] ?? '';
1431  }
1432 }
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$templateService
‪MarkerBasedTemplateService $templateService
Definition: AbstractPlugin.php:199
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$altLLkey
‪string $altLLkey
Definition: AbstractPlugin.php:127
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\applyStdWrapRecursive
‪array applyStdWrapRecursive(array $conf, $level=0)
Definition: AbstractPlugin.php:246
‪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:999
‪TYPO3\CMS\Core\Utility\GeneralUtility\xml2array
‪static mixed xml2array($string, $NSprefix='', $reportDocTag=false)
Definition: GeneralUtility.php:1482
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_linkToPage
‪string pi_linkToPage($str, $id, $target='', $urlParameters=[])
Definition: AbstractPlugin.php:346
‪TYPO3\CMS\Core\Utility\PathUtility
Definition: PathUtility.php:25
‪TYPO3\CMS\Core\Database\Connection\PARAM_INT
‪const PARAM_INT
Definition: Connection.php:49
‪TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger
‪static bool canBeInterpretedAsInteger($var)
Definition: MathUtility.php:74
‪TYPO3\CMS\Core\Database\Query\QueryHelper\parseTableList
‪static array array[] parseTableList(string $input)
Definition: QueryHelper.php:72
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_list_header
‪string pi_list_header()
Definition: AbstractPlugin.php:769
‪TYPO3\CMS\Core\Utility\PathUtility\dirname
‪static string dirname($path)
Definition: PathUtility.php:251
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_list_modeSelector
‪string pi_list_modeSelector($items=[], $tableParams='')
Definition: AbstractPlugin.php:688
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_getPidList
‪string pi_getPidList($pid_list, $recursive=0)
Definition: AbstractPlugin.php:1167
‪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:723
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_getClassName
‪string pi_getClassName($class)
Definition: AbstractPlugin.php:785
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_getLL
‪string pi_getLL($key, $alternativeLabel='')
Definition: AbstractPlugin.php:932
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_initPIflexForm
‪pi_initPIflexForm($field='pi_flexform')
Definition: AbstractPlugin.php:1344
‪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:63
‪TYPO3\CMS\Core\Utility\MathUtility\forceIntegerInRange
‪static int forceIntegerInRange($theInt, $min, $max=2000000000, $defaultValue=0)
Definition: MathUtility.php:32
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_prependFieldsWithTable
‪string pi_prependFieldsWithTable($table, $fieldList)
Definition: AbstractPlugin.php:1194
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin
Definition: AbstractPlugin.php:43
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$conf
‪array $conf
Definition: AbstractPlugin.php:178
‪TYPO3\CMS\Core\Localization\Locales
Definition: Locales.php:30
‪TYPO3\CMS\Core\Utility\ArrayUtility\mergeRecursiveWithOverrule
‪static mergeRecursiveWithOverrule(array &$original, array $overrule, $addKeys=true, $includeEmptyValues=true, $enableUnsetFeature=true)
Definition: ArrayUtility.php:654
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$pi_autoCacheEn
‪bool $pi_autoCacheEn
Definition: AbstractPlugin.php:169
‪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:108
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$pi_moreParams
‪string $pi_moreParams
Definition: AbstractPlugin.php:157
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_getCategoryTableContents
‪array pi_getCategoryTableContents($table, $pid, $whereClause='', $groupBy='', $orderBy='', $limit='')
Definition: AbstractPlugin.php:1215
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_linkTP
‪string pi_linkTP($str, $urlParameters=[], $cache=false, $altPageId=0)
Definition: AbstractPlugin.php:363
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$extKey
‪string $extKey
Definition: AbstractPlugin.php:69
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_getFFvalueFromSheetArray
‪mixed pi_getFFvalueFromSheetArray($sheetArray, $fieldNameArr, $value)
Definition: AbstractPlugin.php:1385
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_exec_query
‪Result pi_exec_query($table, $count=false, $addWhere='', $mm_cat='', $groupBy='', $orderBy='', $query='')
Definition: AbstractPlugin.php:1038
‪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:460
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$piVars
‪array $piVars
Definition: AbstractPlugin.php:77
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$prefixId
‪string $prefixId
Definition: AbstractPlugin.php:57
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$pi_tmpPageId
‪int $pi_tmpPageId
Definition: AbstractPlugin.php:189
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$internal
‪array $internal
Definition: AbstractPlugin.php:93
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_wrapInBaseClass
‪string pi_wrapInBaseClass($str)
Definition: AbstractPlugin.php:820
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_getPageLink
‪string pi_getPageLink($id, $target='', $urlParameters=[])
Definition: AbstractPlugin.php:328
‪TYPO3\CMS\Core\Database\Query\QueryHelper
Definition: QueryHelper.php:32
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_setPiVarDefaults
‪pi_setPiVarDefaults()
Definition: AbstractPlugin.php:277
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_getEditIcon
‪string pi_getEditIcon($content, $fields, $title='', $row=[], $tablename='', $oConf=[])
Definition: AbstractPlugin.php:902
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$pi_isOnlyFields
‪string $pi_isOnlyFields
Definition: AbstractPlugin.php:145
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$pi_alwaysPrev
‪int $pi_alwaysPrev
Definition: AbstractPlugin.php:149
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\__construct
‪__construct($_=null, TypoScriptFrontendController $frontendController=null)
Definition: AbstractPlugin.php:209
‪TYPO3\CMS\Core\Utility\HttpUtility\buildQueryString
‪static string buildQueryString(array $parameters, string $prependCharacter='', bool $skipEmptyParameters=false)
Definition: HttpUtility.php:171
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_getFFvalue
‪string null pi_getFFvalue($T3FlexForm_array, $fieldName, $sheet='sDEF', $lang='lDEF', $value='vDEF')
Definition: AbstractPlugin.php:1366
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$cObj
‪ContentObjectRenderer null $cObj
Definition: AbstractPlugin.php:51
‪TYPO3\CMS\Core\Page\DefaultJavaScriptAssetTrait
Definition: DefaultJavaScriptAssetTrait.php:30
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_autoCache
‪bool null pi_autoCache($inArray)
Definition: AbstractPlugin.php:1297
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$pi_listFields
‪string $pi_listFields
Definition: AbstractPlugin.php:161
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_linkTP_keepPIvars
‪string pi_linkTP_keepPIvars($str, $overrulePIvars=[], $cache=false, $clearAnyway=false, $altPageId=0)
Definition: AbstractPlugin.php:387
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$pi_lowerThan
‪int $pi_lowerThan
Definition: AbstractPlugin.php:153
‪TYPO3\CMS\Core\TypoScript\TypoScriptService
Definition: TypoScriptService.php:25
‪$output
‪$output
Definition: annotationChecker.php:121
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_linkTP_keepPIvars_url
‪string pi_linkTP_keepPIvars_url($overrulePIvars=[], $cache=false, $clearAnyway=false, $altPageId=0)
Definition: AbstractPlugin.php:412
‪TYPO3\CMS\Core\Database\Connection
Definition: Connection.php:38
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$pi_EPtemp_cObj
‪ContentObjectRenderer $pi_EPtemp_cObj
Definition: AbstractPlugin.php:185
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_isOnlyFields
‪bool null pi_isOnlyFields($fList, $lowerThan=-1)
Definition: AbstractPlugin.php:1271
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
Definition: TypoScriptFrontendController.php:104
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_RTEcssText
‪string pi_RTEcssText($str)
Definition: AbstractPlugin.php:1328
‪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:976
‪TYPO3\CMS\Core\Utility\ArrayUtility
Definition: ArrayUtility.php:24
‪$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:799
‪TYPO3\CMS\Core\Utility\GeneralUtility\intExplode
‪static int[] intExplode($delimiter, $string, $removeEmptyValues=false, $limit=0)
Definition: GeneralUtility.php:927
‪TYPO3\CMS\Core\Page\DefaultJavaScriptAssetTrait\addDefaultFrontendJavaScript
‪addDefaultFrontendJavaScript()
Definition: DefaultJavaScriptAssetTrait.php:32
‪TYPO3\CMS\Core\Utility\MathUtility
Definition: MathUtility.php:22
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$LOCAL_LANG_loaded
‪bool $LOCAL_LANG_loaded
Definition: AbstractPlugin.php:115
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$LLtestPrefixAlt
‪string $LLtestPrefixAlt
Definition: AbstractPlugin.php:141
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_list_row
‪string pi_list_row($c)
Definition: AbstractPlugin.php:756
‪TYPO3\CMS\Core\Utility\HttpUtility
Definition: HttpUtility.php:22
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$LOCAL_LANG
‪array $LOCAL_LANG
Definition: AbstractPlugin.php:99
‪TYPO3\CMS\Core\Database\ConnectionPool
Definition: ConnectionPool.php:46
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_getRecord
‪array pi_getRecord($table, $uid, $checkPage=false)
Definition: AbstractPlugin.php:1155
‪TYPO3\CMS\Core\Service\MarkerBasedTemplateService
Definition: MarkerBasedTemplateService.php:27
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:50
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$LLkey
‪string $LLkey
Definition: AbstractPlugin.php:121
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$LLtestPrefix
‪string $LLtestPrefix
Definition: AbstractPlugin.php:134
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\setContentObjectRenderer
‪setContentObjectRenderer(ContentObjectRenderer $cObj)
Definition: AbstractPlugin.php:234
‪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:513
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\removeInternalNodeValue
‪array removeInternalNodeValue(array $typoscript)
Definition: AbstractPlugin.php:295
‪TYPO3\CMS\Core\Database\Query\Restriction\FrontendRestrictionContainer
Definition: FrontendRestrictionContainer.php:31
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$pi_autoCacheFields
‪array $pi_autoCacheFields
Definition: AbstractPlugin.php:165
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_getEditPanel
‪string pi_getEditPanel($row=[], $tablename='', $label='', $conf=[])
Definition: AbstractPlugin.php:859
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\$frontendController
‪TypoScriptFrontendController $frontendController
Definition: AbstractPlugin.php:195
‪TYPO3\CMS\Frontend\Plugin\AbstractPlugin\pi_list_linkSingle
‪string pi_list_linkSingle($str, $uid, $cache=false, $mergeArr=[], $urlOnly=false, $altPageId=0)
Definition: AbstractPlugin.php:432