PageRenderTime 45ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/htdocs/core/tpl/ajaxfileupload.tpl.php

https://github.com/asterix14/dolibarr
PHP | 76 lines | 57 code | 3 blank | 16 comment | 0 complexity | ecccb9c2313d3d8acdfcbfde03c3346a MD5 | raw file
Possible License(s): LGPL-2.0
  1. <?php
  2. /* Copyright (C) 2011 Regis Houssin <regis@dolibarr.fr>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. *
  17. */
  18. ?>
  19. <!-- START TEMPLATE FILE UPLOAD -->
  20. <!-- Warning id on script is not W3C compliant and is reported as error by phpcs but it is required by jfilepload plugin -->
  21. <script id="template-upload" type="text/x-jquery-tmpl">
  22. <tr class="template-upload{{if error}} ui-state-error{{/if}}">
  23. <td class="name">${name}</td>
  24. <td class="preview"></td>
  25. <td class="size">${sizef}</td>
  26. {{if error}}
  27. <td class="error" colspan="2"><?php echo $langs->trans('Error'); ?>:
  28. {{if error === 'maxFileSize'}}<?php echo $langs->trans('FileIsTooBig'); ?>
  29. {{else error === 'minFileSize'}}File is too small
  30. {{else error === 'acceptFileTypes'}}Filetype not allowed
  31. {{else error === 'maxNumberOfFiles'}}Max number of files exceeded
  32. {{else}}${error}
  33. {{/if}}
  34. </td>
  35. {{else}}
  36. <td class="progress"><div></div></td>
  37. <td align="right" class="start"><button><?php echo $langs->trans('Start'); ?></button></td>
  38. {{/if}}
  39. <td align="right" class="cancel"><button><?php echo $langs->trans('Cancel'); ?></button></td>
  40. </tr>
  41. </script>
  42. <!-- Warning id on script is not W3C compliant and is reported as error by phpcs but it is required by jfilepload plugin -->
  43. <script id="template-download" type="text/x-jquery-tmpl">
  44. <tr class="template-download{{if error}} ui-state-error{{/if}}">
  45. {{if error}}
  46. <td></td>
  47. <td class="name">${name}</td>
  48. <td class="size">${sizef}</td>
  49. <td class="error" colspan="2"><?php echo $langs->trans('Error'); ?>:
  50. {{if error === 1}}File exceeds upload_max_filesize (php.ini directive)
  51. {{else error === 2}}File exceeds MAX_FILE_SIZE (HTML form directive)
  52. {{else error === 3}}File was only partially uploaded
  53. {{else error === 4}}No File was uploaded
  54. {{else error === 5}}Missing a temporary folder
  55. {{else error === 6}}Failed to write file to disk
  56. {{else error === 7}}File upload stopped by extension
  57. {{else error === 'maxFileSize'}}<?php echo $langs->trans('FileIsTooBig'); ?>
  58. {{else error === 'minFileSize'}}File is too small
  59. {{else error === 'acceptFileTypes'}}Filetype not allowed
  60. {{else error === 'maxNumberOfFiles'}}Max number of files exceeded
  61. {{else error === 'uploadedBytes'}}Uploaded bytes exceed file size
  62. {{else error === 'emptyResult'}}Empty file upload result
  63. {{else}}${error}
  64. {{/if}}
  65. </td>
  66. <td align="right" class="delete">
  67. <button data-type="${delete_type}" data-url="${delete_url}"><?php echo $langs->trans('Delete'); ?></button>
  68. </td>
  69. {{/if}}
  70. </tr>
  71. </script>
  72. <br>
  73. <!-- END PHP TEMPLATE -->