-26 Removals
+29 Additions

Created by:phpboost

1 <script> 1 <script>
2 <!-- 2 <!--
3 function insertAtCursor(myField, myValue) { 3 function insertAtCursor(myField, myValue) {
4 //IE support 4 //IE support
5 if (document.selection) { 5 if (document.selection) {
6 myField.focus(); 6 myField.focus();
7 sel = document.selection.createRange(); 7 sel = document.selection.createRange();
8 sel.text = myValue; 8 sel.text = myValue;
9 } 9 }
10 //MOZILLA/NETSCAPE support 10 //MOZILLA/NETSCAPE support
11 else if (myField.selectionStart || myField.selectionStart == '0') { 11 else if (myField.selectionStart || myField.selectionStart == '0') {
12 var startPos = myField.selectionStart; 12 var startPos = myField.selectionStart;
13 var endPos = myField.selectionEnd; 13 var endPos = myField.selectionEnd;
14 myField.value = myField.value.substring(0, startPos) + myValue + myField.value.substring(endPos, myField.value.length); 14 myField.value = myField.value.substring(0, startPos) + myValue + myField.value.substring(endPos, myField.value.length);
15 } else { 15 } else {
16 myField.value += myValue; 16 myField.value += myValue;
17 } 17 }
18 } 18 }
19 function insert_popup(code) 19 function insert_popup(code)
20 { 20 {
21 # IF C_TINYMCE_EDITOR # 21 # IF C_TINYMCE_EDITOR #
22 if (opener == null) 22 if (opener == null)
23 var field = window.parent.document.getElementById("{FIELD}"); 23 var field = window.parent.document.getElementById("{FIELD}");
24 else 24 else
25 var field = opener.document.getElementById("{FIELD}"); 25 var field = opener.document.getElementById("{FIELD}");
26 # ELSE # 26 # ELSE #
27 var field = opener.document.getElementById("{FIELD}"); 27 var field = opener.document.getElementById("{FIELD}");
28 # ENDIF # 28 # ENDIF #
29 29
30 var field_type = field.tagName.toLowerCase(); 30 var field_type = field.tagName.toLowerCase();
31 31
32 if (field_type == 'input') 32 if (field_type == 'input')
33 { 33 {
34 field.value = code; 34 field.value = code;
35 } 35 }
36 else 36 else
37 { 37 {
38 # IF C_TINYMCE_EDITOR # 38 # IF C_TINYMCE_EDITOR #
39 window.parent.insertTinyMceContent(code); //insertion pour tinymce. 39 window.parent.insertTinyMceContent(code); //insertion pour tinymce.
40 # ELSE # 40 # ELSE #
41 insertAtCursor(field, code); 41 insertAtCursor(field, code);
42 field.scrollTop(field.prop("selectionStart")); 42 field.scrollTop(field.prop("selectionStart"));
43 # ENDIF # 43 # ENDIF #
44 } 44 }
45 45
46 field.focus(); 46 field.focus();
47 } 47 }
48 function close_popup() 48 function close_popup()
49 { 49 {
50 opener=self; 50 opener=self;
51 self.close(); 51 self.close();
52 } 52 }
53 function Confirm_member() { 53 function Confirm_member() {
54 return confirm("{L_CONFIRM_EMPTY_FOLDER}"); 54 return confirm("{L_CONFIRM_EMPTY_FOLDER}");
55 } 55 }
56 function popup_upload(path, width, height, scrollbars) 56 function popup_upload(path, width, height, scrollbars)
57 { 57 {
58 if( height == '0' ) 58 if( height == '0' )
59 height = screen.height - 150; 59 height = screen.height - 150;
60 if( width == '0' ) 60 if( width == '0' )
61 width = screen.width - 200; 61 width = screen.width - 200;
62 window.open(path, "", "width="+width+", height="+height+ ",location=no,status=no,toolbar=no,scrollbars=" + scrollbars + ",resizable=yes"); 62 window.open(path, "", "width="+width+", height="+height+ ",location=no,status=no,toolbar=no,scrollbars=" + scrollbars + ",resizable=yes");
63 } 63 }
64 var hide_folder = false; 64 var hide_folder = false;
65 var empty_folder = 0; 65 var empty_folder = 0;
66 66
67 function display_new_folder() 67 function display_new_folder()
68 { 68 {
69 if( document.getElementById('empty-folder') ) 69 if( document.getElementById('empty-folder') )
70 document.getElementById('empty-folder').style.display = 'none'; 70 document.getElementById('empty-folder').style.display = 'none';
71 71
72 if ( typeof this.divid == 'undefined' ) 72 if ( typeof this.divid == 'undefined' )
73 this.divid = 0; 73 this.divid = 0;
74 else 74 else
75 this.divid++; 75 this.divid++;
76 76
77 if( !hide_folder ) 77 if( !hide_folder )
78 { 78 {
79 document.getElementById('new-folder').innerHTML += '<div class="upload-elements-repertory" id="new-folder' + divid + '"><i class="fa fa-folder fa-2x"></i> <input type="text" name="folder_name" id="folder_name" value="" onblur="add_folder(\'{FOLDER_ID}\', \'{USER_ID}\', ' + divid + ');"></div>'; 79 document.getElementById('new-folder').innerHTML += '<div class="upload-elements-repertory" id="new-folder' + divid + '"><i class="fa fa-folder fa-2x"></i> <input type="text" name="folder_name" id="folder_name" value="" onblur="add_folder(\'{FOLDER_ID}\', \'{USER_ID}\', ' + divid + ');"></div>';
80 document.getElementById('folder_name').focus(); 80 document.getElementById('folder_name').focus();
81 } 81 }
82 else 82 else
83 { 83 {
84 document.getElementById('new-folder' + (divid - 1)).style.display = 'block'; 84 document.getElementById('new-folder' + (divid - 1)).style.display = 'block';
85 document.getElementById('new-folder' + (divid - 1)).innerHTML = '<div class="upload-elements-repertory" id="new-folder' + divid + '"><i class="fa fa-folder fa-2x"></i> <input type="text" name="folder_name" id="folder_name" value="" onblur="add_folder(\'{FOLDER_ID}\', \'{USER_ID}\', ' + (divid - 1) + ');"></div>'; 85 document.getElementById('new-folder' + (divid - 1)).innerHTML = '<div class="upload-elements-repertory" id="new-folder' + divid + '"><i class="fa fa-folder fa-2x"></i> <input type="text" name="folder_name" id="folder_name" value="" onblur="add_folder(\'{FOLDER_ID}\', \'{USER_ID}\', ' + (divid - 1) + ');"></div>';
86 document.getElementById('folder_name').focus(); 86 document.getElementById('folder_name').focus();
87 this.divid--; 87 this.divid--;
88 hide_folder = false; 88 hide_folder = false;
89 } 89 }
90 } 90 }
91 function display_rename_folder(id, previous_name, previous_cut_name) 91 function display_rename_folder(id, previous_name, previous_cut_name)
92 { 92 {
93 if( document.getElementById('f' + id) ) 93 if( document.getElementById('f' + id) )
94 { 94 {
95 document.getElementById('f' + id).innerHTML = '<input type="text" name="finput' + id + '" id="finput' + id + '" value="' + previous_name + '" onblur="rename_folder(\'' + id + '\', \'' + previous_name.replace(/\'/g, "\\\'") + '\', \'' + previous_cut_name.replace(/\'/g, "\\\'") + '\');">'; 95 document.getElementById('f' + id).innerHTML = '<input type="text" name="finput' + id + '" id="finput' + id + '" value="' + previous_name + '" onblur="rename_folder(\'' + id + '\', \'' + previous_name.replace(/\'/g, "\\\'") + '\', \'' + previous_cut_name.replace(/\'/g, "\\\'") + '\');">';
96 document.getElementById('finput' + id).focus(); 96 document.getElementById('finput' + id).focus();
97 } 97 }
98 } 98 }
99 function rename_folder(id_folder, previous_name, previous_cut_name) 99 function rename_folder(id_folder, previous_name, previous_cut_name)
100 { 100 {
101 var name = document.getElementById('finput' + id_folder).value; 101 var name = document.getElementById('finput' + id_folder).value;
102 var regex = /\/|\.|\\|\||\?|<|>|\"/; 102 var regex = /\/|\.|\\|\||\?|<|>|\"/;
103 103
104 document.getElementById('img' + id_folder).innerHTML = '<i class="fa fa-spinner fa-spin"></i>'; 104 document.getElementById('img' + id_folder).innerHTML = '<i class="fa fa-spinner fa-spin"></i>';
105 if( name != '' && regex.test(name) ) //interdiction des caractères spéciaux dans la nom. 105 if( name != '' && regex.test(name) ) //interdiction des caractères spéciaux dans la nom.
106 { 106 {
107 alert("{L_FOLDER_FORBIDDEN_CHARS}"); 107 alert("{L_FOLDER_FORBIDDEN_CHARS}");
108 document.getElementById('f' + id_folder).innerHTML = '<a href="upload.php?f=' + id_folder + '{POPUP}">' + previous_cut_name + '</a>'; 108 document.getElementById('f' + id_folder).innerHTML = '<a href="upload.php?f=' + id_folder + '{POPUP}">' + previous_cut_name + '</a>';
109 document.getElementById('img' + id_folder).innerHTML = ''; 109 document.getElementById('img' + id_folder).innerHTML = '';
110 } 110 }
111 else if( name != '' ) 111 else if( name != '' )
112 { 112 {
113 name2 = escape_xmlhttprequest(name); 113 name2 = escape_xmlhttprequest(name);
114 data = "id_folder=" + id_folder + "&name=" + name2 + "&previous_name=" + previous_name; 114 data = "id_folder=" + id_folder + "&name=" + name2 + "&previous_name=" + previous_name;
115 var xhr_object = xmlhttprequest_init('../kernel/framework/ajax/uploads_xmlhttprequest.php?token={TOKEN}&rename_folder=1'); 115 var xhr_object = xmlhttprequest_init('../kernel/framework/ajax/uploads_xmlhttprequest.php?token={TOKEN}&rename_folder=1');
116 xhr_object.onreadystatechange = function() 116 xhr_object.onreadystatechange = function()
117 { 117 {
118 if( xhr_object.readyState == 4 && xhr_object.status == 200 ) 118 if( xhr_object.readyState == 4 && xhr_object.status == 200 )
119 { 119 {
120 if( xhr_object.responseText != '' ) 120 if( xhr_object.responseText != '' )
121 { 121 {
122 document.getElementById('f' + id_folder).innerHTML = '<a href="upload.php?f=' + id_folder + '{POPUP}">' + name + '</a>'; 122 document.getElementById('f' + id_folder).innerHTML = '<a href="upload.php?f=' + id_folder + '{POPUP}">' + name + '</a>';
123 document.getElementById('fhref' + id_folder).innerHTML = '<a href="javascript:display_rename_folder(\'' + id_folder + '\', \'' + xhr_object.responseText.replace(/\'/g, "\\\'") + '\', \'' + name.replace(/\'/g, "\\\'") + '\');" class="fa fa-edit"></a>'; 123 document.getElementById('fhref' + id_folder).innerHTML = '<a href="javascript:display_rename_folder(\'' + id_folder + '\', \'' + xhr_object.responseText.replace(/\'/g, "\\\'") + '\', \'' + name.replace(/\'/g, "\\\'") + '\');" class="fa fa-edit"></a>';
124 } 124 }
125 else 125 else
126 { 126 {
127 alert("{L_FOLDER_ALREADY_EXIST}"); 127 alert("{L_FOLDER_ALREADY_EXIST}");
128 document.getElementById('f' + id_folder).innerHTML = '<a href="upload.php?f=' + id_folder + '{POPUP}">' + previous_cut_name + '</a>'; 128 document.getElementById('f' + id_folder).innerHTML = '<a href="upload.php?f=' + id_folder + '{POPUP}">' + previous_cut_name + '</a>';
129 } 129 }
130 document.getElementById('img' + id_folder).innerHTML = ''; 130 document.getElementById('img' + id_folder).innerHTML = '';
131 } 131 }
132 else if( xhr_object.readyState == 4 ) 132 else if( xhr_object.readyState == 4 )
133 document.getElementById('img' + id_folder).innerHTML = ''; 133 document.getElementById('img' + id_folder).innerHTML = '';
134 } 134 }
135 xmlhttprequest_sender(xhr_object, data); 135 xmlhttprequest_sender(xhr_object, data);
136 } 136 }
137 } 137 }
138 function add_folder(id_parent, user_id, divid) 138 function add_folder(id_parent, user_id, divid)
139 { 139 {
140 var name = document.getElementById("folder_name").value; 140 var name = document.getElementById("folder_name").value;
141 var regex = /\/|\.|\\|\||\?|<|>|\"/; 141 var regex = /\/|\.|\\|\||\?|<|>|\"/;
142 142
143 if( name != '' && regex.test(name) ) //interdiction des caractères spéciaux dans le nom. 143 if( name != '' && regex.test(name) ) //interdiction des caractères spéciaux dans le nom.
144 { 144 {
145 alert("{L_FOLDER_FORBIDDEN_CHARS}"); 145 alert("{L_FOLDER_FORBIDDEN_CHARS}");
146 document.getElementById('new-folder' + divid).innerHTML = ''; 146 document.getElementById('new-folder' + divid).innerHTML = '';
147 document.getElementById('new-folder' + divid).style.display = 'none'; 147 document.getElementById('new-folder' + divid).style.display = 'none';
148 hide_folder = true; 148 hide_folder = true;
149 if( document.getElementById('empty-folder') && empty_folder == 0 ) 149 if( document.getElementById('empty-folder') && empty_folder == 0 )
150 document.getElementById('empty-folder').style.display = 'block'; 150 document.getElementById('empty-folder').style.display = 'block';
151 } 151 }
152 else if( name != '' ) 152 else if( name != '' )
153 { 153 {
154 name2 = escape_xmlhttprequest(name); 154 name2 = escape_xmlhttprequest(name);
155 data = "name=" + name2 + "&user_id=" + user_id + "&id_parent=" + id_parent; 155 data = "name=" + name2 + "&user_id=" + user_id + "&id_parent=" + id_parent;
156 var xhr_object = xmlhttprequest_init('../kernel/framework/ajax/uploads_xmlhttprequest.php?token={TOKEN}&new_folder=1'); 156 var xhr_object = xmlhttprequest_init('../kernel/framework/ajax/uploads_xmlhttprequest.php?token={TOKEN}&new_folder=1');
157 xhr_object.onreadystatechange = function() 157 xhr_object.onreadystatechange = function()
158 { 158 {
159 if( xhr_object.readyState == 4 && xhr_object.status == 200 ) 159 if( xhr_object.readyState == 4 && xhr_object.status == 200 )
160 { 160 {
161 if( xhr_object.responseText > 0 ) 161 if( xhr_object.responseText > 0 )
162 { 162 {
163 document.getElementById('new-folder' + divid).innerHTML = '<a href="upload.php?f=' + xhr_object.responseText + '{POPUP}"><i class="fa fa-folder fa-2x"></i></a><br /> &nbsp;<span id="f' + xhr_object.responseText + '"><a href="upload.php?f=' + xhr_object.responseText + '{POPUP}">' + name + '</a></span><br /> <div class="upload-repertory-controls"><span id="fhref' + xhr_object.responseText + '"><a href="javascript:display_rename_folder(\'' + xhr_object.responseText + '\', \'' + name.replace(/\'/g, "\\\'") + '\', \'' + name.replace(/\'/g, "\\\'") + '\');" class="fa fa-edit"></a></span>&nbsp;<span><a href="upload.php?delf=' + xhr_object.responseText + '&amp;f={FOLDER_ID}&amp;token={TOKEN}{POPUP}" data-confirmation="delete-element"><i class="fa fa-delete"></i></a></span>&nbsp;<span><a href="upload.php?movefd=' + xhr_object.responseText + '&amp;f={FOLDER_ID}{POPUP}" title="{L_MOVETO}" class="fa fa-move"></a></span><span id="img' + xhr_object.responseText + '"></span></div>'; 163 document.getElementById('new-folder' + divid).innerHTML = '<a class="infos-options" href="upload.php?f=' + xhr_object.responseText + '{POPUP}"><i class="fa fa-folder fa-2x"></i></a> &nbsp;<span class="infos-options" id="f' + xhr_object.responseText + '"><a href="upload.php?f=' + xhr_object.responseText + '{POPUP}">' + name + '</a></span> <div class="upload-repertory-controls"><span id="fhref' + xhr_object.responseText + '"><a href="javascript:display_rename_folder(\'' + xhr_object.responseText + '\', \'' + name.replace(/\'/g, "\\\'") + '\', \'' + name.replace(/\'/g, "\\\'") + '\');" class="fa fa-edit"></a></span>&nbsp;<span><a href="upload.php?delf=' + xhr_object.responseText + '&amp;f={FOLDER_ID}&amp;token={TOKEN}{POPUP}" data-confirmation="delete-element"><i class="fa fa-delete"></i></a></span>&nbsp;<span><a href="upload.php?movefd=' + xhr_object.responseText + '&amp;f={FOLDER_ID}{POPUP}" title="{L_MOVETO}" class="fa fa-move"></a></span><span id="img' + xhr_object.responseText + '"></span></div>';
164 var total_folder = document.getElementById('total-folder').innerHTML; 164 var total_folder = document.getElementById('total-folder').innerHTML;
165 total_folder++; 165 total_folder++;
166 document.getElementById('total-folder').innerHTML = total_folder; 166 document.getElementById('total-folder').innerHTML = total_folder;
167 167
168 empty_folder++; 168 empty_folder++;
169 } 169 }
170 else 170 else
171 { 171 {
172 alert("{L_FOLDER_ALREADY_EXIST}"); 172 alert("{L_FOLDER_ALREADY_EXIST}");
173 document.getElementById('new-folder' + divid).innerHTML = ''; 173 document.getElementById('new-folder' + divid).innerHTML = '';
174 document.getElementById('new-folder' + divid).style.display = 'none'; 174 document.getElementById('new-folder' + divid).style.display = 'none';
175 hide_folder = true; 175 hide_folder = true;
176 } 176 }
177 } 177 }
178 } 178 }
179 xmlhttprequest_sender(xhr_object, data); 179 xmlhttprequest_sender(xhr_object, data);
180 } 180 }
181 else 181 else
182 { 182 {
183 if( document.getElementById('empty-folder') && empty_folder == 0 ) 183 if( document.getElementById('empty-folder') && empty_folder == 0 )
184 document.getElementById('empty-folder').style.display = 'block'; 184 document.getElementById('empty-folder').style.display = 'block';
185 document.getElementById('new-folder' + divid).innerHTML = ''; 185 document.getElementById('new-folder' + divid).innerHTML = '';
186 document.getElementById('new-folder' + divid).style.display = 'none'; 186 document.getElementById('new-folder' + divid).style.display = 'none';
187 hide_folder = true; 187 hide_folder = true;
188 } 188 }
189 } 189 }
190 function display_rename_file(id, previous_name, previous_cut_name) 190 function display_rename_file(id, previous_name, previous_cut_name)
191 { 191 {
192 if( document.getElementById('fi' + id) ) 192 if( document.getElementById('fi' + id) )
193 { 193 {
194 document.getElementById('fi1' + id).style.display = 'none'; 194 document.getElementById('fi1' + id).style.display = 'none';
195 document.getElementById('fi' + id).style.display = 'inline'; 195 document.getElementById('fi' + id).style.display = 'inline';
196 document.getElementById('fi' + id).innerHTML = '<input type="text" name="fiinput' + id + '" id="fiinput' + id + '" value="' + previous_name + '" onblur="rename_file(\'' + id + '\', \'' + previous_name.replace(/\'/g, "\\\'") + '\', \'' + previous_cut_name.replace(/\'/g, "\\\'") + '\');">'; 196 document.getElementById('fi' + id).innerHTML = '<input type="text" name="fiinput' + id + '" id="fiinput' + id + '" value="' + previous_name + '" onblur="rename_file(\'' + id + '\', \'' + previous_name.replace(/\'/g, "\\\'") + '\', \'' + previous_cut_name.replace(/\'/g, "\\\'") + '\');">';
197 document.getElementById('fiinput' + id).focus(); 197 document.getElementById('fiinput' + id).focus();
198 } 198 }
199 } 199 }
200 function rename_file(id_file, previous_name, previous_cut_name) 200 function rename_file(id_file, previous_name, previous_cut_name)
201 { 201 {
202 var name = document.getElementById("fiinput" + id_file).value; 202 var name = document.getElementById("fiinput" + id_file).value;
203 var regex = /\/|\\|\||\?|<|>|\"/; 203 var regex = /\/|\\|\||\?|<|>|\"/;
204 204
205 document.getElementById('imgf' + id_file).innerHTML = '<i class="fa fa-spinner fa-spin"></i>'; 205 document.getElementById('imgf' + id_file).innerHTML = '<i class="fa fa-spinner fa-spin"></i>';
206 if( name != '' && regex.test(name) ) //interdiction des caractères spéciaux dans la nom. 206 if( name != '' && regex.test(name) ) //interdiction des caractères spéciaux dans la nom.
207 { 207 {
208 alert("{L_FOLDER_FORBIDDEN_CHARS}"); 208 alert("{L_FOLDER_FORBIDDEN_CHARS}");
209 document.getElementById('fi1' + id_file).style.display = 'inline'; 209 document.getElementById('fi1' + id_file).style.display = 'inline';
210 document.getElementById('fi' + id_file).style.display = 'none'; 210 document.getElementById('fi' + id_file).style.display = 'none';
211 document.getElementById('imgf' + id_file).innerHTML = ''; 211 document.getElementById('imgf' + id_file).innerHTML = '';
212 } 212 }
213 else if( name != '' ) 213 else if( name != '' )
214 { 214 {
215 name2 = escape_xmlhttprequest(name); 215 name2 = escape_xmlhttprequest(name);
216 data = "id_file=" + id_file + "&name=" + name2 + "&previous_name=" + previous_cut_name; 216 data = "id_file=" + id_file + "&name=" + name2 + "&previous_name=" + previous_cut_name;
217 var xhr_object = xmlhttprequest_init('../kernel/framework/ajax/uploads_xmlhttprequest.php?token={TOKEN}&rename_file=1'); 217 var xhr_object = xmlhttprequest_init('../kernel/framework/ajax/uploads_xmlhttprequest.php?token={TOKEN}&rename_file=1');
218 xhr_object.onreadystatechange = function() 218 xhr_object.onreadystatechange = function()
219 { 219 {
220 if( xhr_object.readyState == 4 && xhr_object.status == 200 && xhr_object.responseText != '' ) 220 if( xhr_object.readyState == 4 && xhr_object.status == 200 && xhr_object.responseText != '' )
221 { 221 {
222 if( xhr_object.responseText == '/' ) 222 if( xhr_object.responseText == '/' )
223 { 223 {
224 alert("{L_FOLDER_ALREADY_EXIST}"); 224 alert("{L_FOLDER_ALREADY_EXIST}");
225 document.getElementById('fi1' + id_file).style.display = 'inline'; 225 document.getElementById('fi1' + id_file).style.display = 'inline';
226 document.getElementById('fi' + id_file).style.display = 'none'; 226 document.getElementById('fi' + id_file).style.display = 'none';
227 } 227 }
228 else 228 else
229 { 229 {
230 document.getElementById('fi' + id_file).style.display = 'none'; 230 document.getElementById('fi' + id_file).style.display = 'none';
231 document.getElementById('fi1' + id_file).style.display = 'inline'; 231 document.getElementById('fi1' + id_file).style.display = 'inline';
232 document.getElementById('fi1' + id_file).innerHTML = xhr_object.responseText; 232 document.getElementById('fi1' + id_file).innerHTML = xhr_object.responseText;
233 document.getElementById('fihref' + id_file).innerHTML = '<a href="javascript:display_rename_file(\'' + id_file + '\', \'' + name.replace(/\'/g, "\\\'") + '\', \'' + previous_name.replace(/\'/g, "\\\'") + '\', \'' + xhr_object.responseText.replace(/\'/g, "\\\'") + '\');" class="fa fa-edit"></a>'; 233 document.getElementById('fihref' + id_file).innerHTML = '<a href="javascript:display_rename_file(\'' + id_file + '\', \'' + name.replace(/\'/g, "\\\'") + '\', \'' + previous_name.replace(/\'/g, "\\\'") + '\', \'' + xhr_object.responseText.replace(/\'/g, "\\\'") + '\');" class="fa fa-edit"></a>';
234 } 234 }
235 document.getElementById('imgf' + id_file).innerHTML = ''; 235 document.getElementById('imgf' + id_file).innerHTML = '';
236 } 236 }
237 else if( xhr_object.readyState == 4 && xhr_object.responseText == '' ) 237 else if( xhr_object.readyState == 4 && xhr_object.responseText == '' )
238 { 238 {
239 document.getElementById('fi' + id_file).style.display = 'none'; 239 document.getElementById('fi' + id_file).style.display = 'none';
240 document.getElementById('fi1' + id_file).style.display = 'inline'; 240 document.getElementById('fi1' + id_file).style.display = 'inline';
241 document.getElementById('fihref' + id_file).innerHTML = '<a href="javascript:display_rename_file(\'' + id_file + '\', \'' + previous_name.replace(/\'/g, "\\\'") + '\', \'' + previous_cut_name.replace(/\'/g, "\\\'") + '\');" class="fa fa-edit"></a>'; 241 document.getElementById('fihref' + id_file).innerHTML = '<a href="javascript:display_rename_file(\'' + id_file + '\', \'' + previous_name.replace(/\'/g, "\\\'") + '\', \'' + previous_cut_name.replace(/\'/g, "\\\'") + '\');" class="fa fa-edit"></a>';
242 document.getElementById('imgf' + id_file).innerHTML = ''; 242 document.getElementById('imgf' + id_file).innerHTML = '';
243 } 243 }
244 } 244 }
245 xmlhttprequest_sender(xhr_object, data); 245 xmlhttprequest_sender(xhr_object, data);
246 } 246 }
247 } 247 }
248 var delay = 1000; //Délai après lequel le bloc est automatiquement masqué, après le départ de la souris. 248 var delay = 1000; //Délai après lequel le bloc est automatiquement masqué, après le départ de la souris.
249 var timeout; 249 var timeout;
250 var displayed = false; 250 var displayed = false;
251 var previous_block; 251 var previous_block;
252 252
253 //Affiche le bloc. 253 //Affiche le bloc.
254 function upload_display_block(divID) 254 function upload_display_block(divID)
255 { 255 {
256 var i; 256 var i;
257 257
258 if( timeout ) 258 if( timeout )
259 clearTimeout(timeout); 259 clearTimeout(timeout);
260 260
261 var block = document.getElementById('move' + divID); 261 var block = document.getElementById('move' + divID);
262 if( block.style.display == 'none' ) 262 if( block.style.display == 'none' )
263 { 263 {
264 if( document.getElementById(previous_block) ) 264 if( document.getElementById(previous_block) )
265 document.getElementById(previous_block).style.display = 'none'; 265 document.getElementById(previous_block).style.display = 'none';
266 displayed = true; 266 displayed = true;
267 block.style.display = 'block'; 267 block.style.display = 'block';
268 previous_block = 'move' + divID; 268 previous_block = 'move' + divID;
269 } 269 }
270 else 270 else
271 { 271 {
272 block.style.display = 'none'; 272 block.style.display = 'none';
273 displayed = false; 273 displayed = false;
274 } 274 }
275 } 275 }
276 //Cache le bloc. 276 //Cache le bloc.
277 function upload_hide_block(idfield, stop) 277 function upload_hide_block(idfield, stop)
278 { 278 {
279 if( stop && timeout ) 279 if( stop && timeout )
280 { 280 {
281 clearTimeout(timeout); 281 clearTimeout(timeout);
282 } 282 }
283 else if( displayed ) 283 else if( displayed )
284 { 284 {
285 clearTimeout(timeout); 285 clearTimeout(timeout);
286 timeout = setTimeout('upload_display_block(\'' + idfield + '\')', delay); 286 timeout = setTimeout('upload_display_block(\'' + idfield + '\')', delay);
287 } 287 }
288 } 288 }
289 var selected = 0; 289 var selected = 0;
290 function select_div(id) 290 function select_div(id)
291 { 291 {
292 if( document.getElementById(id) ) 292 if( document.getElementById(id) )
293 { 293 {
294 if( selected == 0 ) 294 if( selected == 0 )
295 { 295 {
296 document.getElementById(id).select(); 296 document.getElementById(id).select();
297 selected = 1; 297 selected = 1;
298 } 298 }
299 else 299 else
300 { 300 {
301 document.getElementById(id).blur(); 301 document.getElementById(id).blur();
302 selected = 0; 302 selected = 0;
303 } 303 }
304 } 304 }
305 } 305 }
306 --> 306 -->
307 </script> 307 </script>
308 308
309 <section id="module-user-upload"> 309 <section id="module-user-upload">
310 <header> 310 <header>
311 <h1>{L_FILES_ACTION}</h1> 311 <h1>{L_FILES_ACTION}</h1>
312 </header> 312 </header>
313 313
314 <div class="content"> 314 <div class="content">
315 315
316 <div id="new-file"> 316 <div id="new-file">
317 # INCLUDE message_helper # 317 # INCLUDE message_helper #
318 <form action="upload.php?f={FOLDER_ID}&amp;token={TOKEN}{POPUP}" enctype="multipart/form-data" method="post"> 318 <form action="upload.php?f={FOLDER_ID}&amp;token={TOKEN}{POPUP}" enctype="multipart/form-data" method="post">
319 <fieldset> 319 <fieldset>
320 <legend>{L_ADD_FILES}</legend> 320 <legend>{L_ADD_FILES}</legend>
321 <div class="form-element"> 321 <div class="form-element">
322 <div class="form-field"> 322 <div class="form-field">
323 <input type="file" name="upload_file" id="upload-file"> 323 <input type="file" name="upload_file" id="upload-file">
324 <input type="hidden" name="max_file_size" value="2000000"> 324 <input type="hidden" name="max_file_size" value="2000000">
325 </div> 325 </div>
326 <input type="hidden" name="token" value="{TOKEN}"> 326 <input type="hidden" name="token" value="{TOKEN}">
327 <button type="submit" name="valid_up" value="true" class="submit">{L_UPLOAD}</button> 327 <button type="submit" name="valid_up" value="true" class="submit">{L_UPLOAD}</button>
328 </div> 328 </div>
329 </fieldset> 329 </fieldset>
330 </form> 330 </form>
331 </div> 331 </div>
332 332
333 <div class="upload-address-bar"> 333 <div class="upload-address-bar">
334 <a href="upload.php?root=1{POPUP}"><i class="fa fa-home"></i> {L_ROOT}</a>{URL} 334 <a href="upload.php?root=1{POPUP}"><i class="fa fa-home" aria-hidden="true"></i> {L_ROOT}</a>{URL}
335 </div> 335 </div>
336 336
337 <div class="upload-address-bar-links"> 337 <div class="upload-address-bar-links">
338 <a href="upload.php?fup={FOLDER_ID}{POPUP}"> 338 <a href="upload.php?fup={FOLDER_ID}{POPUP}">
339 <i class="fa fa-level-up"></i> {L_FOLDER_UP} 339 <i class="fa fa-level-up" aria-hidden="true"></i> {L_FOLDER_UP}
340 </a> 340 </a>
341 <a href="javascript:display_new_folder();"> 341 <a href="javascript:display_new_folder();">
342 <i class="fa fa-plus"></i> {L_FOLDER_NEW} 342 <i class="fa fa-plus" aria-hidden="true"></i> {L_FOLDER_NEW}
343 </a> 343 </a>
344 <a href="javascript:document.getElementById('upload-file').click();"> 344 <a href="javascript:document.getElementById('upload-file').click();">
345 <i class="fa fa-save"></i> {L_ADD_FILES} 345 <i class="fa fa-save" aria-hidden="true"></i> {L_ADD_FILES}
346 </a> 346 </a>
347 </div> 347 </div>
348 <div class="spacer"></div> 348 <div class="spacer"></div>
349 349
350 <legend>{L_FOLDER_CONTENT}</legend> 350 <legend>{L_FOLDER_CONTENT}</legend>
351 351
352 <div class="upload-elements-container"> 352 <div class="upload-elements-container">
353 353
354 # IF C_EMPTY_FOLDER # 354 # IF C_EMPTY_FOLDER #
355 <div id="empty-folder" class="notice">{L_EMPTY_FOLDER}</div> 355 <div id="empty-folder" class="message-helper notice">{L_EMPTY_FOLDER}</div>
356 <span id="new-folder"></span> 356 <span id="new-folder"></span>
357 # ELSE # 357 # ELSE #
358 # START folder # 358 # START folder #
359 <div class="upload-elements-repertory"> 359 <div class="upload-elements-repertory">
360 <a href="upload.php?f={folder.ID}{POPUP}" class="fa # IF folder.C_MEMBER_FOLDER #fa-users # ELSE #fa-folder # ENDIF #fa-2x"></a><br /> 360 <a class="infos-options" href="upload.php?f={folder.ID}{POPUP}">
361 <span id="f{folder.ID}"><a href="upload.php?f={folder.ID}{POPUP}">{folder.NAME}</a></span><br /> 361 <i class="fa # IF folder.C_MEMBER_FOLDER #fa-users # ELSE #fa-folder # ENDIF #fa-2x"></i>
362 </a>
363 <span class="infos-options" id="f{folder.ID}"><a href="upload.php?f={folder.ID}{POPUP}">{folder.NAME}</a></span>
362 <div class="upload-repertory-controls"> 364 <div class="upload-repertory-controls">
363 {folder.RENAME_FOLDER} 365 {folder.RENAME_FOLDER}
364 <span> 366 <span>
365 <a href="upload.php?delf={folder.ID}&amp;f={FOLDER_ID}&amp;token={TOKEN}{POPUP}" title="{folder.L_TYPE_DEL_FOLDER}" class="fa fa-delete" data-confirmation="delete-element"></a> 367 <a href="upload.php?delf={folder.ID}&amp;f={FOLDER_ID}&amp;token={TOKEN}{POPUP}" data-confirmation="delete-element" aria-label="{folder.L_TYPE_DEL_FOLDER}"><i class="fa fa-delete" aria-hidden="true" title="{folder.L_TYPE_DEL_FOLDER}"></i></a>
366 </span> 368 </span>
367 <span> 369 <span>
368 <a href="upload{folder.U_MOVE}" title="{L_MOVETO}" class="fa fa-move"></a> 370 <a href="upload{folder.U_MOVE}" aria-label="{L_MOVETO}"><i class="fa fa-move" aria-hidden="true" title="{L_MOVETO}"></i></a>
369 </span> 371 </span>
370 <span id="img{folder.ID}"></span> 372 <span id="img{folder.ID}"></span>
371 </div> 373 </div>
372 </div> 374 </div>
373 # END folder # 375 # END folder #
374 <span id="new-folder"></span> 376 <span id="new-folder"></span>
375 377
376 # START files # 378 # START files #
377 <div class="upload-elements-file"> 379 <div class="upload-elements-file">
378 # IF files.C_IMG # 380 # IF files.C_IMG #
379 <a href="{files.URL}" data-lightbox="formatter" data-rel="lightcase:collection" title="{files.TITLE}"> 381 <a href="{files.URL}" data-lightbox="formatter" data-rel="lightcase:collection" title="{files.TITLE}">
380 <div class="upload-element-picture" style="background-image: url({files.URL})"></div> 382 <div class="upload-element-picture" style="background-image: url({files.URL})"></div>
381 </a> 383 </a>
382 # ELSE # 384 # ELSE #
383 <a class="# IF files.C_RECENT_FILE #upload-recent-file# END IF #" href="{files.URL}" title="{files.TITLE}"{files.LIGHTBOX}> 385 <a class="# IF files.C_RECENT_FILE #upload-recent-file# END IF #" href="{files.URL}" title="{files.TITLE}"{files.LIGHTBOX}>
384 <div class="upload-element-icon"><i class="fa {files.IMG}"></i></div> 386 <div class="upload-element-icon"><i class="fa-upload-img {files.IMG}"></i></div>
385 </a> 387 </a>
386 # ENDIF # 388 # ENDIF #
387 <div class="upload-element-name# IF files.C_RECENT_FILE # upload-recent-file# ENDIF #" id="fi1{files.ID}">{files.NAME}</div> 389 <div class="upload-element-name# IF files.C_RECENT_FILE # upload-recent-file# ENDIF #" id="fi1{files.ID}">{files.NAME}</div>
388 <span id="fi{files.ID}"></span> 390 <span id="fi{files.ID}"></span>
389 {files.BBCODE} 391 {files.BBCODE}
390 <div class="upload-file-controls"> 392 <div class="upload-file-controls">
391 {files.RENAME_FILE} 393 {files.RENAME_FILE}
392 <a href="upload.php?del={files.ID}&amp;f={FOLDER_ID}&amp;token={TOKEN}{POPUP}" title="{L_DELETE}" class="fa fa-delete" data-confirmation="delete-element"></a> 394 <a href="upload.php?del={files.ID}&amp;f={FOLDER_ID}&amp;token={TOKEN}{POPUP}" data-confirmation="delete-element" aria-label="{L_DELETE}"><i class="fa fa-delete" aria-hidden="true" title="{L_DELETE}"></i></a>
393 <a href="upload{files.U_MOVE}" title="{L_MOVETO}" class="fa fa-move"></a> 395 <a href="upload{files.U_MOVE}" aria-label="{L_MOVETO}"><i class="fa fa-move" aria-hidden="true" title="{L_MOVETO}"></i></a>
394 {files.INSERT} 396 {files.INSERT}
395 </div> 397 </div>
396 <span class="text-strong">{files.FILETYPE}</span><br /> 398 <span class="infos-options text-strong">{files.FILETYPE}</span>
397 <span class="text-strong">{files.SIZE}</span> 399 <span class="text-strong">{files.SIZE}</span>
398 <span id="imgf{files.ID}"></span> 400 <span id="imgf{files.ID}"></span>
399 </div> 401 </div>
400 # END files # 402 # END files #
401 # ENDIF # 403 # ENDIF #
402 <div class="options"> 404 <div class="options infos">
403 {L_FOLDERS} : <strong><span id="total-folder">{TOTAL_FOLDERS}</span></strong><br /> 405 <span class="infos-options" id="total-folder">{L_FOLDERS} : <strong>{TOTAL_FOLDERS}</strong></span>
404 {L_FILES} : <strong>{TOTAL_FILES}</strong><br /> 406 <span class="infos-options">{L_FILES} : <strong>{TOTAL_FILES}</strong></span>
405 {L_FOLDER_SIZE} : <strong>{TOTAL_FOLDER_SIZE}</strong><br /> 407 <span class="infos-options">{L_FOLDER_SIZE} : <strong>{TOTAL_FOLDER_SIZE}</strong></span>
406 {L_DATA} : <strong>{TOTAL_SIZE}</strong> 408 <span class="infos-options">{L_DATA} : <strong>{TOTAL_SIZE}</strong></span>
407 </div> 409 </div>
408 </div> 410 </div>
409 411
410 </div> 412 </div>
411 413
412 <footer> 414 <footer>
413 # IF C_DISPLAY_CLOSE_BUTTON # 415 # IF C_DISPLAY_CLOSE_BUTTON #
414 <fieldset class="fieldset-submit"> 416 <fieldset class="fieldset-submit">
415 <legend>${LangLoader::get_message('close', 'main')}</legend> 417 <legend>${LangLoader::get_message('close', 'main')}</legend>
416 <button type="reset" onclick="javascript:close_popup()" value="true">${LangLoader::get_message('close', 'main')}</button> 418 <button type="reset" onclick="javascript:close_popup()" value="true">${LangLoader::get_message('close', 'main')}</button>
417 </fieldset> 419 </fieldset>
418 # ENDIF # 420 # ENDIF #
419 </footer> 421 </footer>
420 422
421 </section> 423 </section>
Editor
Original Text
Changed Text
Recommended videos