-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJsk.php
50 lines (39 loc) · 982 Bytes
/
Jsk.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
<?php
/**
* @copyright (C) FIT-Media.com (fit-media.com), {@link http://tanitacms.net}
* Date: 22.02.15, Time: 14:26
*
* @author Dmitrij "m00nk" Sheremetjev <[email protected]>
* @package
*/
namespace m00nk\jsk;
use yii\helpers\Json;
class Jsk extends \yii\base\Widget
{
public $language = false;
public function run()
{
$view = $this->getView();
JskAsset::register($view);
if($this->language === false) $this->language = \Yii::$app->language;
$opts = [];
if($this->language != 'ru')
$opts = [
'btnOk'=> 'Ok',
'btnYes'=> 'Yes',
'btnNo'=> 'No',
'btnApply' => 'Apply',
'btnUpdate' => 'Update',
'btnSave' => 'Save',
'btnCancel' => 'Cancel',
'btnClose' => 'Close',
'btnAccept' => 'Accept',
'btnDecline' => 'Decline',
'titleMessage'=> 'Message',
'titleError'=> 'Error',
'titleQuestion'=> 'Question',
'titleConfirm'=> 'Confirm'
];
$view->registerJs('jsk.init('.Json::encode($opts).');');
}
}