aboutsummaryrefslogtreecommitdiff
path: root/views/default/object/plugin.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-09 21:44:12 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-09 21:44:12 +0000
commit6f41511034886224e0888d2f886c7d7ccc48636d (patch)
treec7cdb8a103ce8202fa4568da5c91377d2dea418e /views/default/object/plugin.php
parent3da61eb88485680eb9480c24d56b05d08c218f1b (diff)
downloadelgg-6f41511034886224e0888d2f886c7d7ccc48636d.tar.gz
elgg-6f41511034886224e0888d2f886c7d7ccc48636d.tar.bz2
Refs #2874: More removal of deprecated function user in plugins systems.
git-svn-id: http://code.elgg.org/elgg/trunk@8089 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/object/plugin.php')
-rw-r--r--views/default/object/plugin.php27
1 files changed, 19 insertions, 8 deletions
diff --git a/views/default/object/plugin.php b/views/default/object/plugin.php
index 054931a38..b3bb6eb93 100644
--- a/views/default/object/plugin.php
+++ b/views/default/object/plugin.php
@@ -1,21 +1,32 @@
<?php
/**
- * Elgg plugin
+ * Used to show plugin user settings.
*
- * @package Elgg
- * @subpackage Core
+ * @package Elgg.Core
+ * @subpackage Plugins
*/
-$entity = $vars['entity'];
$plugin = $vars['plugin'];
$plugin_id = $plugin->getID();
-$prefix = $vars['prefix']; // Do we want to show admin settings (default) or user settings
+$user_guid = elgg_get_array_value('user_guid', $vars, elgg_get_logged_in_user_guid());
-$form_body = elgg_view("{$prefix}settings/{$plugin_id}/edit", $vars)
- . "<p>" . elgg_view('input/hidden', array('internalname' => 'plugin', 'value' => $plugin_id))
+// Do we want to show admin settings or user settings
+$type = elgg_get_array_value('type', $vars, '');
+
+if ($type == 'user') {
+ $view = "{$type}settings/{$plugin_id}/edit";
+ $action = "action/plugins/usersettings/save";
+} else {
+ $view = "settings/{$plugin_id}/edit";
+ $action = "action/plugins/settings/save";
+}
+
+$form_body = elgg_view($view, $vars)
+ . "<p>" . elgg_view('input/hidden', array('internalname' => 'plugin_id', 'value' => $plugin_id))
+ . elgg_view('input/hidden', array('internalname' => 'user_guid', 'value' => $user_guid))
. elgg_view('input/submit', array('value' => elgg_echo('save'))) . "</p>";
?>
<div>
- <?php echo elgg_view('input/form', array('body' => $form_body, 'action' => "action/plugins/{$prefix}settings/save")); ?>
+ <?php echo elgg_view('input/form', array('body' => $form_body, 'action' => $action)); ?>
</div> \ No newline at end of file