blob: 9df808e0b1b7c6f7d98a8eb993a352c5f403cf9d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
<?php
function Piwik_getPathFromUrl($url)
{
$path = Piwik_Common::getPathAndQueryFromUrl($url);
if(empty($path))
{
return 'index';
}
return $path;
}
function Piwik_getSearchEngineUrlFromName($name)
{
require_once "DataFiles/SearchEngines.php";
if(isset($GLOBALS['Piwik_SearchEngines_NameToUrl'][$name]))
{
$url = 'http://'.$GLOBALS['Piwik_SearchEngines_NameToUrl'][$name];
}
else
{
$url = 'URL unknown!';
}
return $url;
}
function Piwik_getSearchEngineLogoFromName($url)
{
require_once "DataFiles/SearchEngines.php";
$path = 'plugins/Referers/images/searchEngines/%s.png';
$beginningUrl = strpos($url,'//') + 2;
$normalPath = sprintf($path, substr($url,$beginningUrl));
// flags not in the package !
if(!file_exists($normalPath))
{
return sprintf($path, 'xx');
}
return $normalPath;
}
function Piwik_getRefererTypeLabel($label)
{
$indexTranslation = '';
switch($label)
{
case Piwik_Common::REFERER_TYPE_DIRECT_ENTRY:
$indexTranslation = 'Referers_DirectEntry';
break;
case Piwik_Common::REFERER_TYPE_SEARCH_ENGINE:
$indexTranslation = 'Referers_SearchEngines';
break;
case Piwik_Common::REFERER_TYPE_WEBSITE:
$indexTranslation = 'Referers_Websites';
break;
case Piwik_Common::REFERER_TYPE_CAMPAIGN:
$indexTranslation = 'Referers_Campaigns';
break;
default:
// case of newsletter, partners, before Piwik 0.2.25
$indexTranslation = 'General_Others';
break;
}
return Piwik_Translate($indexTranslation);
}
|