file.php 520 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /**
  3. * Elgg file input
  4. * Displays a file input field
  5. *
  6. * @package Elgg
  7. * @subpackage Core
  8. *
  9. * @uses $vars['value'] The current value if any
  10. * @uses $vars['class'] Additional CSS class
  11. */
  12. if (!empty($vars['value'])) {
  13. echo elgg_echo('fileexists') . "<br />";
  14. }
  15. $vars['class'] = (array) elgg_extract('class', $vars, []);
  16. $vars['class'][] = 'elgg-input-file';
  17. $defaults = array(
  18. 'disabled' => false,
  19. 'type' => 'file'
  20. );
  21. $vars = array_merge($defaults, $vars);
  22. echo elgg_format_element('input', $vars);