SproutCMS

This is the code documentation for the SproutCMS project

source of /sprout/views/file_confirm.php

  1. <?php
  2. /*
  3.  * kate: tab-width 4; indent-width 4; space-indent on; word-wrap off; word-wrap-column 120;
  4.  * :tabSize=4:indentSize=4:noTabs=true:wrap=false:maxLineLen=120:mode=php:
  5.  *
  6.  * Copyright (C) 2015 Karmabunny Pty Ltd.
  7.  *
  8.  * This file is a part of SproutCMS.
  9.  *
  10.  * SproutCMS is free software: you can redistribute it and/or modify it under the terms
  11.  * of the GNU General Public License as published by the Free Software Foundation, either
  12.  * version 3 of the License, or (at your option) any later version.
  13.  *
  14.  * For more information, visit <http://getsproutcms.com>.
  15.  */
  16. use Sprout\Helpers\Enc;
  17. use Sprout\Helpers\File;
  18.  
  19.  
  20. ?>
  21.  
  22. <?php if (!empty($image_too_large)): ?>
  23.  
  24. <div class="file-upload__item__feedback__response file-upload__item__feedback__response--error">
  25. <p class="file-upload__item__feedback__error__text">This image is too large</p>
  26. </div>
  27.  
  28. <?php return; ?>
  29. <?php elseif (!empty($error)): ?>
  30.  
  31. <div class="file-upload__item__feedback__response file-upload__item__feedback__response--error">
  32. <p class="file-upload__item__feedback__error__text"><?= Enc::html($error); ?></p>
  33. </div>
  34.  
  35. <?php return; ?>
  36. <?php endif; ?>
  37.  
  38.  
  39. <?php if (!empty($shrunk_img)): ?>
  40.  
  41. <div class="file-upload__item__feedback__response file-upload__item__feedback__response--success file-upload__item__feedback__response--success--image">
  42. <div style="background-image: url(data:image/png;base64,<?= Enc::html($shrunk_img['encoded_thumbnail']); ?>)" class="file-upload__item__feedback__image"></div>
  43.  
  44. <div class="file-upload__item__feedback__hover">
  45. <p class="file-upload__item__feedback__hover__name"><?php echo Enc::html($orig_file['name']); ?></p>
  46. <p class="file-upload__item__feedback__hover__size"><?php echo Enc::html(File::humanSize($orig_file['size'])); ?></p>
  47. <p class="file-upload__item__feedback__hover__dimensions"><?= Enc::html($shrunk_img['original_height']); ?> &times; <?= Enc::html($shrunk_img['original_width']); ?></p>
  48. </div>
  49. </div>
  50.  
  51. <?php else : ?>
  52.  
  53. <div class="file-upload__item__feedback__response file-upload__item__feedback__response--success file-upload__item__feedback__response--success--not-image">
  54.  
  55. <p class="file-upload__item__feedback__name"><?php echo Enc::html($orig_file['name']); ?></p>
  56. <p class="file-upload__item__feedback__size"><?php echo Enc::html(File::humanSize($orig_file['size'])); ?></p>
  57.  
  58. </div>
  59.  
  60. <?php endif; ?>
  61.  
  62.  
  63.  
  64.  
  65.