[CLEANUP] Cleanup of classes extending AbstractPlugin 27/36627/8
authorFrederic Gaus <gaus@flagbit.de>
Tue, 3 Feb 2015 10:04:06 +0000 (11:04 +0100)
committerMarkus Klein <klein.t3@reelworx.at>
Fri, 6 Feb 2015 02:48:05 +0000 (03:48 +0100)
* fixes a few phpdocs
* use properties from AbstractPlugin instead of $GLOBALS
* define some undefined global vars in FrontendLoginController

Change-Id: I14c4aedd5b3a28ddda63ef9c594635d29ac455d6
Resolves: #64780
Releases: master
Reviewed-on: http://review.typo3.org/36627
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/css_styled_content/Classes/Controller/CssStyledContentController.php
typo3/sysext/felogin/Classes/Controller/FrontendLoginController.php
typo3/sysext/felogin/Tests/Unit/Controller/FrontendLoginControllerTest.php
typo3/sysext/indexed_search/Classes/Controller/SearchFormController.php
typo3/sysext/rtehtmlarea/Classes/Controller/AccessibilityLinkController.php
typo3/sysext/rtehtmlarea/Classes/Controller/CustomAttributeController.php
typo3/sysext/rtehtmlarea/Classes/Controller/ImageRenderingController.php

index 8075374..66e5f38 100644 (file)
@@ -316,14 +316,14 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
                                                }
                                                $conf['linkProc.']['altText'] = ($conf['linkProc.']['iconCObject.']['altText'] = $altText);
                                                $this->cObj->setCurrentVal($currentPath);
-                                               $GLOBALS['TSFE']->register['ICON_REL_PATH'] = $currentPath . $fileName;
-                                               $GLOBALS['TSFE']->register['filename'] = $filesData[$key]['filename'];
-                                               $GLOBALS['TSFE']->register['path'] = $filesData[$key]['path'];
-                                               $GLOBALS['TSFE']->register['fileSize'] = $filesData[$key]['filesize'];
-                                               $GLOBALS['TSFE']->register['fileExtension'] = $filesData[$key]['fileextension'];
-                                               $GLOBALS['TSFE']->register['description'] = $filesData[$key]['description'];
-                                               $GLOBALS['TSFE']->register['titleText'] = $filesData[$key]['titletext'];
-                                               $GLOBALS['TSFE']->register['altText'] = $filesData[$key]['alttext'];
+                                               $this->frontendController->register['ICON_REL_PATH'] = $currentPath . $fileName;
+                                               $this->frontendController->register['filename'] = $filesData[$key]['filename'];
+                                               $this->frontendController->register['path'] = $filesData[$key]['path'];
+                                               $this->frontendController->register['fileSize'] = $filesData[$key]['filesize'];
+                                               $this->frontendController->register['fileExtension'] = $filesData[$key]['fileextension'];
+                                               $this->frontendController->register['description'] = $filesData[$key]['description'];
+                                               $this->frontendController->register['titleText'] = $filesData[$key]['titletext'];
+                                               $this->frontendController->register['altText'] = $filesData[$key]['alttext'];
 
                                                $filesData[$key]['linkedFilenameParts'] = $this->beautifyFileLink(
                                                        explode('//**//', $this->cObj->filelink($fileName, $conf['linkProc.'])),
@@ -334,19 +334,19 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
                                        }
                                }
                                // optionSplit applied to conf to allow differnt settings per file
-                               $splitConf = $GLOBALS['TSFE']->tmpl->splitConfArray($conf, count($filesData));
+                               $splitConf = $this->frontendController->tmpl->splitConfArray($conf, count($filesData));
                                // Now, lets render the list!
                                $outputEntries = array();
                                foreach ($filesData as $key => $fileData) {
-                                       $GLOBALS['TSFE']->register['linkedIcon'] = $fileData['linkedFilenameParts'][0];
-                                       $GLOBALS['TSFE']->register['linkedLabel'] = $fileData['linkedFilenameParts'][1];
-                                       $GLOBALS['TSFE']->register['filename'] = $fileData['filename'];
-                                       $GLOBALS['TSFE']->register['path'] = $fileData['path'];
-                                       $GLOBALS['TSFE']->register['description'] = $fileData['description'];
-                                       $GLOBALS['TSFE']->register['fileSize'] = $fileData['filesize'];
-                                       $GLOBALS['TSFE']->register['fileExtension'] = $fileData['fileextension'];
-                                       $GLOBALS['TSFE']->register['titleText'] = $fileData['titletext'];
-                                       $GLOBALS['TSFE']->register['altText'] = $fileData['alttext'];
+                                       $this->frontendController->register['linkedIcon'] = $fileData['linkedFilenameParts'][0];
+                                       $this->frontendController->register['linkedLabel'] = $fileData['linkedFilenameParts'][1];
+                                       $this->frontendController->register['filename'] = $fileData['filename'];
+                                       $this->frontendController->register['path'] = $fileData['path'];
+                                       $this->frontendController->register['description'] = $fileData['description'];
+                                       $this->frontendController->register['fileSize'] = $fileData['filesize'];
+                                       $this->frontendController->register['fileExtension'] = $fileData['fileextension'];
+                                       $this->frontendController->register['titleText'] = $fileData['titletext'];
+                                       $this->frontendController->register['altText'] = $fileData['alttext'];
                                        $outputEntries[] = $this->cObj->cObjGetSingle($splitConf[$key]['itemRendering'], $splitConf[$key]['itemRendering.']);
                                }
                                if (isset($conf['outerWrap'])) {
@@ -508,8 +508,8 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
                        ? $this->cObj->stdWrap($conf['imgListContainsReferenceUids'], $conf['imgListContainsReferenceUids.'])
                        : $conf['imgListContainsReferenceUids']);
                // Use the calculated information (amount of images, if global caption is wanted) to choose a different rendering method for the images-block
-               $GLOBALS['TSFE']->register['imageCount'] = $imgCount;
-               $GLOBALS['TSFE']->register['renderGlobalCaption'] = $renderGlobalCaption;
+               $this->frontendController->register['imageCount'] = $imgCount;
+               $this->frontendController->register['renderGlobalCaption'] = $renderGlobalCaption;
                $fallbackRenderMethod = '';
                if ($conf['fallbackRendering']) {
                        $fallbackRenderMethod = $this->cObj->cObjGetSingle($conf['fallbackRendering'], $conf['fallbackRendering.']);
@@ -612,7 +612,7 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
                // Fetches pictures
                $splitArr = array();
                $splitArr['imgObjNum'] = $conf['imgObjNum'];
-               $splitArr = $GLOBALS['TSFE']->tmpl->splitConfArray($splitArr, $imgCount);
+               $splitArr = $this->frontendController->tmpl->splitConfArray($splitArr, $imgCount);
                // Contains the width of every image row
                $imageRowsFinalWidths = array();
                // Array index of $imgsTag will be the same as in $imgs, but $imgsTag only contains the images that are actually shown
@@ -629,9 +629,9 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
                                $totalImagePath = $imgPath . $imgs[$imgKey];
                        }
                        // register IMG_NUM is kept for backwards compatibility
-                       $GLOBALS['TSFE']->register['IMAGE_NUM'] = $imgKey;
-                       $GLOBALS['TSFE']->register['IMAGE_NUM_CURRENT'] = $imgKey;
-                       $GLOBALS['TSFE']->register['ORIG_FILENAME'] = $totalImagePath;
+                       $this->frontendController->register['IMAGE_NUM'] = $imgKey;
+                       $this->frontendController->register['IMAGE_NUM_CURRENT'] = $imgKey;
+                       $this->frontendController->register['ORIG_FILENAME'] = $totalImagePath;
                        $this->cObj->data[$this->cObj->currentValKey] = $totalImagePath;
                        $imgObjNum = (int)$splitArr[$a]['imgObjNum'];
                        $imgConf = $conf[$imgObjNum . '.'];
@@ -680,13 +680,13 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
                        }
                        $titleInLink = $this->cObj->stdWrap($imgConf['titleInLink'], $imgConf['titleInLink.']);
                        $titleInLinkAndImg = $this->cObj->stdWrap($imgConf['titleInLinkAndImg'], $imgConf['titleInLinkAndImg.']);
-                       $oldATagParms = $GLOBALS['TSFE']->ATagParams;
+                       $oldATagParms = $this->frontendController->ATagParams;
                        if ($titleInLink) {
                                // Title in A-tag instead of IMG-tag
                                $titleText = trim($this->cObj->stdWrap($imgConf['titleText'], $imgConf['titleText.']));
                                if ($titleText) {
                                        // This will be used by the IMAGE call later:
-                                       $GLOBALS['TSFE']->ATagParams .= ' title="' . htmlspecialchars($titleText) . '"';
+                                       $this->frontendController->ATagParams .= ' title="' . htmlspecialchars($titleText) . '"';
                                }
                        }
 
