aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-20 17:14:46 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-20 17:14:46 +0000
commit20b30e0bc0731b440feae8287f37365ce6050bf0 (patch)
tree8e885b99cdcbdeaa9d47beb9374e27e77d5fcf16 /engine/lib
parent3bc3e27d1280383c4e92b0cc4d419521c9ce9e96 (diff)
downloadelgg-20b30e0bc0731b440feae8287f37365ce6050bf0.tar.gz
elgg-20b30e0bc0731b440feae8287f37365ce6050bf0.tar.bz2
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
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/plugins.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/engine/lib/plugins.php b/engine/lib/plugins.php
index a91006e1b..51488434c 100644
--- a/engine/lib/plugins.php
+++ b/engine/lib/plugins.php
@@ -163,7 +163,7 @@
if ($plugins)
{
- foreach ($plugins as $plugins)
+ foreach ($plugins as $plugin)
if (strcmp($plugin->title, $plugin_name)==0)
return $plugin;
}
@@ -182,14 +182,16 @@
{
$plugin = find_plugin_settings($plugin_name);
- if (!$plugin)
+ if (!$plugin)
$plugin = new ElggPlugin();
if ($name!='title')
{
+ $plugin->title = $plugin_name;
$plugin->$name = $value;
-
$plugin->save();
+
+ return $plugin->getGUID();
}
return false;
@@ -390,6 +392,9 @@
{
// Now run this stuff, but only once
run_function_once("plugin_run_once");
+
+ // Register some actions
+ register_action("plugins/settings/save", false, "", true);
}
// Register a startup event