diff options
author | matt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2010-03-30 16:36:04 +0400 |
---|---|---|
committer | matt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2010-03-30 16:36:04 +0400 |
commit | bb247aaa2598e50e26e3f1b31603b2e43fadd1fd (patch) | |
tree | 0457f4018b4a03f86069922932f39c5e66287cfc /plugins/SitesManager/Controller.php | |
parent | 0b08873d5c8a442facb82cdcbad5ce3b8130867d (diff) |
Fixes #1001 Adding currency setting per website
Defaulting currency to USD for all existing websites
Simplifying website admin screen by rolling all settings into the same form (still using ajax)
Adding SitesManager and UsersManager to the list of hidden plugins
Slightly refactored printing money values to accomodate per website preference
Diffstat (limited to 'plugins/SitesManager/Controller.php')
-rw-r--r-- | plugins/SitesManager/Controller.php | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/plugins/SitesManager/Controller.php b/plugins/SitesManager/Controller.php index 140de42455..5c01f46e85 100644 --- a/plugins/SitesManager/Controller.php +++ b/plugins/SitesManager/Controller.php @@ -34,10 +34,14 @@ class Piwik_SitesManager_Controller extends Piwik_Controller } $view->timezoneSupported = Piwik::isTimezoneSupportEnabled(); $view->timezones = json_encode($timezones); + $view->defaultTimezone = Piwik_SitesManager_API::getInstance()->getDefaultTimezone(); + + $view->currencies = json_encode(Piwik_SitesManager_API::getInstance()->getCurrencyList()); + $view->defaultCurrency = Piwik_SitesManager_API::getInstance()->getDefaultCurrency(); + $view->utcTime = Piwik_Date::now()->getDatetime(); $excludedIpsGlobal = Piwik_SitesManager_API::getInstance()->getExcludedIpsGlobal(); $view->globalExcludedIps = str_replace(',',"\n", $excludedIpsGlobal); - $view->defaultTimezone = Piwik_SitesManager_API::getInstance()->getDefaultTimezone(); $view->currentIpAddress = Piwik_Common::getIpString(); $this->setGeneralVariablesView($view); @@ -45,6 +49,25 @@ class Piwik_SitesManager_Controller extends Piwik_Controller echo $view->render(); } + function setGlobalSettings() + { + $response = new Piwik_API_ResponseBuilder(Piwik_Common::getRequestVar('format')); + + try { + $this->checkTokenInUrl(); + $timezone = Piwik_Common::getRequestVar('timezone', false); + $excludedIps = Piwik_Common::getRequestVar('excludedIps', false); + $currency = Piwik_Common::getRequestVar('currency', false); + Piwik_SitesManager_API::getInstance()->setDefaultTimezone($timezone); + Piwik_SitesManager_API::getInstance()->setDefaultCurrency($currency); + Piwik_SitesManager_API::getInstance()->setGlobalExcludedIps($excludedIps); + $toReturn = $response->getResponse(); + } catch(Exception $e ) { + $toReturn = $response->getResponseException( $e ); + } + echo $toReturn; + } + function displayJavascriptCode() { $idSite = Piwik_Common::getRequestVar('idsite', 1); |