| 1 |
<?php |
<?php |
| 2 |
// $Id: $ |
// $Id: mail.install,v 1.1 2006/10/16 17:04:46 nedjo Exp $ |
| 3 |
|
|
| 4 |
function mail_install() { |
function mail_install() { |
| 5 |
variable_set('mail_mail', 1); |
variable_set('mail_mail', 1); |
| 6 |
|
_mail_install_type_create(); |
| 7 |
|
} |
| 8 |
|
|
| 9 |
|
/** |
| 10 |
|
* Implementation of hook_uninstall(). |
| 11 |
|
*/ |
| 12 |
|
function book_uninstall() { |
| 13 |
|
db_query("DELETE FROM {menu_links} WHERE module = 'mail'"); |
| 14 |
|
menu_cache_clear_all(); |
| 15 |
|
drupal_uninstall_schema('mail'); |
| 16 |
|
} |
| 17 |
|
|
| 18 |
|
function _mail_install_type_create() { |
| 19 |
|
// Create an additional node type |
| 20 |
|
$mail_node_type = array( |
| 21 |
|
'type' => 'mail', |
| 22 |
|
'name' => t('Mail'), |
| 23 |
|
'module' => 'node', |
| 24 |
|
'title_label' => t('Subject'), |
| 25 |
|
'body_label' => t('Message'), |
| 26 |
|
'description' => t('A <em>mail</em> posting is sent to registered users with specified roles and also saved to the site database for future reference.'), |
| 27 |
|
'custom' => TRUE, |
| 28 |
|
'modified' => TRUE, |
| 29 |
|
'locked' => FALSE |
| 30 |
|
); |
| 31 |
|
|
| 32 |
|
$mail_node_type = (object)_node_type_set_defaults($mail_node_type); |
| 33 |
|
node_type_save($mail_node_type); |
| 34 |
|
// Default to not promoted. |
| 35 |
|
variable_set('node_options_mail', array('status')); |
| 36 |
|
// Comments disabled |
| 37 |
|
variable_set('comment_mail', '0'); |
| 38 |
|
} |
| 39 |
|
|
| 40 |
|
function mail_update_1() { |
| 41 |
|
_book_install_type_create(); |
| 42 |
} |
} |