@@ -752,19 +752,19 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
                                $imgsTag[$imgKey] = $this->cObj->cObjGetSingle('IMAGE', array('file' => $totalImagePath));
                        }
                        // Restore our ATagParams
-                       $GLOBALS['TSFE']->ATagParams = $oldATagParms;
+                       $this->frontendController->ATagParams = $oldATagParms;
                        // Store the original filepath
-                       $origImages[$imgKey] = $GLOBALS['TSFE']->lastImageInfo;
-                       if ($GLOBALS['TSFE']->lastImageInfo[0] == 0) {
+                       $origImages[$imgKey] = $this->frontendController->lastImageInfo;
+                       if ($this->frontendController->lastImageInfo[0] == 0) {
                                $imageRowsFinalWidths[(int)floor($a / $colCount)] += $this->cObj->data['imagewidth'];
                        } else {
-                               $imageRowsFinalWidths[(int)floor($a / $colCount)] += $GLOBALS['TSFE']->lastImageInfo[0];
+                               $imageRowsFinalWidths[(int)floor($a / $colCount)] += $this->frontendController->lastImageInfo[0];
                        }
                }
                // How much space will the image-block occupy?
                $imageBlockWidth = max($imageRowsFinalWidths) + $colspacing * ($colCount - 1) + $colCount * $border * ($borderSpace + $borderThickness) * 2;
-               $GLOBALS['TSFE']->register['rowwidth'] = $imageBlockWidth;
-               $GLOBALS['TSFE']->register['rowWidthPlusTextMargin'] = $imageBlockWidth + $textMargin;
+               $this->frontendController->register['rowwidth'] = $imageBlockWidth;
+               $this->frontendController->register['rowWidthPlusTextMargin'] = $imageBlockWidth + $textMargin;
                // noRows is in fact just one ROW, with the amount of columns specified, where the images are placed in.
                // noCols is just one COLUMN, each images placed side by side on each row
                $noRows = $this->cObj->stdWrap($conf['noRows'], $conf['noRows.']);
@@ -781,7 +781,7 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
                if (!is_array($conf['editIcons.'])) {
                        $conf['editIcons.'] = array();
                }
-               $editIconsHTML = $conf['editIcons'] && $GLOBALS['TSFE']->beUserLogin ? $this->cObj->editIcons('', $conf['editIcons'], $conf['editIcons.']) : '';
+               $editIconsHTML = $conf['editIcons'] && $this->frontendController->beUserLogin ? $this->cObj->editIcons('', $conf['editIcons'], $conf['editIcons.']) : '';
                // If noRows, we need multiple imagecolumn wraps
                $imageWrapCols = 1;
                if ($noRows) {
@@ -802,13 +802,13 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
                        if (isset($conf['addClassesCol.'])) {
                                $addClassesCol = $this->cObj->stdWrap($addClassesCol, $conf['addClassesCol.']);
                        }
-                       $addClassesColConf = $GLOBALS['TSFE']->tmpl->splitConfArray(array('addClassesCol' => $addClassesCol), $colCount);
+                       $addClassesColConf = $this->frontendController->tmpl->splitConfArray(array('addClassesCol' => $addClassesCol), $colCount);
                        // Apply optionSplit to the list of classes that we want to add to each image
                        $addClassesImage = $conf['addClassesImage'];
                        if (isset($conf['addClassesImage.'])) {
                                $addClassesImage = $this->cObj->stdWrap($addClassesImage, $conf['addClassesImage.']);
                        }
-                       $addClassesImageConf = $GLOBALS['TSFE']->tmpl->splitConfArray(array('addClassesImage' => $addClassesImage), $imagesInColumns);
+                       $addClassesImageConf = $this->frontendController->tmpl->splitConfArray(array('addClassesImage' => $addClassesImage), $imagesInColumns);
                        $rows = array();
                        $currentImage = 0;
                        // Set the class for the caption (split or global)
@@ -833,7 +833,7 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
                                                // Set the key of the current image
                                                $imageKey = $currentImage + $imgStart;
                                                // Register IMAGE_NUM_CURRENT for the caption
-                                               $GLOBALS['TSFE']->register['IMAGE_NUM_CURRENT'] = $imageKey;
+                                               $this->frontendController->register['IMAGE_NUM_CURRENT'] = $imageKey;
                                                $this->cObj->data[$this->cObj->currentValKey] = $origImages[$imageKey]['origFile'];
                                                if (MathUtility::canBeInterpretedAsInteger($imgs[$imageKey])) {
                                                        $this->initializeCurrentFileInContentObjectRenderer((int)$imgs[$imageKey], $imgListContainsReferenceUids);
@@ -936,7 +936,7 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
                        if (isset($conf['addClassesImage.'])) {
                                $addClassesImage = $this->cObj->stdWrap($addClassesImage, $conf['addClassesImage.']);
                        }
-                       $addClassesImageConf = $GLOBALS['TSFE']->tmpl->splitConfArray(array('addClassesImage' => $addClassesImage), $colCount);
+                       $addClassesImageConf = $this->frontendController->tmpl->splitConfArray(array('addClassesImage' => $addClassesImage), $colCount);
                        // Render the images
                        $images = '';
                        for ($c = 0; $c < $imageWrapCols; $c++) {
@@ -961,12 +961,12 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
                                        } else {
                                                $imageSpace = $origImages[$imgKey][0] + $border * ($borderSpace + $borderThickness) * 2;
                                        }
-                                       $GLOBALS['TSFE']->register['IMAGE_NUM'] = $imgKey;
-                                       $GLOBALS['TSFE']->register['IMAGE_NUM_CURRENT'] = $imgKey;
-                                       $GLOBALS['TSFE']->register['ORIG_FILENAME'] = $origImages[$imgKey]['origFile'];
-                                       $GLOBALS['TSFE']->register['imagewidth'] = $origImages[$imgKey][0];
-                                       $GLOBALS['TSFE']->register['imagespace'] = $imageSpace;
-                                       $GLOBALS['TSFE']->register['imageheight'] = $origImages[$imgKey][1];
+                                       $this->frontendController->register['IMAGE_NUM'] = $imgKey;
+                                       $this->frontendController->register['IMAGE_NUM_CURRENT'] = $imgKey;
+                                       $this->frontendController->register['ORIG_FILENAME'] = $origImages[$imgKey]['origFile'];
+                                       $this->frontendController->register['imagewidth'] = $origImages[$imgKey][0];
+                                       $this->frontendController->register['imagespace'] = $imageSpace;
+                                       $this->frontendController->register['imageheight'] = $origImages[$imgKey][1];
                                        if (MathUtility::canBeInterpretedAsInteger($imgs[$imgKey])) {
                                                $this->initializeCurrentFileInContentObjectRenderer(intval($imgs[$imgKey]), $imgListContainsReferenceUids);
                                        }
@@ -992,7 +992,7 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
                                        } else {
                                                $allRows .= $thisImage;
                                        }
-                                       $GLOBALS['TSFE']->register['columnwidth'] = $maxImageSpace + $tmpColspacing;
+                                       $this->frontendController->register['columnwidth'] = $maxImageSpace + $tmpColspacing;
                                        // Close this row at the end (colCount), or the last row at the final end
                                        if ($separateRows && $i + 1 == count($imgsTag)) {
                                                // Close the very last row with either normal configuration or lastRow stdWrap
@@ -1057,7 +1057,7 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
                                $imgWrapWidth = $imageBlockWidth;
                        }
                        // Wrap around the whole image block
-                       $GLOBALS['TSFE']->register['totalwidth'] = $imgWrapWidth;
+                       $this->frontendController->register['totalwidth'] = $imgWrapWidth;
                        if ($imgWrapWidth) {
                                $images = $this->cObj->stdWrap($images, $conf['imageStdWrap.']);
                        } else {
@@ -1195,7 +1195,7 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
                // Create table attributes and classes array:
                $tableTagParams = ($classes = array());
                // Table attributes for all doctypes except HTML5
-               if ($GLOBALS['TSFE']->config['config']['doctype'] !== 'html5') {
+               if ($this->frontendController->config['config']['doctype'] !== 'html5') {
                        $tableTagParams['border'] = $border;
                        $tableTagParams['cellspacing'] = $cellSpacing;
                        $tableTagParams['cellpadding'] = $cellPadding;
@@ -1251,11 +1251,11 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
         * @return void
         */
        protected function addPageStyle($selector, $declaration) {
-               if (!isset($GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_cssstyledcontent.']['_CSS_PAGE_STYLE'])) {
-                       $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_cssstyledcontent.']['_CSS_PAGE_STYLE'] = array();
+               if (!isset($this->frontendController->tmpl->setup['plugin.']['tx_cssstyledcontent.']['_CSS_PAGE_STYLE'])) {
+                       $this->frontendController->tmpl->setup['plugin.']['tx_cssstyledcontent.']['_CSS_PAGE_STYLE'] = array();
                }
-               if (!isset($GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_cssstyledcontent.']['_CSS_PAGE_STYLE'][$selector])) {
-                       $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_cssstyledcontent.']['_CSS_PAGE_STYLE'][$selector] = TAB . $selector . ' { ' . $declaration . ' }';
+               if (!isset($this->frontendController->tmpl->setup['plugin.']['tx_cssstyledcontent.']['_CSS_PAGE_STYLE'][$selector])) {
+                       $this->frontendController->tmpl->setup['plugin.']['tx_cssstyledcontent.']['_CSS_PAGE_STYLE'][$selector] = TAB . $selector . ' { ' . $declaration . ' }';
                }
        }
 
index 6943211..589fd58 100644 (file)
@@ -99,6 +99,20 @@ class FrontendLoginController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
        protected $logintype;
 
        /**
+        * A list of page UIDs, either an integer or a comma-separated list of integers
+        *
+        * @var string
+        */
+       public $spid;
+
+       /**
+        * Referrer
+        *
+        * @var string
+        */
+       public $referer;
+
+       /**
         * The main method of the plugin
         *
         * @param string $content The PlugIn content
@@ -124,7 +138,7 @@ class FrontendLoginController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
                                $this->spid = $this->conf['storagePid'];
                        }
                } else {
-                       $pids = $GLOBALS['TSFE']->getStorageSiterootPids();
+                       $pids = $this->frontendController->getStorageSiterootPids();
                        $this->spid = $pids['_STORAGE_PID'];
                }
                // GPvars:
@@ -143,7 +157,7 @@ class FrontendLoginController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
                $templateFile = $this->conf['templateFile'] ?: 'EXT:felogin/template.html';
                $this->template = $this->cObj->fileResource($templateFile);
                // Is user logged in?
-               $this->userIsLoggedIn = $GLOBALS['TSFE']->loginUser;
+               $this->userIsLoggedIn = $this->frontendController->loginUser;
                // Redirect
                if ($this->conf['redirectMode'] && !$this->conf['redirectDisable'] && !$this->noRedirect) {
                        $redirectUrl = $this->processRedirect();
@@ -168,7 +182,7 @@ class FrontendLoginController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
                }
                // Process the redirect
                if (($this->logintype === 'login' || $this->logintype === 'logout') && $this->redirectUrl && !$this->noRedirect) {
-                       if (!$GLOBALS['TSFE']->fe_user->isCookieSet() && $this->userIsLoggedIn) {
+                       if (!$this->frontendController->fe_user->isCookieSet() && $this->userIsLoggedIn) {
                                $content .= $this->cObj->stdWrap($this->pi_getLL('cookie_warning', '', TRUE), $this->conf['cookieWarning_stdWrap.']);
                        } else {
                                // Add hook for extra processing before redirect
@@ -216,18 +230,18 @@ class FrontendLoginController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
                if ($postData['forgot_email']) {
                        // Get hashes for compare
                        $postedHash = $postData['forgot_hash'];
-                       $hashData = $GLOBALS['TSFE']->fe_user->getKey('ses', 'forgot_hash');
+                       $hashData = $this->frontendController->fe_user->getKey('ses', 'forgot_hash');
                        if ($postedHash === $hashData['forgot_hash']) {
                                $row = FALSE;
                                // Look for user record
-                               $data = $GLOBALS['TYPO3_DB']->fullQuoteStr($this->piVars['forgot_email'], 'fe_users');
-                               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
+                               $data = $this->databaseConnection->fullQuoteStr($this->piVars['forgot_email'], 'fe_users');
+                               $res = $this->databaseConnection->exec_SELECTquery(
                                        'uid, username, password, email',
                                        'fe_users',
-                                       '(email=' . $data . ' OR username=' . $data . ') AND pid IN (' . $GLOBALS['TYPO3_DB']->cleanIntList($this->spid) . ') ' . $this->cObj->enableFields('fe_users')
+                                       '(email=' . $data . ' OR username=' . $data . ') AND pid IN (' . $this->databaseConnection->cleanIntList($this->spid) . ') ' . $this->cObj->enableFields('fe_users')
                                );
-                               if ($GLOBALS['TYPO3_DB']->sql_num_rows($res)) {
-                                       $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
+                               if ($this->databaseConnection->sql_num_rows($res)) {
+                                       $row = $this->databaseConnection->sql_fetch_assoc($res);
                                }
                                $error = NULL;
                                if ($row) {
@@ -269,7 +283,7 @@ class FrontendLoginController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
                $hash = md5($this->generatePassword(3));
                $markerArray['###FORGOTHASH###'] = $hash;
                // Set hash in feuser session
-               $GLOBALS['TSFE']->fe_user->setKey('ses', 'forgot_hash', array('forgot_hash' => $hash));
+               $this->frontendController->fe_user->setKey('ses', 'forgot_hash', array('forgot_hash' => $hash));
                return $this->cObj->substituteMarkerArrayCached($subpart, $markerArray, $subpartArray, $linkpartArray);
        }
 
@@ -341,7 +355,7 @@ class FrontendLoginController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
                                                        $newPass = $_params['newPassword'];
                                                }
                                                // Save new password and clear DB-hash
-                                               $res = $GLOBALS['TYPO3_DB']->exec_UPDATEquery(
+                                               $res = $this->databaseConnection->exec_UPDATEquery(
                                                        'fe_users',
                                                        'uid=' . $user['uid'],
                                                        array('password' => $newPass, 'felogin_forgotHash' => '', 'tstamp' => $GLOBALS['EXEC_TIME'])
@@ -360,7 +374,7 @@ class FrontendLoginController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
                                }
                                if (!$done) {
                                        // Change password form
-                                       $markerArray['###ACTION_URI###'] = $this->pi_getPageLink($GLOBALS['TSFE']->id, '', array(
+                                       $markerArray['###ACTION_URI###'] = $this->pi_getPageLink($this->frontendController->id, '', array(
                                                $this->prefixId . '[user]' => $user['uid'],
                                                $this->prefixId . '[forgothash]' => $piHash
                                        ));
@@ -392,13 +406,13 @@ class FrontendLoginController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
                $randHash = $validEnd . '|' . $hash;
                $randHashDB = $validEnd . '|' . md5($hash);
                // Write hash to DB
-               $res = $GLOBALS['TYPO3_DB']->exec_UPDATEquery('fe_users', 'uid=' . $user['uid'], array('felogin_forgotHash' => $randHashDB));
+               $res = $this->databaseConnection->exec_UPDATEquery('fe_users', 'uid=' . $user['uid'], array('felogin_forgotHash' => $randHashDB));
                // Send hashlink to user
                $this->conf['linkPrefix'] = -1;
-               $isAbsRelPrefix = !empty($GLOBALS['TSFE']->absRefPrefix);
-               $isBaseURL = !empty($GLOBALS['TSFE']->baseUrl);
+               $isAbsRelPrefix = !empty($this->frontendController->absRefPrefix);
+               $isBaseURL = !empty($this->frontendController->baseUrl);
                $isFeloginBaseURL = !empty($this->conf['feloginBaseURL']);
-               $link = $this->pi_getPageLink($GLOBALS['TSFE']->id, '', array(
+               $link = $this->pi_getPageLink($this->frontendController->id, '', array(
                        rawurlencode($this->prefixId . '[user]') => $user['uid'],
                        rawurlencode($this->prefixId . '[forgothash]') => $randHash
                ));
@@ -406,8 +420,8 @@ class FrontendLoginController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
                if ($isFeloginBaseURL) {
                        // First priority, use specific base URL
                        // "absRefPrefix" must be removed first, otherwise URL will be prepended twice
-                       if (!empty($GLOBALS['TSFE']->absRefPrefix)) {
-                               $link = substr($link, strlen($GLOBALS['TSFE']->absRefPrefix));
+                       if (!empty($this->frontendController->absRefPrefix)) {
+                               $link = substr($link, strlen($this->frontendController->absRefPrefix));
                        }
                        $link = $this->conf['feloginBaseURL'] . $link;
                } elseif ($isAbsRelPrefix) {
@@ -417,7 +431,7 @@ class FrontendLoginController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
                } elseif ($isBaseURL) {
                        // Third priority
                        // Add the global base URL to the link
-                       $link = $GLOBALS['TSFE']->baseUrlWrap($link);
+                       $link = $this->frontendController->baseUrlWrap($link);
                } else {
                        // No prefix is set, return the error
                        return $this->pi_getLL('ll_change_password_nolinkprefix_message');
@@ -459,9 +473,9 @@ class FrontendLoginController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
                $markerArray['###LEGEND###'] = $this->pi_getLL('logout', '', TRUE);
                $markerArray['###ACTION_URI###'] = $this->getPageLink('', array(), TRUE);
                $markerArray['###LOGOUT_LABEL###'] = $this->pi_getLL('logout', '', TRUE);
-               $markerArray['###NAME###'] = htmlspecialchars($GLOBALS['TSFE']->fe_user->user['name']);
+               $markerArray['###NAME###'] = htmlspecialchars($this->frontendController->fe_user->user['name']);
                $markerArray['###STORAGE_PID###'] = $this->spid;
-               $markerArray['###USERNAME###'] = htmlspecialchars($GLOBALS['TSFE']->fe_user->user['username']);
+               $markerArray['###USERNAME###'] = htmlspecialchars($this->frontendController->fe_user->user['username']);
                $markerArray['###USERNAME_LABEL###'] = $this->pi_getLL('username', '', TRUE);
                $markerArray['###NOREDIRECT###'] = $this->noRedirect ? '1' : '0';
                $markerArray['###PREFIXID###'] = $this->prefixId;
@@ -620,29 +634,29 @@ class FrontendLoginController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
                if ($this->conf['redirectMode']) {
                        $redirectMethods = GeneralUtility::trimExplode(',', $this->conf['redirectMode'], TRUE);
                        foreach ($redirectMethods as $redirMethod) {
-                               if ($GLOBALS['TSFE']->loginUser && $this->logintype === 'login') {
+                               if ($this->frontendController->loginUser && $this->logintype === 'login') {
                                        // Logintype is needed because the login-page wouldn't be accessible anymore after a login (would always redirect)
                                        switch ($redirMethod) {
                                                case 'groupLogin':
                                                        // taken from dkd_redirect_at_login written by Ingmar Schlecht; database-field changed
-                                                       $groupData = $GLOBALS['TSFE']->fe_user->groupData;
-                                                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
+                                                       $groupData = $this->frontendController->fe_user->groupData;
+                                                       $res = $this->databaseConnection->exec_SELECTquery(
                                                                'felogin_redirectPid',
-                                                               $GLOBALS['TSFE']->fe_user->usergroup_table,
+                                                               $this->frontendController->fe_user->usergroup_table,
                                                                'felogin_redirectPid<>\'\' AND uid IN (' . implode(',', $groupData['uid']) . ')'
                                                        );
-                                                       if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res)) {
+                                                       if ($row = $this->databaseConnection->sql_fetch_row($res)) {
                                                                // take the first group with a redirect page
                                                                $redirect_url[] = $this->pi_getPageLink($row[0]);
                                                        }
                                                        break;
                                                case 'userLogin':
-                                                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
+                                                       $res = $this->databaseConnection->exec_SELECTquery(
                                                                'felogin_redirectPid',
-                                                               $GLOBALS['TSFE']->fe_user->user_table,
-                                                               $GLOBALS['TSFE']->fe_user->userid_column . '=' . $GLOBALS['TSFE']->fe_user->user['uid'] . ' AND felogin_redirectPid<>\'\''
+                                                               $this->frontendController->fe_user->user_table,
+                                                               $this->frontendController->fe_user->userid_column . '=' . $this->frontendController->fe_user->user['uid'] . ' AND felogin_redirectPid<>\'\''
                                                        );
-                                                       if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res)) {
+                                                       if ($row = $this->databaseConnection->sql_fetch_row($res)) {
                                                                $redirect_url[] = $this->pi_getPageLink($row[0]);
                                                        }
                                                        break;
@@ -707,7 +721,7 @@ class FrontendLoginController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
                                                'linkAccessRestrictedPages' => TRUE
                                        ));
                                        $redirect_url[] = $this->cObj->lastTypoLinkUrl;
-                               } elseif ($this->logintype == '' && $redirMethod == 'logout' && $this->conf['redirectPageLogout'] && $GLOBALS['TSFE']->loginUser) {
+                               } elseif ($this->logintype == '' && $redirMethod == 'logout' && $this->conf['redirectPageLogout'] && $this->frontendController->loginUser) {
                                        // If logout and page not accessible
                                        $redirect_url[] = $this->pi_getPageLink((int)$this->conf['redirectPageLogout']);
                                } elseif ($this->logintype === 'logout') {
@@ -828,7 +842,7 @@ class FrontendLoginController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
                if ($this->conf['preserveGETvars']) {
                        $additionalParams .= $this->getPreserveGetVars();
                }
-               $this->conf['linkConfig.']['parameter'] = $GLOBALS['TSFE']->id;
+               $this->conf['linkConfig.']['parameter'] = $this->frontendController->id;
                if ($additionalParams) {
                        $this->conf['linkConfig.']['additionalParams'] = $additionalParams;
                }
@@ -909,9 +923,9 @@ class FrontendLoginController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
        protected function getUserFieldMarkers() {
                $marker = array();
                // replace markers with fe_user data
-               if ($GLOBALS['TSFE']->fe_user->user) {
+               if ($this->frontendController->fe_user->user) {
                        // All fields of fe_user will be replaced, scheme is ###FEUSER_FIELDNAME###
-                       foreach ($GLOBALS['TSFE']->fe_user->user as $field => $value) {
+                       foreach ($this->frontendController->fe_user->user as $field => $value) {
                                $marker['###FEUSER_' . GeneralUtility::strtoupper($field) . '###'] = $this->cObj->stdWrap($value, $this->conf['userfields.'][$field . '.']);
                        }
                        // Add ###USER### for compatibility
@@ -975,7 +989,7 @@ class FrontendLoginController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
                                $host = $parsedUrl['host'];
                                // Removes the last path segment and slash sequences like /// (if given):
                                $path = preg_replace('#/+[^/]*$#', '', $parsedUrl['path']);
-                               $localDomains = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('domainName', 'sys_domain', '1=1' . $this->cObj->enableFields('sys_domain'));
+                               $localDomains = $this->databaseConnection->exec_SELECTgetRows('domainName', 'sys_domain', '1=1' . $this->cObj->enableFields('sys_domain'));
                                if (is_array($localDomains)) {
                                        foreach ($localDomains as $localDomain) {
                                                // strip trailing slashes (if given)
index d3f3940..b03322c 100644 (file)
@@ -50,7 +50,7 @@ class FrontendLoginControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->testSitePath = '/';
                $this->accessibleFixture = $this->getAccessibleMock(\TYPO3\CMS\Felogin\Controller\FrontendLoginController::class, array('dummy'));
                $this->accessibleFixture->cObj = $this->getMock(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class);
-               $GLOBALS['TSFE'] = $this->getMock(\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::class, array(), array(), '', FALSE);
+               $this->accessibleFixture->_set('frontendController', $this->getMock(\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::class, array(), array(), '', FALSE));
                $this->setUpFakeSitePathAndHost();
        }
 
@@ -66,11 +66,12 @@ class FrontendLoginControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * Mock database
         */
        protected function setUpDatabaseMock() {
-               $GLOBALS['TYPO3_DB'] = $this->getMock(\TYPO3\CMS\Core\Database\DatabaseConnection::class, array('exec_SELECTgetRows'));
-               $GLOBALS['TYPO3_DB']
+               $db = $this->getMock(\TYPO3\CMS\Core\Database\DatabaseConnection::class, array('exec_SELECTgetRows'));
+               $db
                        ->expects($this->any())
                        ->method('exec_SELECTgetRows')
                        ->will($this->returnCallback(array($this, 'getDomainRecordsCallback')));
+               $this->accessibleFixture->_set('databaseConnection', $db);
        }
 
        /**
index 1d382f3..1e3a681 100644 (file)
@@ -180,8 +180,8 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
        /**
         * Main function, called from TypoScript as a USER_INT object.
         *
-        * @param string Content input, ignore (just put blank string)
-        * @param array TypoScript configuration of the plugin!
+        * @param string $content Content input, ignore (just put blank string)
+        * @param array $conf TypoScript configuration of the plugin!
         * @return string HTML code for the search form / result display.
         */
        public function main($content, $conf) {
@@ -302,7 +302,7 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                // Free Index Uid:
                if ($this->conf['search.']['defaultFreeIndexUidList']) {
                        $uidList = GeneralUtility::intExplode(',', $this->conf['search.']['defaultFreeIndexUidList']);
-                       $indexCfgRecords = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid,title', 'index_config', 'uid IN (' . implode(',', $uidList) . ')' . $this->cObj->enableFields('index_config'), '', '', '', 'uid');
+                       $indexCfgRecords = $this->databaseConnection->exec_SELECTgetRows('uid,title', 'index_config', 'uid IN (' . implode(',', $uidList) . ')' . $this->cObj->enableFields('index_config'), '', '', '', 'uid');
                        foreach ($uidList as $uidValue) {
                                if (is_array($indexCfgRecords[$uidValue])) {
                                        $this->optValues['freeIndexUid'][$uidValue] = $indexCfgRecords[$uidValue]['title'];
@@ -328,11 +328,11 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                }
                // Add operators for various languages
                // Converts the operators to UTF-8 and lowercase
-               $this->operator_translate_table[] = array($GLOBALS['TSFE']->csConvObj->conv_case('utf-8', $GLOBALS['TSFE']->csConvObj->utf8_encode($this->pi_getLL('local_operator_AND'), $GLOBALS['TSFE']->renderCharset), 'toLower'), 'AND');
-               $this->operator_translate_table[] = array($GLOBALS['TSFE']->csConvObj->conv_case('utf-8', $GLOBALS['TSFE']->csConvObj->utf8_encode($this->pi_getLL('local_operator_OR'), $GLOBALS['TSFE']->renderCharset), 'toLower'), 'OR');
-               $this->operator_translate_table[] = array($GLOBALS['TSFE']->csConvObj->conv_case('utf-8', $GLOBALS['TSFE']->csConvObj->utf8_encode($this->pi_getLL('local_operator_NOT'), $GLOBALS['TSFE']->renderCharset), 'toLower'), 'AND NOT');
+               $this->operator_translate_table[] = array($this->frontendController->csConvObj->conv_case('utf-8', $this->frontendController->csConvObj->utf8_encode($this->pi_getLL('local_operator_AND'), $this->frontendController->renderCharset), 'toLower'), 'AND');
+               $this->operator_translate_table[] = array($this->frontendController->csConvObj->conv_case('utf-8', $this->frontendController->csConvObj->utf8_encode($this->pi_getLL('local_operator_OR'), $this->frontendController->renderCharset), 'toLower'), 'OR');
+               $this->operator_translate_table[] = array($this->frontendController->csConvObj->conv_case('utf-8', $this->frontendController->csConvObj->utf8_encode($this->pi_getLL('local_operator_NOT'), $this->frontendController->renderCharset), 'toLower'), 'AND NOT');
                // This is the id of the site root. This value may be a commalist of integer (prepared for this)
-               $this->wholeSiteIdList = (int)$GLOBALS['TSFE']->config['rootLine'][0]['uid'];
+               $this->wholeSiteIdList = (int)$this->frontendController->config['rootLine'][0]['uid'];
                // Creating levels for section menu:
                // This selects the first and secondary menus for the "sections" selector - so we can search in sections and sub sections.
                if ($this->conf['show.']['L1sections']) {
@@ -365,11 +365,11 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                // Load the template
                $this->templateCode = $this->cObj->fileResource($this->conf['templateFile']);
                // Add search languages:
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_language', '1=1' . $this->cObj->enableFields('sys_language'));
-               while (FALSE !== ($data = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))) {
+               $res = $this->databaseConnection->exec_SELECTquery('*', 'sys_language', '1=1' . $this->cObj->enableFields('sys_language'));
+               while (FALSE !== ($data = $this->databaseConnection->sql_fetch_assoc($res))) {
                        $this->optValues['lang'][$data['uid']] = $data['title'];
                }
-               $GLOBALS['TYPO3_DB']->sql_free_result($res);
+               $this->databaseConnection->sql_free_result($res);
                // Calling hook for modification of initialized content
                if ($hookObj = $this->hookRequest('initialize_postProc')) {
                        $hookObj->initialize_postProc();
@@ -420,8 +420,8 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                // Shorten search-word string to max 200 bytes (does NOT take multibyte charsets into account - but never mind, shortening the string here is only a run-away feature!)
                $inSW = substr($this->piVars['sword'], 0, 200);
                // Convert to UTF-8 + conv. entities (was also converted during indexing!)
-               $inSW = $GLOBALS['TSFE']->csConvObj->utf8_encode($inSW, $GLOBALS['TSFE']->metaCharset);
-               $inSW = $GLOBALS['TSFE']->csConvObj->entities_to_utf8($inSW, TRUE);
+               $inSW = $this->frontendController->csConvObj->utf8_encode($inSW, $this->frontendController->metaCharset);
+               $inSW = $this->frontendController->csConvObj->entities_to_utf8($inSW, TRUE);
                $sWordArray = FALSE;
                if ($hookObj = $this->hookRequest('getSearchWords')) {
                        $sWordArray = $hookObj->getSearchWords_splitSWords($inSW, $defOp);
@@ -505,7 +505,7 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                        // Create header if we are searching more than one indexing configuration:
                        if (count($indexCfgs) > 1) {
                                if ($freeIndexUid > 0) {
-                                       $indexCfgRec = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('title', 'index_config', 'uid=' . (int)$freeIndexUid . $this->cObj->enableFields('index_config'));
+                                       $indexCfgRec = $this->databaseConnection->exec_SELECTgetSingleRow('title', 'index_config', 'uid=' . (int)$freeIndexUid . $this->cObj->enableFields('index_config'));
                                        $titleString = $indexCfgRec['title'];
                                } else {
                                        $titleString = $this->pi_getLL('opt_freeIndexUid_header_' . $freeIndexUid);
@@ -539,7 +539,7 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                // Organize and process result:
                $result = FALSE;
                if ($res) {
-                       $totalSearchResultCount = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
+                       $totalSearchResultCount = $this->databaseConnection->sql_num_rows($res);
                        // Total search-result count
                        $currentPageNumber = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($this->piVars['pointer'], 0, floor($totalSearchResultCount / $this->piVars['results']));
                        // The pointer is set to the result page that is currently being viewed
@@ -563,7 +563,7 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                        $lastResultNumberToAnalyze = ($currentPageNumber + 1) * $this->piVars['results'] + $this->piVars['results'];
                        // Now, traverse result and put the rows to be displayed into an array
                        // Each row should contain the fields from 'ISEC.*, IP.*' combined + artificial fields "show_resume" (bool) and "result_number" (counter)
-                       while (FALSE !== ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))) {
+                       while (FALSE !== ($row = $this->databaseConnection->sql_fetch_assoc($res))) {
                                if (!$this->checkExistence($row)) {
                                        // Check if the record is still available or if it has been deleted meanwhile.
                                        // Currently this works for files only, since extending it to content elements would cause a lot of overhead...
@@ -616,7 +616,7 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                                        $totalSearchResultCount--;
                                }
                        }
-                       $GLOBALS['TYPO3_DB']->sql_free_result($res);
+                       $this->databaseConnection->sql_free_result($res);
                        $result = array(
                                'resultRows' => $resultRows,
                                'firstRow' => $firstRow,
@@ -848,10 +848,10 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                        if ($res) {
                                // Get phash list by searching for it:
                                $phashList = array();
-                               while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+                               while ($row = $this->databaseConnection->sql_fetch_assoc($res)) {
                                        $phashList[] = $row['phash'];
                                }
-                               $GLOBALS['TYPO3_DB']->sql_free_result($res);
+                               $this->databaseConnection->sql_free_result($res);
                                // Here the phash list are merged with the existing result based on whether we are dealing with OR, NOT or AND operations.
                                if ($c) {
                                        switch ($v['oper']) {
@@ -883,7 +883,7 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
         * @return bool|\mysqli_result SQL result pointer
         */
        public function execPHashListQuery($wordSel, $plusQ = '') {
-               return $GLOBALS['TYPO3_DB']->exec_SELECTquery('IR.phash', 'index_words IW,
+               return $this->databaseConnection->exec_SELECTquery('IR.phash', 'index_words IW,
                                                index_rel IR,
                                                index_section ISEC', $wordSel . '
                                                AND IW.wid=IR.wid
@@ -902,7 +902,7 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
        public function searchWord($sWord, $mode) {
                $wildcard_left = $mode & self::WILDCARD_LEFT ? '%' : '';
                $wildcard_right = $mode & self::WILDCARD_RIGHT ? '%' : '';
-               $wSel = 'IW.baseword LIKE \'' . $wildcard_left . $GLOBALS['TYPO3_DB']->quoteStr($sWord, 'index_words') . $wildcard_right . '\'';
+               $wSel = 'IW.baseword LIKE \'' . $wildcard_left . $this->databaseConnection->quoteStr($sWord, 'index_words') . $wildcard_right . '\'';
                $this->wSelClauses[] = $wSel;
                $res = $this->execPHashListQuery($wSel, ' AND is_stopword=0');
                return $res;
@@ -928,7 +928,7 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
         * @return bool|\mysqli_result SQL result pointer
         */
        public function searchSentence($sSentence) {
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('ISEC.phash', 'index_section ISEC, index_fulltext IFT', 'IFT.fulltextdata LIKE \'%' . $GLOBALS['TYPO3_DB']->quoteStr($sSentence, 'index_fulltext') . '%\' AND
+               $res = $this->databaseConnection->exec_SELECTquery('ISEC.phash', 'index_section ISEC, index_fulltext IFT', 'IFT.fulltextdata LIKE \'%' . $this->databaseConnection->quoteStr($sSentence, 'index_fulltext') . '%\' AND
                                ISEC.phash = IFT.phash
                        ' . $this->sectionTableWhere(), 'ISEC.phash');
                $this->wSelClauses[] = '1=1';
@@ -979,7 +979,7 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                        switch ((string)$this->piVars['sections']) {
                                case '-1':
                                        // '-1' => 'Only this page',
-                                       $out .= ' AND ISEC.page_id=' . $GLOBALS['TSFE']->id;
+                                       $out .= ' AND ISEC.page_id=' . $this->frontendController->id;
                                        break;
                                case '-2':
                                        // '-2' => 'Top + level 1',
@@ -1003,18 +1003,18 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                switch ((string)$this->piVars['media']) {
                        case '0':
                                // '0' => 'Kun TYPO3 sider',
-                               $out = ' AND IP.item_type=' . $GLOBALS['TYPO3_DB']->fullQuoteStr('0', 'index_phash');
+                               $out = ' AND IP.item_type=' . $this->databaseConnection->fullQuoteStr('0', 'index_phash');
                                break;
                        case '-2':
                                // All external documents
-                               $out = ' AND IP.item_type<>' . $GLOBALS['TYPO3_DB']->fullQuoteStr('0', 'index_phash');
+                               $out = ' AND IP.item_type<>' . $this->databaseConnection->fullQuoteStr('0', 'index_phash');
                                break;
                        case '-1':
                                // All content
                                $out = '';
                                break;
                        default:
-                               $out = ' AND IP.item_type=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($this->piVars['media'], 'index_phash');
+                               $out = ' AND IP.item_type=' . $this->databaseConnection->fullQuoteStr($this->piVars['media'], 'index_phash');
                }
                return $out;
        }
@@ -1040,7 +1040,7 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
        public function freeIndexUidWhere($freeIndexUid) {
                if ($freeIndexUid >= 0) {
                        // First, look if the freeIndexUid is a meta configuration:
-                       $indexCfgRec = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('indexcfgs', 'index_config', 'type=5 AND uid=' . (int)$freeIndexUid . $this->cObj->enableFields('index_config'));
+                       $indexCfgRec = $this->databaseConnection->exec_SELECTgetSingleRow('indexcfgs', 'index_config', 'type=5 AND uid=' . (int)$freeIndexUid . $this->cObj->enableFields('index_config'));
                        if (is_array($indexCfgRec)) {
                                $refs = GeneralUtility::trimExplode(',', $indexCfgRec['indexcfgs']);
                                $list = array(-99);
@@ -1049,13 +1049,13 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                                        list($table, $uid) = GeneralUtility::revExplode('_', $ref, 2);
                                        switch ($table) {
                                                case 'index_config':
-                                                       $idxRec = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('uid', 'index_config', 'uid=' . (int)$uid . $this->cObj->enableFields('index_config'));
+                                                       $idxRec = $this->databaseConnection->exec_SELECTgetSingleRow('uid', 'index_config', 'uid=' . (int)$uid . $this->cObj->enableFields('index_config'));
                                                        if ($idxRec) {
                                                                $list[] = $uid;
                                                        }
                                                        break;
                                                case 'pages':
-                                                       $indexCfgRecordsFromPid = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid', 'index_config', 'pid=' . (int)$uid . $this->cObj->enableFields('index_config'));
+                                                       $indexCfgRecordsFromPid = $this->databaseConnection->exec_SELECTgetRows('uid', 'index_config', 'pid=' . (int)$uid . $this->cObj->enableFields('index_config'));
                                                        foreach ($indexCfgRecordsFromPid as $idxRec) {
                                                                $list[] = $idxRec['uid'];
                                                        }
@@ -1135,7 +1135,7 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                        // So, words are imploded into an OR statement (no "sentence search" should be done here - may deselect results)
                        $wordSel = '(' . implode(' OR ', $this->wSelClauses) . ') AND ';
 
-                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
+                       $res = $this->databaseConnection->exec_SELECTquery(
                                'ISEC.*, IP.*, ' . $grsel,
                                'index_words IW,
                                        index_rel IR,
@@ -1165,7 +1165,7 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                                        $orderBy = 'IP.item_mtime' . $this->isDescending();
                                        break;
                        }
-                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('ISEC.*, IP.*', 'index_phash IP,index_section ISEC' . $page_join, 'IP.phash IN (' . $list . ') ' . $this->mediaTypeWhere() . ' ' . $this->languageWhere() . $freeIndexUidClause . '
+                       $res = $this->databaseConnection->exec_SELECTquery('ISEC.*, IP.*', 'index_phash IP,index_section ISEC' . $page_join, 'IP.phash IN (' . $list . ') ' . $this->mediaTypeWhere() . ' ' . $this->languageWhere() . $freeIndexUidClause . '
                                                        AND IP.phash = ISEC.phash
                                                        AND ' . $page_where, 'IP.phash,ISEC.phash,ISEC.phash_t3,ISEC.rl0,ISEC.rl1,ISEC.rl2 ,ISEC.page_id,ISEC.uniqid,IP.phash_grouping,IP.data_filename ,IP.data_page_id ,IP.data_page_reg1,IP.data_page_type,IP.data_page_mp,IP.gr_list,IP.item_type,IP.item_title,IP.item_description,IP.item_mtime,IP.tstamp,IP.item_size,IP.contentHash,IP.crdate,IP.parsetime,IP.sys_language_uid,IP.item_crdate,IP.cHashParams,IP.externalUrl,IP.recordUid,IP.freeIndexUid,IP.freeIndexSetId', $orderBy);
                }
@@ -1194,25 +1194,25 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                        // So, selecting for the grlist records belonging to the parent phash-row where the current users gr_list exists will help us to know.
                        // If this is NOT found, there is still a theoretical possibility that another user accessible page would display a link, so maybe the resume of such a document here may be unjustified hidden. But better safe than sorry.
                        if (\TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::isTableUsed('index_grlist')) {
-                               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('phash', 'index_grlist', 'phash=' . (int)$row['phash_t3'] . ' AND gr_list=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($GLOBALS['TSFE']->gr_list, 'index_grlist'));
+                               $res = $this->databaseConnection->exec_SELECTquery('phash', 'index_grlist', 'phash=' . (int)$row['phash_t3'] . ' AND gr_list=' . $this->databaseConnection->fullQuoteStr($this->frontendController->gr_list, 'index_grlist'));
                        } else {
                                $res = FALSE;
                        }
-                       if ($res && $GLOBALS['TYPO3_DB']->sql_num_rows($res)) {
+                       if ($res && $this->databaseConnection->sql_num_rows($res)) {
                                return TRUE;
                        } else {
                                return FALSE;
                        }
                } else {
                        // Ordinary TYPO3 pages:
-                       if ((string)$row['gr_list'] !== (string)$GLOBALS['TSFE']->gr_list) {
+                       if ((string)$row['gr_list'] !== (string)$this->frontendController->gr_list) {
                                // Selecting for the grlist records belonging to the phash-row where the current users gr_list exists. If it is found it is proof that this user has direct access to the phash-rows content although he did not himself initiate the indexing...
                                if (\TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::isTableUsed('index_grlist')) {
-                                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('phash', 'index_grlist', 'phash=' . (int)$row['phash'] . ' AND gr_list=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($GLOBALS['TSFE']->gr_list, 'index_grlist'));
+                                       $res = $this->databaseConnection->exec_SELECTquery('phash', 'index_grlist', 'phash=' . (int)$row['phash'] . ' AND gr_list=' . $this->databaseConnection->fullQuoteStr($this->frontendController->gr_list, 'index_grlist'));
                                } else {
                                        $res = FALSE;
                                }
-                               if ($res && $GLOBALS['TYPO3_DB']->sql_num_rows($res)) {
+                               if ($res && $this->databaseConnection->sql_num_rows($res)) {
                                        return TRUE;
                                } else {
                                        return FALSE;
@@ -1291,8 +1291,8 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                        // Number of hits on the search.
                        'tstamp' => $GLOBALS['EXEC_TIME']
                );
-               $GLOBALS['TYPO3_DB']->exec_INSERTquery('index_stat_search', $insertFields);
-               $newId = $GLOBALS['TYPO3_DB']->sql_insert_id();
+               $this->databaseConnection->exec_INSERTquery('index_stat_search', $insertFields);
+               $newId = $this->databaseConnection->sql_insert_id();
                if ($newId) {
                        foreach ($sWArr as $val) {
                                $insertFields = array(
@@ -1300,9 +1300,9 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                                        'index_stat_search_id' => $newId,
                                        'tstamp' => $GLOBALS['EXEC_TIME'],
                                        // Time stamp
-                                       'pageid' => $GLOBALS['TSFE']->id
+                                       'pageid' => $this->frontendController->id
                                );
-                               $GLOBALS['TYPO3_DB']->exec_INSERTquery('index_stat_word', $insertFields);
+                               $this->databaseConnection->exec_INSERTquery('index_stat_word', $insertFields);
                        }
                }
        }
@@ -1428,7 +1428,7 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                        $html = $this->cObj->substituteSubpart($html, '###SEARCH_FORM_EXTENDED###', '');
                }
                if ($this->conf['show.']['advancedSearchLink']) {
-                       $linkToOtherMode = $this->piVars['ext'] ? $this->pi_getPageLink($GLOBALS['TSFE']->id, $GLOBALS['TSFE']->sPre) : $this->pi_getPageLink($GLOBALS['TSFE']->id, $GLOBALS['TSFE']->sPre, array($this->prefixId . '[ext]' => 1));
+                       $linkToOtherMode = $this->piVars['ext'] ? $this->pi_getPageLink($this->frontendController->id, $this->frontendController->sPre) : $this->pi_getPageLink($this->frontendController->id, $this->frontendController->sPre, array($this->prefixId . '[ext]' => 1));
                        $markerArray['###LINKTOOTHERMODE###'] = '<a href="' . htmlspecialchars($linkToOtherMode) . '">' . $this->pi_getLL(($this->piVars['ext'] ? 'link_regularSearch' : 'link_advancedSearch'), '', TRUE) . '</a>';
                } else {
                        $markerArray['###LINKTOOTHERMODE###'] = '';
@@ -1488,7 +1488,7 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                        $item = $this->cObj->getSubpart($this->templateCode, '###RESULT_SECTION_LINKS_LINK###');
                        foreach ($this->resultSections as $id => $dat) {
                                $markerArray = array();
-                               $aBegin = '<a href="' . htmlspecialchars(($GLOBALS['TSFE']->anchorPrefix . '#anchor_' . md5($id))) . '">';
+                               $aBegin = '<a href="' . htmlspecialchars(($this->frontendController->anchorPrefix . '#anchor_' . md5($id))) . '">';
                                $aContent = htmlspecialchars((trim($dat[0]) ? trim($dat[0]) : $this->pi_getLL('unnamedSection'))) . ' (' . $dat[1] . ' ' . $this->pi_getLL(($dat[1] > 1 ? 'word_pages' : 'word_page'), '', TRUE) . ')';
                                $aEnd = '</a>';
                                $markerArray['###LINK###'] = $aBegin . $aContent . $aEnd;
@@ -1664,8 +1664,8 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                        if ($row['show_resume']) {
                                // Can link directly.
                                $targetAttribute = '';
-                               if ($GLOBALS['TSFE']->config['config']['fileTarget']) {
-                                       $targetAttribute = ' target="' . htmlspecialchars($GLOBALS['TSFE']->config['config']['fileTarget']) . '"';
+                               if ($this->frontendController->config['config']['fileTarget']) {
+                                       $targetAttribute = ' target="' . htmlspecialchars($this->frontendController->config['config']['fileTarget']) . '"';
                                }
                                $title = '<a href="' . htmlspecialchars($row['data_filename']) . '"' . $targetAttribute . '>' . htmlspecialchars($this->makeTitle($row)) . '</a>';
                        } else {
@@ -1888,21 +1888,21 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                        if (!$noMarkup) {
                                $markedSW = '';
                                if (\TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::isTableUsed('index_fulltext')) {
-                                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'index_fulltext', 'phash=' . (int)$row['phash']);
+                                       $res = $this->databaseConnection->exec_SELECTquery('*', 'index_fulltext', 'phash=' . (int)$row['phash']);
                                } else {
                                        $res = FALSE;
                                }
                                if ($res) {
-                                       if ($ftdrow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+                                       if ($ftdrow = $this->databaseConnection->sql_fetch_assoc($res)) {
                                                // Cut HTTP references after some length
                                                $content = preg_replace('/(http:\\/\\/[^ ]{60})([^ ]+)/i', '$1...', $ftdrow['fulltextdata']);
                                                $markedSW = $this->markupSWpartsOfString($content);
                                        }
-                                       $GLOBALS['TYPO3_DB']->sql_free_result($res);
+                                       $this->databaseConnection->sql_free_result($res);
                                }
                        }
                        if (!trim($markedSW)) {
-                               $outputStr = $GLOBALS['TSFE']->csConvObj->crop('utf-8', $row['item_description'], $lgd);
+                               $outputStr = $this->frontendController->csConvObj->crop('utf-8', $row['item_description'], $lgd);
                                $outputStr = htmlspecialchars($outputStr);
                        }
                        $output = $this->utf8_to_currentCharset($outputStr ?: $markedSW);
@@ -1946,26 +1946,26 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                foreach ($parts as $k => $strP) {
                        if ($k % 2 == 0) {
                                // Find length of the summary part:
-                               $strLen = $GLOBALS['TSFE']->csConvObj->strlen('utf-8', $parts[$k]);
+                               $strLen = $this->frontendController->csConvObj->strlen('utf-8', $parts[$k]);
                                $output[$k] = $parts[$k];
                                // Possibly shorten string:
                                if (!$k) {
                                        // First entry at all (only cropped on the frontside)
                                        if ($strLen > $postPreLgd) {
-                                               $output[$k] = $divider . preg_replace('/^[^[:space:]]+[[:space:]]/', '', $GLOBALS['TSFE']->csConvObj->crop('utf-8', $parts[$k], -($postPreLgd - $postPreLgd_offset)));
+                                               $output[$k] = $divider . preg_replace('/^[^[:space:]]+[[:space:]]/', '', $this->frontendController->csConvObj->crop('utf-8', $parts[$k], -($postPreLgd - $postPreLgd_offset)));
                                        }
                                } elseif ($summaryLgd > $summaryMax || !isset($parts[($k + 1)])) {
                                        // In case summary length is exceed OR if there are no more entries at all:
                                        if ($strLen > $postPreLgd) {
-                                               $output[$k] = preg_replace('/[[:space:]][^[:space:]]+$/', '', $GLOBALS['TSFE']->csConvObj->crop('utf-8', $parts[$k], ($postPreLgd - $postPreLgd_offset))) . $divider;
+                                               $output[$k] = preg_replace('/[[:space:]][^[:space:]]+$/', '', $this->frontendController->csConvObj->crop('utf-8', $parts[$k], ($postPreLgd - $postPreLgd_offset))) . $divider;
                                        }
                                } else {
                                        // In-between search words:
                                        if ($strLen > $postPreLgd * 2) {
-                                               $output[$k] = preg_replace('/[[:space:]][^[:space:]]+$/', '', $GLOBALS['TSFE']->csConvObj->crop('utf-8', $parts[$k], ($postPreLgd - $postPreLgd_offset))) . $divider . preg_replace('/^[^[:space:]]+[[:space:]]/', '', $GLOBALS['TSFE']->csConvObj->crop('utf-8', $parts[$k], -($postPreLgd - $postPreLgd_offset)));
+                                               $output[$k] = preg_replace('/[[:space:]][^[:space:]]+$/', '', $this->frontendController->csConvObj->crop('utf-8', $parts[$k], ($postPreLgd - $postPreLgd_offset))) . $divider . preg_replace('/^[^[:space:]]+[[:space:]]/', '', $this->frontendController->csConvObj->crop('utf-8', $parts[$k], -($postPreLgd - $postPreLgd_offset)));
                                        }
                                }
-                               $summaryLgd += $GLOBALS['TSFE']->csConvObj->strlen('utf-8', $output[$k]);
+                               $summaryLgd += $this->frontendController->csConvObj->strlen('utf-8', $output[$k]);
                                // Protect output:
                                $output[$k] = htmlspecialchars($output[$k]);
                                // If summary lgd is exceed, break the process:
@@ -1973,7 +1973,7 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                                        break;
                                }
                        } else {
-                               $summaryLgd += $GLOBALS['TSFE']->csConvObj->strlen('utf-8', $strP);
+                               $summaryLgd += $this->frontendController->csConvObj->strlen('utf-8', $strP);
                                $output[$k] = '<strong class="tx-indexedsearch-redMarkup">' . htmlspecialchars($parts[$k]) . '</strong>';
                        }
                }
@@ -1998,7 +1998,7 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                                $add = ', ' . $this->pi_getLL('word_page') . ' ' . $pp[0];
                        }
                }
-               $outputString = $GLOBALS['TSFE']->csConvObj->crop('utf-8', $row['item_title'], 50, '...');
+               $outputString = $this->frontendController->csConvObj->crop('utf-8', $row['item_title'], 50, '...');
                return $this->utf8_to_currentCharset($outputString) . $add;
        }
 
@@ -2018,8 +2018,8 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                $pI = parse_url($row['data_filename']);
                if ($pI['scheme']) {
                        $targetAttribute = '';
-                       if ($GLOBALS['TSFE']->config['config']['fileTarget']) {
-                               $targetAttribute = ' target="' . htmlspecialchars($GLOBALS['TSFE']->config['config']['fileTarget']) . '"';
+                       if ($this->frontendController->config['config']['fileTarget']) {
+                               $targetAttribute = ' target="' . htmlspecialchars($this->frontendController->config['config']['fileTarget']) . '"';
                        }
                        $tmplArray['path'] = '<a href="' . htmlspecialchars($row['data_filename']) . '"' . $targetAttribute . '>' . htmlspecialchars($row['data_filename']) . '</a>';
                } else {
@@ -2146,7 +2146,7 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
        public function getRootLine($id, $pathMP = '') {
                $identStr = $id . '|' . $pathMP;
                if (!isset($this->cache_path[$identStr])) {
-                       $this->cache_rl[$identStr] = $GLOBALS['TSFE']->sys_page->getRootLine($id, $pathMP);
+                       $this->cache_rl[$identStr] = $this->frontendController->sys_page->getRootLine($id, $pathMP);
                }
                return $this->cache_rl[$identStr];
        }
@@ -2158,8 +2158,8 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
         * @return string Domain name
         */
        public function getFirstSysDomainRecordForPage($id) {
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('domainName', 'sys_domain', 'pid=' . (int)$id . $this->cObj->enableFields('sys_domain'), '', 'sorting');
-               $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
+               $res = $this->databaseConnection->exec_SELECTquery('domainName', 'sys_domain', 'pid=' . (int)$id . $this->cObj->enableFields('sys_domain'), '', 'sorting');
+               $row = $this->databaseConnection->sql_fetch_assoc($res);
                return rtrim($row['domainName'], '/');
        }
 
@@ -2195,7 +2195,7 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                                                }
                                        }
                                        // Stop, if we find that the current id is the current root page.
-                                       if ($v['uid'] == $GLOBALS['TSFE']->config['rootLine'][0]['uid']) {
+                                       if ($v['uid'] == $this->frontendController->config['rootLine'][0]['uid']) {
                                                break;
                                        }
                                        $path = '/' . $v['title'] . $path;
@@ -2218,14 +2218,14 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
        public function getMenu($id) {
                if ($this->conf['show.']['LxALLtypes']) {
                        $output = array();
-                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('title,uid', 'pages', 'pid=' . (int)$id . $this->cObj->enableFields('pages'), '', 'sorting');
-                       while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                               $output[$row['uid']] = $GLOBALS['TSFE']->sys_page->getPageOverlay($row);
+                       $res = $this->databaseConnection->exec_SELECTquery('title,uid', 'pages', 'pid=' . (int)$id . $this->cObj->enableFields('pages'), '', 'sorting');
+                       while ($row = $this->databaseConnection->sql_fetch_assoc($res)) {
+                               $output[$row['uid']] = $this->frontendController->sys_page->getPageOverlay($row);
                        }
-                       $GLOBALS['TYPO3_DB']->sql_free_result($res);
+                       $this->databaseConnection->sql_free_result($res);
                        return $output;
                } else {
-                       return $GLOBALS['TSFE']->sys_page->getMenu($id);
+                       return $this->frontendController->sys_page->getMenu($id);
                }
        }
 
@@ -2246,7 +2246,7 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
         * @return string Converted string (backend charset if different from utf-8)
         */
        public function utf8_to_currentCharset($str) {
-               return $GLOBALS['TSFE']->csConv($str, 'utf-8');
+               return $this->frontendController->csConv($str, 'utf-8');
        }
 
        /**
@@ -2274,9 +2274,9 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
        protected function getSearchFormActionURL() {
                $targetUrlPid = $this->getSearchFormActionPidFromTS();
                if ($targetUrlPid == 0) {
-                       $targetUrlPid = $GLOBALS['TSFE']->id;
+                       $targetUrlPid = $this->frontendController->id;
                }
-               return $this->pi_getPageLink($targetUrlPid, $GLOBALS['TSFE']->sPre);
+               return $this->pi_getPageLink($targetUrlPid, $this->frontendController->sPre);
        }
 
        /**
index 7da8c47..2ffe757 100644 (file)
@@ -51,8 +51,8 @@ class AccessibilityLinkController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlu
        /**
         * Remove accessibility icon when no link was rendered, called from TypoScript
         *
-        * @param string Content input. Not used, ignore.
-        * @param       array           TypoScript configuration
+        * @param string $content Content input. Not used, ignore.
+        * @param array $conf TypoScript configuration
         * @return string HTML output.
         * @access private
         */
@@ -65,7 +65,7 @@ class AccessibilityLinkController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlu
                                $attributes = \TYPO3\CMS\Core\Utility\GeneralUtility::get_tag_attributes($matches[0]);
                                if ($attributes['src']) {
                                        // Get RTE Configconfiguration
-                                       $pageTSConfig = $GLOBALS['TSFE']->getPagesTSconfig();
+                                       $pageTSConfig = $this->frontendController->getPagesTSconfig();
                                        if (is_array($pageTSConfig) && is_array($pageTSConfig['RTE.'])) {
                                                $classesAnchorConfiguration = $pageTSConfig['RTE.']['classesAnchor.'];
                                                if (is_array($classesAnchorConfiguration)) {
index 3220c5d..06c2299 100644 (file)
@@ -55,8 +55,8 @@ class CustomAttributeController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugi
        /**
         * Rendering the "data-htmlarea-clickenlarge" custom attribute, called from TypoScript
         *
-        * @param string Content input. Not used, ignore.
-        * @param array TypoScript configuration
+        * @param string $content Content input. Not used, ignore.
+        * @param array $conf TypoScript configuration
         * @return string HTML output.
         * @access private
         */
@@ -96,7 +96,7 @@ class CustomAttributeController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugi
                unset($this->cObj->parameters['allParams']);
                $content = '<img ' . \TYPO3\CMS\Core\Utility\GeneralUtility::implodeAttributes($this->cObj->parameters, TRUE, TRUE) . ' />';
                if ($clickenlarge && is_array($conf['imageLinkWrap.'])) {
-                       $theImage = $file ? $GLOBALS['TSFE']->tmpl->getFileName($file) : '';
+                       $theImage = $file ? $this->frontendController->tmpl->getFileName($file) : '';
                        if ($theImage) {
                                $this->cObj->parameters['origFile'] = $theImage;
                                if ($this->cObj->parameters['title']) {
index 3a18fe2..e9b0aca 100644 (file)
@@ -122,7 +122,7 @@ class ImageRenderingController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
                $magicImageService = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Resource\Service\MagicImageService::class);
 
                // Get RTE configuration
-               $pageTSConfig = $this->getFrontendObject()->getPagesTSconfig();
+               $pageTSConfig = $this->frontendController->getPagesTSconfig();
                if (is_array($pageTSConfig) && is_array($pageTSConfig['RTE.']['default.'])) {
                        $magicImageService->setMagicImageMaximumDimensions($pageTSConfig['RTE.']['default.']);
                }
@@ -151,13 +151,4 @@ class ImageRenderingController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
                return $logManager->getLogger(get_class($this));
        }
 
-       /**
-        * Returns an instance of the Frontend object.
-        *
-        * @return \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
-        */
-       protected function getFrontendObject() {
-               return $GLOBALS['TSFE'];
-       }
-
 }