Addons.php
1.08 KB
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
<?php
namespace ACP\Admin\Page;
use AC;
use AC\Renderable;
use AC\View;
class Addons extends AC\Admin\Page\Addons
{
protected function render_actions(AC\Integration $addon): ?Renderable
{
return $addon->is_plugin_active()
? (new View())->set_template('admin/page/component/addon/active-label')
: null;
}
protected function get_grouped_addons(): array
{
$groups = [];
$active = $this->integrations->find_all_active();
if ($active->exists()) {
$groups[] = [
'title' => __('Active', 'codepress-admin-columns'),
'class' => 'active',
'integrations' => $active,
];
}
$not_active = $this->integrations->find_all_by_inactive_plugins();
if ($not_active->exists()) {
$groups[] = [
'title' => __('Available', 'codepress-admin-columns'),
'class' => 'available',
'integrations' => $not_active,
];
}
return $groups;
}
}