Skip to content

Commit

Permalink
Adopt the changes to the settings form
Browse files Browse the repository at this point in the history
  • Loading branch information
live627 committed Nov 19, 2018
1 parent c98111b commit c45b467
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/DoublePostStopper.php
Expand Up @@ -136,7 +136,7 @@ public static function settings(&$config_vars)
$config_vars,
[
[
isset($_GET['save']) ? 'text' : 'callback',
'callback',
'doublePostThresholds',
],
]
Expand Down Expand Up @@ -169,7 +169,14 @@ function getGroups()
public static function saveSettings()
{
if (isset($_POST['doublePostThresholds'])) {
$_POST['doublePostThresholds'] = json_encode($_POST['doublePostThresholds']);
$settingsForm = new Settings_Form(Settings_Form::DB_ADAPTER);
$settingsForm->setConfigVars(
[[
'text',
'doublePostThresholds',
]]);
$settingsForm->setConfigValues(['doublePostThresholds' => json_encode($_POST['doublePostThresholds'])]);
$settingsForm->save();
}
}

Expand Down

0 comments on commit c45b467

Please sign in to comment.