From 6f41511034886224e0888d2f886c7d7ccc48636d Mon Sep 17 00:00:00 2001 From: brettp Date: Wed, 9 Feb 2011 21:44:12 +0000 Subject: 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 --- views/default/admin/components/plugin_settings.php | 35 ++++++++++++---------- views/default/core/settings/tools.php | 6 ++-- views/default/core/settings/tools/plugin.php | 14 +++++---- views/default/object/plugin.php | 27 ++++++++++++----- 4 files changed, 51 insertions(+), 31 deletions(-) (limited to 'views') diff --git a/views/default/admin/components/plugin_settings.php b/views/default/admin/components/plugin_settings.php index d5e25b4c1..8179728ed 100644 --- a/views/default/admin/components/plugin_settings.php +++ b/views/default/admin/components/plugin_settings.php @@ -2,30 +2,33 @@ /** * Elgg plugin settings * - * @package Elgg - * @subpackage Core + * @uses ElggPlugin $vars['plugin'] The plugin object to display settings for. + * + * @package Elgg.Core + * @subpackage Plugins.Settings */ $plugin = $vars['plugin']; -$plugin_info = load_plugin_manifest($plugin); - -$form_body = elgg_view("settings/{$plugin}/edit", $vars); -$form_body .= elgg_view('input/hidden', array('internalname' => 'plugin', 'value' => $plugin)); -$form_body .= elgg_view('input/submit', array('value' => elgg_echo('save'))); -//$form_body .= elgg_view('input/reset', array('value' => elgg_echo('reset'))); +$plugin_id = $plugin->getID(); +if (elgg_view("settings/$plugin_id/edit")) { ?> -
+ +
-

+

manifest->getName(); ?>

- $form_body, - 'internalid' => 'plugin_settings', - 'action' => "action/plugins/settings/save", +
+ $plugin, + // in for backward compatibility + 'entity' => $plugin, + 'type' => 'admin' )); - ?> + ?> +
+getID(); -$user_guid = $details['user_guid']; +$user_guid = $vars['user_guid']; + if (!$user_guid) { $user_guid = elgg_get_logged_in_user_guid(); } if (elgg_view("usersettings/$plugin_id/edit")) { ?> +

manifest->getName(); ?>

-
+
$plugin, 'entity' => find_plugin_usersettings($plugin_id, $user_guid), - 'prefix' => 'user' + 'type' => 'user' )); ?>
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 @@ 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) - . "

" . 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) + . "

" . 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'))) . "

"; ?>
- $form_body, 'action' => "action/plugins/{$prefix}settings/save")); ?> + $form_body, 'action' => $action)); ?>
\ No newline at end of file -- cgit v1.2.3