-
Notifications
You must be signed in to change notification settings - Fork 1
/
qa-mail-ses-admin.php
58 lines (52 loc) · 2.14 KB
/
qa-mail-ses-admin.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
<?php
class qa_mail_ses_admin {
function option_default($option) {
switch($option) {
case 'plugin_mail_ses_region' :
return 'eu-west-1';
default :
return null;
}
}
function admin_form(&$qa_content) {
$saved = false;
if (qa_clicked('plugin_mail_ses_save')) {
qa_opt('plugin_mail_ses_region', (string)qa_post_text('plugin_mail_ses_region'));
qa_opt('plugin_mail_ses_key', (string)qa_post_text('plugin_mail_ses_key'));
qa_opt('plugin_mail_ses_secret', (string)qa_post_text('plugin_mail_ses_secret'));
$saved=true;
}
return array(
'ok' => $saved ? 'Mail SES settings saved' : null,
'fields' => array(
array(
'label' => 'Region :',
'type' => 'text',
'value' => (string)qa_opt('plugin_mail_ses_region'),
'suffix' => '',
'tags' => 'NAME="plugin_mail_ses_region"',
),
array(
'label' => 'Key :',
'type' => 'text',
'value' => (string)qa_opt('plugin_mail_ses_key'),
'suffix' => '',
'tags' => 'NAME="plugin_mail_ses_key"',
),
array(
'label' => 'Secret :',
'type' => 'password',
'value' => (string)qa_opt('plugin_mail_ses_secret'),
'suffix' => '',
'tags' => 'NAME="plugin_mail_ses_secret"',
),
),
'buttons' => array(
array(
'label' => 'Save Changes',
'tags' => 'NAME="plugin_mail_ses_save"',
),
),
);
}
};