aboutsummaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2011-11-20 18:41:34 -0500
committercash <cash.costello@gmail.com>2011-11-20 18:41:34 -0500
commit9b814dd2124a8c71dec3a8d510d288f040b03b9e (patch)
tree63a53f0445df06963de1537af58faba38213b587 /actions
parentc51b483f24936c8d04a54a6999412937ec21c49a (diff)
downloadelgg-9b814dd2124a8c71dec3a8d510d288f040b03b9e.tar.gz
elgg-9b814dd2124a8c71dec3a8d510d288f040b03b9e.tar.bz2
working on settings
Diffstat (limited to 'actions')
-rw-r--r--actions/photos/admin/settings.php (renamed from actions/admin/settings.php)26
1 files changed, 10 insertions, 16 deletions
diff --git a/actions/admin/settings.php b/actions/photos/admin/settings.php
index d3801f655..a401d9bf3 100644
--- a/actions/admin/settings.php
+++ b/actions/photos/admin/settings.php
@@ -1,25 +1,24 @@
<?php
/**
- * Save settings of Tidypics
+ * Save Tidypics plugin settings
*
+ * @author Cash Costello
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2
*/
-global $CONFIG;
+$plugin = elgg_get_plugin_from_id('tidypics');
-admin_gatekeeper();
-action_gatekeeper();
-
-
-// Params array (text boxes and drop downs)
$params = get_input('params');
-$result = false;
foreach ($params as $k => $v) {
- if (!set_plugin_setting($k, $v, 'tidypics')) {
- register_error(sprintf(elgg_echo('plugins:settings:save:fail'), 'tidypics'));
- forward($_SERVER['HTTP_REFERER']);
+ if (!$plugin->setSetting($k, $v)) {
+ register_error(elgg_echo('plugins:settings:save:fail', array('tidypics')));
+ forward(REFERER);
}
}
+system_message(elgg_echo('tidypics:settings:save:ok'));
+forward(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');
@@ -76,8 +75,3 @@ $image_sizes['thumb_image_width'] = get_input('thumb_width');
$image_sizes['thumb_image_height'] = get_input('thumb_width');
set_plugin_setting('image_sizes', serialize($image_sizes), 'tidypics');
-
-
-system_message(elgg_echo('tidypics:settings:save:ok'));
-
-forward($_SERVER['HTTP_REFERER']);