[TASK] Remove SpriteGenerator IE6 Fallback
authorSteffen Ritter <info@rs-websystems.de>
Tue, 1 Mar 2011 12:21:24 +0000 (13:21 +0100)
committerAndreas Wolf <andreas.wolf@ikt-werk.de>
Tue, 8 Mar 2011 16:35:06 +0000 (17:35 +0100)
The spriteGenerator has features to generate GIF variants (and according CSS) as a fallback for IE6.
Remove it as it is not used anymore (due to #M17805).

Resolves #M17808
Depends #M17805

Change-Id: I6fae8845d4c2ecae3ad56aa8c143dd2e1d76a8b3
Reviewed-on: http://review.typo3.org/952
Reviewed-by: Stefan Galinski <stefan.galinski@gmail.com>
Reviewed-by: Philipp Gampe <forge.typo3.org@philippgampe.info>
Reviewed-by: Andreas Wolf <andreas.wolf@ikt-werk.de>
Tested-by: Andreas Wolf <andreas.wolf@ikt-werk.de>
t3lib/spritemanager/class.t3lib_spritemanager_spritebuildinghandler.php
t3lib/spritemanager/class.t3lib_spritemanager_spritegenerator.php

index 970e5b9..c180e48 100644 (file)
@@ -64,22 +64,6 @@ class t3lib_spritemanager_SpriteBuildingHandler extends t3lib_spritemanager_Abst
 
                $generatorResponse = $this->generatorInstance->generateSpriteFromArray($iconsToProcess);
 
-               if (!is_dir(PATH_site . t3lib_SpriteManager::$tempPath . 'ie6')) {
-                       t3lib_div::mkdir(PATH_site . t3lib_SpriteManager::$tempPath . 'ie6');
-               }
-
-               t3lib_div::upload_copy_move(
-                       $generatorResponse['spriteGifImage'],
-                       t3lib_div::dirname($generatorResponse['spriteGifImage']) . '/ie6/' . basename($generatorResponse['spriteGifImage'])
-               );
-               unlink($generatorResponse['spriteGifImage']);
-
-               t3lib_div::upload_copy_move(
-                       $generatorResponse['cssGif'],
-                       t3lib_div::dirname($generatorResponse['cssGif']) . '/ie6/' . basename($generatorResponse['cssGif'])
-               );
-               unlink($generatorResponse['cssGif']);
-
                $this->iconNames = array_merge($this->iconNames, $generatorResponse['iconNames']);
 
                parent::generate();
index e309797..c398151 100644 (file)
@@ -115,12 +115,6 @@ class t3lib_spritemanager_SpriteGenerator {
         */
        protected $ommitSpriteNameInIconName = FALSE;
 
-       /**
-        * @var boolean
-        * @deprecated IE6 support will be dropped within 4.6 - then gifcopies are superflous
-        */
-       protected $generateGIFCopy = TRUE;
-
        /**
         * namespace of css classes
         *
@@ -248,18 +242,6 @@ class t3lib_spritemanager_SpriteGenerator {
                return $this;
        }
 
-       /**
-        * Setter to enable/disable generating a GIF-Copy of the sprite
-        *
-        * @param boolean $value
-        * @deprecated IE6 support will be dropped within 4.6 - then gifcopies are superflous
-        * @return t3lib_spritemanager_SpriteGenerator  an instance of $this, to enable chaining.
-        */
-       public function setGenerateGifCopy($value) {
-               $this->generateGIFCopy = is_bool($value) ? $value : TRUE;
-               return $this;
-       }
-
        /**
         * Setter for timestamp inclusion: imageFiles will be included with ?timestamp
         *
@@ -272,7 +254,7 @@ class t3lib_spritemanager_SpriteGenerator {
        }
 
        /**
-        * Teads all png,gif,jpg files from the passed folder name (including 1 subfolder level)
+        * Reads all png,gif,jpg files from the passed folder name (including 1 subfolder level)
         * extracts size information and stores data in internal array,
         * afterwards triggers sprite generation.
         *
@@ -317,9 +299,7 @@ class t3lib_spritemanager_SpriteGenerator {
 
                return array(
                        'spriteImage' => PATH_site . $this->spriteFolder . $this->spriteName . '.png',
-                       'spriteGifImage' => PATH_site . $this->spriteFolder . $this->spriteName . '.gif',
                        'cssFile' => PATH_site . $this->cssFolder . $this->spriteName . '.css',
-                       'cssGif' => PATH_site . $this->cssFolder . $this->spriteName . '-ie6.css',
                        'iconNames' => $iconNames
                );
        }
@@ -331,7 +311,6 @@ class t3lib_spritemanager_SpriteGenerator {
         */
        protected function generateCSS() {
                $cssData = '';
-               $cssIe6 = '';
 
                if ($this->includeTimestampInCSS) {
                        $timestamp = '?' . time();
@@ -355,13 +334,6 @@ class t3lib_spritemanager_SpriteGenerator {
                        $cssData .= t3lib_parsehtml::substituteMarkerArray($this->templateSprite, $markerArray);
                }
 
-               if ($this->generateGIFCopy) {
-                       $markerArray['###SPRITEURL###'] = str_replace('.png', '.gif', $markerArray['###SPRITEURL###']);
-                       foreach ($this->spriteBases as $base) {
-                               $cssIe6 .= t3lib_parsehtml::substituteMarkerArray($this->templateSprite, $markerArray);
-                       }
-               }
-
                foreach ($this->iconsData as $key => $data) {
                        $temp = $data['iconNameParts'];
                        array_shift($temp);
@@ -384,9 +356,6 @@ class t3lib_spritemanager_SpriteGenerator {
                }
 
                t3lib_div::writeFile(PATH_site . $this->cssFolder . $this->spriteName . '.css', $cssData);
-               if ($this->generateGIFCopy) {
-                       t3lib_div::writeFile(PATH_site . $this->cssFolder . $this->spriteName . '-ie6.css', $cssIe6);
-               }
        }
 
        /**
@@ -423,12 +392,10 @@ class t3lib_spritemanager_SpriteGenerator {
         * @return void
         */
        protected function generateGraphic() {
-               $iconParameters = array();
                $tempSprite = t3lib_div::tempnam($this->spriteName);
 
                $filePath = array(
                        'mainFile' => PATH_site . $this->spriteFolder . $this->spriteName . '.png',
-                       'gifFile' => NULL
                );
                        // create black true color image with given size
                $newSprite = imagecreatetruecolor($this->spriteWidth, $this->spriteHeight);
@@ -444,28 +411,8 @@ class t3lib_spritemanager_SpriteGenerator {
                }
                imagepng($newSprite, $tempSprite . '.png');
 
-               if ($this->generateGIFCopy) {
-                       $filePath['gifFile'] = PATH_site . $this->spriteFolder . $this->spriteName . '.gif';
-                       $gifSprite = imagecreatetruecolor($this->spriteWidth, $this->spriteHeight);
-                               // make it transparent
-                       imagefill($gifSprite, 0, 0, imagecolorallocate($gifSprite, 127, 127, 127));
-                       foreach ($this->iconsData as $icon) {
-                               $function = 'imagecreatefrom' . strtolower($icon['fileExtension']);
-                               if (function_exists($function)) {
-                                       $currentIcon = $function($icon['fileName']);
-                                       imagecopy($gifSprite, $currentIcon, $icon['left'], $icon['top'], 0, 0, $icon['width'], $icon['height']);
-                               }
-                       }
-                       imagecolortransparent($gifSprite, imagecolorallocate($gifSprite, 127, 127, 127));
-                       imagegif($gifSprite, $tempSprite . '.gif');
-               }
-
                t3lib_div::upload_copy_move($tempSprite . '.png', $filePath['mainFile']);
                t3lib_div::unlink_tempfile($tempSprite . '.png');
-               if ($this->generateGIFCopy) {
-                       t3lib_div::upload_copy_move($tempSprite . '.gif', $filePath['gifFile']);
-                       t3lib_div::unlink_tempfile($tempSprite . '.gif');
-               }
        }
 
        /**