| 1 |
<?php // $Id: send.install,v 1.11 2009/05/22 15:21:55 vauxia Exp $ |
<?php // $Id: send.install,v 1.12 2009/05/25 20:25:56 vauxia Exp $ |
| 2 |
|
|
| 3 |
function send_schema() { |
function send_schema() { |
| 4 |
$schema = array( |
$schema = array( |
| 198 |
), |
), |
| 199 |
); |
); |
| 200 |
|
|
| 201 |
|
// TODO this doesn't work: If send is disbled and then uninstalled, its |
| 202 |
|
// own tables (and probably those other modules) are not returned. |
| 203 |
foreach (module_invoke_all('send_mode_info') as $name => $info) { |
foreach (module_invoke_all('send_mode_info') as $name => $info) { |
| 204 |
if (isset($info['database columns'])) { |
if (isset($info['database columns'])) { |
| 205 |
$name = 'send_contact_'. $name; |
$name = 'send_contact_'. $name; |
| 229 |
|
|
| 230 |
function send_install() { |
function send_install() { |
| 231 |
drupal_install_schema('send'); |
drupal_install_schema('send'); |
| 232 |
_send_install_set_default_template(); |
|
| 233 |
|
// See http://drupal.org/node/200931 : after schema has been loaded, |
| 234 |
|
// call _send_install_set_default_template, which uses drupal_write_record. |
| 235 |
|
register_shutdown_function('drupal_get_schema', NULL, TRUE); |
| 236 |
|
register_shutdown_function('_send_install_set_default_template'); |
| 237 |
} |
} |
| 238 |
|
|
| 239 |
function send_uninstall() { |
function send_uninstall() { |
| 249 |
$template = (object) array( |
$template = (object) array( |
| 250 |
'name' => t('Default template'), |
'name' => t('Default template'), |
| 251 |
'status' => 1, |
'status' => 1, |
| 252 |
'subject' => t('Message from %site', array('%site' => variable_get('site_name', 'Drupal'))), |
'subject' => t('Message from @site', array('@site' => variable_get('site_name', 'Drupal'))), |
| 253 |
'body' => "%message\n%body", |
'body' => "%message\n%body", |
| 254 |
'format' => FILTER_FORMAT_DEFAULT, |
'format' => FILTER_FORMAT_DEFAULT, |
| 255 |
'settings' => array(), |
'settings' => array(), |