PageRenderTime 27ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/prestashop/_/cache/smarty/compile/fa/19/aa/fa19aa05df5f920e458c9f88a596a2173a4715d9.file.virtual_product.tpl.php

https://gitlab.com/A.Julien/sendstockbymail-module-prestashop
PHP | 193 lines | 183 code | 10 blank | 0 comment | 25 complexity | 81ee3951c887380ee32698e102ce6cfb MD5 | raw file
  1. <?php /* Smarty version Smarty-3.1.19, created on 2016-08-29 22:36:15
  2. compiled from "C:\xampp\htdocs\prestashop\prestashop\_\admin2200io4fc\themes\default\template\controllers\products\helpers\uploader\virtual_product.tpl" */ ?>
  3. <?php /*%%SmartyHeaderCode:220457c49cbf8e18f1-35113460%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
  4. $_valid = $_smarty_tpl->decodeProperties(array (
  5. 'file_dependency' =>
  6. array (
  7. 'fa19aa05df5f920e458c9f88a596a2173a4715d9' =>
  8. array (
  9. 0 => 'C:\\xampp\\htdocs\\prestashop\\prestashop\\_\\admin2200io4fc\\themes\\default\\template\\controllers\\products\\helpers\\uploader\\virtual_product.tpl',
  10. 1 => 1472500726,
  11. 2 => 'file',
  12. ),
  13. ),
  14. 'nocache_hash' => '220457c49cbf8e18f1-35113460',
  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_57c49cc0de71c2_14680836',
  32. ),false); /*/%%SmartyHeaderCode%%*/?>
  33. <?php if ($_valid && !is_callable('content_57c49cc0de71c2_14680836')) {function content_57c49cc0de71c2_14680836($_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 class="img-thumbnail text-center">
  56. <p><?php echo $_smarty_tpl->tpl_vars['file']->value['image'];?>
  57. </p>
  58. <?php if (isset($_smarty_tpl->tpl_vars['file']->value['size'])) {?><p><?php echo smartyTranslate(array('s'=>'File size'),$_smarty_tpl);?>
  59. <?php echo $_smarty_tpl->tpl_vars['file']->value['size'];?>
  60. kb</p><?php }?>
  61. <?php if (isset($_smarty_tpl->tpl_vars['file']->value['delete_url'])) {?>
  62. <p>
  63. <a class="btn btn-default" href="<?php echo $_smarty_tpl->tpl_vars['file']->value['delete_url'];?>
  64. ">
  65. <i class="icon-trash"></i> <?php echo smartyTranslate(array('s'=>'Delete'),$_smarty_tpl);?>
  66. </a>
  67. </p>
  68. <?php }?>
  69. </div>
  70. <?php }?>
  71. <?php } ?>
  72. </div>
  73. </div>
  74. <?php }?>
  75. <?php }?>
  76. <?php if (isset($_smarty_tpl->tpl_vars['max_files']->value)&&count($_smarty_tpl->tpl_vars['files']->value)>=$_smarty_tpl->tpl_vars['max_files']->value) {?>
  77. <div class="row">
  78. <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);?>
  79. </div>
  80. </div>
  81. <?php } else { ?>
  82. <div class="form-group">
  83. <div class="col-lg-12">
  84. <input id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  85. " type="file" name="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['name']->value, ENT_QUOTES, 'UTF-8', true);?>
  86. "<?php if (isset($_smarty_tpl->tpl_vars['multiple']->value)&&$_smarty_tpl->tpl_vars['multiple']->value) {?> multiple="multiple"<?php }?> class="hide"/>
  87. <div class="dummyfile input-group">
  88. <span class="input-group-addon"><i class="icon-file"></i></span>
  89. <input id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  90. -name" type="text" name="filename" readonly />
  91. <span class="input-group-btn">
  92. <button id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  93. -selectbutton" type="button" name="submitAddAttachments" class="btn btn-default">
  94. <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);?>
  95. <?php } else { ?><?php echo smartyTranslate(array('s'=>'Add file'),$_smarty_tpl);?>
  96. <?php }?>
  97. </button>
  98. <?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'])) {?>
  99. <a href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['files']->value[0]['download_url'], ENT_QUOTES, 'UTF-8', true);?>
  100. " class="btn btn-default">
  101. <i class="icon-cloud-download"></i>
  102. <?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);?>
  103. <?php } else { ?><?php echo smartyTranslate(array('s'=>'Download current file'),$_smarty_tpl);?>
  104. <?php }?>
  105. </a>
  106. <?php }?>
  107. </span>
  108. </div>
  109. </div>
  110. </div>
  111. <script type="text/javascript">
  112. <?php if (isset($_smarty_tpl->tpl_vars['multiple']->value)&&isset($_smarty_tpl->tpl_vars['max_files']->value)) {?>
  113. var <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  114. _max_files = <?php echo $_smarty_tpl->tpl_vars['max_files']->value-count($_smarty_tpl->tpl_vars['files']->value);?>
  115. ;
  116. <?php }?>
  117. $(document).ready(function(){
  118. $('#<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  119. -selectbutton').click(function(e) {
  120. $('#<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  121. ').trigger('click');
  122. });
  123. $('#<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  124. -name').click(function(e) {
  125. $('#<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  126. ').trigger('click');
  127. });
  128. $('#<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  129. -name').on('dragenter', function(e) {
  130. e.stopPropagation();
  131. e.preventDefault();
  132. });
  133. $('#<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  134. -name').on('dragover', function(e) {
  135. e.stopPropagation();
  136. e.preventDefault();
  137. });
  138. $('#<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  139. -name').on('drop', function(e) {
  140. e.preventDefault();
  141. var files = e.originalEvent.dataTransfer.files;
  142. $('#<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  143. ')[0].files = files;
  144. $(this).val(files[0].name);
  145. });
  146. $('#<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  147. ').change(function(e) {
  148. if ($(this)[0].files !== undefined)
  149. {
  150. var files = $(this)[0].files;
  151. var name = '';
  152. $.each(files, function(index, value) {
  153. name += value.name+', ';
  154. });
  155. $('#<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  156. -name').val(name.slice(0, -2));
  157. $('#virtual_product_name').val(name.slice(0, -2));
  158. }
  159. else // Internet Explorer 9 Compatibility
  160. {
  161. var name = $(this).val().split(/[\\/]/);
  162. $('#<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  163. -name').val(name[name.length-1]);
  164. $('#virtual_product_name').val(name[name.length-1]);
  165. }
  166. });
  167. if (typeof <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  168. _max_files !== 'undefined')
  169. {
  170. $('#<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  171. ').closest('form').on('submit', function(e) {
  172. if ($('#<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  173. ')[0].files.length > <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?>
  174. _max_files) {
  175. e.preventDefault();
  176. alert('<?php echo smartyTranslate(array('s'=>sprintf('You can upload a maximum of %s files',$_smarty_tpl->tpl_vars['max_files']->value)),$_smarty_tpl);?>
  177. ');
  178. }
  179. });
  180. }
  181. });
  182. </script>
  183. <?php }?><?php }} ?>