ajax_loader.php 607 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * Elgg AJAX loader
  4. *
  5. * @package Elgg
  6. * @subpackage Core
  7. *
  8. * @uses $vars['id'] CSS id
  9. * @uses $vars['class'] Optional additional CSS class
  10. * @uses $vars['hidden'] Begin hidden? (true)
  11. */
  12. $attributes = array();
  13. if (isset($vars['id'])) {
  14. $attributes['id'] = $vars['id'];
  15. }
  16. $class = 'elgg-ajax-loader';
  17. if (isset($vars['class'])) {
  18. $class = "$class {$vars['class']}";
  19. }
  20. if (elgg_extract('hidden', $vars, true)) {
  21. $class = "$class hidden";
  22. }
  23. $attributes['class'] = $class;
  24. $attrs = elgg_format_attributes($attributes);
  25. $loader = <<< END
  26. <div $attrs></div>
  27. END;
  28. echo $loader;