aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--actions/settings.php23
-rw-r--r--start.php1
-rw-r--r--views/default/tidypics/forms/admin.php6
3 files changed, 27 insertions, 3 deletions
diff --git a/actions/settings.php b/actions/settings.php
new file mode 100644
index 000000000..2c043426f
--- /dev/null
+++ b/actions/settings.php
@@ -0,0 +1,23 @@
+<?php
+ /**
+ * Save settings of Tidypics
+ *
+ */
+
+ global $CONFIG;
+
+ gatekeeper();
+ action_gatekeeper();
+
+ $params = get_input('params');
+
+ foreach ($params as $k => $v) {
+
+ error_log("$k : $v");
+
+ }
+
+ system_message(elgg_echo('tidypics:settings:save:ok'));
+
+ forward($_SERVER['HTTP_REFERER']);
+?>
diff --git a/start.php b/start.php
index ea5c67e2d..3515ee667 100644
--- a/start.php
+++ b/start.php
@@ -352,6 +352,7 @@
register_elgg_event_handler('pagesetup','system','tidypics_adminmenu');
// Register actions
+ register_action("tidypics/settings", false, $CONFIG->pluginspath . "tidypics/actions/settings.php");
register_action("tidypics/upload", false, $CONFIG->pluginspath . "tidypics/actions/upload.php");
register_action("tidypics/addalbum", false, $CONFIG->pluginspath. "tidypics/actions/addalbum.php");
register_action("tidypics/edit", false, $CONFIG->pluginspath. "tidypics/actions/edit.php");
diff --git a/views/default/tidypics/forms/admin.php b/views/default/tidypics/forms/admin.php
index 8006cc69f..7e1c2bf53 100644
--- a/views/default/tidypics/forms/admin.php
+++ b/views/default/tidypics/forms/admin.php
@@ -9,7 +9,7 @@
// 3. clean up and organize
- $action = $vars['url'];// . "action/";
+ $action = $vars['url'] . 'action/tidypics/settings';
$plugin = find_plugin_settings('tidypics');
@@ -37,11 +37,11 @@
// Watermark Text
$form_body .= "<p>" . elgg_echo('tidypics:settings:watermark') . "<br />";
- $form_body .= elgg_view("input/text",array('internalname' => 'watermark_text', 'value' => $plugin->$watermark_text)) . "</p>";
+ $form_body .= elgg_view("input/text",array('internalname' => 'params[watermark_text]', 'value' => $plugin->$watermark_text)) . "</p>";
// Max Image Size
$form_body .= "<p>" . elgg_echo('tidypics:settings:img_size') . "<br />";
- $form_body .= elgg_view("input/text",array('internalname' => 'maxfilesize', 'value' => $plugin->$maxfilesize)) . "</p>";
+ $form_body .= elgg_view("input/text",array('internalname' => 'params[maxfilesize]', 'value' => $plugin->$maxfilesize)) . "</p>";
// Thumbnail sizes