Bug #40499 » concatenate_css_60b1.patch

Patch for 6.0.0beta1 - Thomas Löffler, 2012-09-01 11:10

View differences:

typo3/sysext/core/Classes/Resource/ResourceCompressor.php (revision )
185 185
			// we remove BACK_PATH from $filename, so make it relative to root path
186 186
			$filenameFromMainDir = $this->getFilenameFromMainDir($fileOptions['file']);
187 187
			// if $options['baseDirectories'] set, we only include files below these directories
188
			if ((!isset($options['baseDirectories']) || $this->checkBaseDirectory($filenameFromMainDir, array_merge($options['baseDirectories'], array($this->targetDirectory)))) && $fileOptions['media'] === 'all') {
189
				$filesToInclude[] = $filenameFromMainDir;
188
			if ((!isset($options['baseDirectories']) || $this->checkBaseDirectory($filenameFromMainDir, array_merge($options['baseDirectories'], array($this->targetDirectory))))) {
189
				$filesToInclude[$fileOptions['media']][] = $filenameFromMainDir;
190 190
				// remove the file from the incoming file array
191 191
				unset($cssFiles[$key]);
192 192
			}
193 193
		}
194 194
		if (count($filesToInclude)) {
195
			$targetFile = $this->createMergedCssFile($filesToInclude);
195
			foreach ($filesToInclude as $media => $cssFilesToInclude) {
196
				$targetFile = $this->createMergedCssFile($cssFilesToInclude);
196
			$targetFileRelative = $this->relativePath . $targetFile;
197
			$concatenatedOptions = array(
198
				'file' => $targetFileRelative,
199
				'rel' => 'stylesheet',
197
				$targetFileRelative = $this->relativePath . $targetFile;
198
				$concatenatedOptions = array(
199
					'file' => $targetFileRelative,
200
					'rel' => 'stylesheet',
200
				'media' => 'all',
201
					'media' => $media,
201
				'compress' => TRUE
202
			);
203
			// place the merged stylesheet on top of the stylesheets
204
			$cssFiles = array_merge(array($targetFileRelative => $concatenatedOptions), $cssFiles);
202
					'compress' => TRUE
203
				);
204
					// place the merged stylesheet on top of the stylesheets
205
				$cssFiles = array_merge(array($targetFileRelative => $concatenatedOptions), $cssFiles);
206
			}
205 207
		}
206 208
		return $cssFiles;
207 209
	}
(3-3/3)