settings.php 646 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /**
  3. * Elgg widget edit settings
  4. *
  5. * @uses $vars['widget']
  6. */
  7. $widget = elgg_extract('widget', $vars);
  8. // not using elgg_view_form() so that we can detect if the form is empty
  9. $form_body = elgg_view('forms/widgets/save', $vars);
  10. if (!$form_body) {
  11. return true;
  12. }
  13. $additional_class = preg_replace('/[^a-z0-9-]/i', '-', "elgg-form-widgets-save-{$widget->handler}");
  14. $form = elgg_view('input/form', array(
  15. 'action' => 'action/widgets/save',
  16. 'body' => $form_body,
  17. 'class' => "elgg-form-widgets-save $additional_class",
  18. ));
  19. ?>
  20. <div class="elgg-widget-edit" id="widget-edit-<?php echo $widget->guid; ?>">
  21. <?php echo $form; ?>
  22. </div>