From 20b30e0bc0731b440feae8287f37365ce6050bf0 Mon Sep 17 00:00:00 2001 From: marcus Date: Fri, 20 Jun 2008 17:14:46 +0000 Subject: Closes #66: Per site plugin settings configuration panel. Use the same technique as edit pages on widgets, i.e. 1) Create a new view in your plugins view/default called settings/PLUGINNAME/edit Where PLUGINNAME is the plugin directory, eg "river" or "profile". 2) Place your edit code in edit.php, fields should save to params[fieldname]. 3) The view will be passed $vars['entity'] which holds any configuration values already set in the metadata. Note. Settings are PER SITE. git-svn-id: https://code.elgg.org/elgg/trunk@1031 36083f99-b078-4883-b0ff-0f9b5a30f544 --- actions/plugins/settings/save.php | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 actions/plugins/settings/save.php (limited to 'actions/plugins/settings/save.php') diff --git a/actions/plugins/settings/save.php b/actions/plugins/settings/save.php new file mode 100644 index 000000000..0a8991641 --- /dev/null +++ b/actions/plugins/settings/save.php @@ -0,0 +1,36 @@ + $v) + { + // Save + $result = set_plugin_setting($k, $v, $plugin); + + // Error? + if (!$result) + { + system_message(sprintf(elgg_echo('plugins:settings:save:fail'), $plugin)); + + forward($_SERVER['HTTP_REFERER']); + + exit; + } + } + + system_message(sprintf(elgg_echo('plugins:settings:save:ok'), $plugin)); + forward($_SERVER['HTTP_REFERER']); +?> \ No newline at end of file -- cgit v1.2.3