From bbc0e0206b9c93a16b84cb68271d10eadef13e25 Mon Sep 17 00:00:00 2001 From: ewinslow Date: Thu, 10 Feb 2011 22:09:40 +0000 Subject: Plugin settings forms now use the forms/ directory git-svn-id: http://code.elgg.org/elgg/trunk@8093 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/forms/plugins/settings/save.php | 27 +++++++++++++++++++++++ views/default/forms/plugins/usersettings/save.php | 4 ++++ views/default/object/plugin.php | 22 +++++------------- 3 files changed, 37 insertions(+), 16 deletions(-) create mode 100644 views/default/forms/plugins/settings/save.php create mode 100644 views/default/forms/plugins/usersettings/save.php (limited to 'views') diff --git a/views/default/forms/plugins/settings/save.php b/views/default/forms/plugins/settings/save.php new file mode 100644 index 000000000..b2d818e87 --- /dev/null +++ b/views/default/forms/plugins/settings/save.php @@ -0,0 +1,27 @@ +getID(); +$user_guid = elgg_get_array_value('user_guid', $vars, elgg_get_logged_in_user_guid()); + +// Do we want to show admin settings or user settings +$type = elgg_get_array_value('type', $vars, ''); + +if ($type != 'user') { + $type = ''; +} + +echo elgg_view("{$type}settings/{$plugin_id}/edit", $vars); + +echo "

"; +echo elgg_view('input/hidden', array('internalname' => 'plugin_id', 'value' => $plugin_id)); +echo elgg_view('input/hidden', array('internalname' => 'user_guid', 'value' => $user_guid)); +echo elgg_view('input/submit', array('value' => elgg_echo('save'))); +echo "

"; + diff --git a/views/default/forms/plugins/usersettings/save.php b/views/default/forms/plugins/usersettings/save.php new file mode 100644 index 000000000..8532cdfd1 --- /dev/null +++ b/views/default/forms/plugins/usersettings/save.php @@ -0,0 +1,4 @@ +getID(); -$user_guid = elgg_get_array_value('user_guid', $vars, elgg_get_logged_in_user_guid()); - // 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"; +if ($type != 'user') { + $type = ''; } -$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)); ?> +
\ No newline at end of file -- cgit v1.2.3