Commit edd26c95 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Adjusting the save_config_options() call to include $form (Bug #1360943)



To be more like the validate_config_options() call and so allow for
something other than the generic success message.

Change-Id: I36a6fec227c525776b58fd29c1548fb30b62a92c
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 42a3cc96
......@@ -95,7 +95,7 @@ function pluginconfig_submit(Pieform $form, $values) {
global $plugintype, $pluginname, $classname;
try {
call_static_method($classname, 'save_config_options', $values);
call_static_method($classname, 'save_config_options', $form, $values);
$success = true;
}
catch (Exception $e) {
......
......@@ -818,7 +818,7 @@ class ArtefactTypeComment extends ArtefactType {
);
}
public static function save_config_options($values) {
public static function save_config_options($form, $values) {
foreach (array('commentratings') as $settingname) {
set_config_plugin('artefact', 'comment', $settingname, $values[$settingname]);
}
......
......@@ -95,7 +95,7 @@ class PluginBlocktypeFolder extends PluginBlocktype {
);
}
public static function save_config_options($values) {
public static function save_config_options($form, $values) {
set_config_plugin('blocktype', 'folder', 'sortorder', $values['sortorder']);
set_config_plugin('blocktype', 'folder', 'folderdownloadzip', $values['folderdownloadzip']);
}
......
......@@ -483,7 +483,7 @@ class PluginBlocktypeGallery extends PluginBlocktype {
}
public static function save_config_options($values) {
public static function save_config_options($form, $values) {
set_config_plugin('blocktype', 'gallery', 'useslimbox2', (int)$values['useslimbox2']);
set_config_plugin('blocktype', 'gallery', 'photoframe', (int)$values['photoframe']);
set_config_plugin('blocktype', 'gallery', 'previewwidth', (int)$values['previewwidth']);
......
......@@ -125,7 +125,7 @@ class PluginBlocktypeInternalmedia extends PluginBlocktype {
return $artefact;
}
public static function save_config_options($values) {
public static function save_config_options($form, $values) {
$enabledtypes = array();
foreach ($values as $type => $enabled) {
if (!in_array($type, self::get_all_filetypes())) {
......
......@@ -1792,7 +1792,7 @@ class ArtefactTypeFile extends ArtefactTypeFileBase {
}
}
public static function save_config_options($values) {
public static function save_config_options($form, $values) {
global $USER;
if ($values['updateuserquotas'] && $values['defaultquota']) {
set_field('usr', 'quota', $values['defaultquota'], 'deleted', 0);
......
......@@ -602,7 +602,7 @@ class ArtefactTypeProfile extends ArtefactType {
return $form;
}
public function save_config_options($values) {
public function save_config_options($form, $values) {
$mandatory = array_merge(array_keys(self::get_always_mandatory_fields()), $values['mandatory']);
set_config_plugin('artefact', 'internal', 'profilemandatory', join(',', $mandatory));
$searchable = array_merge(array_keys(self::get_always_searchable_fields()), $values['searchable']);
......
......@@ -517,7 +517,7 @@ class PluginAuthSaml extends PluginAuth {
}
}
public static function save_config_options($values) {
public static function save_config_options($form, $values) {
$configs = array('simplesamlphplib', 'simplesamlphpconfig');
foreach ($configs as $config) {
set_config_plugin('auth', 'saml', $config, $values[$config]);
......
......@@ -100,7 +100,7 @@ class PluginBlocktypeWall extends SystemBlocktype {
}
}
public static function save_config_options($values) {
public static function save_config_options($form, $values) {
set_config_plugin('blocktype', 'wall', 'defaultpostsizelimit', (int)$values['defaultpostsizelimit']);
}
......
......@@ -567,7 +567,7 @@ EOF;
);
}
public static function save_config_options($values) {
public static function save_config_options($form, $values) {
set_config_plugin('interaction', 'forum', 'postdelay', $values['postdelay']);
}
......
......@@ -1833,8 +1833,8 @@ abstract class Plugin implements IPlugin {
*
* If you return true here, you will also need to define the following methods:
* - get_config_options()
* - [optional] validate_config_options()
* - save_config_options($values)
* - [optional] validate_config_options($form, $values)
* - save_config_options($form, $values)
*
* @return boolean
*/
......
......@@ -336,7 +336,7 @@ class PluginSearchElasticsearch extends PluginSearch {
return $config;
}
public static function save_config_options($values) {
public static function save_config_options($form, $values) {
set_config_plugin('search', 'elasticsearch', 'cronlimit', $values['cronlimit']);
// Changes in artefact types:
......
......@@ -51,7 +51,7 @@ class PluginSearchInternal extends PluginSearch {
);
}
public static function save_config_options($values) {
public static function save_config_options($form, $values) {
set_config_plugin('search', 'internal', 'exactusersearch', (int) $values['exactusersearch']);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment