aboutsummaryrefslogtreecommitdiff
path: root/views/default
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 /views/default
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 'views/default')
-rw-r--r--views/default/admin/plugins_opt/plugin.php4
-rw-r--r--views/default/object/plugin.php22
2 files changed, 23 insertions, 3 deletions
diff --git a/views/default/admin/plugins_opt/plugin.php b/views/default/admin/plugins_opt/plugin.php
index ef8dd36f0..6e20ac9a0 100644
--- a/views/default/admin/plugins_opt/plugin.php
+++ b/views/default/admin/plugins_opt/plugin.php
@@ -31,9 +31,9 @@
<div><?php echo elgg_echo('admin:plugins:label:website') . ": "; ?><a href="<?php echo $manifest['website']; ?>"><?php echo $manifest['website']; ?></a></div>
<?php } ?>
- <?php if ($plugin_object = find_plugin_settings($plugin)) { ?>
+ <?php if (elgg_view("settings/{$plugin}/edit")) { ?>
<div id="<?php echo $plugin; ?>_settings">
- <?php echo elgg_view("object/plugin", array('plugin_object' => $plugin_object)) ?>
+ <?php echo elgg_view("object/plugin", array('plugin' => $plugin, 'entity' => find_plugin_settings($plugin))) ?>
</div>
<?php } ?>
diff --git a/views/default/object/plugin.php b/views/default/object/plugin.php
index 552d42192..edaf1f0db 100644
--- a/views/default/object/plugin.php
+++ b/views/default/object/plugin.php
@@ -9,5 +9,25 @@
* @copyright Curverider Ltd 2008
* @link http://elgg.org/
*/
+
+ $entity = $vars['entity'];
+ $plugin = $vars['plugin'];
+
?>
-// render a plugin & settings \ No newline at end of file
+<div>
+ <form action="<?php echo $vars['url']; ?>action/plugins/settings/save" method="post">
+
+ <?php
+ echo elgg_view("settings/{$plugin}/edit",$vars);
+ ?>
+
+ <p>
+ <input type="hidden" name="plugin" value="<?php echo $plugin ?>" />
+ <input type="submit" value="<?php
+
+ echo elgg_echo('save');
+
+ ?>" />
+ </p>
+ </form>
+</div> \ No newline at end of file