19 if (empty($conf) || !is_object($conf)) {
20 print
"Error, template page can't be called as URL";
26 <!-- START TEMPLATE FILE UPLOAD -->
28 <!-- The file upload form used as target
for the file upload widget -->
29 <form
id=
"fileupload" action=
"<?php echo DOL_URL_ROOT; ?>/core/ajax/fileupload.php" method=
"POST" enctype=
"multipart/form-data">
30 <input
type=
"hidden" name=
"fk_element" value=
"<?php echo $object->id; ?>">
31 <input
type=
"hidden" name=
"element" value=
"<?php echo $object->element; ?>">
32 <input
type=
"hidden" name=
"redirect" value=
"<?php echo $_SERVER['PHP_SELF'].'?id='.$object->id; ?>">
33 <!-- The fileupload-buttonbar contains buttons to add/
delete files and
start/cancel the upload -->
34 <div
class=
"row fileupload-buttonbar">
36 <!-- The fileinput-button span is used to style the file input field as button -->
37 <span
class=
"btn btn-success fileinput-button">
38 <i
class=
"icon-plus icon-white"></i>
39 <span><?php echo $langs->trans(
'AddFiles'); ?></span>
42 $maxmin = $maxfilesizearray[
'maxmin'];
44 print
'<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).
'">';
47 <input
type=
"file" name=
"files[]" multiple>
49 <button
type=
"submit" class=
"btn btn-primary start">
50 <i
class=
"icon-upload icon-white"></i>
51 <span><?php echo $langs->trans(
'StartUpload'); ?></span>
53 <button
type=
"reset" class=
"btn btn-warning cancel">
54 <i
class=
"icon-ban-circle icon-white"></i>
55 <span><?php echo $langs->trans(
'CancelUpload'); ?></span>
58 <button
type=
"button" class=
"btn btn-danger delete">
59 <i
class=
"icon-trash icon-white"></i>
60 <span><?php echo $langs->trans(
'Delete'); ?></span>
62 <input
type=
"checkbox" class=
"toggle">
65 <!-- The global progress information -->
66 <div
class=
"span5 fileupload-progress fade">
67 <!-- The global progress bar -->
69 <div
class=
"progress progress-success progress-striped active" role=
"progressbar" aria-valuemin=
"0" aria-valuemax=
"100">
70 <div
class=
"bar" style=
"width:0%;"></div>
73 <!-- The extended global progress information -->
74 <div
class=
"progress-extended"> </div>
77 <!-- The loading indicator is shown during file processing -->
78 <div
class=
"fileupload-loading"></div>
80 <!-- The table listing the files available
for upload/download -->
81 <table role=
"presentation" class=
"table table-striped"><tbody
class=
"files" data-toggle=
"modal-gallery" data-target=
"#modal-gallery"></tbody></table>
84 <!-- The
template to display files available
for upload -->
85 <!-- Warning
id on script is not W3C compliant and is reported as error by phpcs but it is required by fileupload plugin -->
86 <script
id=
"template-upload" type=
"text/x-tmpl">
87 {%
for (var i=0, file; file=o.files[i]; i++) { %}
88 <tr
class=
"template-upload fade">
89 <td
class=
"preview"><span
class=
"fade"></span></td>
90 <td
class=
"name"><span>{%=file.name%}</span></td>
91 <td
class=
"size"><span>{%=o.formatFileSize(file.size)%}</span></td>
92 {%
if (file.error) { %}
93 <td
class=
"error" colspan=
"2"><span
class=
"label label-important">{%=locale.fileupload.error%}</span> {%=locale.fileupload.errors[file.error] || file.error%}</td>
94 {% }
else if (o.files.valid && !i) { %}
96 <div
class=
"progress progress-success progress-striped active" role=
"progressbar" aria-valuemin=
"0" aria-valuemax=
"100" aria-valuenow=
"0"><div
class=
"bar" style=
"width:0%;"></div></div>
98 <td
class=
"start">{%
if (!o.options.autoUpload) { %}
99 <button
class=
"btn btn-primary">
100 <i
class=
"icon-upload icon-white"></i>
101 <span>{%=locale.fileupload.start%}</span>
105 <td colspan=
"2"></td>
107 <td
class=
"cancel">{%
if (!i) { %}
108 <button
class=
"btn btn-warning">
109 <i
class=
"icon-ban-circle icon-white"></i>
110 <span>{%=locale.fileupload.cancel%}</span>
116 <!-- The
template to display files available
for download -->
117 <!-- Warning
id on script is not W3C compliant and is reported as error by phpcs but it is required by jfilepload plugin -->
118 <script
id=
"template-download" type=
"text/x-tmpl">
119 {%
for (var i=0, file; file=o.files[i]; i++) { %}
120 <tr
class=
"template-download fade">
121 {%
if (file.error) { %}
123 <td
class=
"name"><span>{%=file.name%}</span></td>
124 <td
class=
"size"><span>{%=o.formatFileSize(file.size)%}</span></td>
125 <td
class=
"error" colspan=
"2"><span
class=
"label label-important">{%=locale.fileupload.error%}</span> {%=locale.fileupload.errors[file.error] || file.error%}</td>
127 <td
class=
"preview">{%
if (file.thumbnail_url) { %}
128 <a href=
"{%=file.url%}" title=
"{%=file.name%}" rel=
"gallery" download=
"{%=file.name%}"><img src=
"{%=file.thumbnail_url%}"></a>
131 <a href=
"{%=file.url%}" title=
"{%=file.name%}" rel=
"{%=file.thumbnail_url&&'gallery'%}" download=
"{%=file.name%}">{%=file.name%}</a>
133 <td
class=
"size"><span>{%=o.formatFileSize(file.size)%}</span></td>
134 <td colspan=
"2"></td>
137 <button
class=
"btn btn-danger" data-
type=
"{%=file.delete_type%}" data-url=
"{%=file.delete_url%}">
138 <i
class=
"icon-trash icon-white"></i>
139 <span>{%=locale.fileupload.destroy%}</span>
141 <input
type=
"checkbox" name=
"delete" value=
"1">
147 <!-- END PHP TEMPLATE -->