Mailinglist
 All Data Structures Files Functions Variables Pages
mailinglist.install
Go to the documentation of this file.
1 <?php
10 function mailinglist_schema() {
11  $schema['mailinglist_list'] = array(
12  'description' => 'Table storing Mailinglist Definitions',
13  'fields' => array(
14  'admin_name' => array(
15  'type' => 'varchar',
16  'length' => '255',
17  'not null' => TRUE,
18  'description' => 'Unique name for mailing list Used to identify it programmatically.',
19  ),
20  'admin_title' => array(
21  'type' => 'varchar',
22  'length' => '255',
23  'description' => 'Human-readable name for this Mailing List.',
24  ),
25  'object_type' => array(
26  'type' => 'varchar',
27  'length' => 255,
28  'description' => 'Class responsible for list',
29  'default' => 'MailinglistGenericList',
30  ),
31  'email_from' => array(
32  'type' => 'varchar',
33  'length' => 255,
34  'description' => 'Default from address to use to send to list',
35  'default' => '',
36  ),
37  'email_to' => array(
38  'type' => 'varchar',
39  'length' => 255,
40  'description' => 'Email address to send list email to',
41  'default' => '',
42  ),
43  'operations' => array(
44  'type' => 'text',
45  'size' => 'big',
46  'serialize' => TRUE,
47  'description' => 'Enabled operations for mailinglist.',
48  'object default' => array(
49  ),
50  ),
51  'parameters' => array(
52  'type' => 'text',
53  'size' => 'big',
54  'serialize' => TRUE,
55  'description' => 'Stored parameters for mailinglist.',
56  'object default' => array(
57  ),
58  ),
59  'settings' => array(
60  'type' => 'text',
61  'size' => 'big',
62  'serialize' => TRUE,
63  'description' => 'Configuration of mailinglist',
64  'object default' => array(
65  ),
66  ),
67  ),
68  'primary key' => array('admin_name'),
69  'export' => array(
70  'key' => 'admin_name',
71  'key name' => 'List Name',
72  'primary key' => 'admin_name',
73  'identifier' => 'lists',
74  'object' => 'MailinglistGenericList',
75  'object factory' => '_mailinglist_object_factory',
76  'api' => array(
77  'owner' => 'mailinglist',
78  'api' => 'list',
79  'minimum_version' => 1,
80  'current_version' => 1,
81  ),
82  ),
83  );
84 
85  $schema['mailinglist_retrieve'] = array(
86  'description' => 'Table storing mailbox definitions',
87  'fields' => array(
88  'admin_name' => array(
89  'type' => 'varchar',
90  'length' => '255',
91  'not null' => TRUE,
92  'description' => 'Unique email address of this mailbox. Used to identify it programmatically.',
93  ),
94  'admin_title' => array(
95  'type' => 'varchar',
96  'length' => '255',
97  'description' => 'Human-readable name (email address) of this mailbox.',
98  ),
99  'object_type' => array(
100  'type' => 'varchar',
101  'length' => 255,
102  'description' => 'Class responsible for mailbox retrieval',
103  'default' => 'MailinglistPhpImapRetrieve',
104  ),
105  'settings' => array(
106  'type' => 'text',
107  'size' => 'big',
108  'serialize' => TRUE,
109  'description' => 'Configuration settingss of mailinglist.',
110  'object default' => array(
111  ),
112  ),
113  ),
114  'primary key' => array('admin_name'),
115  'export' => array(
116  'key' => 'admin_name',
117  'key name' => 'Email address',
118  'primary key' => 'admin_name',
119  'identifier' => 'mailbox',
120  'object' => 'MailinglistPhpImapRetrieve',
121  'object factory' => '_mailinglist_object_factory',
122  'api' => array(
123  'owner' => 'mailinglist',
124  'api' => 'retrieve',
125  'minimum_version' => 1,
126  'current_version' => 1,
127  ),
128  ),
129  );
130 
131  $schema['mailinglist_names']= array(
132  'description' => 'Table for tracking email address <-> Real name mappings',
133  'fields' => array(
134  'name_key' => array(
135  'type' => 'serial',
136  'unsigned' => TRUE,
137  'not null' => TRUE,
138  'description' => 'Primary ID field for the table. Not used for anything except internal lookups.',
139  ),
140  'email' => array(
141  'type' => 'varchar',
142  'length' => '255',
143  'description' => 'E-Mail Address',
144  ),
145  'name' => array(
146  'type' => 'varchar',
147  'length' => 255,
148  'description' => 'Name used',
149  ),
150  'count' => array(
151  'description' => 'Number of messages using this combination',
152  'type' => 'int',
153  'not null' => TRUE,
154  'default' => 0,
155  ),
156  ),
157  'primary key' => array('name_key'),
158  );
159 
160  /*
161  Note from experience, we can not ask here if the various mailing lists need their own
162  tables by calling a hook function, as we can not load the objects until we define this
163  schema, or mailinglist_schema will get called again
164  */
165  return $schema;
166 }
174 function mailinglist_enable() {
175 // cache_clear_all('plugins:feeds:plugins', 'cache');
176 // drupal_set_message(t("Now that you've enabled Mailinglist, you need to <a href='@mailbox-add'>add a mailbox</a> corresponding to an IMAP/POP3/mbox mailbox.", array('@mailbox-add' => url('admin/structure/mailinglist/add'))));
177 }
178 
182 function mailinglist_modules_enabled($modules) {
183 /* if (in_array('mailinglist', $modules)) {
184  $plugins = mailinglist_get_plugins('mailinglist', 'retrieve');
185  if (count($plugins) == 1) {
186  drupal_set_message(t('You have enabled Mailinglist, but not any modules providing retrieval plugins (such as the Mailinglist PHP IMAP module). Without a retrieval plugin, Mailinglist is basically useless.'), 'warning');
187  }
188  }
189  */
190 }
191 
mailinglist_modules_enabled($modules)
Implements hook_modules_enabled().
mailinglist_schema()
Implements hook_schema().
mailinglist_enable()
function mailinglist_update_7000() { }