a2cde075
Yarik
first commit
|
1
|
<?php
|
faff2c48
Yarik
Artbox comment cr...
|
2
|
use artbox\webcomment\models\CommentModel;
|
a2cde075
Yarik
first commit
|
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
use yii\base\Model;
use yii\data\ActiveDataProvider;
use yii\helpers\Html;
use yii\web\View;
use yii\widgets\ListView;
use yii\widgets\Pjax;
/**
* @var CommentModel $comment_model
* @var array $list_params
* @var array $item_options
* @var string $item_view
* @var Model $model
* @var ActiveDataProvider $comments
* @var View $this
|
179a0e00
Anastasia
bug fix artbox-co...
|
18
19
20
|
* @var string $display_name
* @var boolean $reply ,
* @var boolean $delete
|
a2cde075
Yarik
first commit
|
21
22
23
24
25
26
27
28
29
|
*/
Pjax::begin();
if(( $success = \Yii::$app->session->getFlash('artbox_comment_success') ) != NULL) {
echo Html::tag('p', $success);
}
echo ListView::widget([
'dataProvider' => $comments,
'itemOptions' => $item_options,
'itemView' => $item_view,
|
6385e72b
Anastasia
bug fix
|
30
|
'emptyText' => false,
|
a2cde075
Yarik
first commit
|
31
|
'summary' => '',
|
b5639b59
Anastasia
comment widget
|
32
|
'viewParams' => [
|
179a0e00
Anastasia
bug fix artbox-co...
|
33
34
|
'display_name' => $display_name,
'reply' => $reply,
|
3dc17ed6
Anastasia
hidden comment in...
|
35
36
37
38
39
40
41
42
43
44
45
46
|
'delete' => $delete,
'more' => $more,
'last' => $comments->count,
],
'beforeItem' => function ($model, $key, $index, $widget) use ($more, $comments) {
if ($more['key'] == $index and $more['show_'] ){
return "<a id='show_more_link' style='cursor:pointer'>Показать еще</a>
<div id='show_more' style='display: none'>";
}
},
'afterItem' => function ($model, $key, $index, $widget) use ($more, $comments) {
|
267c6da2
Anastasia
returnUrl in feed...
|
47
|
if ($index == ($comments->count-1) and $more['show_'] and $more['key'] < $comments->count){
|
3dc17ed6
Anastasia
hidden comment in...
|
48
49
50
51
52
|
return "<a id='hide_more_link' style='cursor:pointer'>Скрыть комментарии</a></div>";
}
}
|
b5639b59
Anastasia
comment widget
|
53
|
|
a2cde075
Yarik
first commit
|
54
55
56
|
]);
Pjax::end();
|