Skip to content
Extraits de code Groupes Projets
Valider f463f209 rédigé par robocoder's avatar robocoder
Parcourir les fichiers

fix broken cachebuster; fix broken ajaxcdn; use piwik_version in cachebuster for consistency

git-svn-id: http://dev.piwik.org/svn/trunk@3056 59fd770c-687e-43c8-a1e3-f5a4ff64c105
parent 2a132e1a
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -45,8 +45,8 @@ class Piwik_AssetManager
const CSS_IMPORT_EVENT = "AssetManager.getCssFiles";
const JS_IMPORT_EVENT = "AssetManager.getJsFiles";
const MERGED_FILE_DIR = "tmp/assets/";
const CSS_IMPORT_DIRECTIVE = "<link rel='stylesheet' type='text/css' href='%s' /> \n";
const JS_IMPORT_DIRECTIVE = "<script type='text/javascript' src='%s'> </script> \n";
const CSS_IMPORT_DIRECTIVE = "<link rel=\"stylesheet\" type=\"text/css\" href=\"%s\" />\n";
const JS_IMPORT_DIRECTIVE = "<script type=\"text/javascript\" src=\"%s\"></script>\n";
const GET_CSS_MODULE_ACTION = "index.php?module=CoreHome&action=getCss";
const GET_JS_MODULE_ACTION = "index.php?module=CoreHome&action=getJs";
const MINIFIED_JS_RATIO = 100;
......@@ -493,4 +493,4 @@ class Piwik_AssetManager
}
return array_keys(array_flip($newFiles));
}
}
\ No newline at end of file
}
......@@ -28,18 +28,12 @@
*/
function smarty_outputfilter_ajaxcdn($source, &$smarty)
{
$use_ajax_cdn = Zend_Registry::get('config')->General->use_ajax_cdn;
if(!$use_ajax_cdn)
{
return $source;
}
$jquery_version = Zend_Registry::get('config')->General->jquery_version;
$jqueryui_version = Zend_Registry::get('config')->General->jqueryui_version;
$swfobject_version = Zend_Registry::get('config')->General->swfobject_version;
$pattern = array(
'~<link rel="stylesheet" type="text/css" href="libs/jquery/themes/([^"]*)" class="ui-theme" />~',
'~<link rel="stylesheet" type="text/css" href="libs/jquery/themes/([^"]*)" />~',
'~<script type="text/javascript" src="libs/jquery/jquery\.js([^"]*)">~',
'~<script type="text/javascript" src="libs/jquery/jquery-ui\.js([^"]*)">~',
'~<script type="text/javascript" src="libs/jquery/jquery-ui-18n\.js([^"]*)">~',
......@@ -47,7 +41,7 @@ function smarty_outputfilter_ajaxcdn($source, &$smarty)
);
$replace = array(
'<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/'.$jqueryui_version.'/themes/\\1" class="ui-theme" />',
'<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/'.$jqueryui_version.'/themes/\\1" />',
'<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/'.$jquery_version.'/jquery.min.js">',
'<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/'.$jqueryui_version.'/jquery-ui.min.js">',
'<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/'.$jqueryui_version.'/i18n/jquery-ui-18n.min.js">',
......
......@@ -31,12 +31,13 @@
*/
function smarty_outputfilter_cachebuster($source, &$smarty)
{
$tag = $smarty->get_template_vars('tag');
$version = $smarty->get_template_vars('piwik_version');
$tag = 'piwik=' . $version;
$pattern = array(
'~<script type="text/javascript" src="([^"]+)">~',
'~<script src="([^"]+)" type="text/javascript">~',
'~<link rel="stylesheet" type="text/css" href="([^"]+)" ?/?>~',
'~<script type=[\'"]text/javascript[\'"] src=[\'"]([^\'"]+)[\'"]>~',
'~<script src=[\'"]([^\'"]+)[\'"] type=[\'"]text/javascript[\'"]>~',
'~<link rel=[\'"]stylesheet[\'"] type=[\'"]text/css[\'"] href=[\'"]([^\'"]+)[\'"] ?/?>~',
);
$replace = array(
......
......@@ -69,16 +69,23 @@ class Piwik_View implements Piwik_iView
}
$this->smarty->error_reporting = $error_reporting;
$this->smarty->assign('tag', 'piwik=' . Piwik_Version::VERSION);
if($filter)
{
$this->smarty->load_filter('output', 'cachebuster');
$this->smarty->load_filter('output', 'ajaxcdn');
$use_ajax_cdn = Zend_Registry::get('config')->General->use_ajax_cdn;
if($use_ajax_cdn)
{
$this->smarty->load_filter('output', 'ajaxcdn');
}
$this->smarty->load_filter('output', 'trimwhitespace');
}
// global value accessible to all templates: the piwik base URL for the current request
$this->piwikUrl = Piwik_Url::getCurrentUrlWithoutFileName();
$this->piwik_version = Piwik_Version::VERSION;
}
/**
......@@ -123,7 +130,6 @@ class Piwik_View implements Piwik_iView
$this->token_auth = Piwik::getCurrentUserTokenAuth();
$this->userHasSomeAdminAccess = Piwik::isUserHasSomeAdminAccess();
$this->userIsSuperUser = Piwik::isUserIsSuperUser();
$this->piwik_version = Piwik_Version::VERSION;
$this->latest_version_available = Piwik_UpdateCheck::isNewestVersionAvailable();
if(Zend_Registry::get('config')->General->autocomplete_min_sites <= count($sites))
{
......
......@@ -7,15 +7,19 @@
* @version $Id$
*/
/**
* Tracker proxy
*/
if(!empty($_SERVER['QUERY_STRING'])) {
include '../piwik.php';
exit;
}
/**
* piwik.js proxy
*
* @see core/Piwik.php
*/
define('PIWIK_INCLUDE_PATH', '..');
define('PIWIK_DOCUMENT_ROOT', '..');
......@@ -25,4 +29,4 @@ $file = 'piwik.js';
Piwik::serveStaticFile($file, "application/javascript; charset=UTF-8");
exit;
\ No newline at end of file
exit;
......@@ -11,7 +11,7 @@
piwikHelper.OFC.set("{$chartDivId}", '{$flashParameters.data}');
{/if}
swfobject.embedSWF(
"{$flashParameters.ofcLibraryPath}open-flash-chart.swf?{$tag}",
"{$flashParameters.ofcLibraryPath}open-flash-chart.swf?piwik={$piwik_version}",
"{$chartDivId}",
"{$flashParameters.width}", "{$flashParameters.height}",
"{$flashParameters.requiredFlashVersion}",
......
......@@ -7,7 +7,7 @@
<link rel="shortcut icon" href="plugins/CoreHome/templates/images/favicon.ico" />
<link rel="stylesheet" type="text/css" href="themes/default/simple_structure.css" />
<link rel="stylesheet" type="text/css" href="libs/jquery/themes/base/jquery-ui.css" class="ui-theme" />
<link rel="stylesheet" type="text/css" href="libs/jquery/themes/base/jquery-ui.css" />
<link rel="stylesheet" type="text/css" href="themes/default/styles.css" />
{literal}
<style>
......
......@@ -6,7 +6,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="plugins/CoreHome/templates/images/favicon.ico" />
<link rel="stylesheet" type="text/css" href="plugins/Login/templates/login.css" media="screen" />
<link rel="stylesheet" type="text/css" href="plugins/Login/templates/login.css" />
{literal}
<script type="text/javascript">
......
......@@ -85,7 +85,6 @@ class Piwik_UserCountryMap_Controller extends Piwik_Controller
$view->metrics = $metrics;
$view->defaultMetric = 'nb_visits';
$view->version = Piwik_Version::VERSION;
echo $view->render();
}
......
......@@ -41,7 +41,7 @@ $(document).ready(function() {
var attr = { id:"UserCountryMap" };
{/literal}
swfobject.embedSWF("plugins/UserCountryMap/PiwikMap.swf?piwik={$version}", "UserCountryMap_map",
swfobject.embedSWF("plugins/UserCountryMap/PiwikMap.swf?piwik={$piwik_version}", "UserCountryMap_map",
"100%", Math.round($('#UserCountryMap_content').width() *.55), "9.0.0",
"libs/swfobject/expressInstall.swf", fv, params, attr
);
......@@ -83,4 +83,4 @@ $(document).ready(function() {
<option value="{$metric[0]}" {if $metric[0] == $defaultMetric}selected="selected"{/if}>{$metric[1]}</option>
{/foreach}
</select>
</div>
\ No newline at end of file
</div>
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter