From 99a5db94c8e91913e42331bd73d37cb93f3cc2d8 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Wed, 3 Jun 2009 01:47:16 +0000 Subject: almost done with new settings page - need to add link to server analysis and remove default plugin edit view --- actions/settings.php | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'actions/settings.php') 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')); -- cgit v1.2.3