Mailinglist
 All Data Structures Files Functions Variables Pages
MailinglistListUI.class.php
Go to the documentation of this file.
1 <?php
20  function edit_form(&$form, &$form_state) {
21  // All Retrievers will need some settings for connection.
22  $form['basic']['#tree'] = FALSE;
23  $form['basic']['#weight'] = 20;
24  $form['basic']['settings']= array(
25  '#type' => 'fieldset',
26  '#title' => 'Basic List settings',
27  '#tree' => TRUE,
28  '#collapsible' => TRUE,
29  '#collapsed' => FALSE,
30  );
31 
32  $form['extra']['#tree'] = FALSE;
33  $form['extra']['#weight'] = 90;
34  $form['extra']['settings']= array(
35  '#type' => 'fieldset',
36  '#title' => 'Advanced Settings',
37  '#tree' => TRUE,
38  '#collapsible' => TRUE,
39  '#collapsed' => TRUE,
40  );
41 
42 
43  parent::edit_form($form, $form_state);
44  // object_type selection is not dependant on type of object
45 
46  $list_plugins = mailinglist_get_plugins('mailinglist', 'list');
47  /* Type of Mailing List */
48  $form['info']['object_type'] = array(
49  '#type' => 'select',
50  '#title' => t('List Type'),
51  '#options' => _mailinglist_build_options($list_plugins),
52  '#default_value' => isset($form_state['item']->object_type) ? $form_state['item']->object_type : NULL,
53  '#description' => t('The List presonality plugin to use for this list'),
54  '#required' => TRUE,
55  );
56  }
57 
61  function hook_menu(&$items) {
62  parent::hook_menu($items);
63  if (isset($items['admin/config/system/mailinglist/list'])) {
64  $items['admin/config/system/mailinglist/list']['type'] = MENU_LOCAL_TASK;
65  }
66  }
67 
71  function list_header($form_state) {
72  if (isset($form_state['input']['test_result'])) {
73  return $form_state['input']['test_result'];
74  }
75  }
76 
80  function test_page($js, $input, $mailbox) {
81  $input['test_result'] = _mailinglist_mailbox_test_output($mailbox);
82  if (!$js) {
83  drupal_goto(ctools_export_ui_plugin_base_path($this->plugin));
84  }
85  else {
86  return $this->list_page($js, $input);
87  }
88  }
90 }
91 
list_header($form_state)
list_header()
_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. ...
test_page($js, $input, $mailbox)
Callback to test a mailbox connection.
mailinglist_get_plugins($module, $type)
Wrapper to load plugins.
edit_form(&$form, &$form_state)
Implements ctools_export_ui::edit_form().
Place for common code for export_ui classes Forwards a lot of ctools_export_ui hooks to the exportabl...
Represents an Mailinglist personality module.
hook_menu(&$items)
Implements ctools_export_ui:hook_menu()