forked from ricco381/yii2-ticket
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Module.php
executable file
·73 lines (58 loc) · 1.76 KB
/
Module.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
<?php
namespace ricco\ticket;
use ricco\ticket\models\User;
use Yii;
/**
* ticket module definition class
*/
class Module extends \yii\base\Module {
/**
* @inheritdoc
*/
public $controllerNamespace = 'ricco\ticket\controllers';
/** @var bool Уведомление на почту о тикетах */
public $mailSend = true;
/** @var string Тема email сообщения когда пользователю приходит ответ */
public $subjectAnswer = 'Response by the ticket';
/** @var User */
public $userModel = false;
public $qq = [
'ask_question' => 'Ask Question',
'bug' => 'Report a Bug',
'new_feature' => 'New Feature',
];
/** @var array Ники администраторав */
public $admin = ['admin'];
/** @var string */
public $uploadFilesDirectory = '@webroot/fileTicket';
/** @var string */
public $uploadFilesExtensions = 'png, jpg';
/** @var int */
public $uploadFilesMaxFiles = 5;
/** @var null|int */
public $uploadFilesMaxSize = null;
/** @var bool|int */
public $pageSize = false;
/**
* @inheritdoc
*/
public function init() {
User::$user = ($this->userModel !== false) ? $this->userModel : Yii::$app->user->identityClass;
parent::init();
$this->registerTranslations();
}
/**
* Registration of translation class.
*/
protected function registerTranslations()
{
Yii::$app->i18n->translations['ticket'] = [
'class' => 'yii\i18n\PhpMessageSource',
'sourceLanguage' => 'en',
'basePath' => '@ricco/ticket/messages',
'fileMap' => [
'ticket' => 'ticket.php',
],
];
}
}