Commit b4e6d23e authored by Georg Ringer's avatar Georg Ringer
Browse files

[TASK] Remove checks for extensions which are always loaded

There are several calls to check if extensions like extbase are loaded.
As those extensions cannot be removed and are always loaded,
the code can be removed.

Resolves: #56858
Releases: 6.2
Change-Id: I434daaa2e5ae98ac623e8c9c06a0cb41560d3610
Reviewed-on: https://review.typo3.org/28335
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Stefan Neufeind
Reviewed-by: Oliver Klee
Tested-by: Stefan Neufeind
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
parent 41aedcf6
......@@ -529,7 +529,7 @@ class ClickMenu {
$tmpTSc = BackendUtility::getModTSconfig($this->pageinfo['uid'], 'mod.web_list');
$tmpTSc = $tmpTSc['properties']['newContentWiz.']['overrideWithExtension'];
$newContentWizScriptPath = ExtensionManagementUtility::isLoaded($tmpTSc) ? ExtensionManagementUtility::extRelPath($tmpTSc) . 'mod1/db_new_content_el.php' : 'sysext/cms/layout/db_new_content_el.php';
$url = $table == 'pages' || !ExtensionManagementUtility::isLoaded('cms') ? 'db_new.php?id=' . $uid . '&pagesOnly=1' : $newContentWizScriptPath . '?id=' . $rec['pid'] . '&sys_language_uid=' . (int)$rec['sys_language_uid'];
$url = $table == 'pages' ? 'db_new.php?id=' . $uid . '&pagesOnly=1' : $newContentWizScriptPath . '?id=' . $rec['pid'] . '&sys_language_uid=' . (int)$rec['sys_language_uid'];
return $this->linkItem($GLOBALS['LANG']->makeEntities($GLOBALS['LANG']->getLL('CM_newWizard')), $this->excludeIcon(IconUtility::getSpriteIcon('actions-' . ($table === 'pages' ? 'page' : 'document') . '-new')), $this->urlRefForCM($url, 'returnUrl'), 0);
}
......@@ -581,7 +581,7 @@ class ClickMenu {
if ($this->iParts[0] == 'pages' && $this->iParts[1] && $GLOBALS['BE_USER']->check('modules', $pageModule)) {
$theIcon = 'actions-page-open';
$this->editPageIconSet = 1;
if ($GLOBALS['BE_USER']->uc['classicPageEditMode'] || !ExtensionManagementUtility::isLoaded('cms')) {
if ($GLOBALS['BE_USER']->uc['classicPageEditMode']) {
$addParam = '&editRegularContentFromId=' . (int)$this->iParts[1];
} else {
$editOnClick = 'if(' . $loc . '){' . $loc . '.location.href=top.TS.PATH_typo3+\'alt_doc.php?returnUrl=\'+top.rawurlencode(' . $this->frameLocation(($loc . '.document')) . '.pathname+' . $this->frameLocation(($loc . '.document')) . '.search)+\'&edit[' . $table . '][' . $uid . ']=edit' . $addParam . '\';}';
......
......@@ -490,9 +490,7 @@ class Clipboard {
if ($this->fileMode) {
$str = $GLOBALS['TBE_TEMPLATE']->dfw($str);
} else {
if (ExtensionManagementUtility::isLoaded('recordlist')) {
$str = '<a href="' . htmlspecialchars(BackendUtility::getModuleUrl('web_list', array('id' => $rec['pid']), $this->backPath)) . '">' . $str . '</a>';
}
$str = '<a href="' . htmlspecialchars(BackendUtility::getModuleUrl('web_list', array('id' => $rec['pid']), $this->backPath)) . '">' . $str . '</a>';
}
} elseif (file_exists($rec)) {
if (!$this->fileMode) {
......
......@@ -501,7 +501,7 @@ class BackendController {
'moduleMenuWidth' => $this->menuWidth - 1,
'topBarHeight' => isset($GLOBALS['TBE_STYLES']['dims']['topFrameH']) ? (int)$GLOBALS['TBE_STYLES']['dims']['topFrameH'] : 30,
'showRefreshLoginPopup' => isset($GLOBALS['TYPO3_CONF_VARS']['BE']['showRefreshLoginPopup']) ? (int)$GLOBALS['TYPO3_CONF_VARS']['BE']['showRefreshLoginPopup'] : FALSE,
'listModulePath' => ExtensionManagementUtility::isLoaded('recordlist') ? ExtensionManagementUtility::extRelPath('recordlist') . 'mod1/' : '',
'listModulePath' => ExtensionManagementUtility::extRelPath('recordlist') . 'mod1/',
'debugInWindow' => $GLOBALS['BE_USER']->uc['debugInWindow'] ? 1 : 0,
'ContextHelpWindows' => array(
'width' => 600,
......@@ -556,9 +556,6 @@ class BackendController {
* @return void
*/
protected function handlePageEditing() {
if (!ExtensionManagementUtility::isLoaded('cms')) {
return;
}
// EDIT page:
$editId = preg_replace('/[^[:alnum:]_]/', '', GeneralUtility::_GET('edit'));
$editRecord = '';
......
......@@ -962,7 +962,7 @@ class EditDocumentController {
// SAVE button:
$buttons['save'] = IconUtility::getSpriteIcon('actions-document-save', array('html' => '<input type="image" name="_savedok" class="c-inputButton" src="clear.gif" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveDoc', TRUE) . '" />'));
// SAVE / VIEW button:
if ($this->viewId && !$this->noView && ExtensionManagementUtility::isLoaded('cms') && $this->getNewIconMode($this->firstEl['table'], 'saveDocView')) {
if ($this->viewId && !$this->noView && $this->getNewIconMode($this->firstEl['table'], 'saveDocView')) {
$buttons['save_view'] = IconUtility::getSpriteIcon('actions-document-save-view', array('html' => '<input type="image" class="c-inputButton" name="_savedokview" src="clear.gif" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveDocShow', TRUE) . '" />'));
}
// SAVE / NEW button:
......@@ -1370,17 +1370,15 @@ class EditDocumentController {
* @todo Define visibility
*/
public function editRegularContentFromId() {
if (ExtensionManagementUtility::isLoaded('cms')) {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'tt_content', 'pid=' . (int)$this->editRegularContentFromId . BackendUtility::deleteClause('tt_content') . BackendUtility::versioningPlaceholderClause('tt_content') . ' AND colPos=0 AND sys_language_uid=0', '', 'sorting');
if ($GLOBALS['TYPO3_DB']->sql_num_rows($res)) {
$ecUids = array();
while ($ecRec = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$ecUids[] = $ecRec['uid'];
}
$this->editconf['tt_content'][implode(',', $ecUids)] = 'edit';
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'tt_content', 'pid=' . (int)$this->editRegularContentFromId . BackendUtility::deleteClause('tt_content') . BackendUtility::versioningPlaceholderClause('tt_content') . ' AND colPos=0 AND sys_language_uid=0', '', 'sorting');
if ($GLOBALS['TYPO3_DB']->sql_num_rows($res)) {
$ecUids = array();
while ($ecRec = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$ecUids[] = $ecRec['uid'];
}
$GLOBALS['TYPO3_DB']->sql_free_result($res);
$this->editconf['tt_content'][implode(',', $ecUids)] = 'edit';
}
$GLOBALS['TYPO3_DB']->sql_free_result($res);
}
/**
......@@ -1463,7 +1461,7 @@ class EditDocumentController {
* @todo Define visibility
*/
public function setDocument($currentDocFromHandlerMD5 = '', $retUrl = 'alt_doc_nodoc.php') {
if (!ExtensionManagementUtility::isLoaded('cms') && $retUrl === 'alt_doc_nodoc.php') {
if ($retUrl === 'alt_doc_nodoc.php') {
return;
}
if (!$this->modTSconfig['properties']['disableDocSelector'] && is_array($this->docHandler) && count($this->docHandler)) {
......
......@@ -116,7 +116,7 @@ class NoDocumentsOpenController {
$pageModule = \TYPO3\CMS\Backend\Utility\BackendUtility::isModuleSetInTBE_MODULES($newPageModule) ? $newPageModule : 'web_layout';
// Perform some access checks:
$a_wl = $GLOBALS['BE_USER']->check('modules', 'web_list');
$a_wp = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('cms') && $GLOBALS['BE_USER']->check('modules', $pageModule);
$a_wp = $GLOBALS['BE_USER']->check('modules', $pageModule);
// Finding module images: PAGE
$imgFile = $GLOBALS['LANG']->moduleLabels['tabs_images']['web_layout_tab'];
$imgInfo = @getimagesize($imgFile);
......
......@@ -240,9 +240,7 @@ class RteController {
// Save
$buttons['save'] = '<a href="#" onclick="TBE_EDITOR.checkAndDoSubmit(1); return false;">' . '<img' . IconUtility::skinImg($this->doc->backPath, 'gfx/savedok.gif') . ' class="c-inputButton" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveDoc', TRUE) . '" alt="" />' . '</a>';
// Save & View
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('cms')) {
$buttons['save_view'] = '<a href="#" onclick="' . htmlspecialchars('document.editform.redirect.value+=\'&popView=1\'; TBE_EDITOR.checkAndDoSubmit(1); return false;') . '">' . '<img' . IconUtility::skinImg($this->doc->backPath, 'gfx/savedokshow.gif') . ' class="c-inputButton" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveDocShow', TRUE) . '" alt="" />' . '</a>';
}
$buttons['save_view'] = '<a href="#" onclick="' . htmlspecialchars('document.editform.redirect.value+=\'&popView=1\'; TBE_EDITOR.checkAndDoSubmit(1); return false;') . '">' . '<img' . IconUtility::skinImg($this->doc->backPath, 'gfx/savedokshow.gif') . ' class="c-inputButton" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveDocShow', TRUE) . '" alt="" />' . '</a>';
// Save & Close
$buttons['save_close'] = '<input type="image" class="c-inputButton" onclick="' . htmlspecialchars(('document.editform.redirect.value=\'' . $closeUrl . '\'; TBE_EDITOR.checkAndDoSubmit(1); return false;')) . '" name="_saveandclosedok"' . IconUtility::skinImg($this->doc->backPath, 'gfx/saveandclosedok.gif', '') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveCloseDoc', TRUE) . '" />';
// Undo/Revert:
......
......@@ -626,10 +626,8 @@ class ShortcutToolbarItem implements \TYPO3\CMS\Backend\Toolbar\ToolbarItemHookI
$selectFields[] = 'uid';
$selectFields[] = 'pid';
if ($table == 'pages') {
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('cms')) {
$selectFields[] = 'module';
$selectFields[] = 'extendToSubpages';
}
$selectFields[] = 'module';
$selectFields[] = 'extendToSubpages';
$selectFields[] = 'doktype';
}
if (is_array($GLOBALS['TCA'][$table]['ctrl']['enablecolumns'])) {
......
......@@ -68,9 +68,7 @@ class BrowseTreeView extends \TYPO3\CMS\Backend\Tree\View\AbstractTreeView {
$this->MOUNTS = array_diff($this->MOUNTS, $hideList);
}
$this->fieldArray = array_merge($this->fieldArray, array('doktype', 'php_tree_stop', 't3ver_id', 't3ver_state', 't3ver_wsid', 't3ver_move_id'));
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('cms')) {
$this->fieldArray = array_merge($this->fieldArray, array('hidden', 'starttime', 'endtime', 'fe_group', 'module', 'extendToSubpages', 'is_siteroot', 'nav_hide'));
}
$this->fieldArray = array_merge($this->fieldArray, array('hidden', 'starttime', 'endtime', 'fe_group', 'module', 'extendToSubpages', 'is_siteroot', 'nav_hide'));
}
/**
......
......@@ -67,17 +67,15 @@ class PageTreeView extends \TYPO3\CMS\Backend\Tree\View\AbstractTreeView {
*/
public function init($clause = '', $orderByFields = '') {
parent::init(' AND deleted=0 ' . $clause, 'sorting');
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('cms')) {
$this->fieldArray = array_merge($this->fieldArray, array(
'hidden',
'starttime',
'endtime',
'fe_group',
'module',
'extendToSubpages',
'nav_hide'
));
}
$this->fieldArray = array_merge($this->fieldArray, array(
'hidden',
'starttime',
'endtime',
'fe_group',
'module',
'extendToSubpages',
'nav_hide'
));
$this->table = 'pages';
$this->treeName = 'pages';
}
......
......@@ -2995,7 +2995,7 @@ class BackendUtility {
*/
static public function getListViewLink($urlParameters = array(), $linkTitle = '', $linkText = '') {
$url = self::getModuleUrl('web_list', $urlParameters);
if (!ExtensionManagementUtility::isLoaded('recordlist') || $url === FALSE) {
if ($url === FALSE) {
return '';
} else {
return '<a href="' . htmlspecialchars($url) . '" title="' . htmlspecialchars($linkTitle) . '">' . IconUtility::getSpriteIcon('actions-system-list-open') . htmlspecialchars($linkText) . '</a>';
......@@ -3337,13 +3337,11 @@ class BackendUtility {
* @return string Domain name, if found.
*/
static public function firstDomainRecord($rootLine) {
if (ExtensionManagementUtility::isLoaded('cms')) {
foreach ($rootLine as $row) {
$dRec = self::getRecordsByField('sys_domain', 'pid', $row['uid'], ' AND redirectTo=\'\' AND hidden=0', '', 'sorting');
if (is_array($dRec)) {
$dRecord = reset($dRec);
return rtrim($dRecord['domainName'], '/');
}
foreach ($rootLine as $row) {
$dRec = self::getRecordsByField('sys_domain', 'pid', $row['uid'], ' AND redirectTo=\'\' AND hidden=0', '', 'sorting');
if (is_array($dRec)) {
$dRecord = reset($dRec);
return rtrim($dRecord['domainName'], '/');
}
}
}
......@@ -3356,21 +3354,19 @@ class BackendUtility {
* @return array Domain record, if found
*/
static public function getDomainStartPage($domain, $path = '') {
if (ExtensionManagementUtility::isLoaded('cms')) {
$domain = explode(':', $domain);
$domain = strtolower(preg_replace('/\\.$/', '', $domain[0]));
// Path is calculated.
$path = trim(preg_replace('/\\/[^\\/]*$/', '', $path));
// Stuff
$domain .= $path;
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('sys_domain.*', 'pages,sys_domain', '
pages.uid=sys_domain.pid
AND sys_domain.hidden=0
AND (sys_domain.domainName=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($domain, 'sys_domain') . ' OR sys_domain.domainName=' . $GLOBALS['TYPO3_DB']->fullQuoteStr(($domain . '/'), 'sys_domain') . ')' . self::deleteClause('pages'), '', '', '1');
$result = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
$GLOBALS['TYPO3_DB']->sql_free_result($res);
return $result;
}
$domain = explode(':', $domain);
$domain = strtolower(preg_replace('/\\.$/', '', $domain[0]));
// Path is calculated.
$path = trim(preg_replace('/\\/[^\\/]*$/', '', $path));
// Stuff
$domain .= $path;
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('sys_domain.*', 'pages,sys_domain', '
pages.uid=sys_domain.pid
AND sys_domain.hidden=0
AND (sys_domain.domainName=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($domain, 'sys_domain') . ' OR sys_domain.domainName=' . $GLOBALS['TYPO3_DB']->fullQuoteStr(($domain . '/'), 'sys_domain') . ')' . self::deleteClause('pages'), '', '', '1');
$result = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
$GLOBALS['TYPO3_DB']->sql_free_result($res);
return $result;
}
/**
......
......@@ -6891,68 +6891,66 @@ class DataHandler {
$TSConfig = $this->getTCEMAIN_TSconfig($tscPID);
if (!$TSConfig['clearCache_disable']) {
// If table is "pages":
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('cms')) {
$list_cache = array();
if ($table === 'pages' || $table === 'pages_language_overlay') {
if ($table === 'pages_language_overlay') {
$pageUid = $this->getPID($table, $uid);
} else {
$pageUid = $uid;
}
// Builds list of pages on the SAME level as this page (siblings)
$res_tmp = $GLOBALS['TYPO3_DB']->exec_SELECTquery('A.pid AS pid, B.uid AS uid', 'pages A, pages B', 'A.uid=' . (int)$pageUid . ' AND B.pid=A.pid AND B.deleted=0');
$pid_tmp = 0;
while ($row_tmp = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_tmp)) {
$list_cache[] = $row_tmp['uid'];
$pid_tmp = $row_tmp['pid'];
// Add children as well:
if ($TSConfig['clearCache_pageSiblingChildren']) {
$res_tmp2 = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'pages', 'pid=' . (int)$row_tmp['uid'] . ' AND deleted=0');
while ($row_tmp2 = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_tmp2)) {
$list_cache[] = $row_tmp2['uid'];
}
$GLOBALS['TYPO3_DB']->sql_free_result($res_tmp2);
}
}
$GLOBALS['TYPO3_DB']->sql_free_result($res_tmp);
// Finally, add the parent page as well:
$list_cache[] = $pid_tmp;
// Add grand-parent as well:
if ($TSConfig['clearCache_pageGrandParent']) {
$res_tmp = $GLOBALS['TYPO3_DB']->exec_SELECTquery('pid', 'pages', 'uid=' . (int)$pid_tmp);
if ($row_tmp = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_tmp)) {
$list_cache[] = $row_tmp['pid'];
$list_cache = array();
if ($table === 'pages' || $table === 'pages_language_overlay') {
if ($table === 'pages_language_overlay') {
$pageUid = $this->getPID($table, $uid);
} else {
$pageUid = $uid;
}
// Builds list of pages on the SAME level as this page (siblings)
$res_tmp = $GLOBALS['TYPO3_DB']->exec_SELECTquery('A.pid AS pid, B.uid AS uid', 'pages A, pages B', 'A.uid=' . (int)$pageUid . ' AND B.pid=A.pid AND B.deleted=0');
$pid_tmp = 0;
while ($row_tmp = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_tmp)) {
$list_cache[] = $row_tmp['uid'];
$pid_tmp = $row_tmp['pid'];
// Add children as well:
if ($TSConfig['clearCache_pageSiblingChildren']) {
$res_tmp2 = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'pages', 'pid=' . (int)$row_tmp['uid'] . ' AND deleted=0');
while ($row_tmp2 = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_tmp2)) {
$list_cache[] = $row_tmp2['uid'];
}
$GLOBALS['TYPO3_DB']->sql_free_result($res_tmp);
$GLOBALS['TYPO3_DB']->sql_free_result($res_tmp2);
}
} else {
// For other tables than "pages", delete cache for the records "parent page".
$list_cache[] = ($pageUid = (int)$this->getPID($table, $uid));
}
// Call pre-processing function for clearing of cache for page ids:
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearPageCacheEval'])) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearPageCacheEval'] as $funcName) {
$_params = array('pageIdArray' => &$list_cache, 'table' => $table, 'uid' => $uid, 'functionID' => 'clear_cache()');
// Returns the array of ids to clear, FALSE if nothing should be cleared! Never an empty array!
GeneralUtility::callUserFunction($funcName, $_params, $this);
$GLOBALS['TYPO3_DB']->sql_free_result($res_tmp);
// Finally, add the parent page as well:
$list_cache[] = $pid_tmp;
// Add grand-parent as well:
if ($TSConfig['clearCache_pageGrandParent']) {
$res_tmp = $GLOBALS['TYPO3_DB']->exec_SELECTquery('pid', 'pages', 'uid=' . (int)$pid_tmp);
if ($row_tmp = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_tmp)) {
$list_cache[] = $row_tmp['pid'];
}
$GLOBALS['TYPO3_DB']->sql_free_result($res_tmp);
}
// Delete cache for selected pages:
if (is_array($list_cache)) {
$pageIds = $GLOBALS['TYPO3_DB']->cleanIntArray($list_cache);
foreach ($pageIds as $pageId) {
// Workspaces always use "-1" as the page id which do not
// point to real pages and caches at all. Flushing caches for
// those records does not make sense and decreases performance
if ($pageId >= 0) {
GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Cache\\CacheManager')->flushCachesByTag('pageId_' . $pageId);
}
} else {
// For other tables than "pages", delete cache for the records "parent page".
$list_cache[] = ($pageUid = (int)$this->getPID($table, $uid));
}
// Call pre-processing function for clearing of cache for page ids:
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearPageCacheEval'])) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearPageCacheEval'] as $funcName) {
$_params = array('pageIdArray' => &$list_cache, 'table' => $table, 'uid' => $uid, 'functionID' => 'clear_cache()');
// Returns the array of ids to clear, FALSE if nothing should be cleared! Never an empty array!
GeneralUtility::callUserFunction($funcName, $_params, $this);
}
}
// Delete cache for selected pages:
if (is_array($list_cache)) {
$pageIds = $GLOBALS['TYPO3_DB']->cleanIntArray($list_cache);
foreach ($pageIds as $pageId) {
// Workspaces always use "-1" as the page id which do not
// point to real pages and caches at all. Flushing caches for
// those records does not make sense and decreases performance
if ($pageId >= 0) {
GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Cache\\CacheManager')->flushCachesByTag('pageId_' . $pageId);
}
}
// Delete cache for current table and record
GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Cache\\CacheManager')->flushCachesByTag($table);
GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Cache\\CacheManager')->flushCachesByTag($table . '_' . $uid);
}
// Delete cache for current table and record
GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Cache\\CacheManager')->flushCachesByTag($table);
GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Cache\\CacheManager')->flushCachesByTag($table . '_' . $uid);
}
// Clear cache for pages entered in TSconfig:
if ($TSConfig['clearCacheCmd']) {
......@@ -7026,9 +7024,7 @@ class DataHandler {
if ($this->admin || $this->BE_USER->getTSConfigVal('options.clearCache.all')) {
// Clear cache group "all" of caching framework caches
GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Cache\\CacheManager')->flushCachesInGroup('all');
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('cms')) {
$GLOBALS['TYPO3_DB']->exec_TRUNCATEquery('cache_treelist');
}
$GLOBALS['TYPO3_DB']->exec_TRUNCATEquery('cache_treelist');
// Clearing additional cache tables:
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearAllCache_additionalTables'])) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearAllCache_additionalTables'] as $tableName) {
......@@ -7054,21 +7050,19 @@ class DataHandler {
$tagsToFlush = array();
// Clear cache for a page ID!
if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($cacheCmd)) {
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('cms')) {
$list_cache = array($cacheCmd);
// Call pre-processing function for clearing of cache for page ids:
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearPageCacheEval'])) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearPageCacheEval'] as $funcName) {
$_params = array('pageIdArray' => &$list_cache, 'cacheCmd' => $cacheCmd, 'functionID' => 'clear_cacheCmd()');
// Returns the array of ids to clear, FALSE if nothing should be cleared! Never an empty array!
GeneralUtility::callUserFunction($funcName, $_params, $this);
}
$list_cache = array($cacheCmd);
// Call pre-processing function for clearing of cache for page ids:
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearPageCacheEval'])) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearPageCacheEval'] as $funcName) {
$_params = array('pageIdArray' => &$list_cache, 'cacheCmd' => $cacheCmd, 'functionID' => 'clear_cacheCmd()');
// Returns the array of ids to clear, FALSE if nothing should be cleared! Never an empty array!
GeneralUtility::callUserFunction($funcName, $_params, $this);
}
// Delete cache for selected pages:
if (is_array($list_cache)) {
foreach ($list_cache as $pageId) {
$tagsToFlush[] = 'pageId_' . (int)$pageId;
}
}
// Delete cache for selected pages:
if (is_array($list_cache)) {
foreach ($list_cache as $pageId) {
$tagsToFlush[] = 'pageId_' . (int)$pageId;
}
}
}
......
......@@ -148,9 +148,9 @@ class DatabaseIntegrityCheck {
*/
public function genTree($theID, $depthData, $versions = FALSE) {
if ($versions) {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,title,doktype,deleted,t3ver_wsid,t3ver_id,t3ver_count' . (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('cms') ? ',hidden' : ''), 'pages', 'pid=-1 AND t3ver_oid=' . (int)$theID . ' ' . (!$this->genTree_includeDeleted ? 'AND deleted=0' : '') . $this->perms_clause, '', 'sorting');
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,title,doktype,deleted,t3ver_wsid,t3ver_id,t3ver_count,hidden', 'pages', 'pid=-1 AND t3ver_oid=' . (int)$theID . ' ' . (!$this->genTree_includeDeleted ? 'AND deleted=0' : '') . $this->perms_clause, '', 'sorting');
} else {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,title,doktype,deleted' . (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('cms') ? ',hidden' : ''), 'pages', 'pid=' . (int)$theID . ' ' . (!$this->genTree_includeDeleted ? 'AND deleted=0' : '') . $this->perms_clause, '', 'sorting');
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,title,doktype,deleted,hidden', 'pages', 'pid=' . (int)$theID . ' ' . (!$this->genTree_includeDeleted ? 'AND deleted=0' : '') . $this->perms_clause, '', 'sorting');
}
// Traverse the records selected:
$a = 0;
......
......@@ -67,9 +67,6 @@ class StandaloneView extends \TYPO3\CMS\Fluid\View\AbstractTemplateView {
* @param \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $contentObject The current cObject. If NULL a new instance will be created
*/
public function __construct(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $contentObject = NULL) {
if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('extbase')) {
return 'In the current version you still need to have Extbase installed in order to use the Fluid Standalone view!';
}
$this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
$configurationManager = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
if ($contentObject === NULL) {
......
......@@ -3,10 +3,7 @@ if (!defined('TYPO3_MODE')) {
die('Access denied.');
}
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43($_EXTKEY);
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('extbase')) {
// Configure the Extbase Plugin
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin($_EXTKEY, 'Pi2', array('Search' => 'form,search'), array('Search' => 'form,search'));
}
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin($_EXTKEY, 'Pi2', array('Search' => 'form,search'), array('Search' => 'form,search'));
// Attach to hooks:
$TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['pageIndexing'][] = 'TYPO3\\CMS\\IndexedSearch\\Indexer';
$TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['headerNoCache']['tx_indexedsearch'] = '&TYPO3\\CMS\\IndexedSearch\\Hook\\TypoScriptFrontendHook->headerNoCache';
......
......@@ -402,12 +402,10 @@ class DatabaseIntegrityView {
$codeArr[$i][] = $GLOBALS['LANG']->getLL('total_pages');
$codeArr[$i][] = count($admin->page_idArray);
$i++;
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('cms')) {
$codeArr[$i][] = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord('pages', array('hidden' => 1));
$codeArr[$i][] = $GLOBALS['LANG']->getLL('hidden_pages');
$codeArr[$i][] = $admin->recStats['hidden'];
$i++;
}
$codeArr[$i][] = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord('pages', array('hidden' => 1));
$codeArr[$i][] = $GLOBALS['LANG']->getLL('hidden_pages');
$codeArr[$i][] = $admin->recStats['hidden'];
$i++;
$codeArr[$i][] = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord('pages', array('deleted' => 1));
$codeArr[$i][] = $GLOBALS['LANG']->getLL('deleted_pages');
$codeArr[$i][] = count($admin->recStats['deleted']['pages']);
......
......@@ -312,11 +312,9 @@ class DatabaseRecordList extends \TYPO3\CMS\Recordlist\RecordList\AbstractDataba
$selectFields[] = $thumbsCol;
}
if ($table == 'pages') {
if (ExtensionManagementUtility::isLoaded('cms')) {
$selectFields[] = 'module';
$selectFields[] = 'extendToSubpages';
$selectFields[] = 'nav_hide';
}
$selectFields[] = 'module';
$selectFields[] = 'extendToSubpages';
$selectFields[] = 'nav_hide';
$selectFields[] = 'doktype';
}
if (is_array($GLOBALS['TCA'][$table]['ctrl']['enablecolumns'])) {
......
......@@ -40,14 +40,12 @@ Example implementation for TYPO3 frontend:
$password = 'XXX';
$saltedPassword = '';
if (\TYPO3\CMS\Core\Utility\GeneralUtility::isLoaded('saltedpasswords')) {
if (\TYPO3\CMS\Saltedpasswords\Utility::SaltedPasswordsUtility::isUsageEnabled('FE')) {
$objSalt = \TYPO3\CMS\Saltedpasswords\Salt\SaltFactory::getSaltingInstance(NULL);
if (is_object($objSalt)) {
$saltedPassword = $objSalt->getHashedPassword($password);
}
}
}
if (\TYPO3\CMS\Saltedpasswords\Utility::SaltedPasswordsUtility::isUsageEnabled('FE')) {
$objSalt = \TYPO3\CMS\Saltedpasswords\Salt\SaltFactory::getSaltingInstance(NULL);
if (is_object($objSalt)) {
$saltedPassword = $objSalt->getHashedPassword($password);
}
}
.. _checking-a-password:
......
......@@ -495,7 +495,7 @@ class VersionModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClass
$pageModule = BackendUtility::isModuleSetInTBE_MODULES($newPageModule) ? $newPageModule : 'web_layout';
// Perform some acccess checks:
$a_wl = $GLOBALS['BE_USER']->check('modules', 'web_list');
$a_wp = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('cms') && $GLOBALS['BE_USER']->check('modules', $pageModule);
$a_wp = $GLOBALS['BE_USER']->check('modules', $pageModule);
$adminLink .= '<a href="#" onclick="top.loadEditId(' . $row['uid'] . ');top.goToModule(\'' . $pageModule . '\'); return false;">' . IconUtility::getSpriteIcon('actions-page-open') . '</a>';
$adminLink .= '<a href="#" onclick="top.loadEditId(' . $row['uid'] . ');top.goToModule(\'web_list\'); return false;">' . IconUtility::getSpriteIcon('actions-system-list-open') . '</a>';
// "View page" icon is added:
......
......@@ -90,7 +90,7 @@ class SortPagesWizardModuleFunction extends \TYPO3\CMS\Backend\Module\AbstractFu
$lines = array();
$lines[] = '<thead><tr>';
$lines[] = '<th>' . $this->wiz_linkOrder($GLOBALS['LANG']->getLL('wiz_changeOrder_title'), 'title') . '</th>';
$lines[] = (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('cms') ? '<th> ' . $this->wiz_linkOrder($GLOBALS['LANG']->getLL('wiz_changeOrder_subtitle'), 'subtitle') . '</th>' : '');
$lines[] = '<th> ' . $this->wiz_linkOrder($GLOBALS['LANG']->getLL('wiz_changeOrder_subtitle'), 'subtitle') . '</th>';
$lines[] = '<th>' . $this->wiz_linkOrder($GLOBALS['LANG']->getLL('wiz_changeOrder_tChange'), 'tstamp') . '</th>';
$lines[] = '<th>' . $this->wiz_linkOrder($GLOBALS['LANG']->getLL('wiz_changeOrder_tCreate'), 'crdate') . '</th>';
$lines[] = '</tr></thead>';
......@@ -100,7 +100,7 @@ class SortPagesWizardModuleFunction extends \TYPO3\CMS\Backend\Module\AbstractFu
// edit permissions for that page!
$pRec = BackendUtility::getRecord('pages', $rec['uid'], 'uid', ' AND ' . $m_perms_clause);
$lines[] = '<tr class="db_list_normal"><td nowrap="nowrap">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord('pages', $rec) . (!is_array($pRec) ? $GLOBALS['TBE_TEMPLATE']->rfw('<strong>' . $GLOBALS['LANG']->getLL('wiz_W', TRUE) . '</strong> ') : '') . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($rec['title'], $GLOBALS['BE_USER']->uc['titleLen'])) . '</td>
' . (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('cms') ? '<td nowrap="nowrap">' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($rec['subtitle'], $GLOBALS['BE_USER']->uc['titleLen'])) . '</td>' : '') . '
<td nowrap="nowrap">' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($rec['subtitle'], $GLOBALS['BE_USER']->uc['titleLen'])) . '</td>
<td nowrap="nowrap">' . BackendUtility::datetime($rec['tstamp']) . '</td>
<td nowrap="nowrap">' . BackendUtility::datetime($rec['crdate']) . '</td>
</tr>';
......@@ -111,9 +111,7 @@ class SortPagesWizardModuleFunction extends \TYPO3\CMS\Backend\Module\AbstractFu
// Menu:
$lines = array();
$lines[] = $this->wiz_linkOrder($GLOBALS['LANG']->getLL('wiz_changeOrder_title'), 'title');
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('cms')) {
$lines[] = $this->wiz_linkOrder($GLOBALS['LANG']->getLL('wiz_changeOrder_subtitle'), 'subtitle');
}
$lines[] = $this->wiz_linkOrder($GLOBALS['LANG']->getLL('wiz_changeOrder_subtitle'), 'subtitle');
$lines[] = $this->wiz_linkOrder($GLOBALS['LANG']->getLL('wiz_changeOrder_tChange'), 'tstamp');
$lines[] = $this->wiz_linkOrder($GLOBALS['LANG']->getLL('wiz_changeOrder_tCreate'), 'crdate');
$lines[] = '';
......
......@@ -232,7 +232,7 @@ class PreviewController extends \TYPO3\CMS\Workspaces\Controller\AbstractControl
'moduleMenuWidth' => $this->menuWidth - 1,
'topBarHeight' => isset($GLOBALS['TBE_STYLES']['dims']['topFrameH']) ? (int)$GLOBALS['TBE_STYLES']['dims']['topFrameH'] : 30,
'showRefreshLoginPopup' => isset($GLOBALS['TYPO3_CONF_VARS']['BE']['showRefreshLoginPopup']) ? (int)$GLOBALS['TYPO3_CONF_VARS']['BE']['showRefreshLoginPopup'] : FALSE,