diff options
Diffstat (limited to 'views/default/forms/plugins')
-rw-r--r-- | views/default/forms/plugins/settings/save.php | 31 | ||||
-rw-r--r-- | views/default/forms/plugins/usersettings/save.php | 14 |
2 files changed, 45 insertions, 0 deletions
diff --git a/views/default/forms/plugins/settings/save.php b/views/default/forms/plugins/settings/save.php new file mode 100644 index 000000000..dc7b2fef7 --- /dev/null +++ b/views/default/forms/plugins/settings/save.php @@ -0,0 +1,31 @@ +<?php +/** + * Used to show plugin settings for both users and admins. + * + * @package Elgg.Core + * @subpackage Plugins + */ + +$plugin = $vars['entity']; +$plugin_id = $plugin->getID(); +$user_guid = elgg_extract('user_guid', $vars, elgg_get_logged_in_user_guid()); + +// Do we want to show admin settings or user settings +$type = elgg_extract('type', $vars, ''); + +if ($type != 'user') { + $type = ''; +} + +if (elgg_view_exists("{$type}settings/$plugin_id/edit")) { + elgg_deprecated_notice("{$type}settings/$plugin_id/edit was deprecated in favor of plugins/$plugin_id/{$type}settings", 1.8); + echo elgg_view("{$type}settings/$plugin_id/edit", $vars); +} else { + echo elgg_view("plugins/$plugin_id/{$type}settings", $vars); +} + +echo '<div class="elgg-foot">'; +echo elgg_view('input/hidden', array('name' => 'plugin_id', 'value' => $plugin_id)); +echo elgg_view('input/hidden', array('name' => 'user_guid', 'value' => $user_guid)); +echo elgg_view('input/submit', array('value' => elgg_echo('save'))); +echo '</div>'; diff --git a/views/default/forms/plugins/usersettings/save.php b/views/default/forms/plugins/usersettings/save.php new file mode 100644 index 000000000..ced88f818 --- /dev/null +++ b/views/default/forms/plugins/usersettings/save.php @@ -0,0 +1,14 @@ +<?php +/** + * Plugin user settings + * + * Calls the plugin admin settings form body with type set to 'user' + * + * @package Elgg.Core + * @subpackage Plugins + */ + +$vars['type'] = 'user'; + +// Can't use elgg_view_form() because it overrides the $vars['action'] parameter +echo elgg_view('forms/plugins/settings/save', $vars);
\ No newline at end of file |