This repository has been archived by the owner on Jan 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPlugin.php
executable file
·47 lines (42 loc) · 1.61 KB
/
Plugin.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
<?php namespace HendrikErz\PatreonList;
use System\Classes\PluginBase;
class Plugin extends PluginBase
{
public function registerComponents()
{
return [
'HendrikErz\PatreonList\Components\Patreons' => 'patreonList',
'HendrikErz\PatreonList\Components\Tiers' => 'patreonTiers',
];
}
public function registerSettings()
{
}
// Register custom column types
public function registerListColumnTypes()
{
return [
'hide_indicator' => function ($val) {
// No display if hide_from_all is 0
if (!$val) {
return '';
}
// Else: Display a hidden indicator
$title = \Lang::get('hendrikerz.patreonlist::lang.columns.hide_from_all_tooltip');
return '<span data-toggle="tooltip" data-placement="top" title="' . $title . '" class="oc-icon-eye-slash text-danger"></span>';
},
'patron_status' => function ($val) {
if ($val) {
// Active patron
return '<span class="oc-icon-circle text-success">' . \Lang::get('hendrikerz.patreonlist::lang.columns.status_active') . '</span>';
} else {
// Inactive patron
return '<span class="oc-icon-circle text-danger">' . \Lang::get('hendrikerz.patreonlist::lang.columns.status_inactive') . '</span>';
}
},
'tier_description' => function ($val) {
return $val; // Don't filter out the HTML
},
];
}
}