save.php 943 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * Used to show plugin settings for both users and admins.
  4. *
  5. * @package Elgg.Core
  6. * @subpackage Plugins
  7. */
  8. $plugin = $vars['entity'];
  9. $plugin_id = $plugin->getID();
  10. $user_guid = elgg_extract('user_guid', $vars, elgg_get_logged_in_user_guid());
  11. // Do we want to show admin settings or user settings
  12. $type = elgg_extract('type', $vars, '');
  13. if ($type != 'user') {
  14. $type = '';
  15. }
  16. if (elgg_view_exists("plugins/$plugin_id/{$type}settings")) {
  17. echo elgg_view("plugins/$plugin_id/{$type}settings", $vars);
  18. } else {
  19. echo elgg_view_deprecated("{$type}settings/$plugin_id/edit", $vars, "Use the view plugins/$plugin_id/{$type}settings", 1.8);
  20. }
  21. echo '<div class="elgg-foot">';
  22. echo elgg_view('input/hidden', array('name' => 'plugin_id', 'value' => $plugin_id));
  23. echo elgg_view('input/hidden', array('name' => 'user_guid', 'value' => $user_guid));
  24. echo elgg_view('input/submit', array('value' => elgg_echo('save')));
  25. echo '</div>';