update Piwik to version 2.16 (fixes #91)
This commit is contained in:
parent
296343bf3b
commit
d885a4baa9
5833 changed files with 418860 additions and 226988 deletions
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* Piwik - Open source web analytics
|
||||
* Piwik - free/libre analytics platform
|
||||
*
|
||||
* @link http://piwik.org
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
||||
|
|
@ -64,10 +64,10 @@ class Theme
|
|||
return false;
|
||||
}
|
||||
$jsFiles = $info['javascript'];
|
||||
if(!is_array($jsFiles)) {
|
||||
if (!is_array($jsFiles)) {
|
||||
$jsFiles = array($jsFiles);
|
||||
}
|
||||
foreach($jsFiles as &$jsFile) {
|
||||
foreach ($jsFiles as &$jsFile) {
|
||||
$jsFile = 'plugins/' . $this->theme->getPluginName() . '/' . $jsFile;
|
||||
}
|
||||
return $jsFiles;
|
||||
|
|
@ -97,7 +97,7 @@ class Theme
|
|||
// rewrites images in JS files
|
||||
'~(=)[\s]?[\'"]([^\'"]+[.jpg|.png|.gif|svg]?)[\'"]~',
|
||||
);
|
||||
return preg_replace_callback($pattern, array($this,'rewriteAssetPathIfOverridesFound'), $output);
|
||||
return preg_replace_callback($pattern, array($this, 'rewriteAssetPathIfOverridesFound'), $output);
|
||||
}
|
||||
|
||||
private function rewriteAssetPathIfOverridesFound($src)
|
||||
|
|
@ -107,18 +107,18 @@ class Theme
|
|||
|
||||
// Basic health check, we dont replace if not starting with plugins/
|
||||
$posPluginsInPath = strpos($pathAsset, 'plugins');
|
||||
if( $posPluginsInPath !== 0) {
|
||||
if ($posPluginsInPath !== 0) {
|
||||
return $source;
|
||||
}
|
||||
|
||||
// or if it's already rewritten
|
||||
if(strpos($pathAsset, $this->themeName) !== false) {
|
||||
if (strpos($pathAsset, $this->themeName) !== false) {
|
||||
return $source;
|
||||
}
|
||||
|
||||
$pathPluginName = substr($pathAsset, strlen('plugins/'));
|
||||
$nextSlash = strpos($pathPluginName, '/');
|
||||
if($nextSlash === false) {
|
||||
if ($nextSlash === false) {
|
||||
return $source;
|
||||
}
|
||||
$pathPluginName = substr($pathPluginName, 0, $nextSlash);
|
||||
|
|
@ -133,11 +133,11 @@ class Theme
|
|||
// Strip trailing query string
|
||||
$fileToCheck = $overridingAsset;
|
||||
$queryStringPos = strpos($fileToCheck, '?');
|
||||
if( $queryStringPos !== false) {
|
||||
if ($queryStringPos !== false) {
|
||||
$fileToCheck = substr($fileToCheck, 0, $queryStringPos);
|
||||
}
|
||||
|
||||
if(file_exists($fileToCheck)) {
|
||||
if (file_exists($fileToCheck)) {
|
||||
return str_replace($pathAsset, $overridingAsset, $source);
|
||||
}
|
||||
return $source;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue