1 | <?php |
||
13 | class ChatWidget extends Widget |
||
14 | { |
||
15 | /** |
||
16 | * @var boolean set to true if widget will be run for auth users |
||
17 | */ |
||
18 | public $auth = false; |
||
19 | public $user_id = null; |
||
20 | public $view = 'index'; |
||
21 | /** @var integer $port web socket port */ |
||
22 | public $port = 8080; |
||
23 | /** @var array $chatList list of preloaded chats */ |
||
24 | public $chatList = [ |
||
25 | 'id' => 1, |
||
26 | 'title' => 'All' |
||
27 | ]; |
||
28 | /** @var string path to avatars folder */ |
||
29 | public $imgPath = '@vendor/joni-jones/yii2-wschat/assets/img'; |
||
30 | |||
31 | /** |
||
32 | * @var boolean is user available to add nwe rooms |
||
33 | */ |
||
34 | public $add_room = true; |
||
35 | |||
36 | /** |
||
37 | * @override |
||
38 | */ |
||
39 | public function run() |
||
48 | |||
49 | /** |
||
50 | * Register js variables |
||
51 | * |
||
52 | * @access protected |
||
53 | * @return void |
||
54 | */ |
||
55 | protected function registerJsOptions() |
||
65 | } |
||
66 | |||
67 |