Commit 27a202d7 authored by jkummer's avatar jkummer

TYPO3 CMS 8.7 compatibility

parent 3571b3f7
......@@ -501,7 +501,11 @@ class tx_pmkshadowbox_build {
)
);
return \TYPO3\CMS\Core\Utility\GeneralUtility::removeArrayEntryByValue($scripts, '');
if (\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_branch) >= \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger('8.0')) {
return \TYPO3\CMS\Core\Utility\ArrayUtility::removeArrayEntryByValue($scripts, '');
} else {
return \TYPO3\CMS\Core\Utility\GeneralUtility::removeArrayEntryByValue($scripts, '');
}
}
/**
......
......@@ -46,15 +46,23 @@ class tx_pmkshadowbox_clearcachemenu implements \TYPO3\CMS\Backend\Toolbar\Clear
/** @var \TYPO3\CMS\Core\Authentication\BackendUserAuthentication $backendUser */
$backendUser = $GLOBALS['BE_USER'];
if ($backendUser->isAdmin()) {
/** @var \TYPO3\CMS\Lang\LanguageService $languageObject */
$languageObject = $GLOBALS['LANG'];
$title = $languageObject->sL('LLL:EXT:pmkshadowbox/locallang.xml:clearCacheTitle');
if (\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_branch) >= \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger('8.0')) {
$title = 'LLL:EXT:pmkshadowbox/locallang.xml:clearCacheTitle';
$href = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('tce_db', ['ajaxID' => 'pmkshadowbox::clearShadowboxBuilds']);
$icon = \TYPO3\CMS\Core\Utility\PathUtility::getRelativePathTo(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('pmkshadowbox')) . 'ext_icon.gif';
} else {
/** @var \TYPO3\CMS\Lang\LanguageService $languageObject */
$languageObject = $GLOBALS['LANG'];
$title = $languageObject->sL('LLL:EXT:pmkshadowbox/locallang.xml:clearCacheTitle');
$href = $GLOBALS['BACK_PATH'] . 'ajax.php?ajaxID=pmkshadowbox::clearShadowboxBuilds';
$icon = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('pmkshadowbox') . 'ext_icon.gif';
}
$cacheActions[] = array(
'id' => 'clearShadowboxBuilds',
'title' => $title,
'href' => $GLOBALS['BACK_PATH'] . 'ajax.php?ajaxID=pmkshadowbox::clearShadowboxBuilds',
'icon' => '<img src="' . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('pmkshadowbox') .
'ext_icon.gif" width="16" height="16" title="' . htmlspecialchars($title) . '" alt="" />'
'href' => $href,
'icon' => '<img src="' . $icon . '" width="16" height="16" title="Clear shadowbox builds" alt="" />',
'iconIdentifier' => 'actions-system-cache-clear-impact-medium'
);
$optionValues[] = 'clearShadowboxBuilds';
......
......@@ -2,6 +2,7 @@
$extensionPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('pmkshadowbox');
return array(
'tx_pmkshadowbox_clearcachemenu' => $extensionPath . 'classes/class.tx_pmkshadowbox_clearcachemenu.php',
'tx_pmkshadowbox_cache' => $extensionPath . 'classes/class.tx_pmkshadowbox_cache.php',
'tx_pmkshadowbox_build' => $extensionPath . 'classes/class.tx_pmkshadowbox_build.php',
'tx_ttnews_imageMarker' => $extensionPath . 'classes/class.tx_ttnews_imageMarkerHook.php',
......
......@@ -15,7 +15,7 @@ $EM_CONF[$_EXTKEY] = array(
'description' => 'Shadowbox is an online media viewer application (Lightbox) that supports all of the web\'s most popular media publishing formats. Shadowbox is written entirely in JavaScript and CSS and is highly customizable. Compatible with ALL JS Frameworks.',
'category' => 'fe',
'shy' => 0,
'version' => '3.5.0',
'version' => '3.6.0',
'dependencies' => '',
'conflicts' => 'kj_imagelightbox2,perfectlightbox,wsclicklightbox,ju_multibox,pmkslimbox',
'priority' => '',
......@@ -36,8 +36,8 @@ $EM_CONF[$_EXTKEY] = array(
array (
'depends' =>
array (
'typo3' => '6.2.99-7.6.99',
'php' => '5.3.0-5.5.99',
'typo3' => '6.2.0-8.7.99',
'php' => '5.3.0-7.2.99',
),
'conflicts' =>
array (
......@@ -52,6 +52,16 @@ $EM_CONF[$_EXTKEY] = array(
array (
),
),
'autoload' => array(
'classmap' => array(
'classes',
),
),
'autoload-dev' => array(
'classmap' => array(
'tests',
),
),
);
?>
\ No newline at end of file
......@@ -6,23 +6,24 @@ if (!defined('TYPO3_MODE')) {
// post processing hook to clear any existing cache files if the clear cache button is used
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc'][] =
'EXT:pmkshadowbox/classes/class.tx_pmkshadowbox_cache.php:&tx_pmkshadowbox_cache->clearCachePostProc';
'EXT:pmkshadowbox/classes/class.tx_pmkshadowbox_cache.php:tx_pmkshadowbox_cache->clearCachePostProc';
// Hook for adding "IMAGE_NUM_CURRENT" register value in tt_news
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('tt_news')) {
$TYPO3_CONF_VARS['EXTCONF']['tt_news']['extraItemMarkerHook'][] =
'EXT:pmkshadowbox/classes/class.tx_ttnews_imageMarkerHook.php:&tx_ttnews_imageMarker';
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['tt_news']['extraItemMarkerHook'][] =
'EXT:pmkshadowbox/classes/class.tx_ttnews_imageMarkerHook.php:tx_ttnews_imageMarker';
}
// Register Clear Cache Menu hook
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['additionalBackendItems']['cacheActions']['clearShadowboxBuilds'] =
'EXT:pmkshadowbox/classes/class.tx_pmkshadowbox_clearcachemenu.php:&tx_pmkshadowbox_clearcachemenu';
'EXT:pmkshadowbox/classes/class.tx_pmkshadowbox_clearcachemenu.php:tx_pmkshadowbox_clearcachemenu';
// Register Ajax call
$TYPO3_CONF_VARS['BE']['AJAX']['pmkshadowbox::clearShadowboxBuilds'] =
'EXT:pmkshadowbox/classes/class.tx_pmkshadowbox_cache.php:&tx_pmkshadowbox_cache->clear';
$GLOBALS['TYPO3_CONF_VARS']['BE']['AJAX']['pmkshadowbox::clearShadowboxBuilds'] = [
'callbackMethod' => 'EXT:pmkshadowbox/classes/class.tx_pmkshadowbox_cache.php:tx_pmkshadowbox_cache->clear'
];
// Register eID script for saving and printing SB content.
$TYPO3_CONF_VARS['FE']['eID_include']['pmkshadowbox'] = 'EXT:pmkshadowbox/classes/class.tx_pmkshadowbox_printsave.php';
$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['pmkshadowbox'] = 'EXT:pmkshadowbox/classes/class.tx_pmkshadowbox_printsave.php';
?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment