/
example_config.php
140 lines (134 loc) · 3.7 KB
/
example_config.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
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<?php
include('simple_options.php');
// Get categories
$cat_list = get_categories();
$final_cat_list = array();
foreach($cat_list as $cw_cat){
$termID = $cw_cat->term_id;
$termName = $cw_cat->name;
$final_cat_list[$termID] = $termName;
}
$cwv3_op_data = array(
'plugin_title' => 'Content Warning v3',
'prefix' => 'cwv3_',
'menu_title' => 'CWv3 Options',
'slug' => 'cwv3_options',
'opData' => array(
'sitewide' => array(
'name' => 'Sitewide',
'type' => 'check',
'desc' => 'Enable the dialog on "All Pages"',
'fields' => array(
'enabled' => 'Enable'
),
'def' => 'enabled'
),
'death' => array(
'name' => 'Cookie Life',
'desc' => 'How long before the cookie expires.',
'type' => 'timeframe',
'def' => array('multiplier'=>1, 'time'=>60*60*24)
),
// Dialog Options
'd_title' => array(
'name' => 'Dialog Title',
'desc' => '',
'type' => 'text',
'def' => 'WARNING: Explicit Content'
),
'd_msg' => array(
'name' => 'Dialog Message',
'type' => 'editor',
'desc' => 'A message shown to your visitor.',
'def' => 'The content you are about to view may be considered offensive and/or inappropriate. Furthermore, this content may be considered adult content, if you are not of legal age or are easily offended, you are required to click the exit button.',
'settings' => array(
'teeny' => true,
'media_buttons' => false
)
),
'exit_txt' => array(
'name' => 'Exit Text',
'type' => 'text',
'desc' => 'The text for the exit button.',
'def' => 'Exit'
),
'exit_link' => array(
'name' => 'Exit Link',
'type' => 'text',
'desc' => 'The full URL a user should be directed to upon clicking the exit button.',
'def' => 'http://google.com'
),
'enter_txt' => array(
'name' => 'Enter Text',
'type' => 'text',
'desc' => 'The text for the enter button.',
'def' => 'Enter'
),
'enter_link' => array(
'name' => 'Enter Link',
'type' => 'text',
'desc' => 'The full URL a user should be directed to upon clicking the enter button. Leave blank to just close the dialog.',
'def' => '#'
),
// Denial Options
'denial' => array(
'name' => 'Toggle Denial Option',
'desc' => '',
'type' => 'check',
'fields' => array('enabled' => 'Enable denial handling.')
),
'method' => array(
'name' => 'Denial Handling Method',
'desc' => '',
'type' => 'radio',
'fields' => array(
'redirect' => 'Redirect the user.',
'show' => 'Show the denial dialog.'
),
'def' => 'redirect'
),
'den_title' => array(
'name' => 'Dialog Title',
'desc' => '',
'type' => 'text',
'def' => 'Access Denied'
),
'den_msg' => array(
'name' => 'Denial Message',
'desc' => '',
'type' => 'editor',
'def' => 'You have been denied access to this content. If you feel this is in error, please contact a site administrator.',
'settings' => array(
'media_buttons' => false,
'teeny' => true
)
),
// Advanced Options
//// Styling Options
'bg_image' => array(
'name' => 'Background Image',
'desc' => 'If not empty, the dialog will use this instead of the background opacity and color.',
'type' => 'media'
),
'bg_opacity' => array(
'name' => 'Background Opacity',
'desc' => 'Input a number from 0-100, the latter being completely opaque.',
'type' => 'text',
'def' => 75
),
'bg_color' => array(
'name' => 'Background Color',
'desc' => 'The Overlay color.',
'type' => 'color',
'fields' => array('color'=>'#000000')
),
'cat_list' => array(
'name' => 'Category restrictions',
'desc' => 'Select categories that you would like to restrict with the dialog.',
'type' => 'check',
'fields' => $final_cat_list
)
)
);
$opObj = new JW_SIMPLE_OPTIONS($cwv3_op_dat);
?>