-
Notifications
You must be signed in to change notification settings - Fork 9
/
index.php
1639 lines (1348 loc) · 62.4 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
date_default_timezone_set('UTC');
$LoginDialog = true;
$login_user = '';
$login_pass = 'admin';
$charset = 'utf-8';
$show_file_or_dir = true ; // can show directory
$perpage = (isset($_GET['perpage'])) ? (int)$_GET['perpage'] : 10;
$table_fixed = (isset($_GET['perpage'])) ? 'table-fixed' : '';
$alert_msg = (isset($_GET['alert'])) ? $_GET['alert'] : '';
@session_start();
if(isset($_GET['logout'])) { session_destroy() ; exit(header('Location: '.$_SERVER['PHP_SELF'])); }
if(isset($_POST['username']) && isset($_POST['password']) )
{
if($_POST['username'] == $login_user && $_POST['password'] == $login_pass)
{
$_SESSION['login']['user'] = $login_user ;
$_SESSION['login']['pass'] = $login_pass ;
$_SESSION['login']['status'] = "1" ;
exit(header('Location: '.$_SERVER['PHP_SELF'] ));
}
}
$_extensions[0] = array();
$_extensions[1] = array();
//$_extensions[1] = array( "css","js","txt","json","xml"); // can read _extensions
//$_extensions[0] = array("gif", "jpg", "jpeg", "png","bmp","dir","css","js"); // Allowed_extensions = in Browse directorie
$RTL_languages = array('ar','arc','bcc','bqi','ckb','dv','fa','glk','he','lrc','mzn','pnb','ps','sd','ug','ur','yi');
$RTL_languages = array_map('strtolower', $RTL_languages);
$_extensions[0] = array_map('strtolower', $_extensions[0]);
$_extensions[1] = array_map('strtolower', $_extensions[1]);
$_maxFileSize = return_bytes(ini_get('upload_max_filesize'));
$_extensions[2] = array("gif", "jpg", "jpeg", "png","bmp","ico","tiff","svg"); //images extensions
$_extensions[3] = array("mp3", "wav", "ogg"); //music extensions
//$_extensions[4] = array('doc', 'docx', 'docm', 'dot', 'dotx', 'dotm', 'wps','pdf'); //formats doc extensions
$_extensions[2] = array_map('strtolower', $_extensions[2]);
$icon[0]='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAr0lEQVQ4jbXTsQrCMBAG4AxOgk66ubj5Cg5C3sBX0SVLl3Mp1pb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5vZElsnaQBQJQEphRByScNjwK73A14ASJrulgEUJPsN0BxcOeUeQPlk+btaAUZIb/PnWjN7AAAAAElFTkSuQmCC';
$icon[13]='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAXUlEQVQ4jWNgGJbAk4GBIQQP9qXUghCaG+DMwMDARa4BzgwMDEYMDAwsSJiRFAM6GRgYYhkYGAKQsBwpBjAxMDCkMDAwcONRQzAMmKCYbAMIAYIGEEpIWZS6YJABAEwKC7pKuYTEAAAAAElFTkSuQmCC';
$icon[6]='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAd0lEQVQ4jWNgoBXo6+vz7+/vb+jv72+YMGFCVUNDgwhJBkyYMGEyjN3Q0MA3YcKEKoKaYDb29/c3TJw48QAevgNeQwhZQtAVxNCjBgx7AzqhtAM6nZuby97f319NyID5fX19XcjJGJqhGidOnHi1q6tLFa8BpAIAcUCizUwVOu0AAAAASUVORK5CYII=';
$icon[7]='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA/ElEQVQ4ja2TPUpDURCFB2wsopVdNuAWYproArKGkM6U0TxIqikeaMi775xTZAXp3nICwdrOBbgAm/sgvN8oDgxc7sz55jCXa/Yf4e53JDcAvJppmg57ASQ37j6o3gNwSd/VWpIkN7XGJjAAj+4+iqK4MjPL81wAnOT7JYC1u99mWXZP8kByBWAba1t3v+4EVHZzBDACMJMUJKW9Ds7qSwCjeH4CsLxoB6U4hPBgZhZCeKyJuwBx8vhM/No2pQYg+VKKAUwkndpc1gAkF+UzAZjE7Te6bARI+gIwl7QjuWpz2QmQ9Angua2nE/DrHpJTkm9Nn6lMkvu+IX+KH1+Xuy051gU6AAAAAElFTkSuQmCC';
$icon[15]='data:image/gif;base64,R0lGODlhHwAfANUAAP///5qamiYmJuTk5Ly8vMzMzKqqqrCwsKKioujo6NTU1Pb29qioqKCgoK6urtL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fEpixq+fALbfG/lIsj4ESGIuDyE8bH9y62wPJNtdwJ5IVrYHAEBK6btxg0MXL1j1bgBgezpbJllL6hdAV/DCnmRTsvxazZqvjASHx2bnAAAAAElFTkSuQmCC';
$icon[11]='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA9UlEQVQ4jc2QTUoDQRCFs0jEn7WuFQ8QFx6gNwYXunP0Cq6EgVkI2XQgzIRuut4rG8HaCV7AI7oxYRwSMhACFjRNP977qroGg39XZjbKORcApiSfiqI46B2u6/pUVd9CCFfOuWFKaUzyPcZ41gugqnMzO25rVVWdkPwiOSO5EJHHjQCSsx5NnlNK43Xhl5xzsQ1QluWRqloI4XIlisiE5F3XLCK3qvrtvT9s6865IUlZCQCmZjZaE35V1U8AH13In++SvBGR+7YBwMPv7ZumOReR640TLHegqnMAvnVc5+0BeJKIMV5s29dyEt/LuE+A2wmw9/oBfgaBG4x+og4AAAAASUVORK5CYII=';
$icon[5]='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAhUlEQVQ4jWNgoCZoaGgQmTBhQlV/f38DOm5paZEmaMCECROqysrKeNHF+/v7GyZOnPiloaGBB68B/f39DbjEoa67vmrVKmZyDKhuaGjg6+np0ZgwYcJikg1oa2sT7e/vr4Z65QDJBhCtZtSAYWHAhAkT/CZOnDgFW2aC4YkTJ34jZAlJAADcp3JNo6PIZgAAAABJRU5ErkJggg==';
$icon[10]='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA00lEQVQ4jd3PPQrCQBAF4BWE3EFsvMk2Vl7A1t5tLESwscywsO+91ILXsbJPKVjqDYTYpBCJiX+Vr5xhvplx7v9iZgMAO0kXkldJh5TS9OVhSUdJ0cyGIYSM5BhAKWnVCdSbYxNM8hxjHLUCki5mNmzqkdySnLcCJK8hhOxJLwew7rrgQHL8WK+qqidpD2DSCqSUpgBKMxs8DC8lnbz3/VagvmJF8lz/nEvaSzoVRVEB2HQCzjkXYxyRnANYA5h47/sANm8hTblDFt8gC0mzj4Gf5wYc04KjAuZmyQAAAABJRU5ErkJggg==';
$icon[14]='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAwklEQVQ4jb2QPQrCQBCFFyvxBtYKuYOVnZ3nCF7BZpsUG9id96bLDTyDlaWnEGzt0xliJYSwJOvvg9cMzPfejDG/UlEUc5K5iOwBbIwxk+RlAFsAtaq2TwM4VlU1S0oGUJM8O+cya+0UwI5kQ9KPAkjmqto657JeqwPJ2yhARKyqtqnz7wIABJJN93l9k7yGEJZRQGyZ5ElEbNfe+1UUMJTctYjYZECsgYis/wd46YSPnxhCKAHch9IBXMqyXEQB7+gBtIEmVWp3raAAAAAASUVORK5CYII=';
$icon[9]='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABDUlEQVQ4jd2SMU7DQBBFp+UacACKXMCNJYLCCVxzHDf2CfAqVdaz402NiJK0WRcUuUBAlAEbClJ8CuLIctaS63xpNdJo9Pft7Cc6Kk1TkEeFtcIiyI2BZsbrdqt9c0REI1+TRdBo4xwAIDfm3KSPgEXw9v4BAFiu1tg4BxbxznoJjLXY7z/xXf+cSDTzuUFD0NQkSRDH8a1Yi9/DAVVd46uqAAAzn0GLoF2vZD5HV7nvCX07yJR6ZhFoZmhm5CLIlHoZvAMiuh5PJg9BENyFYXh/nLsZTCDW6iYHLAIuip33miiKHn39dg5cWQIAWGQ2mKCbA1eWF5uDPmXT6aKbgyelFoMN6P/PR51zysEf2/RBFJCWMhsAAAAASUVORK5CYII=';
$icon[8]='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAlElEQVQ4jWNgoCZoaGgQmTBhQlV/f38DOm5paZEmaMCECROqysrKeNHF+/v7GyZOnPiloaGBB68B/f39DTAaCTv09/c3QF13fdWqVcwEDcAiXt3Q0MDX09OjMWHChMUku6CtrU20v7+/GuqVA6QagOEdkr1AtBqquWDUCxR4YcKECX4TJ06cgscFDRMnTvxGyBKSAADats4cMtUnDAAAAABJRU5ErkJggg==';
/*---------------------------arabic -------------------*/
$lang[0] = 'ar';
$lang[1] = 'حذف';
$lang[2] = 'تعديل';
$lang[3] = 'معاينة';
$lang[4] = 'الرئيسية';
$lang[5] = 'الاسم';
$lang[6] = 'الحجم';
$lang[7] = 'الصيغة';
$lang[8] = 'الاوامر';
$lang[9] = 'الصفحة';
$lang[10] = 'عدد الملفات';
$lang[11] = 'مستكشف الملفات';
$lang[12] = 'من برمجة';
$lang[13] = 'هل انت متاكد من حذف هذا الملف';
$lang[14] = 'موافق';
$lang[15] = 'الغاء';
$lang[16] = 'مجلد';
$lang[17] = 'جاري الارسال ...';
$lang[18] = 'استعراض المجلد';
$lang[19] = 'بحث';
$lang[20] = 'اعادة التسمية';
$lang[21] = 'لا يمكن فتح الملف';
$lang[22] = 'تسجيل الدخول';
$lang[23] = 'دخول';
$lang[24] = 'اسم المستخدم';
$lang[25] = 'كلمة المرور';
$lang[26] = 'خروج';
$lang[27] = 'حول';
$lang[28] = 'اخر تعديل';
$lang[29] = 'مجلد جديد';
$lang[30] = 'رفع ملف';
$lang[31] = 'لم يتم العثور على تطابق';
$lang[32] = 'احتيار ملف ... ';
$lang[33] = 'خطأ';
$lang[34] = 'نجاح';
$lang[35] = 'جاري التحميل ...';
$lang[36] = 'الصيغ المسموحة';
$lang[37] = 'الحجم الاقصى';
$lang[38] = 'غير موجود';
$lang[39] = 'المجلدات الشجرية';
$lang[40] = 'نسخ الى';
$lang[41] = 'فك الضغط';
$lang[42] = 'معلومات';
$lang[43] = 'فارغ';
$units = array( 'بايت', 'كيلوبايت', 'ميقابايت', 'جيقابايت', 'تيرابايت', 'بيتابايت', 'اكسابايت', 'زيتابايت', 'يوتابيت');
/*---------------------------english -------------------*/
$lang[0] = 'en';
$lang[1] = 'Remove';
$lang[2] = 'Edit';
$lang[3] = 'Preview';
$lang[4] = 'home';
$lang[5] = 'Filename';
$lang[6] = 'Size';
$lang[7] = 'Extension';
$lang[8] = 'Actions';
$lang[9] = 'Page';
$lang[10] = 'Total files';
$lang[11] = 'File Manager';
$lang[12] = 'by';
$lang[13] = 'Are you sure you want to Remove this file';
$lang[14] = 'Save';
$lang[15] = 'Cancel';
$lang[16] = 'Folder';
$lang[17] = 'Sending ...';
$lang[18] = 'Browse directorie';
$lang[19] = 'Search';
$lang[20] = 'Rename';
$lang[21] = 'Unable to open file!';
$lang[22] = 'Sign in';
$lang[23] = 'Login';
$lang[24] = 'Username';
$lang[25] = 'Password';
$lang[26] = 'Logout';
$lang[27] = 'About';
$lang[28] = 'Last modified';
$lang[29] = 'New folder';
$lang[30] = 'Upload file';
$lang[31] = 'Match not found';
$lang[32] = 'Browse ... ';
$lang[33] = 'Error';
$lang[34] = 'Success';
$lang[35] = 'Loading ...';
$lang[36] = 'Allowed extensions';
$lang[37] = 'Max filesize';
$lang[38] = 'Not exists';
$lang[39] = 'Tree View';
$lang[40] = 'Copy to';
$lang[41] = 'UnZip file';
$lang[42] = 'Information';
$lang[43] = 'Empty';
$units = array( 'B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
/*----------------------------------------------*/
$is_rtl=false;
if( in_array( $lang[0], $RTL_languages ) )
$is_rtl=true;
function Login()
{
global $login_user,$login_pass;
if(isset($_SESSION['login']))
{
if($_SESSION['login']['user'] ==$login_user && $_SESSION['login']['pass'] ==$login_pass && $_SESSION['login']['status'] =="1")
return true; else return false;
} else return false;
}
function print_array($array)
{
global $charset;
header("Content-type: application/json; charset=".$charset);
return json_encode($array);
}
function recurse_copy($src,$dst) {
if ( is_file($src) )
{
$_DIRNAME = pathinfo($dst, PATHINFO_DIRNAME);
if(!file_exists($_DIRNAME))
@mkdir($_DIRNAME, 0777, true);
return @copy($src,$dst);
}
$dir = opendir($src);
if(!file_exists($dst))
@mkdir($dst, 0777, true);
while(false !== ( $file = readdir($dir)) ) {
if (( $file != '.' ) && ( $file != '..' )) {
if ( is_dir($src . '/' . $file) ) {
recurse_copy($src . '/' . $file,$dst . '/' . $file);
}
else {
copy($src . '/' . $file,$dst . '/' . $file);
}
}
}
closedir($dir);
}
function openZipArchive($file,$extract_path)
{
global $alert_msg,$lang;
if(!file_exists($extract_path))
@mkdir($extract_path, 0777, true);
$zip = new ZipArchive;
$res = $zip->open($file);
if ($res === TRUE) {
$zip->extractTo($extract_path);
$zip->close();
return true;
} else {
$alert_msg=$lang[33].' - '.$lang[41];
return false;
}
}
function unlinkRecursive($dir, $RemoveRootToo)
{
if (is_file($dir) === true)
return @unlink($dir);
if(!$dh = @opendir($dir))
return;
while (false !== ($obj = readdir($dh)))
{
if($obj == '.' || $obj == '..')
continue;
if (!@unlink($dir . '/' . $obj))
unlinkRecursive($dir.'/'.$obj, true);
}
closedir($dh);
if ($RemoveRootToo)
@rmdir($dir);
return;
}
function return_bytes ($size_str)
{
switch (substr ($size_str, -1))
{
case 'M': case 'm': return (int)$size_str * 1048576;
case 'K': case 'k': return (int)$size_str * 1024;
case 'G': case 'g': return (int)$size_str * 1073741824;
default: return $size_str;
}
}
function is_sub_dir($path = NULL, $parent_folder = SITE_PATH) {
$dir = dirname($path);
$folder = substr($path, strlen($dir));
$dir = realpath($dir);
$folder = preg_replace('/[^a-z0-9\.\-_]/i', '', $folder);
if( !$dir OR !$folder OR $folder === '.') {
return FALSE;
}
$path = $dir.'/'. $folder;/*DS*/
if( strcasecmp($path, $parent_folder) > 0 ) {
return $path;
}
return FALSE;
}
function text_position($position=0)
{
global $is_rtl;
if($position==0)
{if($is_rtl ) echo 'left'; else echo 'right';}
else
{if($is_rtl ) echo 'right'; else echo 'left';}
}
function css()
{
global $is_rtl;
$css='';
if(file_exists('./css/bootstrap.min.css'))
$css.='<link href="./css/bootstrap.min.css" rel="stylesheet">';
else
$css.='<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">';
if(file_exists('./js/jquery-2.2.0.min.js'))
$css.='<script src="./js/jquery-2.2.0.min.js"></script>';
else
$css.='<script src="//code.jquery.com/jquery-2.2.0.min.js"></script>';
if(file_exists('./js/bootstrap.min.js'))
$css.='<script src="./js/bootstrap.min.js"></script>';
else
$css.='<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>';
if(file_exists('./js/jquery.twbsPagination.min.js'))
$css.='<script src="./js/jquery.twbsPagination.min.js"></script>';
else
$css.='<script src="//raw.githubusercontent.com/esimakin/twbs-pagination/develop/jquery.twbsPagination.min.js"></script>';
if( $is_rtl )
if(file_exists('./css/bootstrap-rtl.min.css'))
$css.='<link href="./css/bootstrap-rtl.min.css" rel="stylesheet">';
else
$css.='<link rel="stylesheet" href="//cdn.rawgit.com/morteza/bootstrap-rtl/v3.3.4/dist/css/bootstrap-rtl.min.css">';
return $css;
}
function alert($str)
{
global $lang;
return '<div class="alert alert-danger"><a href="#" class="close" data-dismiss="alert" aria-label="close">×</a><strong>'.$lang[33].'!</strong> '.$str.'</div>';
}
function AJAX_request()
{
if(isset($_SERVER['HTTP_X_REQUESTED_WITH']) && !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest')
return true ; else return false;
}
if(!Login() && $LoginDialog && ( isset($_GET['uploadfile']) || isset($_GET['listFolderFiles']) || isset($_GET['copy']) || isset($_GET['unzip']) || isset($_GET['table']) || isset($_GET['rename']) || isset($_GET['Remove']) || isset($_GET['read']) || isset($_GET['newfolder']) ) )
{
die(print_array(array( 'table' => '<div class="container_01"><center>'.$lang[31].'</center></div>' , 'total' => 1 , 'page' => 1, 'dir' => '' , 'dirHtml' => '' ,'alert' => alert($lang[22]) )));
}
if(!Login() && $LoginDialog)
{
if($login_user=='')
$html_input_user='<input name="username" value="" type="hidden" >';
else
$html_input_user='<div class="input-group" style="margin-top:10px;">
<span class="input-group-addon"><i class="UserIcon"></i></span>
<input id="user" type="text" class="form-control" name="username" value="" placeholder="'.$lang[24].'">
</div>';
echo ('<!DOCTYPE html>
<html>
<head>
<title>'.$lang[22].'</title>
<meta charset="'.$charset.'">
<link href="'.$icon[12].'" rel="icon" type="image/x-icon" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
'.css().'
<style>
body {background: #F1F1F1 none repeat scroll 0% 0%;}
.UserIcon{background:url( '.$icon[12].') no-repeat left center;padding: 5px 0 5px 20px;}
.PassIcon{background:url( '.$icon[14].') no-repeat left center;padding: 5px 0 5px 20px;}
</style>
</head>
<body>
<div class="container">
<div class="col-sm-4 col-sm-offset-4" style="margin-top:50px;">
<div class="well" style="background-color: #FFF;">
<legend>'.$lang[22].'</legend>
<form accept-charset="'.$charset.'" action="" method="post">'.$html_input_user.'
<div class="input-group" style="margin-top:10px;">
<span class="input-group-addon"><i class="PassIcon"></i></span>
<input id="password" type="password" class="form-control" name="password" placeholder="'.$lang[25].'">
</div>
<button class="btn btn-info btn-block" style="margin-top:10px;" type="submit">'.$lang[23].'</button>
</form>
</div>
</div>
</div>
</body>
</html>');
unset($lang);
unset($icon);
unset($_extensions);
unset($RTL_languages);
unset($LoginDialog);
unset($login_user);
unset($login_pass);
unset($is_rtl);
unset($units);
unset($charset);
unset($_maxFileSize);
unset($_SERVER); unset($_SESSION);unset($_COOKIE);unset($_GET); unset($_POST);unset($_FILES);unset($_ENV); unset($_REQUEST);
exit();
}
$page = (isset($_GET['page'])) ? (int)$_GET['page'] : 1;
if(!($page>0)) $page = 1;
$directory = (isset($_GET['dir'])) ? $_GET['dir'] : '.';
if(isset($_GET['copy']) /*&& AJAX_request()*/ ) {file_exists_str($_GET['copy']); recurse_copy( $_GET['copy'],$_GET['to'] ); }
if(isset($_GET['Remove']) && AJAX_request() ) {file_exists_str($_GET['Remove']);@unlinkRecursive($_GET['Remove'],true); }
if(isset($_GET['newfolder']) && AJAX_request() ) {@mkdir( $directory .'/'.$_GET['newfolder'] , 0777, true); }
if(isset($_GET['rename']) && AJAX_request() ) {file_exists_str($_GET['rename']);@rename($_GET['rename'],$directory .'/'.$_GET['newrename']);}
if(isset($_GET['unzip']) && AJAX_request() ) {file_exists_str($_GET['unzip']);@openZipArchive($_GET['unzip'],$_GET['to']);}
if(isset($_GET['listFolderFiles']) && AJAX_request() ) {die(listFolderFiles($directory));}
if(isset($_GET['read']) && $show_file_or_dir && AJAX_request() ) {file_exists_str($_GET['read']);if(in_array(extension($_GET['read']), $_extensions[1]) || count($_extensions[1])==0 )
{ header('Content-type: text/html; charset='.$charset);
die( _read($_GET['read']) ) ;
} else die($lang[7]);}
if(isset($_GET['write']) && $show_file_or_dir && AJAX_request() ) {file_exists_str($_POST['write']);if(in_array(extension($_POST['write']), $_extensions[1]) || count($_extensions[1])==0 )
{ header('Content-type: text/html; charset='.$charset);
$txtData = (isset($_POST['txt'])) ? $_POST['txt'] : '';
die( _write($_POST['write'],$txtData) ) ;
} else die($lang[7]);}
if ( isset($_GET['uploadfile']) && AJAX_request() ) {
$response = array();
if (isset( $_FILES["inputFileUpload"] ) && !empty( $_FILES["inputFileUpload"]["name"] ) )
if (is_array($_FILES['inputFileUpload']['name']) || is_object($_FILES['inputFileUpload']['name']))
foreach($_FILES['inputFileUpload']['name'] as $n => $name) {
if(!empty($name)) {
$tmp_name = basename($name);
$tmp_size = $_FILES["inputFileUpload"]["size"][$n] ;
$tmp_type = $_FILES["inputFileUpload"]["type"][$n] ;
$error = $_FILES["inputFileUpload"]["error"][$n] ;
$name_ = $_FILES["inputFileUpload"]["name"][$n] ;
$target_file = $directory .'/'.$tmp_name;
// )
if( in_array(extension($tmp_name), $_extensions[0] ) || count($_extensions[0]) ==0 )
{
if(move_uploaded_file($_FILES["inputFileUpload"]["tmp_name"][$n], $target_file))
$response[] =array( 'code' => '1','status' => $lang[34] ,'url' => $target_file , 'tmp_name' => $tmp_name , 'size' => $tmp_size , 'type' => $tmp_type , 'error' => $error , 'name' => $name_);
elseif($error!=0)
$response[] =array( 'code' => '0','status' => $lang[33].'_'.$error );
elseif($tmp_size>$_maxFileSize)
$response[] =array( 'code' => '0','status' => $lang[37] );
else
$response[] =array( 'code' => '0','status' => $lang[33] );
} else $response[] = array( 'code' => '0','status' => $lang[7] );
} else $response[] = array( 'code' => '0','status' => $lang[38] );
}
die(print_array($response));
}; //$alert_msg=$lang[38];
//exit(header('Location: ?page='.$page.'&dir='.$directory.'"'));
if(!function_exists('scandir')) {
function scandir($dir, $sortorder = 0) {
if(is_dir($dir)) {
$dirlist = opendir($dir);
while( ($file = readdir($dirlist)) !== false) {
if(!is_dir($file)) {
$files[] = $file;
}
}
($sortorder == 0) ? asort($files) : rsort($files);
return $files;
} else {
return FALSE;
break;
}
}
};
function folderSize ($dir)
{
$size = 0;
foreach (glob(rtrim($dir, '/').'/*', GLOB_NOSORT) as $each) {
$size += is_file($each) ? filesize($each) : folderSize($each);
}
return $size;
}
function FilterScanDir($dir)
{
global $_extensions,$directory;
$times = array() ;
$files_tmp = array() ;
$folers_tmp = array() ;
$total_files = 0;
$files = (is_dir($dir)) ? @scandir($dir) : array() ;
if (is_array($files) || is_object($files))
foreach($files as $file)
if( ( in_array(extension($file), $_extensions[0] ) || count($_extensions[0]) ==0 ) && $file !=='.' )
{
if($file !=='..')
$total_files++;
if(is_dir($file))
$folers_tmp[]=$file;
else
$files_tmp[]=$file;
$times[] = date ("d/m/Y H:i:s", @filemtime($directory.'/'.$file));
}
//arsort($files_tmp);
//$files = array_keys($files_tmp);
//array_multisort(array_map('filemtime', $files_tmp ), SORT_DESC, $files_tmp);
return array( 'list' => array_merge($folers_tmp,$files_tmp) ,'times' => $times , 'count' => $total_files );
}
function listFolderFiles($dir){
global $_extensions;
if (is_file($dir) === true)
return ;
$ffs = scandir($dir);
echo ' <ul>';
if (is_array($ffs) || is_object($ffs))
foreach($ffs as $ff){
if($ff != '.' && $ff != '..' && ( in_array(extension($ff), $_extensions[0] ) || count($_extensions[0]) ==0 ) ){
echo '<li><a href="'.$dir.'/'.$ff.'">'.$ff;
if(is_dir($dir.'/'.$ff)) listFolderFiles($dir.'/'.$ff);
echo '</a></li>';
}
}
echo '</ul>';
}
$total_files = 0;
$offset = ($page-1)*$perpage;
//setcookie('directory', $directory, time() + (86400 * 30), "/");
//get subset of file array
$FilesArray = FilterScanDir($directory);
$files = $FilesArray['list'];
$times = $FilesArray['times'];
$total_files= $FilesArray['count'];
//$files = (isset($files_tmp) && is_array($files_tmp)) ? $files_tmp : array();
if(isset($_GET['search']))
{
unset($files);
$files = array();
$total_files = 1;
if (in_array($_GET['search'], $FilesArray['list']))
$files[0] = $_GET['search'];
else
$files[0] = 'Match_not_found';
}
if($table_fixed=='')
$total_pages = ceil($total_files/$perpage);
else
$total_pages = 1;
unset($FilesArray);
if($table_fixed=='')
$files = array_slice($files, $offset, $perpage);
function showfile($file)
{
global $directory,$_extensions,$lang;
if($file=='.' )
return '<a href="?" onclick="getContent('."'dir=".$directory.'/'.$file."'".',0); return false;"><strong>'.$file.'</strong></a>';
elseif($file=='Match_not_found')
return '<span class="ExplorIcon">'.$lang[31].'</span>';
elseif($file=='..' )
return '<span class="TreeIcon"></span><a href="?" onclick="getContent('."'dir=".$directory.'/'.$file."'".',0); return false;">'.$file.'</a>';
elseif(is_dir($directory.'/'.$file) && file_exists($directory.'/'.$file) )
return '<span class="CFolderIcon"></span><a href="?" onclick="getContent('."'dir=".$directory.'/'.$file."'".',0); return false;">'.$file.'</a>';
elseif (in_array(extension($file), $_extensions[2] ))
return '<span class="ImageIcon"></span><a href="'.$directory.'/'.$file.'">'.$file.'</a>' ;
elseif (in_array(extension($file), array("zip","rar","7z","gzip","tar","wim","xz") ))
return '<span class="ZipIcon"></span><a href="'.$directory.'/'.$file.'">'.$file.'</a>' ;
else
return '<span class="PhpIcon"></span><a href="'.$directory.'/'.$file.'">'.$file.'</a>';
}
function extension($file)
{
global $lang;
if($file=='Match_not_found')
return '--';
$extension=strtolower(pathinfo($file, PATHINFO_EXTENSION )) ;
if($extension=='')
return 'dir';//$lang[16] ;
else
return $extension; //ucfirst
}
function file_exists_str($file)
{
global $alert_msg,$lang;
if(!file_exists($file))
$alert_msg=$lang[38];
}
function file_size($file)
{
global $directory;
return @filesize_formatted($directory.'/'.$file);
}
function action($file)
{
global $directory,$page,$show_file_or_dir,$lang,$total_files,$_extensions;
if($file=='Match_not_found' )
return '--';
if( $file =='..')
return '--';
$html= '<a data-toggle="tooltip" title="'.$lang[1].'" onclick="SetRemoveModalattr('."'".$directory.'/'.$file.'&dir='.$directory.'&page='.$page."'".'); return false;" href="#"><span class="RemoveIcon"></span></a> ';
if($show_file_or_dir)
{
if(is_dir($directory.'/'.$file))
{
$count=FilterScanDir($directory.'/'.$file); //$count=FilterScanDir($directory.'/'.$file)['count'];
$count=$count['count'];
$html.='<a data-toggle="tooltip" title="'.$lang[18].'" onclick="SetShowFileModalattr('."'".$directory.'/'.$file.'/&perpage='.$count."&#directory'".'); return false;" href="#"><span class="OFolderIcon"></span></a> ' ;
unset($count);
}
elseif (in_array(extension($file), $_extensions[2] ))
$html.='<a data-toggle="tooltip" title="'.$lang[3].'" onclick="SetShowFileModalattr('."'".$directory.'/'.$file."'".'); return false;" href="#"><span class="ImageIcon"></span></a> ' ;
elseif (in_array(extension($file), array("zip","rar","7z","gzip","tar","wim","xz") ))
$html.='<a data-toggle="tooltip" title="'.$lang[41].'" onclick="SetZipFileModalattr('."'".$directory.'/'.$file.'&dir='.$directory.'&page='.$page."'".'); return false;" href="#"><span class="ZipIcon"></span></a> ' ;
else
$html.='<a data-toggle="tooltip" title="'.$lang[3].'" onclick="SetShowFileModalattr('."'".$directory.'/'.$file."'".'); return false;" href="#"><span class="ShowIcon"></span></a> ' ;
}
$html.='<a data-toggle="tooltip" title="'.$lang[40].'" onclick="SetCopyFileModalattr('."'".$directory.'/'.$file.'&dir='.$directory.'&page='.$page."'".'); return false;" href="#"><span class="CopyIcon"></span></a>';
$html.='<a data-toggle="tooltip" title="'.$lang[20].'" onclick="SetRenameModalattr('."'".$directory.'/'.$file.'&dir='.$directory.'&page='.$page."'".'); return false;" href="#"><span class="RenameIcon"></span></a>';
return $html;
}
function _read($file,$Modes="r")
{
global $lang;
$file_size = filesize($file);
if( !$file_size || !is_readable($file) ) return $lang[21];
$myfile = fopen($file, $Modes) ;
if(!$myfile) return $lang[21]; //w
return fread($myfile, $file_size );
fclose($myfile);
};
function _write($file,$txt='',$Modes="w")
{
global $lang;
if(file_exists($file) && $txt=='') return $lang[43];
if( file_exists($file) && ( !filesize($file) || !is_readable($file) ) ) return $lang[21];
$myfile = fopen($file, $Modes) ;
if(!$myfile) return $lang[21]; //w
if ( fwrite($myfile, $txt ) )
{
fclose($myfile);
return $lang[34];
} else {
fclose($myfile);
return $lang[33];
}
};
function GetOldirectory()
{
global $directory,$page,$lang;
$html='<li><a href="#" onclick="getContent('."'dir=."."'".',0); return false;">'.$lang[4].'</a></li>';
$newDir='.';
$elements = explode('/',$directory);
if (is_array($elements) || is_object($elements))
foreach ( $elements as $key_value )
{
if($key_value!='.'){
$newDir = $newDir.'/'.$key_value;
$html.='<li><a href="#" onclick="getContent('."'dir=".$newDir.'&page='.$page."'".',0); return false;">'.$key_value.'</a></li>';
}
}
return $html;
}
function filesize_formatted($path)
{
global $units ;
if(is_dir($path) || $path=='./Match_not_found' ) return '--';//directory
$size = filesize($path);
$power = $size > 0 ? floor(log($size, 1024)) : 0;
return number_format($size / pow(1024, $power), 2, '.', ',') . ' ' . $units[$power];
}
function fileTime($index,$file)
{
global $times ;
if($file=='Match_not_found') return '--';
return $times[$index];
};
if(isset($_GET['table']) && AJAX_request() )
{
$html='<div class="table-responsive"><table class="table table-hover '.$table_fixed.'"><thead><tr>';
if($table_fixed=='')
$html.='<th class="col-md-4">'.$lang[5].'</th><th class="hidden-xs col-md-2">'.$lang[6].'</th><th class="hidden-xs col-md-2">'.$lang[7].'</th><th class="hidden-xs col-md-2">'.$lang[28].'</th>';
else
$html.='<th class="col-xs-12 col-sm-6">'.$lang[5].'</th><th class="hidden-xs col-xs-2 col-sm-2 col-md-2">'.$lang[6].'</th><th class="hidden-xs col-xs-2 col-sm-2 col-md-2">'.$lang[7].'</th>';
$html.='<th class="hidden-xs col-md-2">'.$lang[8].'</th></tr></thead><tbody>';
//output appropriate items
if (is_array($files) || is_object($files))
foreach($files as $index => $file )
{
$html.='<tr>';
if($table_fixed=='')
$html.='<td class="col-md-3">'.showfile($file).'</td><td class="hidden-xs col-md-2">'.file_size($file).'</td><td class="hidden-xs col-md-2">'.extension($file).'</td><td class="hidden-xs col-md-2">'.fileTime($index,$file).'</td>';
else
$html.='<td class="col-xs-12 col-sm-5">'.showfile($file).'</td><td class="hidden-xs col-xs-2 col-sm-2 col-md-2">'.file_size($file).'</td><td class="hidden-xs col-xs-2 col-sm-2 col-md-2"><span class="label label-default">'.extension($file).'</span></td>';
$html.='<td class="hidden-xs col-xs-3 col-sm-3 col-md-3">'.action($file).'</td></tr>';
}
$html.='<tr>';
if($table_fixed=='')
$html.='<td colspan="5" class="col-xs-12 col-sm-12 col-md-12">';
else
$html.='<td colspan="4" class="col-xs-12 col-sm-12 col-md-12">';
$html.=$lang[9].' : <mark>'.$page.'</mark> '.$lang[10].' : <mark>'.$total_files.'</mark></td></tr></tbody></table></div>';
if($alert_msg!='')
$alert_msg = alert($alert_msg);
$response = array( 'table' => $html , 'total' => $total_pages , 'page' => $page , 'dir' => $directory , 'dirHtml' => GetOldirectory() ,'alert' => $alert_msg);
unset($html);
die(print_array($response));
}
// free memory
unset($files);
unset($times);
//unset($directory);
unset($total_files);
//unset($page);
unset($offset);
//unset($total_pages);
unset($perpage);
unset($table_fixed);
unset($RTL_languages);
unset($show_file_or_dir);
unset($alert_msg);
?>
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="<?php echo $charset ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<?php echo css();?>
<link href="<?php echo $icon[4];?>" rel="icon" type="image/x-icon" />
<title><?php echo $lang[11]; ?></title>
<style>
.ZipIcon {background:url(<?php echo $icon[0];?>) no-repeat left center; padding: 5px 0 5px 25px;margin-left: 5px;}
.ImageIcon {background:url(<?php echo $icon[1];?>) no-repeat left center; padding: 5px 0 5px 25px;margin-left: 5px;}
.CopyIcon {background:url(<?php echo $icon[2];?>) no-repeat left center; padding: 5px 0 5px 25px;margin-left: 5px;}
.CFolderIcon {background:url(<?php echo $icon[3];?>) no-repeat left center; padding: 5px 0 5px 25px;margin-left: 5px;}
.OFolderIcon {background:url(<?php echo $icon[4];?>) no-repeat left center; padding: 5px 0 5px 25px;margin-left: 5px;}
.PhpIcon{background:url( <?php echo $icon[5];?>) no-repeat left center;padding: 5px 0 5px 25px;margin-left: 5px;}
.RemoveIcon {background:url(<?php echo $icon[6];?>) no-repeat left center; padding: 5px 0 5px 25px;margin-left: 5px;}
.RenameIcon{background:url( <?php echo $icon[7];?>) no-repeat left center;padding: 5px 0 5px 25px;margin-left: 5px;}
.ShowIcon {background:url(<?php echo $icon[8];?>) no-repeat left center; padding: 5px 0 5px 25px;margin-left: 5px;}
.TreeIcon{background:url( <?php echo $icon[9];?>) no-repeat left center;padding: 5px 0 5px 25px;margin-left: 5px;}
.ExplorIcon{background:url( <?php echo $icon[10];?>) no-repeat left center;padding: 5px 0 5px 25px;margin-left: 5px;}
.UploadIcon{background:url( <?php echo $icon[11];?>) no-repeat left center;padding: 5px 0 5px 25px;margin-left: 5px;}
.UserIcon{background:url( <?php echo $icon[12];?>) no-repeat left center;padding: 5px 0 5px 25px;margin-left: 5px;}
.LogoutIcon{background:url( <?php echo $icon[13];?>) no-repeat left center;padding: 5px 0 5px 25px;margin-left: 5px;}
.table,.breadcrumb,.navbar-default{border: 1px solid #D8D8D8;background: #fff none repeat scroll 0% 0%;}
.container_01{border: 1px solid #D8D8D8;background: #fff none repeat scroll 0% 0%;padding: 25px;margin-bottom:20px;}
.Loading{background:url(<?php echo $icon[15];?>) no-repeat center center; padding: 25px ;}
body {background: #F1F1F1 none repeat scroll 0% 0%;margin-bottom:20px;}
td{font-size: 12px;}
.pagination { margin:0px;}
.table-fixed { border-top: 0px ;}
.table-fixed thead { width: 97%;}
.table-fixed tbody {height: 300px;overflow-y: auto;width: 100%;}
.table-fixed thead, .table-fixed tbody, .table-fixed tr, .table-fixed td, .table-fixed th {display: block;}
.table-fixed tbody td, .table-fixed thead > tr> th {float: left;border-bottom-width: 1px;}
.btn-file {position: relative;overflow: hidden;}
.btn-file input[type=file] {position: absolute;top: 0;right: 0;min-width: 100%;min-height: 100%;font-size: 100px;text-align: right;filter: alpha(opacity=0);opacity: 0;outline: none; background: white;cursor: inherit;display: block;}
.navbar-brand {font-size: 14px;}
.treeview, .treeview ul {margin:0;padding:0;list-style:none;color: #D8D8D8;}
.treeview ul { margin-left:1em;position:relative}
.treeview ul ul {margin-left:.5em}
.treeview li {margin:0;padding:0 1em;line-height:2em;position:relative}
<?php if( $is_rtl ) { ?>
.treeview ul:before {content:"";display:block;width:0;position:absolute;top:0;right:0;border-right:1px solid;bottom:15px;}
.treeview ul li:before {content:"";display:block;width:10px;height:0;border-top:1px solid;margin-top:-1px;position:absolute;top:1em;right:0}
<?php } else {?>
.treeview ul:before {content:"";display:block;width:0;position:absolute;top:0;left:0;border-left:1px solid;bottom:15px;}
.treeview ul li:before {content:"";display:block;width:10px;height:0;border-top:1px solid;margin-top:-1px;position:absolute;top:1em;left:0}
<?php } ?>
</style>
</head>
<body>
<div class="container">
<div class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href=""> <span class="ExplorIcon" ></span> <?php echo $lang[11].'<span class="hidden-xs"> , '.$lang[12].' '. base64_decode('PGNvZGU+b25leGl0ZTwvY29kZT4=') . ' '?></span></a>
</div>
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav navbar-<?php text_position();?>">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<span class="UserIcon"></span> <?php /*if(isset($_SESSION['login']['user'])) echo $_SESSION['login']['user']; */?>
<b class="caret"></b>
</a>
<ul class="dropdown-menu dropdown-menu-<?php text_position();?>">
<li><a href="#" onclick="SetNewFolderModalattr();return false;"><span class="CFolderIcon"></span> <?php echo $lang[29];?></a></li>
<li><a href="#" onclick="SetUploadFileModalattr();return false;"><span class="UploadIcon"></span> <?php echo $lang[30];?></a></li>
<?php if($LoginDialog) {?>
<li><a href="?logout"><span class="LogoutIcon"></span> <?php echo $lang[26];?></a></li>
<?php }?>
</ul>
</li>
</ul>
<div class = "navbar-form navbar-<?php text_position();?>" role="search">
<div class="input-group">
<input type="text" class="form-control" id="inputSearch" placeholder="<?php echo $lang[19];?>" name="q">
<input type="hidden" value="<?php echo $directory.'&page='.$page;?>" id="dirInputSearch">
<div class="input-group-btn">
<button class="btn btn-default" onclick="Search()" type="submit"><span class="ExplorIcon" style="padding: 5px 0px 5px 18px;"></span></button>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Modal Rename -->
<div id="Rename" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title"><?php echo $lang[20]; ?> : <code id="RenamefileName"></code></h4>
</div>
<div class="modal-body">
<input id="renameDir" type="hidden" >
<input id="renameOldInput" type="hidden" >
<input type="text" class="form-control" id="renameInput">
</div>
<div class="modal-footer">
<span id="RenameLabelsuccess" class="label label-success pull-<?php text_position(1);?>"></span>
<button type="button" class="btn btn-success" onclick="renameAndContent()"><?php echo $lang[14]; ?></button>
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo $lang[15]; ?></button>
</div>
</div>
</div>
</div>
<!-- Modal Remove -->
<div id="Remove" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title"><?php echo $lang[1]; ?> : <code id="RemovefileName"></code></h4>
</div>
<div class="modal-body">
<input id="Removedir" type="hidden" >
<input id="RemoveInput" type="hidden" >
<?php echo $lang[13]; ?>
</div>
<div class="modal-footer">
<span id="RemoveLabelsuccess" class="label label-success pull-<?php text_position(1);?>"></span>
<button type="button" class="btn btn-success" onclick="RemoveAndContent()"><?php echo $lang[14]; ?></button>
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo $lang[15]; ?></button>
</div>
</div>
</div>
</div>
<!-- Modal Remove -->
<div id="ZipFile" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title"><?php echo $lang[41]; ?> : <code id="ZipfileName"></code></h4>
</div>
<div class="modal-body">
<input id="Zipdir" type="hidden" >
<input class="form-control" id="FolderUnzipInput" >
<div id="ZipLoad"></div>
</div>
<div class="modal-footer">
<span id="ZipLabelsuccess" class="label label-success pull-<?php text_position(1);?>"></span>
<button type="button" class="btn btn-success" onclick="zipAndContent()"><?php echo $lang[14]; ?></button>
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo $lang[15]; ?></button>
</div>
</div>
</div>
</div>
<!-- Modal NewFolder -->
<div id="NewFolder" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title"><?php echo $lang[29]; ?> </h4>
</div>
<div class="modal-body">
<input id="NewFolderDir" type="hidden" >
<input type="text" class="form-control" id="NewFolderInput">
</div>
<div class="modal-footer">
<span id="NewFolderLabelsuccess" class="label label-success pull-<?php text_position(1);?>"></span>
<button type="button" class="btn btn-success" onclick="newfolderAndContent()"><?php echo $lang[14]; ?></button>
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo $lang[15]; ?></button>
</div>
</div>
</div>
</div>
<!-- Modal CopyFolder -->
<div id="CopyFolder" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->