-
Notifications
You must be signed in to change notification settings - Fork 76
/
Assets.php
57 lines (47 loc) · 1.25 KB
/
Assets.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
<?php
namespace mihaildev\elfinder;
use yii\web\AssetBundle;
use yii\web\JqueryAsset;
class Assets extends AssetBundle
{
public $sourcePath = '@vendor/studio-42/elfinder';
public $publishOptions = [
'except' => [
'php/',
'files/',
]
];
public $css = array(
'css/elfinder.min.css',
'css/theme.css',
);
public $js = array(
'js/elfinder.min.js'
);
public $depends = array(
'yii\jui\JuiAsset',
);
/**
* @param string $lang
* @param \yii\web\View $view
*/
public static function addLangFile($lang, $view){
$lang = ElFinder::getSupportedLanguage($lang);
if ($lang !== false && $lang !== 'en'){
$view->registerJsFile(self::getPathUrl().'/js/i18n/elfinder.' . $lang . '.js', ['depends' => [Assets::className()]]);
}
}
public static function getPathUrl(){
return \Yii::$app->assetManager->getPublishedUrl("@vendor/studio-42/elfinder");
}
public static function getSoundPathUrl(){
return self::getPathUrl()."/sounds/";
}
/**
* @param \yii\web\View $view
*/
public static function noConflict($view){
list(,$path) = \Yii::$app->assetManager->publish(__DIR__."/assets");
$view->registerJsFile($path.'/no.conflict.js', ['depends' => [JqueryAsset::className()]]);
}
}