-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStaticPages.config.php
More file actions
94 lines (82 loc) · 2.78 KB
/
StaticPages.config.php
File metadata and controls
94 lines (82 loc) · 2.78 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
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
<?php
/*
Static pages module config
https://github.com/ryancramerdesign/Helloworld
AT
15.12.23
*/
namespace ProcessWire;
foreach( wire('templates') as $template ){
$nonStaticTemplatesOptions[$template->id] = $template->name;
if( $template->name == 'admin' ) $nonStaticTemplatesValue[] = $template->id;
}
foreach (new \DirectoryIterator($_SERVER['DOCUMENT_ROOT']) as $fileInfo) {
if($fileInfo->isDot()) continue;
if($fileInfo->isFile()) continue;
$nonStaticDirsValue[] = $fileInfo->getFilename();
}
$nonStaticDirsValue = implode("\n", $nonStaticDirsValue);
////
$config = [
[
'name' => 'nonStaticTemplates',
'type' => 'AsmSelect',
'label' => $this->_('Non-static page templates'),
//'description' => $this->_('one name per line'),
'notes' => $this->_('Pages having these templates will have no static representation.'),
'required' => true,
'columnWidth' => 25,
'options' => $nonStaticTemplatesOptions,
'value' => $nonStaticTemplatesValue,
],
[
'name' => 'nonStaticDirs',
'type' => 'textarea',
'label' => $this->_('Non-static directories'),
'description' => $this->_('one name per line'),
'notes' => $this->_('These directories will be protected from deletion when static files and dirs are deleted.'),
'required' => true,
'columnWidth' => 25,
'value' => $nonStaticDirsValue,
],
[
'name' => 'newDirPermissions',
'type' => 'text',
'label' => $this->_('Permissions for every new static dir'),
'description' => $this->_('UNIX string like 0755'),
//'notes' => $this->_('Path relative to website root directory.'),
'required' => true,
'columnWidth' => 25,
'value' => '0755',
],
[
'name' => 'staticFile',
'type' => 'text',
'label' => $this->_('Static file name'),
//'description' => $this->_('normally index.html'),
//'notes' => $this->_('Path relative to website root directory.'),
'required' => true,
'columnWidth' => 25,
'value' => 'index.html',
],
[
'name' => 'forceWipeOnModuleSave',
'type' => 'checkbox',
'label' => $this->_('Force static pages deletion on module save'),
//'description' => $this->_('UNIX string like 0755'),
//'notes' => $this->_('Path relative to website root directory.'),
//'required' => true,
'columnWidth' => 50,
//'value' => 1,
],
[
'name' => 'isEnabled',
'type' => 'checkbox',
'label' => $this->_('Enable this module'),
//'description' => $this->_('UNIX string like 0755'),
//'notes' => $this->_('Path relative to website root directory.'),
//'required' => true,
'columnWidth' => 50,
'value' => 1,
],
];