-
Notifications
You must be signed in to change notification settings - Fork 22
/
LteChatBox.php
69 lines (65 loc) · 1.34 KB
/
LteChatBox.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
<?php
/**
* Created by solly [26.03.17 0:30]
*/
namespace insolita\wgadminlte;
use yii\helpers\Html;
/**
* Class LteChatBox
* @example
* <?php
* echo LteChatBox::begin(['type'=>'info']);
*
* echo LteChatMessage::widget([
* 'author'=>'Jane Smith',
* 'message'=>'Hi guys! How are you?',
* 'image'=>'http://site.ru/images/123.jpg',
* 'imageAlt'=>'some text',
* 'createdAt'=>'2017-03-29 23:33',
* 'isRight' =>false
* ']);
*
* echo LteChatMessage::widget([
* 'author'=>'Artur Green',
* 'message'=>'Look this cool video',
* 'image'=>'http://site.ru/images/321.jpg',
* 'createdAt'=>'2017-03-29 23:18',
* 'isRight' =>true
* ']);
*
* echo LteChatBox::end();
* ?>
* @package insolita\wgadminlte
*/
class LteChatBox extends LteBox
{
/**
* @var string
*/
public $topTemplate
= <<<HTML
<div {options}>
<div {headerOptions}><h3 class="box-title">{title}</h3>{box-tools}</div>
<div class="box-body">
<div class="direct-chat-messages">
HTML;
/**
* @var string
*/
public $bottomTemplate
= <<<HTML
</div>
</div>
<div class="box-footer {footerOptions}">{footer}</div>
</div>
HTML;
/**
*
*/
public function init()
{
Html::addCssClass($this->options,'direct-chat');
Html::addCssClass($this->options,'direct-chat-'.$this->type);
parent::init();
}
}