Commit 0e33de2b authored by Stefan Neufeind's avatar Stefan Neufeind Committed by Christian Kuhn
Browse files

[TASK] Make use of "use"-statement for BackendUtility

Change-Id: I5d631cf408758e89c69b129bb414d1ee14289bdd
Resolves: #51158
Releases: 6.2
Reviewed-on: https://review.typo3.org/23182
Reviewed-by: Kai Ole Hartwig
Tested-by: Kai Ole Hartwig
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
parent 7fb894c5
......@@ -1043,15 +1043,16 @@ class PageLayoutController {
'pages_language_overlay',
'pid = ' . intval($this->id) . ' ' .
'AND sys_language_uid = ' . intval($this->current_sys_language) .
\TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('pages_language_overlay') .
\TYPO3\CMS\Backend\Utility\BackendUtility::versioningPlaceholderClause('pages_language_overlay'),
BackendUtility::deleteClause('pages_language_overlay') .
BackendUtility::versioningPlaceholderClause('pages_language_overlay'),
'',
'',
'',
'sys_language_uid'
);
$editLanguageOnClick = htmlspecialchars(\TYPO3\CMS\Backend\Utility\BackendUtility::editOnClick(
$editLanguageOnClick = htmlspecialchars(
BackendUtility::editOnClick(
'&edit[pages_language_overlay][' . $overlayRecord['uid'] . ']=edit',
$GLOBALS['BACK_PATH'])
);
......@@ -1064,7 +1065,9 @@ class PageLayoutController {
// Edit page properties
$editPageOnClick = htmlspecialchars(\TYPO3\CMS\Backend\Utility\BackendUtility::editOnClick('&edit[pages][' . $this->id . ']=edit', $GLOBALS['BACK_PATH']));
$editPageOnClick = htmlspecialchars(
BackendUtility::editOnClick('&edit[pages][' . $this->id . ']=edit', $GLOBALS['BACK_PATH'])
);
$buttons['edit_page'] = '<a href="#" ' .
'onclick="' . $editPageOnClick . '"' .
'title="' . $GLOBALS['LANG']->getLL('editPageProperties', TRUE) . '">' .
......
<?php
namespace TYPO3\CMS\Backend\Tests\Unit\Utility;
use TYPO3\CMS\Backend\Utility;
/***************************************************************
* Copyright notice
......@@ -25,6 +24,8 @@ use TYPO3\CMS\Backend\Utility;
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use TYPO3\CMS\Backend\Utility\BackendUtility;
/**
* Testcase for \TYPO3\CMS\Core\Utility\BackendUtility
*
......@@ -38,7 +39,7 @@ class BackendUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
private $fixture;
public function setUp() {
$this->fixture = new Utility\BackendUtility();
$this->fixture = new BackendUtility();
}
public function tearDown() {
......@@ -156,7 +157,7 @@ class BackendUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
* @test
*/
public function getProcessedValueForGroupWithOneAllowedTable() {
/** @var \PHPUnit_Framework_MockObject_MockObject|Utility\BackendUtility $fixture */
/** @var \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Backend\Utility\BackendUtility $fixture */
$fixture = $this->getMock('TYPO3\\CMS\\Backend\\Utility\\BackendUtility', array('getRecordWSOL'));
$fixture->staticExpects($this->at(0))->method('getRecordWSOL')->will($this->returnValue(array('title' => 'Page 1')));
$fixture->staticExpects($this->at(1))->method('getRecordWSOL')->will($this->returnValue(array('title' => 'Page 2')));
......@@ -167,7 +168,7 @@ class BackendUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
* @test
*/
public function getProcessedValueForGroupWithMultipleAllowedTables() {
/** @var \PHPUnit_Framework_MockObject_MockObject|Utility\BackendUtility $fixture */
/** @var \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Backend\Utility\BackendUtility $fixture */
$fixture = $this->getMock('TYPO3\\CMS\\Backend\\Utility\\BackendUtility', array('getRecordWSOL'));
$fixture->staticExpects($this->at(0))->method('getRecordWSOL')->will($this->returnValue(array('title' => 'Page 1')));
$fixture->staticExpects($this->at(1))->method('getRecordWSOL')->will($this->returnValue(array('header' => 'Content 2')));
......@@ -453,7 +454,7 @@ class BackendUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
* @test
*/
public function getFuncCheckReturnsInputTagWithValueAttribute() {
$this->assertStringMatchesFormat('<input %Svalue="1"%S/>', Utility\BackendUtility::getFuncCheck('params', 'test', TRUE));
$this->assertStringMatchesFormat('<input %Svalue="1"%S/>', BackendUtility::getFuncCheck('params', 'test', TRUE));
}
/**
......@@ -669,7 +670,7 @@ class BackendUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
*/
public function getExcludeFieldsReturnsCorrectFieldList($tca, $expected) {
$GLOBALS['TCA'] = $tca;
$this->assertSame($expected, \TYPO3\CMS\Backend\Utility\BackendUtility::getExcludeFields());
$this->assertSame($expected, BackendUtility::getExcludeFields());
}
/**
......@@ -682,7 +683,7 @@ class BackendUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
public function viewOnClickReturnsOnClickCodeWithAlternativeUrl() {
$alternativeUrl = 'https://typo3.org/about/typo3-the-cms/the-history-of-typo3/#section';
$onclickCode = 'var previewWin = window.open(\'' . $alternativeUrl . '\',\'newTYPO3frontendWindow\');';
$this->assertStringMatchesFormat($onclickCode, Utility\BackendUtility::viewOnClick(NULL, NULL, NULL, NULL, $alternativeUrl, NULL, FALSE));
$this->assertStringMatchesFormat($onclickCode, BackendUtility::viewOnClick(NULL, NULL, NULL, NULL, $alternativeUrl, NULL, FALSE));
}
/**
......@@ -877,7 +878,7 @@ class BackendUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
* @dataProvider replaceMarkersInWhereClauseDataProvider
*/
public function replaceMarkersInWhereClauseReturnsValidWhereClause($whereClause, $tsConfig, $expected) {
$this->assertSame($expected, Utility\BackendUtility::replaceMarkersInWhereClause($whereClause, 'dummytable', 'dummyfield', $tsConfig));
$this->assertSame($expected, BackendUtility::replaceMarkersInWhereClause($whereClause, 'dummytable', 'dummyfield', $tsConfig));
}
}
?>
......@@ -24,6 +24,7 @@
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Module: Web>Page
*
......
......@@ -26,11 +26,9 @@ namespace TYPO3\CMS\Core\Configuration\FlexForm;
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Contains functions for manipulating flex form data
*
* @author Kasper Skårhøj <kasperYYYY@typo3.com>
*/
use TYPO3\CMS\Backend\Utility\BackendUtility;
/**
* Contains functions for manipulating flex form data
*
......@@ -111,7 +109,7 @@ class FlexFormTools {
}
$this->callBackObj = $callBackObj;
// Get Data Structure:
$dataStructArray = \TYPO3\CMS\Backend\Utility\BackendUtility::getFlexFormDS($GLOBALS['TCA'][$table]['columns'][$field]['config'], $row, $table, $field);
$dataStructArray = BackendUtility::getFlexFormDS($GLOBALS['TCA'][$table]['columns'][$field]['config'], $row, $table, $field);
// If data structure was ok, proceed:
if (is_array($dataStructArray)) {
// Get flexform XML data:
......@@ -253,7 +251,7 @@ class FlexFormTools {
public function getAvailableLanguages() {
$isL = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('static_info_tables');
// Find all language records in the system
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('static_lang_isocode,title,uid', 'sys_language', 'pid=0' . \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('sys_language'), '', 'title');
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('static_lang_isocode,title,uid', 'sys_language', 'pid=0' . BackendUtility::deleteClause('sys_language'), '', 'title');
// Traverse them
$output = array();
$output[0] = array(
......@@ -264,7 +262,7 @@ class FlexFormTools {
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$output[$row['uid']] = $row;
if ($isL && $row['static_lang_isocode']) {
$rr = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('static_languages', $row['static_lang_isocode'], 'lg_iso_2');
$rr = BackendUtility::getRecord('static_languages', $row['static_lang_isocode'], 'lg_iso_2');
if ($rr['lg_iso_2']) {
$output[$row['uid']]['ISOcode'] = $rr['lg_iso_2'];
}
......
......@@ -26,6 +26,9 @@ namespace TYPO3\CMS\Core\Database;
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use TYPO3\CMS\Backend\Utility\BackendUtility;
/**
* Class for generating front end for building queries
*
......@@ -33,12 +36,6 @@ namespace TYPO3\CMS\Core\Database;
* @author Kasper Skårhøj <kasperYYYY@typo3.com>
* @coauthor Jo Hasenau <info@cybercraft.de>
*/
/**
* Class for generating front end for building queries
*
* @author Christian Jul Jensen <christian@typo3.com>
* @author Kasper Skårhøj <kasperYYYY@typo3.com>
*/
class QueryGenerator {
/**
......@@ -828,7 +825,7 @@ class QueryGenerator {
$from_table_Arr = explode(',', $fieldSetup['allowed']);
$useTablePrefix = 1;
if (!$fieldSetup['prepend_tname']) {
$checkres = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fN, $table, \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table), ($groupBy = ''), ($orderBy = ''), ($limit = ''));
$checkres = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fN, $table, BackendUtility::deleteClause($table), ($groupBy = ''), ($orderBy = ''), ($limit = ''));
if ($checkres) {
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($checkres)) {
if (stristr($row[$fN], ',')) {
......@@ -901,18 +898,18 @@ class QueryGenerator {
if ($from_table == 'pages') {
$where_clause = 'uid IN (' . $webMountPageTree . ') ';
if (!$GLOBALS['SOBE']->MOD_SETTINGS['show_deleted']) {
$where_clause .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($from_table) . ' AND' . $perms_clause;
$where_clause .= BackendUtility::deleteClause($from_table) . ' AND' . $perms_clause;
}
} else {
$where_clause = 'pid IN (' . $webMountPageTree . ') ';
if (!$GLOBALS['SOBE']->MOD_SETTINGS['show_deleted']) {
$where_clause .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($from_table);
$where_clause .= BackendUtility::deleteClause($from_table);
}
}
} else {
$where_clause = 'uid';
if (!$GLOBALS['SOBE']->MOD_SETTINGS['show_deleted']) {
$where_clause .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($from_table);
$where_clause .= BackendUtility::deleteClause($from_table);
}
}
$orderBy = 'uid';
......@@ -1402,9 +1399,9 @@ class QueryGenerator {
if (in_array('order', $enableArr) && !$GLOBALS['BE_USER']->userTS['mod.']['dbint.']['disableOrderBy']) {
$orderByArr = explode(',', $this->extFieldLists['queryOrder']);
$orderBy = '';
$orderBy .= $this->mkTypeSelect('SET[queryOrder]', $orderByArr[0], '') . '&nbsp;' . \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncCheck($GLOBALS['SOBE']->id, 'SET[queryOrderDesc]', $modSettings['queryOrderDesc'], '', '', 'id="checkQueryOrderDesc"') . '&nbsp;<label for="checkQueryOrderDesc">Descending</label>';
$orderBy .= $this->mkTypeSelect('SET[queryOrder]', $orderByArr[0], '') . '&nbsp;' . BackendUtility::getFuncCheck($GLOBALS['SOBE']->id, 'SET[queryOrderDesc]', $modSettings['queryOrderDesc'], '', '', 'id="checkQueryOrderDesc"') . '&nbsp;<label for="checkQueryOrderDesc">Descending</label>';
if ($orderByArr[0]) {
$orderBy .= '<BR>' . $this->mkTypeSelect('SET[queryOrder2]', $orderByArr[1], '') . '&nbsp;' . \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncCheck($GLOBALS['SOBE']->id, 'SET[queryOrder2Desc]', $modSettings['queryOrder2Desc'], '', '', 'id="checkQueryOrder2Desc"') . '&nbsp;<label for="checkQueryOrder2Desc">Descending</label>';
$orderBy .= '<BR>' . $this->mkTypeSelect('SET[queryOrder2]', $orderByArr[1], '') . '&nbsp;' . BackendUtility::getFuncCheck($GLOBALS['SOBE']->id, 'SET[queryOrder2Desc]', $modSettings['queryOrder2Desc'], '', '', 'id="checkQueryOrder2Desc"') . '&nbsp;<label for="checkQueryOrder2Desc">Descending</label>';
}
$out .= '<tr>
<td' . $TDparams . '><strong>Order By:</strong></td>
......@@ -1463,7 +1460,7 @@ class QueryGenerator {
$theList = '';
}
if ($id && $depth > 0) {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'pages', 'pid=' . $id . ' ' . \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('pages') . ' AND ' . $perms_clause);
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'pages', 'pid=' . $id . ' ' . BackendUtility::deleteClause('pages') . ' AND ' . $perms_clause);
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
if ($begin <= 0) {
$theList .= ',' . $row['uid'];
......@@ -1508,7 +1505,7 @@ class QueryGenerator {
}
$fieldlist = $this->extFieldLists['queryFields'] . ',pid' . ($GLOBALS['TCA'][$this->table]['ctrl']['delete'] ? ',' . $GLOBALS['TCA'][$this->table]['ctrl']['delete'] : '');
if (!$GLOBALS['SOBE']->MOD_SETTINGS['show_deleted']) {
$qString .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($this->table);
$qString .= BackendUtility::deleteClause($this->table);
}
$query = $GLOBALS['TYPO3_DB']->SELECTquery($fieldlist, $this->table, $qString, trim($this->extFieldLists['queryGroup']), $this->extFieldLists['queryOrder'] ? trim($this->extFieldLists['queryOrder_SQL']) : '', $this->extFieldLists['queryLimit']);
return $query;
......
......@@ -27,6 +27,7 @@ namespace TYPO3\CMS\Core\Database;
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
......@@ -101,7 +102,7 @@ class ReferenceIndex {
// Get current index from Database:
$currentRels = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'sys_refindex', 'tablename=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($table, 'sys_refindex') . ' AND recuid=' . intval($uid), '', '', '', 'hash');
// First, test to see if the record exists (including deleted-flagged)
if (\TYPO3\CMS\Backend\Utility\BackendUtility::getRecordRaw($table, 'uid=' . intval($uid), 'uid')) {
if (BackendUtility::getRecordRaw($table, 'uid=' . intval($uid), 'uid')) {
// Then, get relations:
$relations = $this->generateRefIndexData($table, $uid);
if (is_array($relations)) {
......@@ -370,7 +371,7 @@ class ReferenceIndex {
if ($conf['type'] == 'flex') {
// Get current value array:
// NOTICE: failure to resolve Data Structures can lead to integrity problems with the reference index. Please look up the note in the JavaDoc documentation for the function \TYPO3\CMS\Backend\Utility\BackendUtility::getFlexFormDS()
$dataStructArray = \TYPO3\CMS\Backend\Utility\BackendUtility::getFlexFormDS($conf, $row, $table, $field, $this->WSOL);
$dataStructArray = BackendUtility::getFlexFormDS($conf, $row, $table, $field, $this->WSOL);
$currentValueArray = GeneralUtility::xml2array($value);
// Traversing the XML structure, processing files:
if (is_array($currentValueArray)) {
......@@ -390,10 +391,10 @@ class ReferenceIndex {
}
}
// Soft References:
if (strlen($value) && ($softRefs = \TYPO3\CMS\Backend\Utility\BackendUtility::explodeSoftRefParserList($conf['softref']))) {
if (strlen($value) && ($softRefs = BackendUtility::explodeSoftRefParserList($conf['softref']))) {
$softRefValue = $value;
foreach ($softRefs as $spKey => $spParams) {
$softRefObj = \TYPO3\CMS\Backend\Utility\BackendUtility::softRefParserObj($spKey);
$softRefObj = BackendUtility::softRefParserObj($spKey);
if (is_object($softRefObj)) {
$resultArray = $softRefObj->findRef($table, $field, $uid, $softRefValue, $spKey, $spParams);
if (is_array($resultArray)) {
......@@ -442,10 +443,10 @@ class ReferenceIndex {
$this->temp_flexRelations['db'][$structurePath] = $result;
}
// Soft References:
if (strlen($dataValue) && ($softRefs = \TYPO3\CMS\Backend\Utility\BackendUtility::explodeSoftRefParserList($dsConf['softref']))) {
if (strlen($dataValue) && ($softRefs = BackendUtility::explodeSoftRefParserList($dsConf['softref']))) {
$softRefValue = $dataValue;
foreach ($softRefs as $spKey => $spParams) {
$softRefObj = \TYPO3\CMS\Backend\Utility\BackendUtility::softRefParserObj($spKey);
$softRefObj = BackendUtility::softRefParserObj($spKey);
if (is_object($softRefObj)) {
$resultArray = $softRefObj->findRef($table, $field, $uid, $softRefValue, $spKey, $spParams, $structurePath);
if (is_array($resultArray) && is_array($resultArray['elements'])) {
......
......@@ -27,6 +27,8 @@ namespace TYPO3\CMS\Core\Database;
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use TYPO3\CMS\Backend\Utility\BackendUtility;
/**
* Load database groups (relations)
* Used to process the relations created by the TCA element types "group" and "select" for database records. Manages MM-relations as well.
......@@ -617,7 +619,7 @@ class RelationHandler {
}
// Use the deleteClause (e.g. "deleted=0") on this table
if ($useDeleteClause) {
$whereClause .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($foreign_table);
$whereClause .= BackendUtility::deleteClause($foreign_table);
}
// If it's requested to look for the parent uid AND the parent table,
// add an additional SQL-WHERE clause
......@@ -629,9 +631,9 @@ class RelationHandler {
$whereClause .= ' AND ' . $field . '=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($value, $foreign_table);
}
// Select children in the same workspace:
if (\TYPO3\CMS\Backend\Utility\BackendUtility::isTableWorkspaceEnabled($this->currentTable) && \TYPO3\CMS\Backend\Utility\BackendUtility::isTableWorkspaceEnabled($foreign_table)) {
$currentRecord = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord($this->currentTable, $uid, 't3ver_wsid', '', $useDeleteClause);
$whereClause .= \TYPO3\CMS\Backend\Utility\BackendUtility::getWorkspaceWhereClause($foreign_table, $currentRecord['t3ver_wsid']);
if (BackendUtility::isTableWorkspaceEnabled($this->currentTable) && BackendUtility::isTableWorkspaceEnabled($foreign_table)) {
$currentRecord = BackendUtility::getRecord($this->currentTable, $uid, 't3ver_wsid', '', $useDeleteClause);
$whereClause .= BackendUtility::getWorkspaceWhereClause($foreign_table, $currentRecord['t3ver_wsid']);
}
// Get the correct sorting field
// Specific manual sortby for data handled by this field
......@@ -695,7 +697,7 @@ class RelationHandler {
if (!(\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($updateToUid) && $updateToUid > 0)) {
$updateToUid = 0;
}
$considerWorkspaces = $GLOBALS['BE_USER']->workspace !== 0 && \TYPO3\CMS\Backend\Utility\BackendUtility::isTableWorkspaceEnabled($foreign_table);
$considerWorkspaces = $GLOBALS['BE_USER']->workspace !== 0 && BackendUtility::isTableWorkspaceEnabled($foreign_table);
$fields = 'uid,' . $foreign_field;
// Consider the symmetric field if defined:
if ($symmetric_field) {
......@@ -711,7 +713,7 @@ class RelationHandler {
$table = $val['table'];
// Fetch the current (not overwritten) relation record if we should handle symmetric relations
if ($symmetric_field || $considerWorkspaces) {
$row = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord($table, $uid, $fields, '', FALSE);
$row = BackendUtility::getRecord($table, $uid, $fields, '', FALSE);
}
if ($symmetric_field) {
$isOnSymmetricSide = self::isOnSymmetricSide($parentUid, $conf, $row);
......@@ -879,7 +881,8 @@ class RelationHandler {
foreach ($this->itemArray as $key => $val) {
$theRow = $this->results[$val['table']][$val['id']];
if ($theRow && is_array($GLOBALS['TCA'][$val['table']])) {
$label = \TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs(strip_tags(\TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle($val['table'], $theRow)), $titleLen);
$label = \TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs(strip_tags(
BackendUtility::getRecordTitle($val['table'], $theRow)), $titleLen);
$label = $label ? $label : '[...]';
$output[] = str_replace(',', '', $val['table'] . '_' . $val['id'] . '|' . rawurlencode($label));
}
......
......@@ -27,6 +27,7 @@ namespace TYPO3\CMS\Core\Html;
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
......@@ -210,7 +211,7 @@ class RteHtmlParser extends \TYPO3\CMS\Core\Html\HtmlParser {
$this->blockElementList = $this->procOptions['blockElementList'];
}
// Get parameters for rte_transformation:
$p = ($this->rte_p = \TYPO3\CMS\Backend\Utility\BackendUtility::getSpecConfParametersFromArray($specConf['rte_transform']['parameters']));
$p = ($this->rte_p = BackendUtility::getSpecConfParametersFromArray($specConf['rte_transform']['parameters']));
// Setting modes:
if (strcmp($this->procOptions['overruleMode'], '')) {
$modes = array_unique(GeneralUtility::trimExplode(',', $this->procOptions['overruleMode']));
......@@ -808,10 +809,10 @@ class RteHtmlParser extends \TYPO3\CMS\Core\Html\HtmlParser {
// If no id or alias is given, set it to class record pid
// Checking if the id-parameter is an alias.
if (!\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($idPart)) {
list($idPartR) = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordsByField('pages', 'alias', $idPart);
list($idPartR) = BackendUtility::getRecordsByField('pages', 'alias', $idPart);
$idPart = intval($idPartR['uid']);
}
$page = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('pages', $idPart);
$page = BackendUtility::getRecord('pages', $idPart);
if (is_array($page)) {
// Page must exist...
$href = $siteUrl . '?id=' . $idPart . ($pairParts[2] ? $pairParts[2] : '') . ($sectionMark ? '#' . $sectionMark : '');
......
......@@ -27,6 +27,8 @@ namespace TYPO3\CMS\Core\Integrity;
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use TYPO3\CMS\Backend\Utility\BackendUtility;
/**
* This class holds functions used by the TYPO3 backend to check the integrity of the database (The DBint module, 'lowlevel' extension)
*
......@@ -217,10 +219,18 @@ class DatabaseIntegrityCheck {
public function genTree_records($theID, $depthData, $table = '', $versions = FALSE) {
if ($versions) {
// Select all records from table pointing to this page:
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\TYPO3\CMS\Backend\Utility\BackendUtility::getCommonSelectFields($table), $table, 'pid=-1 AND t3ver_oid=' . intval($theID) . (!$this->genTree_includeDeleted ? \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table) : ''));
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
BackendUtility::getCommonSelectFields($table),
$table,
'pid=-1 AND t3ver_oid=' . intval($theID) . (!$this->genTree_includeDeleted ? BackendUtility::deleteClause($table) : '')
);
} else {
// Select all records from table pointing to this page:
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\TYPO3\CMS\Backend\Utility\BackendUtility::getCommonSelectFields($table), $table, 'pid=' . intval($theID) . (!$this->genTree_includeDeleted ? \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table) : ''));
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
BackendUtility::getCommonSelectFields($table),
$table,
'pid=' . intval($theID) . (!$this->genTree_includeDeleted ? BackendUtility::deleteClause($table) : '')
);
}
// Traverse selected:
$a = 0;
......@@ -240,7 +250,7 @@ class DatabaseIntegrityCheck {
$PM = 'join';
$LN = $a == $c ? 'blank' : 'line';
$BTM = $a == $c ? 'bottom' : '';
$this->genTree_HTML .= $depthData . '<img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($this->backPath, ('gfx/ol/' . $PM . $BTM . '.gif'), 'width="18" height="16"') . ' align="top" alt="" />' . $versionLabel . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord($table, $row, array('title' => $table)) . htmlspecialchars(($row['uid'] . ': ' . \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle($table, $row))) . '</span></div>';
$this->genTree_HTML .= $depthData . '<img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($this->backPath, ('gfx/ol/' . $PM . $BTM . '.gif'), 'width="18" height="16"') . ' align="top" alt="" />' . $versionLabel . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord($table, $row, array('title' => $table)) . htmlspecialchars(($row['uid'] . ': ' . BackendUtility::getRecordTitle($table, $row))) . '</span></div>';
}
// Register various data for this item:
$this->rec_idArray[$table][$newID] = $row;
......@@ -306,7 +316,7 @@ class DatabaseIntegrityCheck {
$this->lRecords[$table][$row['uid']] = array(
'uid' => $row['uid'],
'pid' => $row['pid'],
'title' => strip_tags(\TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle($table, $row))
'title' => strip_tags(BackendUtility::getRecordTitle($table, $row))
);
$lostIdList[] = $row['uid'];
}
......@@ -363,7 +373,7 @@ class DatabaseIntegrityCheck {
if ($count) {
$list[$table] = $count;
}
$count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('uid', $table, 'pid IN (' . $pid_list_tmp . ')' . \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table));
$count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('uid', $table, 'pid IN (' . $pid_list_tmp . ')' . BackendUtility::deleteClause($table));
if ($count) {
$list_n[$table] = $count;
}
......@@ -615,7 +625,7 @@ class DatabaseIntegrityCheck {
$idlist = array_keys($dbArr);
$theList = implode(',', $idlist);
if ($theList) {
$mres = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', $table, 'uid IN (' . $theList . ')' . \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table));
$mres = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', $table, 'uid IN (' . $theList . ')' . BackendUtility::deleteClause($table));
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($mres)) {
if (isset($dbArr[$row['uid']])) {
unset($dbArr[$row['uid']]);
......
......@@ -27,6 +27,7 @@ namespace TYPO3\CMS\Core\TypoScript;
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
......@@ -429,7 +430,7 @@ class ExtendedTemplateService extends \TYPO3\CMS\Core\TypoScript\TemplateService
if (GeneralUtility::_GP('breakPointLN')) {
$urlParameters['breakPointLN'] = GeneralUtility::_GP('breakPointLN');
}
$aHref = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_ts', $urlParameters) . '#' . $goto;
$aHref = BackendUtility::getModuleUrl('web_ts', $urlParameters) . '#' . $goto;
$HTML .= '<a name="' . $goto . '" href="' . htmlspecialchars($aHref) . '">' . $theIcon . '</a>';
}
$label = $key;
......@@ -445,7 +446,7 @@ class ExtendedTemplateService extends \TYPO3\CMS\Core\TypoScript\TemplateService
if (GeneralUtility::_GP('breakPointLN')) {
$urlParameters['breakPointLN'] = GeneralUtility::_GP('breakPointLN');
}
$aHref = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_ts', $urlParameters);
$aHref = BackendUtility::getModuleUrl('web_ts', $urlParameters);
if ($this->bType != 'const') {
$ln = is_array($arr[$key . '.ln..']) ? 'Defined in: ' . $this->lineNumberToScript($arr[($key . '.ln..')]) : 'N/A';
} else {
......@@ -649,14 +650,14 @@ class ExtendedTemplateService extends \TYPO3\CMS\Core\TypoScript\TemplateService
$PM = 'join';
$HTML .= $depthData;
$alttext = '[' . $row['templateID'] . ']';
$alttext .= $row['pid'] ? ' - ' . \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordPath($row['pid'], $GLOBALS['SOBE']->perms_clause, 20) : '';
$alttext .= $row['pid'] ? ' - ' . BackendUtility::getRecordPath($row['pid'], $GLOBALS['SOBE']->perms_clause, 20) : '';
$icon = substr($row['templateID'], 0, 3) == 'sys' ? \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord('sys_template', $row, array('title' => $alttext)) : \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('mimetypes-x-content-template-static', array('title' => $alttext));
if (in_array($row['templateID'], $this->clearList_const) || in_array($row['templateID'], $this->clearList_setup)) {
$urlParameters = array(
'id' => $GLOBALS['SOBE']->id,
'template' => $row['templateID']
);
$aHref = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_ts', $urlParameters);
$aHref = BackendUtility::getModuleUrl('web_ts', $urlParameters);
$A_B = '<a href="' . htmlspecialchars($aHref) . '">';
$A_E = '</a>';
if (GeneralUtility::_GP('template') == $row['templateID']) {
......@@ -832,7 +833,7 @@ class ExtendedTemplateService extends \TYPO3\CMS\Core\TypoScript\TemplateService
}
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_template', 'pid=' . intval($id) . $addC . ' ' . $this->whereClause, '', 'sorting', '1');
$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
\TYPO3\CMS\Backend\Utility\BackendUtility::workspaceOL('sys_template', $row);
BackendUtility::workspaceOL('sys_template', $row);
$GLOBALS['TYPO3_DB']->sql_free_result($res);
// Returns the template row if found.
return $row;
......@@ -852,7 +853,7 @@ class ExtendedTemplateService extends \TYPO3\CMS\Core\TypoScript\TemplateService
$outRes = array();
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_template', 'pid=' . intval($id) . ' ' . $this->whereClause, '', 'sorting');
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
\TYPO3\CMS\Backend\Utility\BackendUtility::workspaceOL('sys_template', $row);
BackendUtility::workspaceOL('sys_template', $row);
if (is_array($row)) {
$outRes[] = $row;
}
......@@ -1578,7 +1579,7 @@ class ExtendedTemplateService extends \TYPO3\CMS\Core\TypoScript\TemplateService
* @todo Define visibility
*/
public function ext_prevPageWithTemplate($id, $perms_clause) {
$rootLine = \TYPO3\CMS\Backend\Utility\BackendUtility::BEgetRootLine($id, $perms_clause ? ' AND ' . $perms_clause : '');
$rootLine = BackendUtility::BEgetRootLine($id, $perms_clause ? ' AND ' . $perms_clause : '');
foreach ($rootLine as $p) {
if ($this->ext_getFirstTemplate($p['uid'])) {
return $p;
......
......@@ -27,6 +27,7 @@ namespace TYPO3\CMS\Core\Utility\File;
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Resource\File;
use TYPO3\CMS\Core\Utility\GeneralUtility;
......@@ -412,10 +413,10 @@ class ExtendedFileUtility extends \TYPO3\CMS\Core\Utility\File\BasicFileUtility
foreach ($refIndexRecords as $fileReferenceRow) {
if ($fileReferenceRow['tablename'] === 'sys_file_reference') {
$row = $this->transformFileReferenceToRecordReference($fileReferenceRow);
$shortcutRecord = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord($row['tablename'], $row['recuid']);
$shortcutRecord = BackendUtility::getRecord($row['tablename'], $row['recuid']);
$icon = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord($row['tablename'], $shortcutRecord);
$onClick = 'Clickmenu.show("' . $row['tablename'] . '", "' . $row['recuid'] . '", "1", "+info,history,edit", "|", "");return false;';
$shortcutContent[] = '<a href="#" oncontextmenu="' . htmlspecialchars($onClick) . '" onclick="' . htmlspecialchars($onClick) . '">' . $icon . '</a>' . htmlspecialchars((\TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle($row['tablename'], $shortcutRecord) . ' [' . \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordPath($shortcutRecord['pid'], '', 80) . ']'));
$shortcutContent[] = '<a href="#" oncontextmenu="' . htmlspecialchars($onClick) . '" onclick="' . htmlspecialchars($onClick) . '">' . $icon . '</a>' . htmlspecialchars((BackendUtility::getRecordTitle($row['tablename'], $shortcutRecord) . ' [' . BackendUtility::getRecordPath($shortcutRecord['pid'], '', 80) . ']'));
}
}
......
......@@ -27,6 +27,8 @@ namespace TYPO3\CMS\Cshmanual\Controller;
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use TYPO3\CMS\Backend\Utility\BackendUtility;
/**
* Script Class for rendering the Context Sensitive Help documents, either the single display in the small pop-up window or the full-table view in the larger window.
*
......@@ -148,7 +150,7 @@ class HelpModuleController {
$this->field = $flexFormField;
}
// limitAccess is checked if the $this->table really IS a table (and if the user is NOT a translator who should see all!)
$showAllToUser = \TYPO3\CMS\Backend\Utility\BackendUtility::isModuleSetInTBE_MODULES('txllxmltranslateM1') && $GLOBALS['BE_USER']->check('modules', 'txllxmltranslateM1');
$showAllToUser = BackendUtility::isModuleSetInTBE_MODULES('txllxmltranslateM1') && $GLOBALS['BE_USER']->check('modules', 'txllxmltranslateM1');
$this->limitAccess = isset($GLOBALS['TCA'][$this->table]) ? !$showAllToUser : FALSE;
$GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_view_help.xlf', 1);
}
......@@ -278,7 +280,7 @@ class HelpModuleController {
<!-- NEW SECTION: -->
', $outputSections);
}
$output .= '<hr /><p class="manual-title">' . \TYPO3\CMS\Backend\Utility\BackendUtility::TYPO3_copyRightNotice() . '</p>';
$output .= '<hr /><p class="manual-title">' . BackendUtility::TYPO3_copyRightNotice() . '</p>';
return $output;
}
......@@ -634,7 +636,7 @@ class HelpModuleController {
public function createGlossaryIndex() {
// Create hash string and try to retrieve glossary array:
$hash = md5('typo3/mod.php?M=help_cshmanual:glossary');
list($this->glossaryWords, $this->substWords) = unserialize(\TYPO3\CMS\Backend\Utility\BackendUtility::getHash($hash));
list($this->glossaryWords, $this->substWords) = unserialize(BackendUtility::getHash($hash));
// Generate glossary words if not found: