aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2009-05-27 01:15:50 +0000
committerCash Costello <cash.costello@gmail.com>2009-05-27 01:15:50 +0000
commitfcbfde4da4a2928e960dc4851a6d44d4353a14c7 (patch)
treefdbd0b274f1b41e0eeb885f79c5adb7840730f34
parent620be743083e3c7c53d71c7686175c8ad341c7cb (diff)
downloadelgg-fcbfde4da4a2928e960dc4851a6d44d4353a14c7.tar.gz
elgg-fcbfde4da4a2928e960dc4851a6d44d4353a14c7.tar.bz2
added action framework for new settings page
-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