-
Notifications
You must be signed in to change notification settings - Fork 988
/
index.php
152 lines (141 loc) · 4.82 KB
/
index.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<?php
/**
* Index view for plugin manager
* @var $this AdminController
*
* @since 2015-10-02
* @author Olle Haerstedt
*/
// DO NOT REMOVE This is for automated testing to validate we see that page
echo viewHelper::getViewTestTag('pluginManager');
?>
<?php $pageSize = intval(Yii::app()->user->getState('pageSize', Yii::app()->params['defaultPageSize'])); ?>
<div class='col-sm-12'>
<div> <!-- Extra funny div -->
<div class="pagetitle h3"><?php eT('Plugin manager'); ?></div>
<div class='col-sm-12'>
<div class='pull-right'>
<?php /* Disabled for prototype 1.
<a
href=''
class='btn btn-default '
data-tooltip='true'
title='<?php eT('Install plugins from the extension shop'); ?>'
>
<i class='fa fa-shopping-cart'></i>
<?php eT('Browse the shop'); ?>
</a>
*/ ?>
<?php foreach ($extraMenus as $menu): ?>
<a
href='<?php echo $menu->getHref(); ?>'
<?php if ($menu->getOnClick()): ?>
onclick='<?php echo $menu->getOnClick(); ?>'
<?php endif; ?>
class='btn btn-default'
>
<?php if ($menu->getIconClass()): ?>
<i class='<?php echo $menu->getIconClass(); ?>'></i>
<?php endif; ?>
<?php echo $menu->getLabel(); ?>
</a>
<?php endforeach; ?>
<a
href=''
class='btn btn-success '
data-toggle='modal'
data-target='#installPluginZipModal'
data-tooltip='true'
title='<?php eT('Install plugin by ZIP archive'); ?>'
>
<i class='fa fa-file-zip-o'></i>
<?php eT('Install ZIP'); ?>
</a>
<a
href='<?php echo $scanFilesUrl; ?>'
class='btn btn-default'
data-toggle='tooltip'
title='<?php eT('Scan files for available plugins'); ?>'
>
<i class='fa fa-file '></i>
<i class='fa fa-search '></i>
<?php eT('Scan files'); ?>
</a>
</div>
</div>
<?php
$sort = new CSort();
$sort->attributes = array(
'name'=>array(
'asc'=> 'name',
'desc'=> 'name desc',
),
'description'=>array(
'asc'=> 'description',
'desc'=> 'description desc',
),
'status'=>array(
'asc'=> 'active',
'desc'=> 'active desc',
'default'=> 'desc',
),
);
$sort->defaultOrder = array(
'name' => CSort::SORT_ASC,
);
$providerOptions = array(
'pagination' => array(
'pageSize' => $pageSize,
),
'sort' => $sort,
'caseSensitiveSort' => false,
);
$dataProvider = new CArrayDataProvider($plugins, $providerOptions);
$gridColumns = [
[
'header' => gT('Status'),
'type' => 'html',
'name' => 'status',
'value' => '$data->getStatus()'
],
[
'header' => gT('Plugin'),
'name' => 'name',
'type' => 'html',
'value' => '$data->getName()'
],
[
'header' => gT('Description'),
'name' => 'description'
],
[
'type' => 'raw',
'header' => gT('Action'),
'name' => 'action',
'value' => '$data->getActionButtons()'
],
];
$this->widget(
'bootstrap.widgets.TbGridView',
[
'dataProvider' => $dataProvider,
'id' => 'plugins-grid',
'summaryText' => gT('Displaying {start}-{end} of {count} result(s).') .' '
. sprintf(
gT('%s rows per page'),
CHtml::dropDownList(
'pageSize',
$pageSize,
Yii::app()->params['pageSizeOptions'],
[
'class' => 'changePageSize form-control',
'style' => 'display: inline; width: auto'
]
)
),
'columns' => $gridColumns,
'rowHtmlOptionsExpression' => 'array("data-id" => $data["id"])',
]
);
$this->renderPartial('./pluginmanager/uploadModal', []);