manager.php
1.68 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
<?php
/**
* @var \yii\web\View $this
* @var array $options
*/
use mihaildev\elfinder\Assets;
use yii\helpers\Json;
Assets::register($this);
Assets::addLangFile($options['lang'], $this);
if(!empty($options['noConflict']))
Assets::noConflict($this);
unset($options['noConflict']);
$this->registerJs("
function ElFinderGetCommands(disabled){
var Commands = elFinder.prototype._options.commands;
$.each(disabled, function(i, cmd) {
(idx = $.inArray(cmd, Commands)) !== -1 && Commands.splice(idx,1);
});
return Commands;
}
var winHashOld = '';
function elFinderFullscreen(){
var width = $(window).width()-($('#elfinder').outerWidth(true) - $('#elfinder').width());
var height = $(window).height()-($('#elfinder').outerHeight(true) - $('#elfinder').height());
var el = $('#elfinder').elfinder('instance');
var winhash = $(window).width() + '|' + $(window).height();
if(winHashOld == winhash)
return;
winHashOld = winhash;
el.resize(width, height);
}
$('#elfinder').elfinder(".Json::encode($options).").elfinder('instance');
$(window).resize(elFinderFullscreen);
elFinderFullscreen();
");
$this->registerCss("
html, body {
height: 100%;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
position: relative;
padding: 0; margin: 0;
}
");
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>elFinder 2.0</title>
<?php $this->head() ?>
</head>
<body>
<?php $this->beginBody() ?>
<div id="elfinder"></div>
<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>