basic_upload.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * Basic uploader form
  4. *
  5. * This only handled uploading the images. Editing the titles and descriptions
  6. * are handled with the edit forms.
  7. *
  8. * @uses $vars['entity']
  9. *
  10. * @author Cash Costello
  11. * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2
  12. */
  13. $album = $vars['entity'];
  14. $maxfilesize = (float) elgg_get_plugin_setting('maxfilesize', 'tidypics');
  15. $instructions = elgg_echo("tidypics:uploader:upload");
  16. $max = elgg_echo('tidypics:uploader:basic', array($maxfilesize));
  17. $list = '';
  18. for ($x = 0; $x < 6; $x++) { // reduce input file buttons
  19. $list .= '<li>' . elgg_view('input/file', array('name' => 'images[]')) . '</li>';
  20. }
  21. $foot = elgg_view('input/hidden', array('name' => 'guid', 'value' => $album->getGUID()));
  22. $foot .= elgg_view('input/submit', array('value' => elgg_echo("photos:addphotos")));
  23. $form_body = <<<HTML
  24. <div>
  25. $max
  26. </div>
  27. <div>
  28. <ol>
  29. $list
  30. </ol>
  31. </div>
  32. <div class='elgg-foot'>
  33. $foot
  34. </div>
  35. HTML;
  36. echo elgg_view('input/form', array(
  37. 'body' => $form_body,
  38. 'action' => 'action/photos/image/upload',
  39. 'enctype' => 'multipart/form-data',
  40. ));