Commit ce687bfb authored by sgalinsk's avatar sgalinsk

[TASK] Code cleanup


git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/pmkshadowbox/trunk@85414 735d13b6-9817-0410-8766-e36946ffe9aa
parent 7c78c3ab
<?php
/***************************************************************
* Copyright notice
*
* (c) 2010 Stefan Galinski (stefan.galinski@gmail.com)
* (c) 2010 Peter Klein (pmk@io.dk)
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
* A copy is found in the textfile GPL.txt and important notices to the license
* from the author is found in LICENSE.txt distributed with these scripts.
*
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
// unfortunately not automatically loaded
* Copyright notice
*
* (c) 2010 Stefan Galinski (stefan.galinski@gmail.com)
* (c) 2010 Peter Klein (pmk@io.dk)
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
* A copy is found in the textfile GPL.txt and important notices to the license
* from the author is found in LICENSE.txt distributed with these scripts.
*
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
// unfortunately not automatically loaded
require_once(t3lib_extMgm::extPath('pmkshadowbox') . 'resources/jsmin.php');
/**
......@@ -38,11 +39,11 @@ require_once(t3lib_extMgm::extPath('pmkshadowbox') . 'resources/jsmin.php');
class tx_pmkshadowbox_build {
/**
* Content Object for Typoscript Operations
*
*
* @param tslib_cObj
* @var tslib_cObj
*/
public $cObj = null;
public $cObj = NULL;
/**
* Cache Handler
......@@ -50,11 +51,11 @@ class tx_pmkshadowbox_build {
* @property tx_pmkshadowbox_cache
* @var tx_pmkshadowbox_cache
*/
protected $cacheHandler = null;
protected $cacheHandler = NULL;
/**
* Extension Configuration
*
*
* @var array
*/
protected $extensionConfiguration = array();
......@@ -72,7 +73,7 @@ class tx_pmkshadowbox_build {
* Note: If no cache handler parameter is given, the method will create a new one!
*
* @param tx_pmkshadowbox_cache $cacheHandler
* @return void
* @throws Exception
*/
public function __construct($cacheHandler = NULL) {
$this->cObj = t3lib_div::makeInstance('tslib_cObj');
......@@ -123,7 +124,7 @@ class tx_pmkshadowbox_build {
* Applies the stdWrap typoscript property on all entries of the given array that
* are suffixed with a dot. The primitive value without a dot is overriden in this case.
*
* @parameters array $configuration typoscript configuration
* @param array $configuration typoscript configuration
* @return array normalized typoscript configuration
*/
protected function applyStdWrapOn(array $configuration) {
......@@ -211,7 +212,7 @@ class tx_pmkshadowbox_build {
* string will be returned.
*
* @param mixed $useSizzle see method description
* @return string
* @return string
*/
protected function getCssSelectorSupport($useSizzle) {
$sizzle = '';
......@@ -227,7 +228,7 @@ class tx_pmkshadowbox_build {
* path based on the TYPO3 root directory. If the file doesn't exists a blank string is
* returned.
*
* @param string $skinModification TYPO3 path to a skin modification directory
* @param string $typo3SkinModificationDirectory TYPO3 path to a skin modification directory
* @return string
*/
protected function getSkinModificationDirectory($typo3SkinModificationDirectory) {
......@@ -237,7 +238,7 @@ class tx_pmkshadowbox_build {
} else {
$skinModificationDirectory = '';
}
return $skinModificationDirectory;
}
......@@ -364,7 +365,7 @@ class tx_pmkshadowbox_build {
$scriptContent .= $content;
}
// the scriptmerger check prevents the minification of the script twice!
// the scriptmerger check prevents the minification of the script twice!
if ($this->extensionConfiguration['enableJavascriptMinification'] === '1' &&
!t3lib_extMgm::isLoaded('scriptmerger')
) {
......@@ -384,11 +385,12 @@ class tx_pmkshadowbox_build {
* @return void
*/
protected function copySkinResources($skinModificationDirectory) {
// copy the default resources
// copy the default resources
$absoluteSourceDirectory = PATH_site . $this->sourceDirectory . 'resources/';
$directoryHandler = new DirectoryIterator($absoluteSourceDirectory);
$allowedFileExtensions = array('png', 'gif', 'jpg', 'css');
foreach ($directoryHandler as $fileInfo) {
/** @var $fileInfo DirectoryIterator */
if ($fileInfo->isFile()) {
$fileName = $fileInfo->getFilename();
$fileExtension = substr($fileName, strrpos($fileName, '.') + 1);
......@@ -400,7 +402,7 @@ class tx_pmkshadowbox_build {
}
}
// copy the skin modification resources if available
// copy the skin modification resources if available
$resourceFolder = PATH_site . $skinModificationDirectory . 'resources/';
if (is_dir($resourceFolder)) {
$directoryHandler = new DirectoryIterator($resourceFolder);
......@@ -462,7 +464,7 @@ class tx_pmkshadowbox_build {
$flashExpressInstallScriptName = '';
if ($configuration['flashExpressInstallScript'] !== '') {
$flashExpressInstallScriptName = '-' . $this->
getFileNameWithoutExtension($configuration['flashExpressInstallScript']);
getFileNameWithoutExtension($configuration['flashExpressInstallScript']);
}
$buildDirectory = $this->getFileNameWithoutExtension($configuration['adapter']) . '-' .
......@@ -521,7 +523,7 @@ class tx_pmkshadowbox_build {
* @return string relative path to the build directory
*/
public function build($content, array $configuration) {
// prepare the configuration (apply stdWrap, fallbacks and existence checks)
// prepare the configuration (apply stdWrap, fallbacks and existence checks)
$configuration = $this->applyStdWrapOn($configuration);
$configuration['adapter'] = $this->getAdapter($configuration['adapter']);
......@@ -537,17 +539,17 @@ class tx_pmkshadowbox_build {
$configuration['language'] = $this->
getLanguage($configuration['language'], $configuration['languageFallback']);
// get the name of the final build directory
// get the name of the final build directory
$buildDirectory = $this->getNameOfBuildDirectory($configuration);
$this->cacheHandler->setBuildDirectory($buildDirectory);
// an existing cache directory can be delivered immediately
// an existing cache directory can be delivered immediately
$buildDirectory = $this->cacheHandler->getPathToBuildDirectory();
if (file_exists($buildDirectory . 'shadowbox.js')) {
return $buildDirectory;
}
// otherwise create a new one
// otherwise create a new one
$this->createScriptFile(
$this->getOrderedScripts($configuration)
);
......@@ -565,7 +567,10 @@ class tx_pmkshadowbox_build {
}
}
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/pmkshadowbox/classes/class.tx_pmkshadowbox_build.php']) {
if (defined(
'TYPO3_MODE'
) && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/pmkshadowbox/classes/class.tx_pmkshadowbox_build.php']
) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/pmkshadowbox/classes/class.tx_pmkshadowbox_build.php']);
}
......
<?php
/***************************************************************
* Copyright notice
*
* (c) 2010 Stefan Galinski (stefan.galinski@gmail.com)
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
* A copy is found in the textfile GPL.txt and important notices to the license
* from the author is found in LICENSE.txt distributed with these scripts.
*
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
* Copyright notice
*
* (c) 2010 Stefan Galinski (stefan.galinski@gmail.com)
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
* A copy is found in the textfile GPL.txt and important notices to the license
* from the author is found in LICENSE.txt distributed with these scripts.
*
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* This class handles all cache directory operations.
......@@ -33,25 +33,25 @@
class tx_pmkshadowbox_cache {
/**
* Path to the Cache Directory
*
*
* @var string
*/
protected $cacheDirectory = '';
/**
* Build Directory Name
*
*
* @var string
*/
protected $buildDirectory = '';
/**
* Constructor
*
*
* Note: The cache directory is created if it does not already exists!
*
* @param string $cacheDirectory
* @return void
*
* @param string $cacheDirectory
* @throws Exception
*/
public function __construct($cacheDirectory = 'typo3temp/pmkshadowbox/') {
$this->cacheDirectory = $cacheDirectory;
......@@ -99,11 +99,13 @@ class tx_pmkshadowbox_cache {
public function clear() {
$cacheDirectoryIterator = new DirectoryIterator(PATH_site . $this->cacheDirectory);
foreach ($cacheDirectoryIterator as $fileInfo) {
/** @var $fileInfo DirectoryIterator */
if ($fileInfo->isDot() || !$fileInfo->isDir()) {
continue;
}
foreach (new DirectoryIterator($fileInfo->getPathname()) as $cacheFileInfo) {
/** @var $cacheFileInfo DirectoryIterator */
if ($cacheFileInfo->isDot()) {
continue;
}
......@@ -192,7 +194,10 @@ class tx_pmkshadowbox_cache {
}
}
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/pmkshadowbox/classes/class.tx_pmkshadowbox_cache.php']) {
if (defined(
'TYPO3_MODE'
) && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/pmkshadowbox/classes/class.tx_pmkshadowbox_cache.php']
) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/pmkshadowbox/classes/class.tx_pmkshadowbox_cache.php']);
}
......
<?php
/***************************************************************
* Copyright notice
*
* (c) 2010 Stefan Galinski <stefan.galinski@gmail.com>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
* A copy is found in the textfile GPL.txt and important notices to the license
* from the author is found in LICENSE.txt distributed with these scripts.
*
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
* Copyright notice
*
* (c) 2010 Stefan Galinski <stefan.galinski@gmail.com>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
* A copy is found in the textfile GPL.txt and important notices to the license
* from the author is found in LICENSE.txt distributed with these scripts.
*
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
require_once (PATH_typo3 . 'interfaces/interface.backend_cacheActionsHook.php');
require_once(PATH_typo3 . 'interfaces/interface.backend_cacheActionsHook.php');
/**
* Extending class to render the menu for the cache clearing actions,
* and adding Clear Shadowbox Builds option
*
* @author Stefan Galinski <stefan.galinski@gmail.com>
* @package TYPO3
* @author Stefan Galinski <stefan.galinski@gmail.com>
* @package TYPO3
* @subpackage pmkshadowbox
*/
class tx_pmkshadowbox_clearcachemenu implements backend_cacheActionsHook {
......@@ -43,23 +43,30 @@ class tx_pmkshadowbox_clearcachemenu implements backend_cacheActionsHook {
* @param array array of access configuration identifiers (typically used by userTS with options.clearCache.identifier)
* @return void
*/
public function manipulateCacheActions(&$cacheActions, &$optionValues) {
if ($GLOBALS['BE_USER']->isAdmin()) {
$title = $GLOBALS['LANG']->sL('LLL:EXT:pmkshadowbox/locallang.xml:clearCacheTitle');
$cacheActions[] = array (
'id' => 'clearShadowboxBuilds',
public function manipulateCacheActions(&$cacheActions, &$optionValues) {
/** @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');
$cacheActions[] = array(
'id' => 'clearShadowboxBuilds',
'title' => $title,
'href' => $GLOBALS['BACK_PATH'] . 'ajax.php?ajaxID=pmkshadowbox::clearShadowboxBuilds',
'icon' => '<img src="' . t3lib_extMgm::extRelPath('pmkshadowbox') .
'href' => $GLOBALS['BACK_PATH'] . 'ajax.php?ajaxID=pmkshadowbox::clearShadowboxBuilds',
'icon' => '<img src="' . t3lib_extMgm::extRelPath('pmkshadowbox') .
'ext_icon.gif" width="16" height="16" title="' . htmlspecialchars($title) . '" alt="" />'
);
$optionValues[] = 'clearShadowboxBuilds';
}
}
}
}
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/pmkshadowbox/classes/class.tx_pmkshadowbox_clearcachemenu.php']) {
if (defined(
'TYPO3_MODE'
) && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/pmkshadowbox/classes/class.tx_pmkshadowbox_clearcachemenu.php']
) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/pmkshadowbox/classes/class.tx_pmkshadowbox_clearcachemenu.php']);
}
?>
<?php
/***************************************************************
* Copyright notice
*
* (c) 2011 Peter Klein <pmk@io.dk>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
* A copy is found in the textfile GPL.txt and important notices to the license
* from the author is found in LICENSE.txt distributed with these scripts.
*
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/***************************************************************
* Copyright notice
*
* (c) 2011 Peter Klein <pmk@io.dk>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
* A copy is found in the textfile GPL.txt and important notices to the license
* from the author is found in LICENSE.txt distributed with these scripts.
*
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Class tx_pmkshadowbox_printsave
*/
class tx_pmkshadowbox_printsave {
/**
* Main function
*
* @return void
*/
public function main() {
$image = $this->cleanGPValue(t3lib_div::_GET('image'));
// Check if the requested file has an valid image file extension
$allowedExtensions = t3lib_div::trimExplode(',', (strlen($TYPO3_CONF_VARS['GFX']['imagefile_ext']) > 0 ? $TYPO3_CONF_VARS['GFX']['imagefile_ext'] : 'gif,jpg,jpeg,tif,bmp,pcx,tga,png,pdf,ai'), 1);
$allowedExtensions = t3lib_div::trimExplode(
',', (strlen(
$GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
) > 0 ? $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] : 'gif,jpg,jpeg,tif,bmp,pcx,tga,png,pdf,ai'), 1
);
$imageInfo = pathinfo($image);
if (!in_array(strtolower($imageInfo['extension']), $allowedExtensions)) die('You are trying to download/print a file, which you don\'t have access to.');
if (!in_array(
strtolower($imageInfo['extension']), $allowedExtensions
)
) {
die('You are trying to download/print a file, which you don\'t have access to.');
}
if (!is_file(t3lib_div::getFileAbsFileName(str_replace(t3lib_div::getIndpEnv('TYPO3_SITE_URL'),'',$image)))) die('File not found!');
if (!is_file(
t3lib_div::getFileAbsFileName(str_replace(t3lib_div::getIndpEnv('TYPO3_SITE_URL'), '', $image))
)
) {
die('File not found!');
}
switch ($this->cleanGPValue(t3lib_div::_GET('mode'))) {
case 'print':
$this->print_image($image);
break;
break;
case 'save':
$this->force_download($image);
break;
break;
default:
break;
break;
}
}
/**
* @param string $filename
* @return void
*/
function print_image($filename) {
echo '<html>
<head>
......@@ -66,30 +92,56 @@ class tx_pmkshadowbox_printsave {
</script>
</head>
<body style="margin:0;padding:0;">
<img src="'.$filename.'" style="border:none;cursor:pointer;" onclick="self.close()">
<img src="' . $filename . '" style="border:none;cursor:pointer;" onclick="self.close()">
</body>
</html>';
}
public function force_download($filename, $mimetype='') {
$filename = str_replace(t3lib_div::getIndpEnv('TYPO3_SITE_URL'),PATH_site,$filename);
if (!file_exists($filename)) return false;
// Mimetype not set?
if (empty($mimetype)) {
$file_extension = strtolower(substr(strrchr($filename,"."),1));
switch( $file_extension ) {
case "pdf": $mimetype="application/pdf"; break;
case "exe": $mimetype="application/octet-stream"; break;
case "zip": $mimetype="application/zip"; break;
case "doc": $mimetype="application/msword"; break;
case "xls": $mimetype="application/vnd.ms-excel"; break;
case "ppt": $mimetype="application/vnd.ms-powerpoint"; break;
case "gif": $mimetype="image/gif"; break;
case "png": $mimetype="image/png"; break;
/**
* @param string $filename
* @param string $mimetype
* @return bool
*/
public function force_download($filename, $mimetype = '') {
$filename = str_replace(t3lib_div::getIndpEnv('TYPO3_SITE_URL'), PATH_site, $filename);
if (!file_exists($filename)) {
return FALSE;
}
// Mimetype not set?
if (empty($mimetype)) {
$file_extension = strtolower(substr(strrchr($filename, "."), 1));
switch ($file_extension) {
case "pdf":
$mimetype = "application/pdf";
break;
case "exe":
$mimetype = "application/octet-stream";
break;
case "zip":
$mimetype = "application/zip";
break;
case "doc":
$mimetype = "application/msword";
break;
case "xls":
$mimetype = "application/vnd.ms-excel";
break;
case "ppt":
$mimetype = "application/vnd.ms-powerpoint";
break;
case "gif":
$mimetype = "image/gif";
break;
case "png":
$mimetype = "image/png";
break;
case "jpeg":
case "jpg": $mimetype="image/jpg"; break;
default: $mimetype="application/force-download";
case "jpg":
$mimetype = "image/jpg";
break;
default:
$mimetype = "application/force-download";
}
}
......@@ -100,28 +152,37 @@ class tx_pmkshadowbox_printsave {
header('Pragma: public'); // required
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Cache-Control: private',false); // required for certain browsers
header('Cache-Control: private', FALSE); // required for certain browsers
header('Content-Transfer-Encoding: binary');
header('Content-Type: ' . $mimetype);
header('Content-Length: ' . filesize($filename));
header('Content-Disposition: attachment; filename="' . basename($filename) . '";' );
header('Content-Disposition: attachment; filename="' . basename($filename) . '";');
// Send data
readfile($filename);
exit;
}
/**
* @return bool
*/
private function ob_clean_all() {
$ob_active = ob_get_length () !== false;
while($ob_active) {
$ob_active = ob_get_length() !== FALSE;
while ($ob_active) {
ob_end_clean();
$ob_active = ob_get_length () !== false;
$ob_active = ob_get_length() !== FALSE;
}
return true;
return TRUE;
}
// Clean GET/POST values to prevent XSS/PoC attacks
private function cleanGPValue($value,$htmlspecialchars = 1) {
/**
* Clean GET/POST values to prevent XSS/PoC attacks
*
* @param string $value
* @param int $htmlspecialchars
* @return mixed|string
*/
private function cleanGPValue($value, $htmlspecialchars = 1) {
// Remove HTML tags in value
$value = strip_tags($value);
......@@ -137,12 +198,14 @@ class tx_pmkshadowbox_printsave {
}
}
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/pmkshadowbox/classes/class.tx_pmkshadowbox_printsave.php']) {
if (defined(
'TYPO3_MODE'
) && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/pmkshadowbox/classes/class.tx_pmkshadowbox_printsave.php']
) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/pmkshadowbox/classes/class.tx_pmkshadowbox_printsave.php']);
}
// Make instance:
// Make instance:
$output = t3lib_div::makeInstance('tx_pmkshadowbox_printsave');
$output->main();
......
This diff is collapsed.
......@@ -4,24 +4,25 @@ if (!defined('TYPO3_MODE')) {
die('Access denied.');
}
// post processing hook to clear any existing cache files if the clear cache button is used
// 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';
// Hook for adding "IMAGE_NUM_CURRENT" register value in tt_news
// Hook for adding "IMAGE_NUM_CURRENT" register value in tt_news
if (t3lib_extMgm::isLoaded('tt_news')) {
$TYPO3_CONF_VARS['EXTCONF']['tt_news']['extraItemMarkerHook'][] =
'EXT:pmkshadowbox/classes/class.tx_ttnews_imageMarkerHook.php:&tx_ttnews_imageMarker';
}
// Register Clear Cache Menu hook
// 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';
// Register Ajax call
// Register Ajax call
$TYPO3_CONF_VARS['BE']['AJAX']['pmkshadowbox::clearShadowboxBuilds'] =
'EXT:pmkshadowbox/classes/class.tx_pmkshadowbox_cache.php:&tx_pmkshadowbox_cache->clear';
// Register eID script for saving and printing SB content.
// Register eID script for saving and printing SB content.
$TYPO3_CONF_VARS['FE']['eID_include']['pmkshadowbox'] = 'EXT:pmkshadowbox/classes/class.tx_pmkshadowbox_printsave.php';
?>
?>
\ No newline at end of file
<?php
if (!defined ('TYPO3_MODE')) {
if (!defined('TYPO3_MODE')) {
die ('Access denied.');
}
t3lib_extMgm::addStaticFile($_EXTKEY, 'static/PMK_Shadowbox/', 'Shadowbox - Base');
t3lib_extMgm::addStaticFile($_EXTKEY, 'static/PMK_Shadowbox_ClickEnlarge/', 'Shadowbox - tt_content (Click Enlarge)');
t3lib_extMgm::addStaticFile($_EXTKEY, 'static/PMK_Shadowbox_tt_news/', 'Shadowbox - tt_news');
t3lib_extMgm::addStaticFile($_EXTKEY, 'static/PMK_Shadowbox_tt_products/', 'Shadowbox - tt_products');
t3lib_extMgm::addStaticFile('pmkshadowbox', 'static/PMK_Shadowbox/', 'Shadowbox - Base');
t3lib_extMgm::addStaticFile(
'pmkshadowbox', 'static/PMK_Shadowbox_ClickEnlarge/', 'Shadowbox - tt_content (Click Enlarge)'
);
t3lib_extMgm::addStaticFile('pmkshadowbox', 'static/PMK_Shadowbox_tt_news/', 'Shadowbox - tt_news');
t3lib_extMgm::addStaticFile('pmkshadowbox', 'static/PMK_Shadowbox_tt_products/', 'Shadowbox - tt_products');
?>
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