From 50e13164bec89706fbf96cc36436400c41ad33fa Mon Sep 17 00:00:00 2001 From: Stefan Neufeind Date: Sat, 6 Jul 2013 18:24:33 +0200 Subject: [PATCH] [TASK] Namespacing: Use-statement for common classes like GeneralUtility Change-Id: I43d6ef559b0b46e6302ea891b4d39501a99423a6 Resolves: #49745 Releases: 6.2 Reviewed-on: https://review.typo3.org/22041 Reviewed-by: Christian Kuhn Tested-by: Christian Kuhn --- Classes/FrontendEditPanel.php | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/Classes/FrontendEditPanel.php b/Classes/FrontendEditPanel.php index 815eeae..c630c46 100644 --- a/Classes/FrontendEditPanel.php +++ b/Classes/FrontendEditPanel.php @@ -28,6 +28,8 @@ namespace TYPO3\CMS\Feedit; * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ +use TYPO3\CMS\Core\Utility\GeneralUtility; + /** * View class for the edit panels in frontend editing. * @@ -47,7 +49,7 @@ class FrontendEditPanel { * @return void */ public function __construct() { - $this->cObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer'); + $this->cObj = GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer'); $this->cObj->start(array()); } @@ -70,7 +72,7 @@ class FrontendEditPanel { // Special content is about to be shown, so the cache must be disabled. $GLOBALS['TSFE']->set_no_cache('Frontend edit panel is shown', TRUE); $formName = 'TSFE_EDIT_FORM_' . substr($GLOBALS['TSFE']->uniqueHash(), 0, 4); - $formTag = '
'; + $formTag = ''; $sortField = $GLOBALS['TCA'][$table]['ctrl']['sortby']; $labelField = $GLOBALS['TCA'][$table]['ctrl']['label']; $hideField = $GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['disabled']; @@ -131,7 +133,7 @@ class FrontendEditPanel { - ' . ($labelTxt ? '' : '') . ' + ' . ($labelTxt ? '' : '') . '
' . $panel . ' ' . sprintf($labelTxt, htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($dataArr[$labelField], 50))) . ' ' . $panel . ' ' . sprintf($labelTxt, htmlspecialchars(GeneralUtility::fixed_lgd_cs($dataArr[$labelField], 50))) . ' 
'; @@ -187,9 +189,9 @@ class FrontendEditPanel { $GLOBALS['TSFE']->set_no_cache('Display frontend edit icons', TRUE); $style = $conf['styleAttribute'] ? ' style="' . htmlspecialchars($conf['styleAttribute']) . '"' : ''; $iconTitle = $this->cObj->stdWrap($conf['iconTitle'], $conf['iconTitle.']); - $iconImg = $conf['iconImg'] ? $conf['iconImg'] : ''; - $nV = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('ADMCMD_view') ? 1 : 0; - $adminURL = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir; + $iconImg = $conf['iconImg'] ? $conf['iconImg'] : ''; + $nV = GeneralUtility::_GP('ADMCMD_view') ? 1 : 0; + $adminURL = GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir; $icon = $this->editPanelLinkWrap_doWrap($iconImg, $adminURL . 'alt_doc.php?edit[' . $table . '][' . $editUid . ']=edit&columnsOnly=' . rawurlencode($fieldList) . '&noView=' . $nV . $addUrlParamStr, $currentRecord); if ($conf['beforeLastTag'] < 0) { $content = $icon . $content; @@ -222,8 +224,8 @@ class FrontendEditPanel { protected function editPanelLinkWrap($string, $formName, $cmd, $currentRecord = '', $confirm = '', $nPid = '') { // Editing forms on page only supported in Live workspace (because of incomplete implementation) $editFormsOnPage = $GLOBALS['BE_USER']->uc['TSFE_adminConfig']['edit_editFormsOnPage'] && $GLOBALS['BE_USER']->workspace === 0; - $nV = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('ADMCMD_view') ? 1 : 0; - $adminURL = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir; + $nV = GeneralUtility::_GP('ADMCMD_view') ? 1 : 0; + $adminURL = GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir; if ($cmd == 'edit' && !$editFormsOnPage) { $rParts = explode(':', $currentRecord); $out = $this->editPanelLinkWrap_doWrap($string, $adminURL . 'alt_doc.php?edit[' . $rParts[0] . '][' . $rParts[1] . ']=edit&noView=' . $nV, $currentRecord); @@ -240,7 +242,7 @@ class FrontendEditPanel { } else { if ($confirm && $GLOBALS['BE_USER']->jsConfirmation(8)) { // Gets htmlspecialchared later - $cf1 = 'if (confirm(' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue($confirm, TRUE) . ')) {'; + $cf1 = 'if (confirm(' . GeneralUtility::quoteJSvalue($confirm, TRUE) . ')) {'; $cf2 = '}'; } else { $cf1 = ($cf2 = ''); @@ -261,7 +263,7 @@ class FrontendEditPanel { */ protected function editPanelLinkWrap_doWrap($string, $url, $currentRecord) { if ($GLOBALS['BE_USER']->uc['TSFE_adminConfig']['edit_editNoPopup'] || $GLOBALS['BE_USER']->extAdminConfig['module.']['edit.']['forceNoPopup']) { - $retUrl = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REQUEST_URI'); + $retUrl = GeneralUtility::getIndpEnv('REQUEST_URI'); $rParts = explode(':', $currentRecord); // This parentRecordNumber is used to make sure that only elements 3- of ordinary content elements makes a 'anchor' jump down the page. if ($rParts[0] == 'tt_content' && $this->parentRecordNumber > 2) { @@ -345,7 +347,7 @@ class FrontendEditPanel { * @return string */ protected function editContent($formTag, $formName, $theCmd, $newUID, array $dataArray, $table, $currentRecord, $blackLine) { - $tceforms = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Form\\FrontendFormEngine'); + $tceforms = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Form\\FrontendFormEngine'); $tceforms->initDefaultBEMode(); $tceforms->prependFormFieldNames = 'TSFE_EDIT[data]'; $tceforms->prependFormFieldNames_file = 'TSFE_EDIT_file'; @@ -356,11 +358,11 @@ class FrontendEditPanel { $tceforms->defStyle = 'font-family:Verdana;font-size:10px;'; $tceforms->edit_showFieldHelp = 0; $tceforms->helpTextFontTag = ''; - $trData = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Form\\DataPreprocessor'); + $trData = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Form\\DataPreprocessor'); $trData->addRawData = TRUE; $trData->lockRecords = 1; // Added without testing - should provide ability to submit default values in frontend editing, in-page. - $trData->defVals = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('defVals'); + $trData->defVals = GeneralUtility::_GP('defVals'); $trData->fetchRecord($table, $theCmd == 'new' ? $newUID : $dataArray['uid'], $theCmd == 'new' ? 'new' : ''); reset($trData->regTableItems_data); $processedDataArr = current($trData->regTableItems_data); @@ -369,7 +371,7 @@ class FrontendEditPanel { $panel = ''; $buttons = ''; $buttons .= ''; - $buttons .= ''; + $buttons .= ''; // Buttons top $panel .= $tceforms->intoTemplate(array('ITEM' => $buttons)); $panel .= $tceforms->getMainFields($table, $processedDataArr);