save.php 850 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * Elgg widget edit settings
  4. *
  5. * @uses $vars['widget']
  6. * @uses $vars['show_access']
  7. */
  8. $widget = $vars['widget'];
  9. $show_access = elgg_extract('show_access', $vars, true);
  10. $edit_view = "widgets/$widget->handler/edit";
  11. $custom_form_section = elgg_view($edit_view, array('entity' => $widget));
  12. $access = '';
  13. if ($show_access) {
  14. $access = elgg_echo('access') . ': ' . elgg_view('input/access', array(
  15. 'name' => 'params[access_id]',
  16. 'value' => $widget->access_id,
  17. ));
  18. }
  19. if (!$custom_form_section && !$access) {
  20. return true;
  21. }
  22. $hidden = elgg_view('input/hidden', array('name' => 'guid', 'value' => $widget->guid));
  23. $submit = elgg_view('input/submit', array('value' => elgg_echo('save')));
  24. $body = <<<___END
  25. $custom_form_section
  26. <div>
  27. $access
  28. </div>
  29. <div class="elgg-foot">
  30. $hidden
  31. $submit
  32. </div>
  33. ___END;
  34. echo $body;