Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Settings + 2.4 BC break #8

Merged
merged 3 commits into from
Feb 5, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions API.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,9 @@ public function getSettingsCalendars()
return false;
}

if (version_compare(Version::VERSION, '2.4.0-b1', 'ge'))
{
$settings = new Settings('RerUserDates');

return $settings->getSettingValue($settings->calendars);
}
$settings = new Settings('RerUserDates');

return false;
return $settings->getSetting('profiles')->getValue();
}

/**
Expand Down
9 changes: 2 additions & 7 deletions RerUserDates.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
use Piwik\Plugin;
use Piwik\Notification;
use Piwik\Plugins\UsersManager\API as APIUsersManager;
use Piwik\Url;
use Piwik\Version;

/**
*/
Expand Down Expand Up @@ -109,11 +107,8 @@ protected function isSuperuser()
*/
protected function checkPiwikSettingsFeature()
{
if (version_compare(Version::VERSION, '2.4.0-b1', 'ge'))
{
$settings = new Settings('RerUserDates');
$this->profiles = $settings->getSetting($settings->profiles);
}
$settings = new Settings('RerUserDates');
$this->profiles = $settings->getSetting('profiles')->getValue();
}

/**
Expand Down
8 changes: 2 additions & 6 deletions Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

use Piwik\Piwik;
use Piwik\Settings\SystemSetting;
use Piwik\Version;

/**
* Class Settings
Expand All @@ -35,11 +34,8 @@ class Settings extends \Piwik\Plugin\Settings
protected function init()
{
$this->setIntroduction(Piwik::translate('RerUserDates_Settings'));
if (version_compare(Version::VERSION, '2.4.0-b1', 'ge'))
{
$this->createProfileSettings();
$this->createCalendarSettings();
}
$this->createProfileSettings();
$this->createCalendarSettings();
}

/**
Expand Down