plaintext.php 742 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * Elgg long text input (plaintext)
  4. * Displays a long text input field that should not be overridden by wysiwyg editors.
  5. *
  6. * @package Elgg
  7. * @subpackage Core
  8. *
  9. * @uses $vars['value'] The current value, if any
  10. * @uses $vars['name'] The name of the input field
  11. * @uses $vars['class'] Additional CSS class
  12. * @uses $vars['disabled']
  13. */
  14. $vars['class'] = (array) elgg_extract('class', $vars, []);
  15. $vars['class'][] = 'elgg-input-plaintext';
  16. $defaults = array(
  17. 'value' => '',
  18. 'rows' => '10',
  19. 'cols' => '50',
  20. 'disabled' => false,
  21. );
  22. $vars = array_merge($defaults, $vars);
  23. $value = htmlspecialchars($vars['value'], ENT_QUOTES, 'UTF-8');
  24. unset($vars['value']);
  25. echo elgg_format_element('textarea', $vars, $value);