-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProcessPodcastSubscriptionsConfig.php
More file actions
59 lines (50 loc) · 1.35 KB
/
ProcessPodcastSubscriptionsConfig.php
File metadata and controls
59 lines (50 loc) · 1.35 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
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/**
* COPYRIGHT NOTICE
* Copyright (c) 2023 Neue Rituale GbR
* @author NR <code@neuerituale.com>
*/
namespace ProcessWire;
class ProcessPodcastSubscriptionsConfig extends ModuleConfig
{
/**
* @return array
* @throws WireException
*/
public function getDefaults(): array {
// get schedules from Lazy Cron
$lazyCronInstance = $this->modules->get('LazyCron');
$getTimeFuncsFunction = function(){ return $this->timeFuncs; };
return [
'cronSchedule' => 86400,
'timeFuncs' => $getTimeFuncsFunction->call($lazyCronInstance),
'lastMaintenance' => 0,
'parent' => 1
];
}
/**
* @return InputfieldWrapper
*/
public function getInputfields(): InputfieldWrapper {
$inputfields = parent::getInputfields();
/** @var InputfieldSelect */
$inputfields->add([
'type' => 'Select',
'name' => 'cronSchedule',
'label' => $this->_('Cron Schedule'),
'description' => $this->_('If selected, the cron will updates all subscribed feeds.'),
'options' => $this->get('timeFuncs'),
'columnWidth' => 100,
]);
/** @var InputfieldSelect */
$inputfields->add([
'type' => 'Textarea',
'name' => 'subscriptionLinksConfig',
'label' => $this->_('Subscription Links'),
'description' => $this->_('One per line name and label'),
'notes' => $this->_('spotify=Spotify'),
'columnWidth' => 100,
]);
return $inputfields;
}
}