forked from michalc/PDW-File-Browser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
753 lines (690 loc) · 32.6 KB
/
index.php
File metadata and controls
753 lines (690 loc) · 32.6 KB
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
<?php
/*
PDW File Browser v1.3 beta
Date: October 19, 2010
Url: http://www.neele.name
Copyright (c) 2010 Guido Neele
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
ob_start( 'ob_gzhandler' );
define('MINIFY_CACHE_DIR', dirname(__FILE__) . '/cache');
require_once('functions.php');
require_once('minify.php');
if(!empty($_COOKIE["pdw-view"])):
$viewLayout = $_COOKIE["pdw-view"];
elseif(isset($_REQUEST['pdw-view'])):
$viewLayout = $_REQUEST['pdw-view'];
endif;
if(!empty($_REQUEST['skin'])) {
$skin = $_REQUEST['skin'];
} elseif(isset($_GET["skin"])){
$skin = $_GET["skin"];
} elseif (isset($defaultSkin)) {
$skin = $defaultSkin;
} else {
$skin = '';
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>PDW File Browser v1.3 (beta)</title>
<link rel="shortcut icon" href="mediabrowser.ico" />
<script type="text/javascript">
//<![CDATA[
var returnID = "<?php echo isset($_GET['returnID']) ? $_GET['returnID'] : ''; ?>";
var editor = "<?php echo $editor; ?>";
var funcNum = "<?php echo isset($_GET['CKEditorFuncNum']) ? $_GET['CKEditorFuncNum'] : 0; ?>";
var select_one_file = "<?php echo translate('Select only one file to insert!');?>";
var insert_cancelled = "<?php echo translate('Insert cancelled because there is no target to insert to!');?>";
var invalid_characters_used = "<?php echo translate('Invalid characters used!')?>";
var rename_file = "<?php echo translate('Please give a new name for file');?>";
var rename_folder = "<?php echo translate('Please give a new name for folder');?>";
var rename_error = "<?php echo translate('Rename failed!');?>";
//]]>
</script>
<?php
// MINIFY JS and CSS
// Create new Minify objects.
$minifyCSS = new Minify(TYPE_CSS);
$minifyJS = new Minify(TYPE_JS);
// Specify the files to be minified.
$cssFiles = array('css/mediabrowser.css');
// Only load skin if $_GET["skin"] or $defaultSkin is set.
if ($skin != ""):
$cssFiles[count($cssFiles)] = 'skins/'.$skin.'/skin.css';
endif;
$minifyCSS->addFile($cssFiles);
$jsFiles = array(
'js/jquery.js',
'js/jquery.mediabrowser.js',
'js/jquery.plugins.js',
'swfupload/swfupload.min.js',
'swfupload/plugins/swfupload.queue.js',
'swfupload/fileprogress.js',
'swfupload/handlers.js'
);
//If editor is TinyMCE then add javascript file
if ($editor == "tinymce"):
$jsFiles[count($jsFiles)] = 'js/tiny_mce_popup.js';
endif;
$minifyJS->addFile($jsFiles);
// JAVASCRIPT
echo '<script type="text/javascript">';
echo '//<![CDATA[';
echo $minifyJS->combine();
echo '//]]>';
echo '</script>';
// CSS
echo '<style type="text/css">';
echo $minifyCSS->combine();
echo '</style>';
?>
<script type="text/javascript">
//<![CDATA[
var swfu;
var foldercmenu;
var filecmenu;
var imagecmenu;
var cmenu;
$(document).ready(function() {
// Prevent text selections
divFiles = document.getElementById('files');
divFiles.onselectstart = function() {return false;} // ie
divFiles.onmousedown = function() {return false;} // mozilla
// *** Context Menu ***//
$.contextMenu.theme = 'mb';
$.contextMenu.shadowOpacity = .3;
// activate folder/file selection before show
$.contextMenu.beforeShow = function(){
// Hide all other contextmenus
$('table.contextmenu, div.context-menu-shadow').css({'display': 'none'});
// Enable paste button if clipboard has items
if($.MediaBrowser.clipboard.length > 0){
$('table.contextmenu div.context-menu-item').removeClass('context-menu-item-disabled');
} else {
// Disable paste button if no items are added to the clipboard
$('table.contextmenu div.context-menu-item[title=paste]').addClass('context-menu-item-disabled');
}
// Show selection of file, folder or image
if($(this.target).hasClass('folder')){ //Folder
$.MediaBrowser.selectFileOrFolder(this.target, $(this.target).attr('href'), 'folder', 'cmenu');
} else if($(this.target).hasClass('file')){ //File
$.MediaBrowser.selectFileOrFolder(this.target, $(this.target).attr('href'), 'file', 'cmenu');
} else if($(this.target).hasClass('image')){ //Image
$.MediaBrowser.selectFileOrFolder(this.target, $(this.target).attr('href'), 'image', 'cmenu');
}
return true;
}
//Context menus
foldercmenu = [
{'<?php echo translate("Open");?>':{
onclick: function(menuItem,menu) { $.MediaBrowser.loadFolder($(this).attr('href')); },
icon:'img/contextmenu/open.png'
}
}
<?php if($allowedActions['copy_paste'] === TRUE || $allowedActions['cut_paste'] === TRUE): ?>
,$.contextMenu.separator
<?php endif; ?>
<?php if($allowedActions['copy_paste'] === TRUE): ?>
,{'<?php echo translate("Copy");?>':{
onclick:function(menuItem,menu) { $.MediaBrowser.copy(); },
icon:'img/contextmenu/copy.gif'
}
}
<?php endif; ?>
<?php if($allowedActions['cut_paste'] === TRUE): ?>
,{'<?php echo translate("Cut");?>':{
onclick:function(menuItem,menu) { $.MediaBrowser.cut(); },
icon:'img/contextmenu/cut.gif'
}
}
<?php endif; ?>
<?php if($allowedActions['copy_paste'] === TRUE || $allowedActions['cut_paste'] === TRUE): ?>
,{'<?php echo translate("Paste");?>':{
onclick:function(menuItem,menu) { $.MediaBrowser.paste(); },
icon:'img/contextmenu/paste.gif',
disabled:true
}
}
<?php endif; ?>
<?php if($allowedActions['rename'] === TRUE): ?>
,$.contextMenu.separator,
{'<?php echo translate("Rename");?>':{
onclick:function(menuItem,menu) { $.MediaBrowser.rename($(this).attr('href'), 'folder'); },
icon:'img/contextmenu/rename.png'
}
}
<?php endif; ?>
<?php if($allowedActions['delete'] === TRUE): ?>
,$.contextMenu.separator,
{'<?php echo translate("Delete");?>':{
onclick:function(menuItem,menu) {
if(confirm('<?php echo translate("Do you really want to delete this folder and its contents?");?>')){
$.MediaBrowser.delete_all();
}
},
icon:'img/contextmenu/delete.gif',
disabled:false
}
}
<?php endif; ?>
];
filecmenu = [
{'<?php echo translate("Insert");?>':{
onclick:function(menuItem,menu) { $.MediaBrowser.insertFile(); },
icon:'img/contextmenu/insert.png'
}
}
<?php if($allowedActions['copy_paste'] === TRUE || $allowedActions['cut_paste'] === TRUE): ?>
,$.contextMenu.separator
<?php endif; ?>
<?php if($allowedActions['copy_paste'] === TRUE): ?>
,{'<?php echo translate("Copy");?>':{
onclick:function(menuItem,menu) { $.MediaBrowser.copy(); },
icon:'img/contextmenu/copy.gif'
}
}
<?php endif; ?>
<?php if($allowedActions['cut_paste'] === TRUE): ?>
,{'<?php echo translate("Cut");?>':{
onclick:function(menuItem,menu) { $.MediaBrowser.cut(); },
icon:'img/contextmenu/cut.gif'
}
}
<?php endif; ?>
<?php if($allowedActions['copy_paste'] === TRUE || $allowedActions['cut_paste'] === TRUE): ?>
,{'<?php echo translate("Paste");?>':{
onclick:function(menuItem,menu) { $.MediaBrowser.paste(); },
icon:'img/contextmenu/paste.gif',
disabled:true
}
}
<?php endif; ?>
<?php if($allowedActions['rename'] === TRUE): ?>
,$.contextMenu.separator,
{'<?php echo translate("Rename");?>':{
onclick:function(menuItem,menu) { $.MediaBrowser.rename($(this).attr('href'), 'file'); },
icon:'img/contextmenu/rename.png'
}
}
<?php endif; ?>
<?php if($allowedActions['delete'] === TRUE): ?>
,$.contextMenu.separator,
{'<?php echo translate("Delete");?>':{
onclick:function(menuItem,menu) {
if(confirm('<?php echo translate("Do you really want to delete this file?");?>')){
$.MediaBrowser.delete_all();
}
},
icon:'img/contextmenu/delete.gif',
disabled:false
}
}
<?php endif; ?>
];
imagecmenu = [
{'<?php echo translate("Insert");?>':{
onclick:function(menuItem,menu) { $.MediaBrowser.insertFile(); },
icon:'img/contextmenu/insert.png'
}
}
<?php if($allowedActions['copy_paste'] === TRUE || $allowedActions['cut_paste'] === TRUE): ?>
,$.contextMenu.separator
<?php endif; ?>
<?php if($allowedActions['copy_paste'] === TRUE): ?>
,{'<?php echo translate("Copy");?>':{
onclick:function(menuItem,menu) { $.MediaBrowser.copy(); },
icon:'img/contextmenu/copy.gif'
}
}
<?php endif; ?>
<?php if($allowedActions['cut_paste'] === TRUE): ?>
,{'<?php echo translate("Cut");?>':{
onclick:function(menuItem,menu) { $.MediaBrowser.cut(); },
icon:'img/contextmenu/cut.gif'
}
}
<?php endif; ?>
<?php if($allowedActions['copy_paste'] === TRUE || $allowedActions['cut_paste'] === TRUE): ?>
,{'<?php echo translate("Paste");?>':{
onclick:function(menuItem,menu) { $.MediaBrowser.paste(); },
icon:'img/contextmenu/paste.gif',
disabled:true
}
}
<?php endif; ?>
<?php if($allowedActions['rename'] === TRUE): ?>
,$.contextMenu.separator,
{'<?php echo translate("Rename");?>':{
onclick:function(menuItem,menu) { $.MediaBrowser.rename($(this).attr('href'), 'file'); },
icon:'img/contextmenu/rename.png'
}
}
<?php endif; ?>
<?php if($allowedActions['delete'] === TRUE): ?>
,$.contextMenu.separator,
{'<?php echo translate("Delete");?>':{
onclick:function(menuItem,menu) {
if(confirm('<?php echo translate("Do you really want to delete this image?");?>')){
$.MediaBrowser.delete_all();
}
},
icon:'img/contextmenu/delete.gif',
disabled:false
}
}
<?php endif; ?>
];
cmenu = [
{'<?php echo translate("Large images");?>':{
onclick:function(menuItem,menu) { $.MediaBrowser.changeview('large_images'); },
icon:'img/contextmenu/view_images_large.png'
}
},
{'<?php echo translate("Small images");?>':{
onclick:function(menuItem,menu) { $.MediaBrowser.changeview('small_images'); },
icon:'img/contextmenu/view_images_small.png'
}
},
{'<?php echo translate("List");?>':{
onclick:function(menuItem,menu) { $.MediaBrowser.changeview('list'); },
icon:'img/contextmenu/view_list.png'
}
},
{'<?php echo translate("Details");?>':{
onclick:function(menuItem,menu) { $.MediaBrowser.changeview('details'); },
icon:'img/contextmenu/view_details.png'
}
},
{'<?php echo translate("Tiles");?>':{
onclick:function(menuItem,menu) { $.MediaBrowser.changeview('tiles'); },
icon:'img/contextmenu/view_tiles.png'
}
},
{'<?php echo translate("Content");?>':{
onclick:function(menuItem,menu) { $.MediaBrowser.changeview('content'); },
icon:'img/contextmenu/view_content.png'
}
}
<?php if($allowedActions['create_folder'] === TRUE): ?>
,$.contextMenu.separator,
{'<?php echo translate("New folder");?>':{
onclick:function(menuItem,menu) { $.MediaBrowser.showLayer('newfolder'); },
icon:'img/contextmenu/open.png'
}
}
<?php endif; ?>
<?php if($allowedActions['copy_paste'] === TRUE || $allowedActions['cut_paste'] === TRUE): ?>
,$.contextMenu.separator,
{'<?php echo translate("Paste");?>':{
onclick:function(menuItem,menu) { $.MediaBrowser.paste(); },
icon:'img/contextmenu/paste.gif',
disabled:true
}
}
<?php endif; ?>
];
// *** Media Browser ***//
$.MediaBrowser.init();
// Add context menu to the files, folders and images
$.MediaBrowser.contextmenu();
<?php if($allowedActions['upload'] === TRUE): ?>
// *** SWFUpload ***//
// Upload configuration
var settings = {
flash_url: "swfupload/swfupload.swf",
upload_url: "swfupload/upload.php",
post_params: {
"PHPSESSID": "<?php echo session_id(); ?>",
"uploadpath": "<?php echo rawurlencode($uploadpath); ?>"
},
file_size_limit: "<?php echo $max_file_size_in_bytes/(1024*1024); ?> MB",
file_types: "<?php echo '*.' . str_replace(';', ';*.', str_replace(',', ';', str_replace(' ', '', $extension_whitelist))); ?>",
file_types_description: "All Files",
file_upload_limit: 100,
file_queue_limit: 0,
custom_settings: {
progressTarget : "fsUploadProgress",
cancelButtonId : "btnCancel"
},
debug: false,
// Button settings
button_width: "175",
button_height: "20",
button_window_mode: "transparent",
button_placeholder_id: "spanButtonPlaceHolder",
button_text: '<span class="browseButton"><?php echo translate("Browse..."); ?></span>',
button_text_style: ".browseButton {font-family:sans-serif; color:#000000; font-size:14px; font-weight: bold;}",
button_cursor: SWFUpload.CURSOR.HAND,
button_text_top_padding: 1,
// The event handler functions are defined in handlers.js
swfupload_loaded_handler : swfUploadLoaded,
file_queued_handler : fileQueued,
file_queue_error_handler : fileQueueError,
file_dialog_complete_handler : fileDialogComplete,
upload_start_handler : uploadStart,
upload_progress_handler : uploadProgress,
upload_error_handler : uploadError,
upload_success_handler : uploadSuccess,
upload_complete_handler : uploadComplete,
queue_complete_handler : queueComplete, // Queue plugin event
// SWFObject settings
minimum_flash_version : "9.0.28",
swfupload_pre_load_handler : swfUploadPreLoad,
swfupload_load_failed_handler : swfUploadLoadFailed
};
swfu = new SWFUpload(settings);
<?php endif;?>
});
//]]>
</script>
</head>
<body>
<input type="hidden" id="currentfolder" value="<?php echo $uploadpath;?>" />
<input type="hidden" id="currentview" value="<?php echo $viewLayout;?>" />
<!--
+++++++++++++++++++++++++++++++++
+ Address Bar & Search +
+++++++++++++++++++++++++++++++++
-->
<?php $rootname = array_pop((explode("/", trim($uploadpath,"/")))); ?>
<div id="addressbar" class="ab">
<ol>
<li class="root"><span> </span></li>
<li><a href="<?php echo $uploadpath;?>" title="<?php echo $rootname;?>"><span><?php echo $rootname;?></span></a></li>
</ol>
<div id="searchbar">
<div class="cap"></div>
<input name="search" id="search" value="<?php echo translate('Search');?>" />
<div class="button"></div>
</div>
</div>
<!--
+++++++++++++++++++++++++++++++++
+ Menu Bar +
+++++++++++++++++++++++++++++++++
-->
<div id="navbar" class="nb">
<ul class="left">
<?php if($allowedActions['create_folder'] === TRUE): ?><li><a href="#" onclick="return $.MediaBrowser.showLayer('newfolder');" title="<?php echo translate('New folder');?>"><span><?php echo translate("New folder");?></span></a></li><?php endif; ?>
<?php if($allowedActions['upload'] === TRUE): ?><li><a href="#" onclick="return $.MediaBrowser.showLayer('upload');" title="<?php echo translate('Upload');?>"><span><?php echo translate("Upload");?></span></a></li><?php endif; ?>
<li class="label"><a href="#" onclick="return $.MediaBrowser.printClipboard();" title="<?php echo translate('Clipboard');?>"><span><?php echo translate("Clipboard");?> ( <div id="cbItems">0</div> <?php echo translate("items");?> )</span></a></li>
</ul>
<ul class="right">
<li><a href="#" title="<?php echo translate("Change view");?>"><span><?php echo translate("View");?></span></a>
<ul>
<li><a href="#" onclick="return $.MediaBrowser.changeview('large_images');" title="<?php echo translate('Large images');?>"><span class="icon large"></span><?php echo translate("Large images");?></a></li>
<li><a href="#" onclick="return $.MediaBrowser.changeview('small_images');" title="<?php echo translate('Small images');?>"><span class="icon small"></span><?php echo translate("Small images");?></a></li>
<li><a href="#" onclick="return $.MediaBrowser.changeview('list');" title="<?php echo translate('List');?>"><span class="icon list"></span><?php echo translate("List");?></a></li>
<li><a href="#" onclick="return $.MediaBrowser.changeview('details');" title="<?php echo translate('Details');?>"><span class="icon details"></span><?php echo translate("Details");?></a></li>
<li><a href="#" onclick="return $.MediaBrowser.changeview('tiles');" title="<?php echo translate('Tiles');?>"><span class="icon tiles"></span><?php echo translate("Tiles");?></a></li>
<li><a href="#" onclick="return $.MediaBrowser.changeview('content');" title="<?php echo translate('Content');?>"><span class="icon content"></span><?php echo translate("Content");?></a></li>
</ul>
</li>
<?php if($allowedActions['settings'] === TRUE): ?><li><a href="#" onclick="return $.MediaBrowser.showLayer('settings');" class="settings" title="<?php echo translate('Settings');?>"><span><img src="img/settings.png" alt="<?php echo translate('Settings');?>" /></span></a></li><?php endif; ?>
<li><a href="#" onclick="return $.MediaBrowser.showLayer('help');" class="help" title="<?php echo translate('Help');?>"><span><img src="img/help.png" alt="<?php echo translate('Help');?>" /></span></a></li>
</ul>
</div>
<div id="message"></div>
<div id="explorer">
<!--
+++++++++++++++++++++++++++++++++
+ Treeview +
+++++++++++++++++++++++++++++++++
-->
<div id="tree">
<?php
require_once("treeview.php");
?>
</div>
<div id="vertical-resize-handler" class="resize-grip"></div>
<div id="main">
<!--
+++++++++++++++++++++++++++++++++
+ Files & Folders +
+++++++++++++++++++++++++++++++++
-->
<div id="filelist" class="layer">
<h2><?php echo $rootname?></h2>
<select id="filters">
<option value=""><?php echo translate("All files");?> (*.*) </option>
<option<?php echo (isset($_GET["filter"]) && $_GET["filter"] == "flash" ? ' selected="selected"' : '');?> value=".swf|.flv|.fla">Flash </option>
<option<?php echo (isset($_GET["filter"]) && $_GET["filter"] == "image" ? ' selected="selected"' : '');?> value=".bmp|.gif|.jpg|.jpeg|.png">Images </option>
<option<?php echo (isset($_GET["filter"]) && $_GET["filter"] == "media" ? ' selected="selected"' : '');?> value=".avi|.flv|.mov|.mp3|.mp4|.mpeg|.mpg|.ogg|.wav|.wma|.wmv">Media </option>
<?php
if(isset($customFilters)):
foreach($customFilters as $key => $value){
echo '<option value="'.$value.'">'.$key.' </option>'."\n";
}
endif;
?>
</select>
<hr />
<div id="files">
<?php
// Get all folders in root upload folder but don't iterate
$dirs = getDirTree(STARTINGPATH, true, false);
switch($viewLayout){
case 'large_images':
require_once("view_images_large.php");
break;
case 'small_images':
require_once("view_images_small.php");
break;
case 'list':
require_once("view_list.php");
break;
case 'details':
require_once("view_details.php");
break;
case 'tiles':
require_once("view_tiles.php");
break;
default: //Content
require_once("view_content.php");
break;
}
?>
</div>
</div>
<!--
+++++++++++++++++++++++++++++++++
+ Create a new folder +
+++++++++++++++++++++++++++++++++
-->
<?php if($allowedActions['create_folder'] === TRUE): ?>
<div id="newfolder" class="layer">
<h2><?php echo translate("Add a new folder")?></h2>
<a href="#" class="close" onclick="$.MediaBrowser.hideLayer(); $.MediaBrowser.loadFolder($.MediaBrowser.currentFolder); return false;">X</a>
<hr />
<div class="window">
<form id="newfolderform" name="newfolderform" onsubmit="$.MediaBrowser.newFolder(); return false;">
<div class="padding10">
<div class="height20">
<label for="folderpath"><?php echo translate("New folder is created in");?>: <input class="path" type="text" name="folderpath" id="folderpath" readonly="readonly"/></label>
</div>
<div class="paddingtop10 height20 marginbottom5">
<label for="newfoldername"><?php echo translate("Name of the new folder");?>: <input class="path border" type="text" name="foldername" id="foldername" /></label>
</div>
<div class="paddingtop10 height20 marginbottom5">
<button type="submit"><?php echo translate("Create folder");?></button>
<button type="button" onclick="$.MediaBrowser.hideLayer(); $.MediaBrowser.loadFolder($.MediaBrowser.currentFolder); return false;"><?php echo translate("Close");?></button>
</div>
</div>
</form>
</div>
</div>
<?php endif; ?>
<!--
+++++++++++++++++++++++++++++++++
+ Upload a new file +
+++++++++++++++++++++++++++++++++
-->
<?php if($allowedActions['upload'] === TRUE): ?>
<div id="upload" class="layer">
<h2><?php echo translate("Upload a new file")?></h2>
<a href="#" class="close" onclick="$.MediaBrowser.hideLayer(); $.MediaBrowser.loadFolder($.MediaBrowser.currentFolder); return false;">X</a>
<hr />
<div class="window">
<form id="form1" action="index.php" method="post" enctype="multipart/form-data">
<div class="paddingtop10 paddingleft10 height20">
<label for="uploadpath"><?php echo translate("Currently uploading in folder");?>: <input class="path" type="text" name="uploadpath" id="uploadpath" readonly="readonly" /></label>
</div>
<div class="paddingtop10 paddingleft10 height20">
<?php echo translate("Select your file");?>: <span id="spanButtonPlaceHolder"></span>
</div>
<div class="padding10 height20"><?php echo sprintf(translate("Upload limited to %d MB!"), ($max_file_size_in_bytes/(1024*1024)));?></div>
<div class="fieldset flash" id="fsUploadProgress">
<span class="legend"><?php echo translate("Upload queue");?></span>
</div>
<div class="paddingleft10">
<button id="btnCancel" type="button"><?php echo translate('Cancel all uploads');?></button>
<button type="button" onclick="$.MediaBrowser.hideLayer(); $.MediaBrowser.loadFolder($.MediaBrowser.currentFolder); return false;"><?php echo translate('Close');?></button>
</div>
<div id="divLoadingContent" class="content" style="background-color: #FFFF66; border-top: solid 4px #FF9966; border-bottom: solid 4px #FF9966; margin: 10px 25px; padding: 10px 15px; display: none;">
SWFUpload is loading. Please wait a moment...
</div>
<div id="divLongLoading" class="content" style="background-color: #FFFF66; border-top: solid 4px #FF9966; border-bottom: solid 4px #FF9966; margin: 10px 25px; padding: 10px 15px; display: none;">
SWFUpload is taking a long time to load or the load has failed. Please make sure that the Flash Plugin is enabled and that a working version of the Adobe Flash Player is installed.
</div>
<div id="divAlternateContent" class="content" style="background-color: #FFFF66; border-top: solid 4px #FF9966; border-bottom: solid 4px #FF9966; margin: 10px 25px; padding: 10px 15px; display: none;">
We're sorry. SWFUpload could not load. You may need to install or upgrade Flash Player.
Visit the <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Adobe website</a> to get the Flash Player.
</div>
</form>
</div>
</div>
<?php endif; ?>
<!--
+++++++++++++++++++++++++++++++++
+ Settings +
+++++++++++++++++++++++++++++++++
-->
<?php if($allowedActions['settings'] === TRUE): ?>
<div id="settings" class="layer" style="display:none;">
<h2><?php echo translate("Settings"); ?></h2>
<a href="#" class="close" onclick="$.MediaBrowser.hideLayer(); return false;" title="<?php echo translate('Close')?>"><?php echo translate("Close")?></a>
<hr />
<div class="window">
<div class="padding10">
<dl>
<dt><?php echo translate("Language");?></dt>
<dd>
<select id="settings_language">
<?php
require_once('lang/languages.php');
foreach($languages as $key => $value){
printf('<option%s value="%s">%s</option>',($language == $value ? ' selected="selected"' : '') , $value, $key);
}
?>
</select>
</dd>
<dt><?php echo translate("Theme");?></dt>
<dd>
<select id="settings_skin">
<?php
require_once('skins/skins.php');
$skins["Redmond"] = "";
asort($skins);
foreach($skins as $key => $value){
printf('<option%s value="%s">%s</option>', ($skin == $value ? ' selected="selected"' : ''), $value, $key);
}
?>
</select>
</dd>
</dl>
<p><?php echo translate("Cookies need to be enabled to save your settings!");?></p>
<hr />
<button type="button" onclick="$.MediaBrowser.saveSettings(); return false;"><?php echo translate("Save settings");?></button>
<button type="button" onclick="$.MediaBrowser.hideLayer(); return false;"><?php echo translate("Close");?></button>
</div>
</div>
</div>
<?php endif; ?>
<!--
+++++++++++++++++++++++++++++++++
+ Help +
+++++++++++++++++++++++++++++++++
-->
<div id="help" class="layer" style="display:none;">
<h2>PDW File Browser v1.3 beta</h2>
<a href="#" class="close" onclick="$.MediaBrowser.hideLayer(); return false;" title="<?php echo translate("Close")?>"><?php echo translate("Close")?></a>
<hr />
<div class="window">
<div class="padding10">
<p>Author: Guido Neele<br />
Date: October 10, 2010<br />
Url: http://www.neele.name</p>
<p>Copyright (c) 2010 Guido Neele</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.</p>
<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.</p>
<p>This plugin makes use of:</p>
<ul>
<li>jQuery (jquery.com)</li>
<li>jQuery.contextmenu - Matt Kruse (javascripttoolbox.com)</li>
<li>SWFUpload - (swfupload.org)</li>
<li>Javascript functions urlencode/urldecode - (phpjs.org)</li>
<li>createCookie - Peter-Paul Koch (http://www.quirksmode.org/js/cookies.html)</li>
<li>Javascript function printf - Dav Glass extension for the Yahoo UI Library</li>
<li>Modified version of Slimbox 2 - Christophe Beyls (http://www.digitalia.be)</li>
</ul>
<p><button type="button" onclick="$.MediaBrowser.hideLayer(); return false;"><?php echo translate("Close");?></button></p>
</div>
</div>
</div>
</div>
</div>
<!--
+++++++++++++++++++++++++++++++++
+ File Information Pane +
+++++++++++++++++++++++++++++++++
-->
<div id="file-specs">
<div id="info">
<?php
require_once("file_specs.php");
?>
</div>
<form id="fileform" name="fileform" onsubmit="$.MediaBrowser.insertFile(); return false;">
<label for="file"><?php echo translate("File");?></label>
<input type="text" name="file" id="file" readonly="readonly" value="" />
<button type="submit"><?php echo translate("Insert");?></button>
<div>
<?php
$checked = isset($_COOKIE["absoluteURL"]) ? $_COOKIE["absoluteURL"] : $absolute_url;
?>
<label for="absolute_url"><input class="checkbox" type="checkbox" id="absolute_url" <?php echo $absolute_url_disabled ? 'disabled="disabled" ' : '';?><?php echo $checked ? 'checked="checked" ' : '';?>/><?php echo translate("Absolute URL with hostname");?></label>
</div>
</form>
</div>
</body>
</html>