21 parent::hook_menu($items);
22 if (isset($items[
'admin/config/system/mailinglist/mailbox'])) {
23 $items[
'admin/config/system/mailinglist/mailbox'][
'type'] = MENU_LOCAL_TASK;
33 $form[
'connection'][
'#tree'] = FALSE;
34 $form[
'connection'][
'#weight'] = 20;
35 $form[
'connection'][
'settings']= array(
36 '#type' =>
'fieldset',
37 '#title' =>
'Mailbox connection settings',
39 '#collapsible' => TRUE,
40 '#collapsed' => FALSE,
43 $form[
'extra'][
'#tree'] = FALSE;
44 $form[
'extra'][
'#weight'] = 90;
45 $form[
'extra'][
'settings']= array(
46 '#type' =>
'fieldset',
47 '#title' =>
'More settings',
49 '#collapsible' => TRUE,
53 parent::edit_form($form, $form_state);
59 $form[
'info'][
'object_type'] = array(
61 '#title' => t(
'Mailbox Type'),
63 '#default_value' => isset($form_state[
'item']->object_type) ? $form_state[
'item']->object_type : NULL,
64 '#description' => t(
'Plug in to use to read mailbox'),
73 if (isset($form_state[
'input'][
'test_result'])) {
74 return $form_state[
'input'][
'test_result'];
84 drupal_goto(ctools_export_ui_plugin_base_path($this->plugin));
87 return $this->list_page($js, $input);
99 dpm($mailbox,
'process_page');
100 $page[
'list'] = array(
103 array(
'data' =>
'Message', ),
104 array(
'data' =>
'List'),
105 array(
'data' =>
'Results', ),
106 array(
'data' =>
'Subject', ),
111 drupal_set_title($this->get_page_title(
'process', $mailbox));
114 if (method_exists($mailbox,
'get_message_list')) {
116 $msg_list = $mailbox->get_message_list($mailbox->settings[
'limit']);
121 foreach ($msg_list as $msg_idx => $msg_id) {
122 $msg = $mailbox->get_message($msg_id);
125 foreach ($lists as $list => $listobj) {
126 $handled = $listobj->processMessage($msg);
128 if ($mailbox->get_setting(
'delete_after_read', FALSE)) {
129 dpm(
'Purge', $msg_id);
135 if ($handled == FALSE) {
137 $handled =
"Unhandled";
139 if ($handled === TRUE) {
142 $row = array($msg_id, $list, $handled, $msg->header(
'Subject'));
143 $msg_list[$msg_idx] = array($msg_id, $handled ? $list :
'Unhandled');
144 $page[
'list'][
'#rows'][$msg_idx] = $row;
Represents an email mailbox (IMAP, POP3, etc...).
_mailinglist_mailbox_test_output($mailbox)
_mailinglist_mailbox_test_output()
_mailinglist_build_options($source, $key_name= 'name')
Builds a Select control array from a menu form an array from a ctools_get_plugin. ...
list_header($form_state)
list_header()
test_page($js, $input, $mailbox)
Callback to test a mailbox connection.
mailinglist_get_plugins($module, $type)
Wrapper to load plugins.
process_page($js, $input, $mailbox)
process_page()
Place for common code for export_ui classes Forwards a lot of ctools_export_ui hooks to the exportabl...
edit_form(&$form, &$form_state)
Implements ctools_export_ui::edit_form().
hook_menu(&$items)
Implements ctools_export_ui::hook_form().
mailinglist_list_load_all($show_disabled=TRUE)
Load all mailinglists.