longtext.php 816 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * Elgg display long text
  4. * Displays a large amount of text, with new lines converted to line breaks
  5. *
  6. * @package Elgg
  7. * @subpackage Core
  8. *
  9. * @uses $vars['value'] The text to display
  10. * @uses $vars['parse_urls'] Whether to turn urls into links. Default is true.
  11. * @uses $vars['class']
  12. */
  13. $class = 'elgg-output';
  14. $additional_class = elgg_extract('class', $vars, '');
  15. if ($additional_class) {
  16. $vars['class'] = "$class $additional_class";
  17. } else {
  18. $vars['class'] = $class;
  19. }
  20. $parse_urls = elgg_extract('parse_urls', $vars, true);
  21. unset($vars['parse_urls']);
  22. $text = $vars['value'];
  23. unset($vars['value']);
  24. if ($parse_urls) {
  25. $text = parse_urls($text);
  26. }
  27. $text = filter_tags($text);
  28. $text = elgg_autop($text);
  29. $attributes = elgg_format_attributes($vars);
  30. echo "<div $attributes>$text</div>";