-
Notifications
You must be signed in to change notification settings - Fork 1
/
UserLogs.php
57 lines (48 loc) · 1.41 KB
/
UserLogs.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 rikcage\user_logs;
use Yii;
/**
* bdlogs module definition class
*/
class UserLogs extends \yii\base\Module
{
/**
* @inheritdoc
*/
public $controllerNamespace = 'rikcage\user_logs\controllers';
public $theme = false;
public $access_rules; //array
public $behaviors_params; //array
public $logs_live; //string
public $virtual_cron = true; //string
public $var_name_last_delete; //string
public $gitignore_list = array();
/**
* @inheritdoc
*/
public function init()
{
parent::init();
//UserLogs::registerInit();
UserLogs::registerTranslations();
if ($this->theme) {
Yii::$app->view->theme = new \yii\base\Theme($this->theme);
}
// custom initialization code goes here
}
public static function registerTranslations()
{
Yii::setAlias('@rikcage', dirname(dirname(__DIR__)) . '/rikcage/yii2-user-logs');
if (!isset(Yii::$app->i18n->translations['user_logs'])) {
Yii::$app->i18n->translations['user_logs'] = [
'class' => 'yii\i18n\PhpMessageSource',
//'sourceLanguage' => 'en-US',
//'sourceLanguage' => 'ru-Ru',
'basePath' => '@rikcage/messages/',
'fileMap' => [
'user_logs' => 'user_logs.php',
],
];
}
}
}