-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathTextformatterPrivacyWireConfig.php
54 lines (47 loc) · 1.9 KB
/
TextformatterPrivacyWireConfig.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
<?php namespace ProcessWire;
class TextformatterPrivacyWireConfig extends ModuleConfig
{
public function getDefaults()
{
return [
'open_tag' => '[[',
'close_tag' => ']]',
'video_category' => null,
];
}
public function getInputfields()
{
$inputfields = parent::getInputfields();
// open tag
$f = $this->modules->get('InputfieldText');
$f->attr('name', 'open_tag');
$f->label = $this->_('Open Tag');
$f->columnWidth = 50;
$inputfields->add($f);
// close tag
$f = $this->modules->get('InputfieldText');
$f->attr('name', 'close_tag');
$f->label = $this->_('Close Tag');
$f->columnWidth = 50;
$inputfields->add($f);
// embedded media
$fs = $this->modules->get('InputfieldFieldset');
$fs->attr('name', 'embedded_media');
$fs->label = $this->_('Embedded media');
$inputfields->add($fs);
// category for embedded videos (optional)
$f = $this->modules->get('InputfieldSelect');
$f->attr('name', 'video_category');
$f->label = $this->_('Category for embedded videos');
$f->description = $this->_('If you select a category here, users will need to accept said cookie category before embedded video elements are displayed. Leave empty to disable this feature.');
$f->notes = $this->_('Recommended if you\'re using [TextformatterVideoEmbed](https://processwire.com/modules/textformatter-video-embed/). Note that TextformatterPrivacyWire need to run after TextformatterVideoEmbed for this to work.');
$f->columnWidth = 50;
$f->options = [
"statistics" => $this->_("Statistics"),
'marketing' => $this->_("Marketing"),
'external_media' => $this->_("External Media")
];
$fs->add($f);
return $inputfields;
}
}