Skip to content
Extraits de code Groupes Projets
Valider 5fcd9f15 rédigé par mattab's avatar mattab
Parcourir les fichiers

Fix System tests

parent ca85d28c
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -564,8 +564,7 @@ class API extends \Piwik\Plugin\API ...@@ -564,8 +564,7 @@ class API extends \Piwik\Plugin\API
public function getGlossaryReports($idSite) public function getGlossaryReports($idSite)
{ {
$glossary = StaticContainer::get('Piwik\Plugins\API\Glossary'); $glossary = StaticContainer::get('Piwik\Plugins\API\Glossary');
$glossary->setIdSite($idSite); return $glossary->reportsGlossary($idSite);
return $glossary->reportsGlossary();
} }
/** /**
...@@ -577,8 +576,7 @@ class API extends \Piwik\Plugin\API ...@@ -577,8 +576,7 @@ class API extends \Piwik\Plugin\API
public function getGlossaryMetrics($idSite) public function getGlossaryMetrics($idSite)
{ {
$glossary = StaticContainer::get('Piwik\Plugins\API\Glossary'); $glossary = StaticContainer::get('Piwik\Plugins\API\Glossary');
$glossary->setIdSite($idSite); return $glossary->metricsGlossary($idSite);
return $glossary->metricsGlossary();
} }
/** /**
......
...@@ -13,15 +13,17 @@ class Glossary ...@@ -13,15 +13,17 @@ class Glossary
{ {
protected $metadata = array(); protected $metadata = array();
public function setIdSite($idSite) public function __construct(API $api)
{ {
$this->metadata = API::getInstance()->getReportMetadata($idSite); $this->api = $api;
} }
public function reportsGlossary() public function reportsGlossary($idSite)
{ {
$metadata = $this->api->getReportMetadata($idSite);
$reports = array(); $reports = array();
foreach ($this->metadata as $report) { foreach ($metadata as $report) {
if (isset($report['documentation'])) { if (isset($report['documentation'])) {
$reports[] = array( $reports[] = array(
'name' => sprintf("%s (%s)", $report['name'], $report['category']), 'name' => sprintf("%s (%s)", $report['name'], $report['category']),
...@@ -37,10 +39,12 @@ class Glossary ...@@ -37,10 +39,12 @@ class Glossary
return $reports; return $reports;
} }
public function metricsGlossary() public function metricsGlossary($idSite)
{ {
$metadata = $this->api->getReportMetadata($idSite);
$metrics = array(); $metrics = array();
foreach ($this->metadata as $report) { foreach ($metadata as $report) {
if (!isset($report['metricsDocumentation'])) { if (!isset($report['metricsDocumentation'])) {
continue; continue;
} }
......
...@@ -84,10 +84,6 @@ ...@@ -84,10 +84,6 @@
<name>Pages per Visit (Visitors)</name> <name>Pages per Visit (Visitors)</name>
<documentation>In this report, you can see how many visits involved a certain number of pageviews. Initially, the report is shown as a tag cloud, more common numbers of pages are displayed in a larger font.&lt;br /&gt;Please note, that you can view the report in other ways than as a tag cloud. Use the controls at the bottom of the report to do so.</documentation> <documentation>In this report, you can see how many visits involved a certain number of pageviews. Initially, the report is shown as a tag cloud, more common numbers of pages are displayed in a larger font.&lt;br /&gt;Please note, that you can view the report in other ways than as a tag cloud. Use the controls at the bottom of the report to do so.</documentation>
</row> </row>
<row>
<name>Provider (Visitors)</name>
<documentation>This report shows which Internet Service Providers your visitors used to access the website. You can click on a provider name for more details. &lt;br /&gt; If Piwik can't determine a visitor's provider, it is listed as IP.</documentation>
</row>
<row> <row>
<name>Referrer Type (Referrers)</name> <name>Referrer Type (Referrers)</name>
<documentation>This table contains information about the distribution of the referrer types.&lt;br /&gt;&lt;b&gt;Direct Entry:&lt;/b&gt; A visitor has entered the URL in his browser and started browsing on your website - he entered the website directly.&lt;br /&gt;&lt;b&gt;Search Engines:&lt;/b&gt; A visitor was referred to your website by a search engine. &lt;br /&gt; See the &quot;Search Engines &amp; Keywords&quot; report for more details.&lt;br /&gt;&lt;b&gt;Websites:&lt;/b&gt; The visitor followed a link on another website that led to your site. &lt;br /&gt; See the &quot;Websites &amp; Social&quot; report for more details.&lt;br /&gt;&lt;b&gt;Campaigns:&lt;/b&gt; Visitors that came to your website as the result of a campaign. &lt;br /&gt; See the &quot;Campaigns&quot; report for more details.</documentation> <documentation>This table contains information about the distribution of the referrer types.&lt;br /&gt;&lt;b&gt;Direct Entry:&lt;/b&gt; A visitor has entered the URL in his browser and started browsing on your website - he entered the website directly.&lt;br /&gt;&lt;b&gt;Search Engines:&lt;/b&gt; A visitor was referred to your website by a search engine. &lt;br /&gt; See the &quot;Search Engines &amp; Keywords&quot; report for more details.&lt;br /&gt;&lt;b&gt;Websites:&lt;/b&gt; The visitor followed a link on another website that led to your site. &lt;br /&gt; See the &quot;Websites &amp; Social&quot; report for more details.&lt;br /&gt;&lt;b&gt;Campaigns:&lt;/b&gt; Visitors that came to your website as the result of a campaign. &lt;br /&gt; See the &quot;Campaigns&quot; report for more details.</documentation>
......
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