-
Notifications
You must be signed in to change notification settings - Fork 988
/
labelsets_view.php
86 lines (75 loc) · 3.3 KB
/
labelsets_view.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
74
75
76
77
78
79
80
81
82
83
84
85
86
<?php
/**
* This file render the list of label sets
* It use the Label Sets model getAllRecords method to build the data provider.
*
* @var $model obj the LabelSets model
*/
?>
<?php $pageSize=Yii::app()->user->getState('pageSize',Yii::app()->params['defaultPageSize']);?>
<div class="col-lg-12">
<div class="pagetitle h3"><?php eT('Label sets list'); ?></div>
<div class="row">
<div class="col-lg-12 content-right">
<?php
$this->widget('bootstrap.widgets.TbGridView', array(
'dataProvider' => $model->search(),
// Number of row per page selection
'id' => 'labelsets-grid',
'emptyText'=>gT('No label sets found.'),
'summaryText'=>gT('Displaying {start}-{end} of {count} result(s).').' '. sprintf(gT('%s rows per page'),
CHtml::dropDownList(
'pageSize',
$pageSize,
Yii::app()->params['pageSizeOptions'],
array('class'=>'changePageSize form-control', 'style'=>'display: inline; width: auto'))),
'columns' => array(
array(
'header' => gT('Label set ID'),
'name' => 'labelset_id',
'value'=>'$data->lid',
'htmlOptions' => array('class' => 'col-md-1'),
),
array(
'header' => gT('Name'),
'name' => 'name',
'value'=>'$data->label_name',
'htmlOptions' => array('class' => 'col-md-2'),
),
array(
'header' => gT('Languages'),
'name' => 'languages',
'value'=> '$data->languages',
'type' => 'LanguageList',
'htmlOptions' => array('class' => 'col-md-6'),
),
array(
'header'=>'',
'name'=>'actions',
'type'=>'raw',
'value'=>'$data->buttons',
'htmlOptions' => array('class' => 'col-md-2 col-xs-1 text-right'),
),
),
'htmlOptions'=>array('style'=>'cursor: pointer;', 'class'=>'hoverAction'),
'selectionChanged'=>"function(id){window.location='" . Yii::app()->urlManager->createUrl('admin/labels/sa/view/lid' ) . '/' . "' + $.fn.yiiGridView.getSelection(id.split(',', 1));}",
'ajaxUpdate' => true,
));
?>
</div>
</div>
</div>
<script type="text/javascript">
jQuery(function($) {
// To update rows per page via ajax
$(document).on("change", '#pageSize', function() {
$.fn.yiiGridView.update('labelsets-grid',{ data:{ pageSize: $(this).val() }});
});
//Delete button
$(document).ready(function() {
$('a[data-confirm]').click(function() {
return confirm($(this).attr('data-confirm'));
});
});
});
</script>