Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorMatthieu Aubry <matt@piwik.org>2013-07-13 09:44:08 +0400
committerMatthieu Aubry <matt@piwik.org>2013-07-13 09:44:08 +0400
commitea69cc4389e0945109ec1cdc30cacd62986d84d0 (patch)
treeaa16ed0480d2cffb9f02a8ec27855ed8203ac4f6 /core
parent93bafe48f46c60acc6b6dd2e5d7ece06f3b2f415 (diff)
parentd78d735e16dda63a3037b5e6b28be2b347d3eb19 (diff)
Merge pull request #88 from tzi/pleineLune__less-installation
CSS, templates improvements. Enable Assetmanager on login page, separate css for installer/upgrader, progress in theming, Less installation. Super boulot Thomas !
Diffstat (limited to 'core')
-rw-r--r--core/AssetManager.php15
-rw-r--r--core/Twig.php4
2 files changed, 6 insertions, 13 deletions
diff --git a/core/AssetManager.php b/core/AssetManager.php
index ccae3e8126..21a5662479 100644
--- a/core/AssetManager.php
+++ b/core/AssetManager.php
@@ -10,11 +10,6 @@
*/
/**
- * @see libs/cssmin/cssmin.php
- */
-require_once PIWIK_INCLUDE_PATH . '/libs/cssmin/cssmin.php';
-
-/**
* @see libs/jsmin/jsmin.php
*/
require_once PIWIK_INCLUDE_PATH . '/libs/jsmin/jsmin.php';
@@ -60,7 +55,7 @@ class Piwik_AssetManager
if (self::getDisableMergedAssets()) {
// Individual includes mode
self::removeMergedAsset(self::MERGED_CSS_FILE);
- return self::getIndividualCssIncludes();
+ self::generateMergedCssFile();
}
return sprintf(self::CSS_IMPORT_DIRECTIVE, self::GET_CSS_MODULE_ACTION);
}
@@ -96,6 +91,8 @@ class Piwik_AssetManager
}
$rootDirectoryLen = strlen($rootDirectory);
+ $less = new lessc;
+
// Loop through each css file
$files = self::getCssFiles();
foreach ($files as $file) {
@@ -103,6 +100,7 @@ class Piwik_AssetManager
self::validateCssFile($file);
$fileLocation = self::getAbsoluteLocation($file);
+ $less->addImportDir(dirname($fileLocation));
$content = file_get_contents($fileLocation);
// Rewrite css url directives
@@ -120,8 +118,7 @@ class Piwik_AssetManager
$mergedContent = $mergedContent . $content;
}
- $mergedContent = cssmin::minify($mergedContent);
- $mergedContent = str_replace("\n", "\r\n", $mergedContent);
+ $mergedContent = $less->compile($mergedContent);
Piwik_PostEvent('AssetManager.filterMergedCss', array(&$mergedContent));
@@ -189,7 +186,7 @@ class Piwik_AssetManager
{
$priorityCssOrdered = array(
'libs/',
- 'plugins/Zeitgeist/stylesheets/common.css',
+ 'plugins/Zeitgeist/stylesheets/base.less',
'plugins/Zeitgeist/stylesheets/',
'plugins/',
);
diff --git a/core/Twig.php b/core/Twig.php
index 47497b00be..9022c31ba7 100644
--- a/core/Twig.php
+++ b/core/Twig.php
@@ -72,13 +72,9 @@ class Piwik_Twig
$assetType = strtolower($params['type']);
switch ($assetType) {
case 'css':
-
return Piwik_AssetManager::getCssAssets();
-
case 'js':
-
return Piwik_AssetManager::getJsAssets();
-
default:
throw new Exception("The twig function includeAssets 'type' parameter needs to be either 'css' or 'js'.");
}