From cbec93e99a8eaf46a63b42801c69dabee1ad81ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Moumn=C3=A9?= Date: Thu, 19 Jun 2014 21:28:51 +0200 Subject: refs #3838 - SitesManager fully migrated to AngularJS --- plugins/SitesManager/API.php | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'plugins/SitesManager/API.php') 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; } /** @@ -1240,6 +1247,17 @@ class API extends \Piwik\Plugin\API }, $currencies); } + /** + * 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 -- cgit v1.2.3