diff --git a/.travis.yml b/.travis.yml
index 1abe9f5..b2323ed 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -10,9 +10,18 @@ matrix:
- php: 5.4
- php: 5.3
- php: 7.0
- env: CODE_ANALYSIS=yes
+ env: TYPO3="dev-master as 8.5.0" CODE_ANALYSIS=yes
+ - php: 7.0
+ env: TYPO3=^8.0 CODE_ANALYSIS=yes
+ - php: 7.0
+ env: TYPO3=^7.6 CODE_ANALYSIS=yes
+ - php: 7.0
+ env: TYPO3=^6.2 CODE_ANALYSIS=yes
allow_failures:
- - env: CODE_ANALYSIS=yes
+ - env: TYPO3="dev-master as 8.5.0" CODE_ANALYSIS=yes
+ - env: TYPO3=^8.0 CODE_ANALYSIS=yes
+ - env: TYPO3=^7.6 CODE_ANALYSIS=yes
+ - env: TYPO3=^6.2 CODE_ANALYSIS=yes
addons:
apt:
@@ -28,7 +37,7 @@ script:
- >
if [[ "$CODE_ANALYSIS" == "yes" ]]; then
- composer require typo3/cms="^7.6"
+ composer require typo3/cms="$TYPO3" --ignore-platform-reqs
git checkout composer.json
.Build/bin/phpstan analyse --level 5 ext_localconf.php ext_tables.php Classes
fi
diff --git a/Classes/Configuration/ConfigurationGenerator.php b/Classes/Configuration/ConfigurationGenerator.php
index e97b5ab..dcce9cf 100644
--- a/Classes/Configuration/ConfigurationGenerator.php
+++ b/Classes/Configuration/ConfigurationGenerator.php
@@ -28,7 +28,6 @@
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
-use TYPO3\CMS\Core\Locking\LockingStrategyInterface;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
@@ -58,9 +57,11 @@ public function generateConfiguration()
$fileName = PATH_site . self::AUTOCONFIGURTION_FILE;
if (class_exists('TYPO3\\CMS\\Core\\Locking\\LockFactory')) {
$lockFactory = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Locking\\LockFactory');
+ $capabilities = constant('TYPO3\\CMS\\Core\\Locking\\LockingStrategyInterface::LOCK_CAPABILITY_EXCLUSIVE')
+ | constant('TYPO3\\CMS\\Core\\Locking\\LockingStrategyInterface::LOCK_CAPABILITY_NOBLOCK');
$lockObject = $lockFactory->createLocker(
$fileName,
- LockingStrategyInterface::LOCK_CAPABILITY_EXCLUSIVE | LockingStrategyInterface::LOCK_CAPABILITY_NOBLOCK
+ $capabilities
);
$lockObject->acquire();
} else {
diff --git a/Classes/Hooks/DataHandling/DataHandlerHook.php b/Classes/Hooks/DataHandling/DataHandlerHook.php
index 24937b5..d9e3eb7 100644
--- a/Classes/Hooks/DataHandling/DataHandlerHook.php
+++ b/Classes/Hooks/DataHandling/DataHandlerHook.php
@@ -216,7 +216,7 @@ protected function getChildPages($pageId)
/** @var $tree \TYPO3\CMS\Backend\Tree\View\PageTreeView */
$tree = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\View\\PageTreeView');
$tree->init('AND ' . $GLOBALS['BE_USER']->getPagePermsClause(1));
- $tree->makeHTML = false;
+ $tree->makeHTML = 0;
$tree->getTree($pageId, 99, '');
foreach ($tree->tree as $data) {
diff --git a/Classes/Hooks/UrlRewritingHook.php b/Classes/Hooks/UrlRewritingHook.php
index 2261943..20faf83 100644
--- a/Classes/Hooks/UrlRewritingHook.php
+++ b/Classes/Hooks/UrlRewritingHook.php
@@ -122,7 +122,7 @@ class UrlRewritingHook implements SingletonInterface
/**
* Indicates whether devLog is enabled
*
- * @var true
+ * @var bool
*/
protected $enableDevLog = false;
@@ -137,14 +137,25 @@ class UrlRewritingHook implements SingletonInterface
/**
* Mime type that can be set according to the file extension (decoding only).
*
- * @var string
+ * @var string|null
*/
protected $mimeType = null;
- public $enableStrictMode = false;
-
+ /**
+ * @var bool
+ */
public $enableChashDebug = false;
+ /**
+ * @var bool
+ */
+ protected $enableChashUrlDebug = false;
+
+ /**
+ * @var bool
+ */
+ public $enableStrictMode = false;
+
/**
* If non-empty, corresponding URL query parameter will be ignored in preVars
* (note: preVars only!). This is necessary for _DOMAINS feature. This value
@@ -1022,7 +1033,7 @@ public function decodeSpURL($params)
$cachedInfo['GET_VARS']['id'] = $cachedInfo['id'];
$_SERVER['QUERY_STRING'] = $this->decodeSpURL_createQueryString($cachedInfo['GET_VARS']);
if (is_callable('TYPO3\\CMS\\Core\\Utility\\GeneralUtility::flushInternalRuntimeCaches')) {
- GeneralUtility::flushInternalRuntimeCaches();
+ call_user_func('TYPO3\\CMS\\Core\\Utility\\GeneralUtility::flushInternalRuntimeCaches');
}
// Jump-admin if configured
@@ -1339,7 +1350,7 @@ protected function decodeSpURL_settingPreVars(&$pathParts, $config)
return $GET_VARS;
}
}
- return null;
+ return array();
}
/**
@@ -1410,7 +1421,7 @@ protected function decodeSpURL_settingPostVarSets(&$pathParts, $postVarSetCfg, $
return $GET_VARS;
}
}
- return null;
+ return array();
}
/**
@@ -1948,7 +1959,7 @@ protected function decodeSpURL_cHashCache($speakingURIpath)
* @param string $value Value to match field in database to.
* @param bool $aliasToUid If TRUE, the input $value is an alias-string that needs translation to an ID integer. FALSE (default) means the reverse direction
*
- * @return string Result value of lookup. If no value was found the $value is returned.
+ * @return int|string Result value of lookup. Either an int value (id) or a string (alias). If no value was found the $value is returned.
*/
protected function lookUpTranslation($cfg, $value, $aliasToUid = false)
{
@@ -2036,7 +2047,7 @@ protected function lookUpTranslation($cfg, $value, $aliasToUid = false)
if ($csConvObj->strlen('utf-8', $aliasValue) > $maximumAliasLength) {
$aliasValue = $csConvObj->crop('utf-8', $aliasValue, $maximumAliasLength);
}
- return $this->lookUp_newAlias($cfg, $aliasValue, $value, $lang);
+ return $this->lookUp_newAlias($cfg, $aliasValue, (int)$value, $lang);
} // If no cache for alias, then just return whatever value is appropriate:
if (strlen($row[$cfg['alias_field']]) <= $maximumAliasLength) {
return $row[$cfg['alias_field']];
@@ -2082,7 +2093,7 @@ protected function lookUp_uniqAliasToId($cfg, $aliasValue, $onlyNonExpired = fal
* @param int $lang sys_language_uid to use for lookup
* @param string $aliasValue Optional alias value to limit search to
*
- * @return string Alias string. If none is found: false
+ * @return string|null Alias string. If none is found: null
* @see lookUpTranslation(), lookUp_uniqAliasToId()
*/
protected function lookUp_idToUniqAlias($cfg, $idValue, $lang, $aliasValue = '')
@@ -2124,7 +2135,7 @@ protected function lookUp_newAlias($cfg, $newAliasValue, $idValue, $lang)
$newAliasValue = $this->lookUp_cleanAlias($cfg, $newAliasValue);
// If autoupdate is true we might be here even if an alias exists. Therefore we check if that alias is the $newAliasValue and if so, we return that instead of making a new, unique one.
- if ($cfg['autoUpdate'] && $this->lookUp_idToUniqAlias($cfg, $idValue, $lang, $newAliasValue)) {
+ if ($cfg['autoUpdate'] && $this->lookUp_idToUniqAlias($cfg, (string)$idValue, $lang, $newAliasValue)) {
return $newAliasValue;
}
@@ -2163,7 +2174,7 @@ protected function lookUp_newAlias($cfg, $newAliasValue, $idValue, $lang)
);
// Checking that this alias hasn't been stored since we looked last time
- $returnAlias = $this->lookUp_idToUniqAlias($cfg, $idValue, $lang, $uniqueAlias);
+ $returnAlias = $this->lookUp_idToUniqAlias($cfg, (string)$idValue, $lang, $uniqueAlias);
if ($returnAlias) {
// If we are here it is because another process managed to create this alias in the time between we looked the first time and now when we want to put it in database.
$uniqueAlias = $returnAlias;
@@ -2349,7 +2360,7 @@ protected function getHost()
/**
* Returns configuration for a postVarSet (default) based on input page id
*
- * @param int $pageId Page id
+ * @param int|string $pageId Page id or alias
* @param string $mainCat Main key in hellurl configuration array. Default is "postVarSets" but could be "fixedPostVars"
*
* @return array Configuration array
@@ -2360,7 +2371,7 @@ public function getPostVarSetConfig($pageId, $mainCat = 'postVarSets')
{
// If the page id is NOT an integer, it's an alias we have to look up
if (!MathUtility::canBeInterpretedAsInteger($pageId)) {
- $pageId = $this->pageAliasToID($pageId);
+ $pageId = $this->pageAliasToID((string)$pageId);
}
// Checking if the value is not an array but a pointer to another key
diff --git a/Classes/UriGeneratorAndResolver.php b/Classes/UriGeneratorAndResolver.php
index 0bb8889..b154d32 100644
--- a/Classes/UriGeneratorAndResolver.php
+++ b/Classes/UriGeneratorAndResolver.php
@@ -173,7 +173,7 @@ private function resolveAlias($pageId)
*/
protected function isExcludedPage($pageId)
{
- return $this->conf['excludePageIds'] && GeneralUtility::inList($this->conf['excludePageIds'], $pageId);
+ return $this->conf['excludePageIds'] && GeneralUtility::inList($this->conf['excludePageIds'], (string)$pageId);
}
/**
@@ -197,7 +197,7 @@ protected function mergeWithPathParts(array &$pathParts, $pagePath)
* Resolves shortcuts if necessary and returns the final destination page id.
*
* @param int $pageId
- * @param array $mpvar
+ * @param string $mpvar
*
* @return mixed false if not found or int
*/
@@ -280,8 +280,8 @@ protected function createPagePathAndUpdateURLCache($id, $mpvar, $lang, $cachedPa
* Adds a new entry to the path cache.
*
* @param int $pageId
- * @param int $cachedPagePath
- * @param int $pagePath
+ * @param string $cachedPagePath
+ * @param string $pagePath
* @param int $langId
* @param int $rootPageId
* @param string $mpvar
@@ -291,7 +291,7 @@ protected function createPagePathAndUpdateURLCache($id, $mpvar, $lang, $cachedPa
private function updateURLCache($pageId, $cachedPagePath, $pagePath, $langId, $rootPageId, $mpvar)
{
$canCachePaths = !$this->conf['disablePathCache'] && !$this->pObj->isBEUserLoggedIn();
- $newPathDiffers = ((string)$pagePath !== (string)$cachedPagePath);
+ $newPathDiffers = $pagePath !== $cachedPagePath;
if ($canCachePaths && $newPathDiffers) {
/** @noinspection PhpUndefinedMethodInspection */
$cacheCondition = 'page_id=' . intval($pageId) .
@@ -528,7 +528,7 @@ protected function IDtoPagePathSegments($id, $mpvar, $langID)
}
if (!$rootFound) {
// Pass #2 -- check normal page
- $this->pObj->devLog('Starting to walk rootline for id=' . $id . ' from index=' . $i, $rootLine);
+ $this->pObj->devLog('Starting to walk rootline for id=' . $id . ' from index=0 to ' . $numberOfRootlineEntries, $rootLine);
for ($i = 0; $i < $numberOfRootlineEntries; $i++) {
if ($GLOBALS['TSFE']->tmpl->rootLine[0]['uid'] == $rootLine[$i]['uid']) {
$this->pObj->devLog('Found rootline', array('uid' => $id, 'rootline start pid' => $rootLine[$i]['uid']));
@@ -628,7 +628,7 @@ protected function rootLineToPath($rl, $lang)
// Building up the path from page title etc.
if (!$page['tx_hellurl_exclude'] || count($rl) == 0) {
// List of "pages" fields to traverse for a "directory title" in the speaking URL (only from RootLine!!)
- $segTitleFieldArray = GeneralUtility::trimExplode(',', $this->conf['segTitleFieldList'] ? $this->conf['segTitleFieldList'] : TX_HELLURL_SEGTITLEFIELDLIST_DEFAULT, 1);
+ $segTitleFieldArray = GeneralUtility::trimExplode(',', $this->conf['segTitleFieldList'] ? $this->conf['segTitleFieldList'] : TX_HELLURL_SEGTITLEFIELDLIST_DEFAULT, true);
$theTitle = '';
foreach ($segTitleFieldArray as $fieldName) {
if (isset($page[$fieldName]) && $page[$fieldName] !== '') {
@@ -656,7 +656,7 @@ protected function rootLineToPath($rl, $lang)
*
* @param array $pathParts Array of segments from virtual path
*
- * @return int Page ID
+ * @return array Page ID and GET_VARS
* @see decodeSpURL_idFromPath()
*/
protected function pagePathtoID(&$pathParts)
@@ -946,17 +946,15 @@ protected function fetchPagesForPath($url)
* @param int $startPid Page id in which to search subpages matching first part of urlParts
* @param string $mpvar MP variable string
* @param array $urlParts Segments of the virtual path (passed by reference; items removed)
- * @param array|string $currentIdMp Array with the current pid/mpvar to return if no processing is done.
+ * @param array|null $currentIdMp Array with the current pid/mpvar to return if no processing is done.
* @param bool $foundUID
*
* @return array With resolved id and $mpvar
*/
- protected function findIDBySegment($startPid, $mpvar, array &$urlParts, $currentIdMp = '', $foundUID = false)
+ protected function findIDBySegment($startPid, $mpvar, array &$urlParts, $currentIdMp = null, $foundUID = false)
{
// Creating currentIdMp variable if not set
- if (!is_array($currentIdMp)) {
- $currentIdMp = array($startPid, $mpvar, $foundUID);
- }
+ $currentIdMp = ($currentIdMp !== null) ? $currentIdMp : array($startPid, $mpvar, $foundUID);
// No more urlparts? Return what we have.
if (count($urlParts) == 0) {
@@ -1004,7 +1002,7 @@ protected function findIDBySegment($startPid, $mpvar, array &$urlParts, $current
* when excluded segment is found
*
* @param array $row Row to process
- * @param array $mpvar MP var
+ * @param string $mpvar MP var
* @param array $urlParts URL segments
* @param bool $foundUID
*
@@ -1045,7 +1043,7 @@ protected function findPageBySegmentAndPid($searchPid, $title)
// List of "pages" fields to traverse for a "directory title" in the speaking URL (only from RootLine!!)
$segTitleFieldList = $this->conf['segTitleFieldList'] ? $this->conf['segTitleFieldList'] : TX_HELLURL_SEGTITLEFIELDLIST_DEFAULT;
$selList = GeneralUtility::uniqueList('uid,pid,doktype,mount_pid,mount_pid_ol,tx_hellurl_exclude,' . $segTitleFieldList);
- $segTitleFieldArray = GeneralUtility::trimExplode(',', $segTitleFieldList, 1);
+ $segTitleFieldArray = GeneralUtility::trimExplode(',', $segTitleFieldList, true);
// page select object - used to analyse mount points.
$sys_page = GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Page\\PageRepository');
@@ -1223,7 +1221,7 @@ public function encodeTitle($title)
*
* @param int $offsetFromNow Offset to expiration
*
- * @return int Expiration time stamp
+ * @return int|string Expiration timestamp or SQL string if adodb is loaded
*/
protected function makeExpirationTime($offsetFromNow = 0)
{
diff --git a/Classes/View/AdministrationModuleFunction.php b/Classes/View/AdministrationModuleFunction.php
index 41af29c..1f1d4a6 100644
--- a/Classes/View/AdministrationModuleFunction.php
+++ b/Classes/View/AdministrationModuleFunction.php
@@ -303,13 +303,13 @@ public function renderModule(\TYPO3\CMS\Backend\Tree\View\PageTreeView $tree)
// Add values from alternative field used to generate URL:
$baseRow = $row['row']; // page row as base.
- $onClick = \TYPO3\CMS\Backend\Utility\BackendUtility::editOnClick('&edit[pages][' . $row['row']['uid'] . ']=edit&columnsOnly=title,nav_title,alias,tx_hellurl_pathsegment', $this->pObj->doc->backPath);
+ $onClick = \TYPO3\CMS\Backend\Utility\BackendUtility::editOnClick('&edit[pages][' . $row['row']['uid'] . ']=edit&columnsOnly=title,nav_title,alias,tx_hellurl_pathsegment', $GLOBALS['BACK_PATH']);
$editIcon = '' .
- $this->getIcon('gfx/edit2.gif', 'width="11" height="12"', $this->pObj->doc->backPath) .
+ $this->getIcon('gfx/edit2.gif', 'width="11" height="12"', $GLOBALS['BACK_PATH']) .
'';
- $onClick = \TYPO3\CMS\Backend\Utility\BackendUtility::viewOnClick($row['row']['uid'], $this->pObj->doc->backPath, '', '', '', '');
+ $onClick = \TYPO3\CMS\Backend\Utility\BackendUtility::viewOnClick($row['row']['uid'], $GLOBALS['BACK_PATH'], null, '', '', '');
$editIcon .= '' .
- $this->getIcon('gfx/zoom.gif', 'width="12" height="12"', $this->pObj->doc->backPath) .
+ $this->getIcon('gfx/zoom.gif', 'width="12" height="12"', $GLOBALS['BACK_PATH']) .
'';
if ($inf['language_id'] > 0) { // For alternative languages, show another list of fields, form page overlay record:
@@ -317,13 +317,13 @@ public function renderModule(\TYPO3\CMS\Backend\Tree\View\PageTreeView $tree)
list($olRec) = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordsByField('pages_language_overlay', 'pid', $row['row']['uid'], ' AND sys_language_uid=' . intval($inf['language_id']));
if (is_array($olRec)) {
$baseRow = array_merge($baseRow, $olRec);
- $onClick = \TYPO3\CMS\Backend\Utility\BackendUtility::editOnClick('&edit[pages_language_overlay][' . $olRec['uid'] . ']=edit&columnsOnly=title,nav_title', $this->pObj->doc->backPath);
+ $onClick = \TYPO3\CMS\Backend\Utility\BackendUtility::editOnClick('&edit[pages_language_overlay][' . $olRec['uid'] . ']=edit&columnsOnly=title,nav_title', $GLOBALS['BACK_PATH']);
$editIcon = '' .
- $this->getIcon('gfx/edit2.gif', 'width="11" height="12"', $this->pObj->doc->backPath) .
+ $this->getIcon('gfx/edit2.gif', 'width="11" height="12"', $GLOBALS['BACK_PATH']) .
'';
- $onClick = \TYPO3\CMS\Backend\Utility\BackendUtility::viewOnClick($row['row']['uid'], $this->pObj->doc->backPath, '', '', '', '&L=' . $olRec['sys_language_uid']);
+ $onClick = \TYPO3\CMS\Backend\Utility\BackendUtility::viewOnClick($row['row']['uid'], $GLOBALS['BACK_PATH'], null, '', '', '&L=' . $olRec['sys_language_uid']);
$editIcon .= '' .
- $this->getIcon('gfx/zoom.gif', 'width="12" height="12"', $this->pObj->doc->backPath) .
+ $this->getIcon('gfx/zoom.gif', 'width="12" height="12"', $GLOBALS['BACK_PATH']) .
'';
} else {
$baseRow = array();
@@ -384,16 +384,16 @@ public function renderModule(\TYPO3\CMS\Backend\Tree\View\PageTreeView $tree)
} else {
$tCells[] = '
' .
'' .
- $this->getIcon('gfx/garbage.gif', 'width="11" height="12"', $this->pObj->doc->backPath, 'Delete') .
+ $this->getIcon('gfx/garbage.gif', 'width="11" height="12"', $GLOBALS['BACK_PATH'], 'Delete') .
'' .
'' .
- $this->getIcon('gfx/edit2.gif', 'width="12" height="12"', $this->pObj->doc->backPath, 'Edit') .
+ $this->getIcon('gfx/edit2.gif', 'width="12" height="12"', $GLOBALS['BACK_PATH'], 'Edit') .
'' .
'' .
- $this->getIcon('gfx/napshot.gif', 'width="12" height="12"', $this->pObj->doc->backPath, 'Use for search') .
+ $this->getIcon('gfx/napshot.gif', 'width="12" height="12"', $GLOBALS['BACK_PATH'], 'Use for search') .
'' .
'' .
- $this->getIcon('gfx/clip_copy.gif', 'width="12" height="12"', $this->pObj->doc->backPath, 'Copy entry') .
+ $this->getIcon('gfx/clip_copy.gif', 'width="12" height="12"', $GLOBALS['BACK_PATH'], 'Copy entry') .
'' .
' | ';
}
@@ -401,7 +401,7 @@ public function renderModule(\TYPO3\CMS\Backend\Tree\View\PageTreeView $tree)
($inf['expire'] ? htmlspecialchars(\TYPO3\CMS\Backend\Utility\BackendUtility::dateTimeAge($inf['expire'], -1)) : '') .
($inf['expire'] ?
'' .
- $this->getIcon('gfx/up.gif', 'width="14" height="14"', $this->pObj->doc->backPath, 'Set expire time to 30 days') .
+ $this->getIcon('gfx/up.gif', 'width="14" height="14"', $GLOBALS['BACK_PATH'], 'Set expire time to 30 days') .
'' : '') .
'';
@@ -447,15 +447,15 @@ public function renderModule(\TYPO3\CMS\Backend\Tree\View\PageTreeView $tree)
$tCells[] = 'Pagepath: | ';
$tCells[] = '' .
'' .
- $this->getIcon('gfx/garbage.gif', 'width="11" height="12"', $this->pObj->doc->backPath) .
+ $this->getIcon('gfx/garbage.gif', 'width="11" height="12"', $GLOBALS['BACK_PATH']) .
'' .
'' .
- $this->getIcon('gfx/edit2.gif', 'width="11" height="12"', $this->pObj->doc->backPath) .
+ $this->getIcon('gfx/edit2.gif', 'width="11" height="12"', $GLOBALS['BACK_PATH']) .
'' .
' | ';
$tCells[] = 'Expires:' .
'' .
- $this->getIcon('gfx/garbage.gif', 'width="11" height="12"', $this->pObj->doc->backPath, 'Flush all expired') .
+ $this->getIcon('gfx/garbage.gif', 'width="11" height="12"', $GLOBALS['BACK_PATH'], 'Flush all expired') .
'' .
' | ';
$tCells[] = 'Errors: | ';
@@ -624,7 +624,7 @@ protected function getLanguageSelector()
*/
protected function getSystemLanguages()
{
- $languages = (array)\TYPO3\CMS\Backend\Utility\BackendUtility::getRecordsByField('sys_language', 'pid', 0, '', '', 'title');
+ $languages = (array)\TYPO3\CMS\Backend\Utility\BackendUtility::getRecordsByField('sys_language', 'pid', '0', '', '', 'title');
$defaultLanguageLabel = $this->getDefaultLanguageName();
@@ -819,7 +819,7 @@ public function decodeView(\TYPO3\CMS\Backend\Tree\View\PageTreeView $tree)
$tCells[] = '' . $row['row']['uid'] . ' | ';
$tCells[] = '' .
'' .
- $this->getIcon('gfx/garbage.gif', 'width="11" height="12"', $this->pObj->doc->backPath, 'Delete entries for page') .
+ $this->getIcon('gfx/garbage.gif', 'width="11" height="12"', $GLOBALS['BACK_PATH'], 'Delete entries for page') .
'' .
' | ';
}
@@ -836,7 +836,7 @@ public function decodeView(\TYPO3\CMS\Backend\Tree\View\PageTreeView $tree)
// Delete:
$tCells[] = '' .
'' .
- $this->getIcon('gfx/garbage.gif', 'width="11" height="12"', $this->pObj->doc->backPath, 'Delete entry') .
+ $this->getIcon('gfx/garbage.gif', 'width="11" height="12"', $GLOBALS['BACK_PATH'], 'Delete entry') .
'' .
' | ';
@@ -877,12 +877,12 @@ public function decodeView(\TYPO3\CMS\Backend\Tree\View\PageTreeView $tree)
$output = '
Displayed entries: ' . $countDisplayed . ' ' .
'' .
- $this->getIcon('gfx/garbage.gif', 'width="11" height="12"', $this->pObj->doc->backPath, 'Delete displayed entries') .
+ $this->getIcon('gfx/garbage.gif', 'width="11" height="12"', $GLOBALS['BACK_PATH'], 'Delete displayed entries') .
'' .
'
Total entries in decode cache: ' . $count_allInTable['count'] . ' ' .
'' .
- $this->getIcon('gfx/garbage.gif', 'width="11" height="12"', $this->pObj->doc->backPath, 'Delete WHOLE decode cache!') .
+ $this->getIcon('gfx/garbage.gif', 'width="11" height="12"', $GLOBALS['BACK_PATH'], 'Delete WHOLE decode cache!') .
'' .
'
' . $output . '
@@ -959,7 +959,7 @@ public function encodeView(\TYPO3\CMS\Backend\Tree\View\PageTreeView $tree)
$tCells[] = '| ' . $row['row']['uid'] . ' | ';
$tCells[] = '' .
'' .
- $this->getIcon('gfx/garbage.gif', 'width="11" height="12"', $this->pObj->doc->backPath, 'Delete entries for page') .
+ $this->getIcon('gfx/garbage.gif', 'width="11" height="12"', $GLOBALS['BACK_PATH'], 'Delete entries for page') .
'' .
' | ';
}
@@ -976,7 +976,7 @@ public function encodeView(\TYPO3\CMS\Backend\Tree\View\PageTreeView $tree)
// Delete:
$tCells[] = '' .
'' .
- $this->getIcon('gfx/garbage.gif', 'width="11" height="12"', $this->pObj->doc->backPath, 'Delete entry!') .
+ $this->getIcon('gfx/garbage.gif', 'width="11" height="12"', $GLOBALS['BACK_PATH'], 'Delete entry!') .
'' .
' | ';
@@ -1034,12 +1034,12 @@ public function encodeView(\TYPO3\CMS\Backend\Tree\View\PageTreeView $tree)
Displayed entries: ' . $countDisplayed . ' ' .
'' .
- $this->getIcon('gfx/garbage.gif', 'width="11" height="12"', $this->pObj->doc->backPath, 'Delete displayed entries') .
+ $this->getIcon('gfx/garbage.gif', 'width="11" height="12"', $GLOBALS['BACK_PATH'], 'Delete displayed entries') .
'' .
'
Total entries in encode cache: ' . $count_allInTable['count'] . ' ' .
'' .
- $this->getIcon('gfx/garbage.gif', 'width="11" height="12"', $this->pObj->doc->backPath, 'Delete WHOLE encode cache!') .
+ $this->getIcon('gfx/garbage.gif', 'width="11" height="12"', $GLOBALS['BACK_PATH'], 'Delete WHOLE encode cache!') .
'' .
'
' . $output . '
@@ -1136,11 +1136,11 @@ public function uniqueAlias()
$tCells[] = '| ' .
// Edit link:
'' .
- $this->getIcon('gfx/edit2.gif', 'width="11" height="12"', $this->pObj->doc->backPath) .
+ $this->getIcon('gfx/edit2.gif', 'width="11" height="12"', $GLOBALS['BACK_PATH']) .
'' .
// Delete link:
'' .
- $this->getIcon('gfx/garbage.gif', 'width="11" height="12"', $this->pObj->doc->backPath) .
+ $this->getIcon('gfx/garbage.gif', 'width="11" height="12"', $GLOBALS['BACK_PATH']) .
'' .
' | ';
@@ -1170,15 +1170,15 @@ public function uniqueAlias()
$tCells[] = 'Lang: | ';
$tCells[] = 'Expire:' .
(!$search ? '' .
- $this->getIcon('gfx/garbage.gif', 'width="11" height="12"', $this->pObj->doc->backPath, 'Flush expired') .
+ $this->getIcon('gfx/garbage.gif', 'width="11" height="12"', $GLOBALS['BACK_PATH'], 'Flush expired') .
'' : '') .
' | ';
$tCells[] = '' .
(!$search ? '' .
- $this->getIcon('gfx/edit2.gif', 'width="11" height="12"', $this->pObj->doc->backPath, 'Edit all') .
+ $this->getIcon('gfx/edit2.gif', 'width="11" height="12"', $GLOBALS['BACK_PATH'], 'Edit all') .
'' .
'' .
- $this->getIcon('gfx/garbage.gif', 'width="11" height="12"', $this->pObj->doc->backPath, 'Delete all') .
+ $this->getIcon('gfx/garbage.gif', 'width="11" height="12"', $GLOBALS['BACK_PATH'], 'Delete all') .
'' : '') .
' | ';
$tCells[] = 'Error: | ';
@@ -1357,7 +1357,7 @@ public function logView()
$tCells[] = '' . \TYPO3\CMS\Backend\Utility\BackendUtility::dateTimeAge($rec['tstamp']) . ' | ';
$tCells[] = '' . ($host ? $host . '/' : '') . htmlspecialchars($rec['url']) . '' .
' ' .
- $this->getIcon('gfx/napshot.gif', 'width="12" height="12"', $this->pObj->doc->backPath, 'Set as redirect') .
+ $this->getIcon('gfx/napshot.gif', 'width="12" height="12"', $GLOBALS['BACK_PATH'], 'Set as redirect') .
'' .
' | ';
$tCells[] = '' . htmlspecialchars($rec['error']) . ' | ';
@@ -1393,7 +1393,7 @@ public function logView()
$output = '
' .
- $this->getIcon('gfx/garbage.gif', 'width="11" height="12"', $this->pObj->doc->backPath, 'Delete All') .
+ $this->getIcon('gfx/garbage.gif', 'width="11" height="12"', $GLOBALS['BACK_PATH'], 'Delete All') .
' Flush log
' . $output . '
@@ -1552,10 +1552,10 @@ protected function generateSingleRedirectContent(array $rec, $page)
{
$output = '| ' .
'' .
- $this->getIcon('gfx/edit2.gif', 'width="11" height="12"', $this->pObj->doc->backPath, 'Edit entry') .
+ $this->getIcon('gfx/edit2.gif', 'width="11" height="12"', $GLOBALS['BACK_PATH'], 'Edit entry') .
'' .
'' .
- $this->getIcon('gfx/garbage.gif', 'width="11" height="12"', $this->pObj->doc->backPath, 'Delete entry') .
+ $this->getIcon('gfx/garbage.gif', 'width="11" height="12"', $GLOBALS['BACK_PATH'], 'Delete entry') .
'' .
' | ';
$output .= sprintf('/%s | ', htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . $rec['url']), htmlspecialchars($rec['url']));
@@ -1706,7 +1706,7 @@ protected function deleteRedirectEntry()
protected function getNewButton()
{
$content = '';
return $content;
}
diff --git a/Classes/ViewHelpers/PageBrowserViewHelper.php b/Classes/ViewHelpers/PageBrowserViewHelper.php
index 88f506e..76bc61b 100644
--- a/Classes/ViewHelpers/PageBrowserViewHelper.php
+++ b/Classes/ViewHelpers/PageBrowserViewHelper.php
@@ -95,8 +95,10 @@ public static function getInlineStyles()
protected function generatePageBrowser()
{
$markup = '';
- for ($page = 1; $page <= min($this->totalPages, $this->currentPage, self::PAGES_AFTER_START + 1); $page++) {
- $markup .= $this->createCell($page);
+ $pageMax = min($this->totalPages, $this->currentPage, self::PAGES_AFTER_START + 1);
+ $page = $pageMax + 1;
+ for ($i = 1; $i <= $pageMax; $i++) {
+ $markup .= $this->createCell($i);
}
if ($page < $this->currentPage - self::PAGES_BEFORE) {
@@ -104,17 +106,18 @@ protected function generatePageBrowser()
$page = $this->currentPage - self::PAGES_BEFORE;
}
- for (; $page <= min($this->totalPages, $this->currentPage + self::PAGES_AFTER); $page++) {
- $markup .= $this->createCell($page);
+ $pageMax = min($this->totalPages, $this->currentPage + self::PAGES_AFTER);
+ for ($i = $page; $i <= $pageMax; $i++) {
+ $markup .= $this->createCell($i);
}
- if ($page < $this->totalPages - self::PAGES_BEFORE_END) {
+ if ($pageMax < $this->totalPages - self::PAGES_BEFORE_END) {
$markup .= $this->createEllipses();
$page = $this->totalPages - self::PAGES_BEFORE_END;
}
- for (; $page <= $this->totalPages; $page++) {
- $markup .= $this->createCell($page);
+ for ($i = $page; $i <= $this->totalPages; $i++) {
+ $markup .= $this->createCell($i);
}
return $markup;