diff options
author | Julien Moumné <julien@moumne.com> | 2014-06-19 23:28:51 +0400 |
---|---|---|
committer | Julien Moumné <julien@moumne.com> | 2014-06-19 23:28:51 +0400 |
commit | cbec93e99a8eaf46a63b42801c69dabee1ad81ef (patch) | |
tree | 99c6c442cb271b72118997ecc8c930ee43a7d9a5 /plugins/SitesManager/API.php | |
parent | 9ec4bcab45e1a3effadab3761ed13835af384e68 (diff) |
refs #3838 - SitesManager fully migrated to AngularJS
Diffstat (limited to 'plugins/SitesManager/API.php')
-rw-r--r-- | plugins/SitesManager/API.php | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/plugins/SitesManager/API.php b/plugins/SitesManager/API.php index d669bb781c..b3675f0dd6 100644 --- a/plugins/SitesManager/API.php +++ b/plugins/SitesManager/API.php @@ -311,12 +311,19 @@ class API extends \Piwik\Plugin\API * Returns the list of websites with the 'admin' access for the current user. * For the superUser it returns all the websites in the database. * + * @param bool $fetchAliasUrls * @return array for each site, an array of information (idsite, name, main_url, etc.) */ - public function getSitesWithAdminAccess() + public function getSitesWithAdminAccess($fetchAliasUrls = false) { $sitesId = $this->getSitesIdWithAdminAccess(); - return $this->getSitesFromIds($sitesId); + $sites = $this->getSitesFromIds($sitesId); + + if ($fetchAliasUrls) + foreach ($sites as &$site) + $site['alias_urls'] = API::getInstance()->getSiteUrlsFromId($site['idsite']); + + return $sites; } /** @@ -1241,6 +1248,17 @@ class API extends \Piwik\Plugin\API } /** + * Return true if Timezone support is enabled on server + * + * @return bool + */ + public function isTimezoneSupportEnabled() + { + Piwik::checkUserHasSomeViewAccess(); + return SettingsServer::isTimezoneSupportEnabled(); + } + + /** * Returns the list of timezones supported. * Used for addSite and updateSite * |