diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-10-13 00:34:39 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-10-13 00:34:39 +0400 |
commit | 7d4d971e3cac828e15ae744613e3d3706d21ad65 (patch) | |
tree | 8df3aa4cab5c836f39a0b70083a2522e5e83ba59 /plugins/UsersManager/UserPreferences.php | |
parent | d2210081f581a867d85f81103f65ce4b1cf2182c (diff) |
a few coding style changes
Diffstat (limited to 'plugins/UsersManager/UserPreferences.php')
-rw-r--r-- | plugins/UsersManager/UserPreferences.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/UsersManager/UserPreferences.php b/plugins/UsersManager/UserPreferences.php index ef77f80e22..430d2b8b65 100644 --- a/plugins/UsersManager/UserPreferences.php +++ b/plugins/UsersManager/UserPreferences.php @@ -84,6 +84,7 @@ class UserPreferences ) { return $userSettingsDate; } + return 'today'; } @@ -96,17 +97,21 @@ class UserPreferences public function getDefaultPeriod() { $userSettingsDate = APIUsersManager::getInstance()->getUserPreference(Piwik::getCurrentUserLogin(), APIUsersManager::PREFERENCE_DEFAULT_REPORT_DATE); + if ($userSettingsDate === false) { return Config::getInstance()->General['default_period']; } + if (in_array($userSettingsDate, array('today', 'yesterday'))) { return 'day'; } + if (strpos($userSettingsDate, 'last') === 0 || strpos($userSettingsDate, 'previous') === 0 ) { return 'range'; } + return $userSettingsDate; } }
\ No newline at end of file |