Skip to content
Extraits de code Groupes Projets
Valider 30e114e7 rédigé par mattpiwik's avatar mattpiwik
Parcourir les fichiers

Fixes Worldmap segment parameter not forwarded correctly, and displaing clear...

Fixes Worldmap segment parameter not forwarded correctly, and displaing clear message when data not found.

git-svn-id: http://dev.piwik.org/svn/trunk@6972 59fd770c-687e-43c8-a1e3-f5a4ff64c105
parent de709340
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -30,6 +30,8 @@ class Piwik_UserCountryMap_Controller extends Piwik_Controller
$token_auth = Piwik::getCurrentUserTokenAuth();
$view = Piwik_View::factory('worldmap');
// will be escaped in the template
$view->dataUrl = "?module=API"
. "&method=API.getProcessedReport&format=XML"
. "&apiModule=UserCountry&apiAction=getCountry"
......@@ -58,19 +60,25 @@ class Piwik_UserCountryMap_Controller extends Piwik_Controller
. '&filter_limit=-1'
);
$metaData = $request->process();
$metrics = array();
foreach ($metaData[0]['metrics'] as $id => $val)
if(!is_array($metaData))
{
throw new Exception("Error while requesting Map reports for website " . (int)$idSite);
}
else
{
if (Piwik_Common::getRequestVar('period') == 'day' || $id != 'nb_uniq_visitors') {
foreach ($metaData[0]['metrics'] as $id => $val)
{
if (Piwik_Common::getRequestVar('period') == 'day' || $id != 'nb_uniq_visitors') {
$metrics[] = array($id, $val);
}
}
foreach ($metaData[0]['processedMetrics'] as $id => $val)
{
$metrics[] = array($id, $val);
}
}
foreach ($metaData[0]['processedMetrics'] as $id => $val)
{
$metrics[] = array($id, $val);
}
$view->metrics = $metrics;
$view->defaultMetric = 'nb_visits';
echo $view->render();
......
......@@ -28,7 +28,7 @@
var isSafari = (navigator.userAgent.toLowerCase().indexOf("safari") != -1 &&
navigator.userAgent.toLowerCase().indexOf("chrome") == -1);
fv.dataUrl = encodeURIComponent("{$dataUrl}");
fv.dataUrl = encodeURIComponent("{$dataUrl|escape:'javascript'}");
fv.hueMin = {$hueMin};
fv.hueMax = {$hueMax};
fv.satMin = {$satMin};
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter