You are here

public static function PiwikData::getSites in Piwik Reports 8

Return a list of sites where statistics are accessible on piwik server.

Parameters

string $token_auth: Piwik server token auth.

Return value

array|string|bool Array of sites returned from Piwik reports API.

2 calls to PiwikData::getSites()
PiwikReportsController::reports in src/Controller/PiwikReportsController.php
Reports.
PiwikReportsSettings::buildForm in src/Form/PiwikReportsSettings.php
Form constructor.

File

src/PiwikData.php, line 65
Contains \Drupal\piwik_reports\PiwikData.

Class

PiwikData

Namespace

Drupal\piwik_reports

Code

public static function getSites($token_auth) {
  $piwik_url = static::getUrl();
  if ($piwik_url) {
    return static::getResponse($piwik_url . 'index.php?module=API&method=SitesManager.getSitesWithAtLeastViewAccess&format=JSON&token_auth=' . $token_auth);
  }
  else {
    return FALSE;
  }
}