-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmaillog.pages.inc
68 lines (62 loc) · 1.74 KB
/
maillog.pages.inc
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
<?php
/**
* @file
* Menu API callback handlers for Maillog pages.
*/
/**
* Display a maillog record.
*
* @param array $maillog
* A maillog record that is to be deleted.
*
* @return string
* Themed output of the maillog page.
*/
function maillog_maillog_page(array $maillog) {
return theme('maillog', array('maillog' => $maillog));
}
/**
* FormAPI callback to allow deleting a Maillog record.
*/
function maillog_maillog_delete_form($form, &$form_state, $maillog) {
$form['id'] = array(
'#type' => 'value',
'#value' => $maillog['id'],
);
// Show some details of the email message.
$form['message'] = array(
'#type' => 'fieldset',
'#collapsible' => FALSE,
'#title' => t('Message details'),
);
$form['message']['subject'] = array(
'#type' => 'textfield',
'#title' => t('Subject'),
'#default_value' => backdrop_substr($maillog['subject'], 0, 128),
'#disabled' => TRUE,
);
$form['message']['to'] = array(
'#type' => 'textfield',
'#title' => t('To'),
'#default_value' => backdrop_substr($maillog['header_to'], 0, 128),
'#disabled' => TRUE,
);
return confirm_form(
$form,
t('Delete Maillog record?'),
'admin/reports/maillog',
t('This action cannot be undone.')
);
}
/**
* FormAPI confirmation callback for maillog_maillog_delete_form().
*/
function maillog_maillog_delete_form_submit($form, &$form_state) {
if (maillog_maillog_delete($form_state['values']['id'])) {
backdrop_set_message(t('Message #!id has been deleted.', array('!id' => $form_state['values']['id'])));
}
else {
backdrop_set_message(t('A problem occurred when deleting message #!id!', array('!id' => $form_state['values']['id'])));
}
$form_state['redirect'] = 'admin/reports/maillog';
}