diff options
author | Cash Costello <cash.costello@gmail.com> | 2009-06-03 01:47:16 +0000 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2009-06-03 01:47:16 +0000 |
commit | 99a5db94c8e91913e42331bd73d37cb93f3cc2d8 (patch) | |
tree | bed8db8ba8b9abdb05652351b3a0848ee86b9c0e /actions | |
parent | ac7b07f54be91fd2ce1e2ff8c2ddbc23c71e2345 (diff) | |
download | elgg-99a5db94c8e91913e42331bd73d37cb93f3cc2d8.tar.gz elgg-99a5db94c8e91913e42331bd73d37cb93f3cc2d8.tar.bz2 |
almost done with new settings page - need to add link to server analysis and remove default plugin edit view
Diffstat (limited to 'actions')
-rw-r--r-- | actions/settings.php | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/actions/settings.php b/actions/settings.php index 427ca2520..c0f53c71d 100644 --- a/actions/settings.php +++ b/actions/settings.php @@ -8,19 +8,28 @@ gatekeeper();
action_gatekeeper();
-
- $params = get_input('params');
+
+ // Params array (text boxes and drop downs)
+ $params = get_input('params');
+ $result = false;
foreach ($params as $k => $v) {
-
- error_log("$k : $v");
-
+ if (!set_plugin_setting($k, $v, 'tidypics')) {
+ register_error(sprintf(elgg_echo('plugins:settings:save:fail'), 'tidypics'));
+ forward($_SERVER['HTTP_REFERER']);
+ }
}
+
+ // check boxes
+ if (is_array(get_input('download_link'))) // this can be done due to way Elgg uses checkboxes
+ set_plugin_setting('download_link', 'enabled', 'tidypics');
+ else
+ set_plugin_setting('download_link', 'disabled', 'tidypics');
- if (get_input('download_link') == true)
- error_log('download link is on');
- if (get_input('tagging') == true)
- error_log('tagging is on');
+ if (is_array(get_input('tagging')))
+ set_plugin_setting('tagging', 'enabled', 'tidypics');
+ else
+ set_plugin_setting('tagging', 'disabled', 'tidypics');
system_message(elgg_echo('tidypics:settings:save:ok'));
|