PageRenderTime 25ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/prestashop/_/cache/smarty/compile/00/63/0a/00630ab01a40d7318a4f29fb0352ba887f780efb.file.simple.tpl.php

https://gitlab.com/A.Julien/sendstockbymail-module-prestashop
PHP | 192 lines | 181 code | 11 blank | 0 comment | 26 complexity | 8745c685320737b47205eb6dd01d74fd MD5 | raw file
  1. <?php /* Smarty version Smarty-3.1.19, created on 2016-08-29 22:37:15
  2. compiled from "C:\xampp\htdocs\prestashop\prestashop\_\admin2200io4fc\themes\default\template\helpers\uploader\simple.tpl" */ ?>
  3. <?php /*%%SmartyHeaderCode:331557c49cfb62f190-90894006%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
  4. $_valid = $_smarty_tpl->decodeProperties(array (
  5. 'file_dependency' =>
  6. array (
  7. '00630ab01a40d7318a4f29fb0352ba887f780efb' =>
  8. array (
  9. 0 => 'C:\\xampp\\htdocs\\prestashop\\prestashop\\_\\admin2200io4fc\\themes\\default\\template\\helpers\\uploader\\simple.tpl',
  10. 1 => 1472500734,
  11. 2 => 'file',
  12. ),
  13. ),
  14. 'nocache_hash' => '331557c49cfb62f190-90894006',
  15. 'function' =>
  16. array (
  17. ),
  18. 'variables' =>
  19. array (
  20. 'files' => 0,
  21. 'file' => 0,
  22. 'show_thumbnail' => 0,
  23. 'id' => 0,
  24. 'max_files' => 0,
  25. 'name' => 0,
  26. 'multiple' => 0,
  27. 'size' => 0,
  28. ),
  29. 'has_nocache_code' => false,
  30. 'version' => 'Smarty-3.1.19',
  31. 'unifunc' => 'content_57c49cfb8f4a24_95381011',
  32. ),false); /*/%%SmartyHeaderCode%%*/?>
  33. <?php if ($_valid && !is_callable('content_57c49cfb8f4a24_95381011')) {function content_57c49cfb8f4a24_95381011($_smarty_tpl) {?>
  34. <?php if (isset($_smarty_tpl->tpl_vars['files']->value)&&count($_smarty_tpl->tpl_vars['files']->value)>0) {?>
  35. <?php $_smarty_tpl->tpl_vars['show_thumbnail'] = new Smarty_variable(false, null, 0);?>
  36. <?php $_smarty_tpl->tpl_vars['file'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['file']->_loop = false;
  37. $_from = $_smarty_tpl->tpl_vars['files']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
  38. foreach ($_from as $_smarty_tpl->tpl_vars['file']->key => $_smarty_tpl->tpl_vars['file']->value) {
  39. $_smarty_tpl->tpl_vars['file']->_loop = true;
  40. ?>
  41. <?php if (isset($_smarty_tpl->tpl_vars['file']->value['image'])&&$_smarty_tpl->tpl_vars['file']->value['type']=='image') {?>
  42. <?php $_smarty_tpl->tpl_vars['show_thumbnail'] = new Smarty_variable(true, null, 0);?>
  43. <?php }?>
  44. <?php } ?>
  45. <?php if ($_smarty_tpl->tpl_vars['show_thumbnail']->value) {?>
  46. <div class="form-group">
  47. <div class="col-lg-12" id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  48. -images-thumbnails">
  49. <?php $_smarty_tpl->tpl_vars['file'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['file']->_loop = false;
  50. $_from = $_smarty_tpl->tpl_vars['files']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
  51. foreach ($_from as $_smarty_tpl->tpl_vars['file']->key => $_smarty_tpl->tpl_vars['file']->value) {
  52. $_smarty_tpl->tpl_vars['file']->_loop = true;
  53. ?>
  54. <?php if (isset($_smarty_tpl->tpl_vars['file']->value['image'])&&$_smarty_tpl->tpl_vars['file']->value['type']=='image') {?>
  55. <div>
  56. <?php echo $_smarty_tpl->tpl_vars['file']->value['image'];?>
  57. <?php if (isset($_smarty_tpl->tpl_vars['file']->value['size'])) {?><p><?php echo smartyTranslate(array('s'=>'File size'),$_smarty_tpl);?>
  58. <?php echo $_smarty_tpl->tpl_vars['file']->value['size'];?>
  59. kb</p><?php }?>
  60. <?php if (isset($_smarty_tpl->tpl_vars['file']->value['delete_url'])) {?>
  61. <p>
  62. <a class="btn btn-default" href="<?php echo $_smarty_tpl->tpl_vars['file']->value['delete_url'];?>
  63. ">
  64. <i class="icon-trash"></i> <?php echo smartyTranslate(array('s'=>'Delete'),$_smarty_tpl);?>
  65. </a>
  66. </p>
  67. <?php }?>
  68. </div>
  69. <?php }?>
  70. <?php } ?>
  71. </div>
  72. </div>
  73. <?php }?>
  74. <?php }?>
  75. <?php if (isset($_smarty_tpl->tpl_vars['max_files']->value)&&count($_smarty_tpl->tpl_vars['files']->value)>=$_smarty_tpl->tpl_vars['max_files']->value) {?>
  76. <div class="row">
  77. <div class="alert alert-warning"><?php echo smartyTranslate(array('s'=>'You have reached the limit (%s) of files to upload, please remove files to continue uploading','sprintf'=>$_smarty_tpl->tpl_vars['max_files']->value),$_smarty_tpl);?>
  78. </div>
  79. </div>
  80. <?php } else { ?>
  81. <div class="form-group">
  82. <div class="col-sm-6">
  83. <input id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  84. " type="file" name="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['name']->value, ENT_QUOTES, 'UTF-8', true);?>
  85. <?php if (isset($_smarty_tpl->tpl_vars['multiple']->value)&&$_smarty_tpl->tpl_vars['multiple']->value) {?>[]<?php }?>"<?php if (isset($_smarty_tpl->tpl_vars['multiple']->value)&&$_smarty_tpl->tpl_vars['multiple']->value) {?> multiple="multiple"<?php }?> class="hide" />
  86. <div class="dummyfile input-group">
  87. <span class="input-group-addon"><i class="icon-file"></i></span>
  88. <input id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  89. -name" type="text" name="filename" readonly />
  90. <span class="input-group-btn">
  91. <button id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  92. -selectbutton" type="button" name="submitAddAttachments" class="btn btn-default">
  93. <i class="icon-folder-open"></i> <?php if (isset($_smarty_tpl->tpl_vars['multiple']->value)&&$_smarty_tpl->tpl_vars['multiple']->value) {?><?php echo smartyTranslate(array('s'=>'Add files'),$_smarty_tpl);?>
  94. <?php } else { ?><?php echo smartyTranslate(array('s'=>'Add file'),$_smarty_tpl);?>
  95. <?php }?>
  96. </button>
  97. <?php if ((!isset($_smarty_tpl->tpl_vars['multiple']->value)||!$_smarty_tpl->tpl_vars['multiple']->value)&&isset($_smarty_tpl->tpl_vars['files']->value)&&count($_smarty_tpl->tpl_vars['files']->value)==1&&isset($_smarty_tpl->tpl_vars['files']->value[0]['download_url'])) {?>
  98. <a href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['files']->value[0]['download_url'], ENT_QUOTES, 'UTF-8', true);?>
  99. " class="btn btn-default">
  100. <i class="icon-cloud-download"></i>
  101. <?php if (isset($_smarty_tpl->tpl_vars['size']->value)) {?><?php echo smartyTranslate(array('s'=>'Download current file (%skb)','sprintf'=>$_smarty_tpl->tpl_vars['size']->value),$_smarty_tpl);?>
  102. <?php } else { ?><?php echo smartyTranslate(array('s'=>'Download current file'),$_smarty_tpl);?>
  103. <?php }?>
  104. </a>
  105. <?php }?>
  106. </span>
  107. </div>
  108. </div>
  109. </div>
  110. <script type="text/javascript">
  111. <?php if (isset($_smarty_tpl->tpl_vars['multiple']->value)&&isset($_smarty_tpl->tpl_vars['max_files']->value)) {?>
  112. var <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  113. _max_files = <?php echo $_smarty_tpl->tpl_vars['max_files']->value-count($_smarty_tpl->tpl_vars['files']->value);?>
  114. ;
  115. <?php }?>
  116. $(document).ready(function(){
  117. $('#<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  118. -selectbutton').click(function(e) {
  119. $('#<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  120. ').trigger('click');
  121. });
  122. $('#<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  123. -name').click(function(e) {
  124. $('#<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  125. ').trigger('click');
  126. });
  127. $('#<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  128. -name').on('dragenter', function(e) {
  129. e.stopPropagation();
  130. e.preventDefault();
  131. });
  132. $('#<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  133. -name').on('dragover', function(e) {
  134. e.stopPropagation();
  135. e.preventDefault();
  136. });
  137. $('#<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  138. -name').on('drop', function(e) {
  139. e.preventDefault();
  140. var files = e.originalEvent.dataTransfer.files;
  141. $('#<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  142. ')[0].files = files;
  143. $(this).val(files[0].name);
  144. });
  145. $('#<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  146. ').change(function(e) {
  147. if ($(this)[0].files !== undefined)
  148. {
  149. var files = $(this)[0].files;
  150. var name = '';
  151. $.each(files, function(index, value) {
  152. name += value.name+', ';
  153. });
  154. $('#<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  155. -name').val(name.slice(0, -2));
  156. }
  157. else // Internet Explorer 9 Compatibility
  158. {
  159. var name = $(this).val().split(/[\\/]/);
  160. $('#<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  161. -name').val(name[name.length-1]);
  162. }
  163. });
  164. if (typeof <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  165. _max_files !== 'undefined')
  166. {
  167. $('#<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  168. ').closest('form').on('submit', function(e) {
  169. if ($('#<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  170. ')[0].files.length > <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  171. _max_files) {
  172. e.preventDefault();
  173. alert('<?php echo smartyTranslate(array('s'=>sprintf('You can upload a maximum of %s files',$_smarty_tpl->tpl_vars['max_files']->value)),$_smarty_tpl);?>
  174. ');
  175. }
  176. });
  177. }
  178. });
  179. </script>
  180. <?php }?>
  181. <?php }} ?>