-
Notifications
You must be signed in to change notification settings - Fork 97
/
CoreAsset.php
84 lines (70 loc) · 1.57 KB
/
CoreAsset.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
<?php
namespace yii2fullcalendar;
use Yii;
use yii\web\AssetBundle;
/**
* @link http://www.frenzel.net/
* @author Philipp Frenzel <[email protected]>
*/
class CoreAsset extends AssetBundle
{
/**
* [$sourcePath description]
* @var string
*/
public $sourcePath = '@bower/fullcalendar/packages/core';
/**
* the language the calender will be displayed in
* @var string ISO2 code for the wished display language
*/
public $language = NULL;
/**
* [$autoGenerate description]
* @var boolean
*/
public $autoGenerate = true;
/**
* tell the calendar, if you like to render google calendar events within the view
* @var boolean
*/
public $googleCalendar = false;
/**
* [$css description]
* @var array
*/
public $css = [
'main.min.css',
];
/**
* [$js description]
* @var array
*/
public $js = [
'main.js',
'locale-all.js',
];
/**
* [$depends description]
* @var array
*/
public $depends = [
'yii\web\YiiAsset',
'yii2fullcalendar\PrintAsset'
];
/**
* @inheritdoc
*/
public function registerAssetFiles($view)
{
$language = $this->language ? $this->language : Yii::$app->language;
if (strtoupper($language) != 'EN-US')
{
$this->js[] = "locale/{$language}.js";
}
if($this->googleCalendar)
{
$this->js[] = 'gcal.js';
}
parent::registerAssetFiles($view);
}
}