Commit db83aee7 authored by Tino Goratsch's avatar Tino Goratsch

- renamed MinifierInterface::getLink() to MinifierInterface::getURI()

parent f06a14b7
......@@ -107,24 +107,19 @@ abstract class AbstractMinifier implements MinifierInterface
abstract protected function processLibraries($layout);
/**
* Erstellt den Link zum Minifier mitsamt allen zu ladenden JavaScript Bibliotheken
*
* @param string $group
* @param string $layout
*
* @return string
* @inheritdoc
*/
protected function buildMinifyLink($group, $layout = 'layout')
public function getURI($layout = 'layout')
{
$debug = (defined('DEBUG') && DEBUG === true);
$filenameHash = $this->generateFilenameHash($group, $layout);
$filenameHash = $this->generateFilenameHash($this->assetGroup, $layout);
$cacheId = 'assets-last-generated-' . $filenameHash;
if (false === ($lastGenerated = $this->systemCache->fetch($cacheId))) {
$lastGenerated = time(); // Assets are not cached -> set the current time as the new timestamp
}
$path = $this->buildAssetPath($debug, $group, $filenameHash, $lastGenerated);
$path = $this->buildAssetPath($debug, $this->assetGroup, $filenameHash, $lastGenerated);
// If the requested minified StyleSheet and/or the JavaScript file doesn't exist, generate it
if (is_file(UPLOADS_DIR . $path) === false || $debug === true) {
......@@ -160,14 +155,6 @@ abstract class AbstractMinifier implements MinifierInterface
file_put_contents($path, $content, LOCK_EX);
}
/**
* @inheritdoc
*/
public function getLink($layout = 'layout')
{
return $this->buildMinifyLink($this->assetGroup, $layout);
}
/**
* @param bool $debug
* @param string $group
......
......@@ -8,9 +8,11 @@ namespace ACP3\Core\Assets;
interface MinifierInterface
{
/**
* Returns the URI of the minified assets
*
* @param string $layout
*
* @return string
*/
function getLink($layout = 'layout');
function getURI($layout = 'layout');
}
\ No newline at end of file
......@@ -54,7 +54,7 @@ class MoveToBottom extends AbstractFilter
$minifyJs = '';
if (!$this->request->getIsAjax()) {
$minifyJs = '<script type="text/javascript" src="' . $this->minifier->getLink() . '"></script>' . "\n";
$minifyJs = '<script type="text/javascript" src="' . $this->minifier->getURI() . '"></script>' . "\n";
}
return str_replace('<!-- JAVASCRIPTS -->', $minifyJs . implode("\n", array_unique($matches[1])) . "\n", $tpl_output);
......
......@@ -40,7 +40,7 @@ class MoveToHead extends AbstractFilter
// Remove placeholder comments
$tpl_output = preg_replace("!@@@SMARTY:STYLESHEETS:BEGIN@@@(.*?)@@@SMARTY:STYLESHEETS:END@@@!is", '', $tpl_output);
$minifyCss = '<link rel="stylesheet" type="text/css" href="' . $this->minifier->getLink() . '">' . "\n";
$minifyCss = '<link rel="stylesheet" type="text/css" href="' . $this->minifier->getURI() . '">' . "\n";
return str_replace('<!-- STYLESHEETS -->', $minifyCss . implode("\n", array_unique($matches[1])) . "\n", $tpl_output);
}
......
......@@ -119,7 +119,7 @@ class TinyMCE extends Core\WYSIWYG\Textarea
'selector' => 'textarea#' . $this->id,
'theme' => 'modern',
'height' => $this->config['height'],
'content_css' => $this->minifier->getLink()
'content_css' => $this->minifier->getURI()
];
// Basic editor
......
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