| 1 |
<?php |
<?php |
| 2 |
// $Id: simplenews.install,v 1.33 2009/07/30 19:56:47 sutharsan Exp $ |
// $Id: simplenews.install,v 1.34 2009/08/13 15:13:48 sutharsan Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 637 |
) |
) |
| 638 |
); |
); |
| 639 |
return $ret; |
return $ret; |
| 640 |
|
} |
| 641 |
|
|
| 642 |
|
/** |
| 643 |
|
* Convert Simplenews custom tokens to Token tokens. |
| 644 |
|
*/ |
| 645 |
|
function simplenews_update_6101() { |
| 646 |
|
$ret = array(); |
| 647 |
|
|
| 648 |
|
$old = array( |
| 649 |
|
'!site', |
| 650 |
|
'!mailto', |
| 651 |
|
'!date', |
| 652 |
|
'!login_uri', |
| 653 |
|
'!uri', |
| 654 |
|
'!confirm_subscribe_url', |
| 655 |
|
'!confirm_unsubscribe_url', |
| 656 |
|
'!newsletter_url', |
| 657 |
|
'!newsletter_name', |
| 658 |
|
); |
| 659 |
|
$new = array( |
| 660 |
|
'[site-name]', |
| 661 |
|
'[user-mail]', |
| 662 |
|
'[site-date]', |
| 663 |
|
'[site-url]/user', |
| 664 |
|
'[site-url]', |
| 665 |
|
'[simplenews-subscribe-url]', |
| 666 |
|
'[simplenews-unsubscribe-url]', |
| 667 |
|
'[simplenews-newsletter-url]', |
| 668 |
|
'[simplenews-newsletters-name]', |
| 669 |
|
); |
| 670 |
|
$variables = array( |
| 671 |
|
'simplenews_confirm_subscribe_subject', |
| 672 |
|
'simplenews_confirm_subscribe_unsubscribed', |
| 673 |
|
'simplenews_confirm_subscribe_subscribed', |
| 674 |
|
'simplenews_confirm_unsubscribe_subscribed', |
| 675 |
|
'simplenews_confirm_unsubscribe_unsubscribed', |
| 676 |
|
); |
| 677 |
|
foreach ($variables as $variable) { |
| 678 |
|
if ($text = variable_get($variable, FALSE)) { |
| 679 |
|
$text = str_replace($old, $new, $text); |
| 680 |
|
variable_set($variable, $text); |
| 681 |
|
} |
| 682 |
|
} |
| 683 |
|
drupal_set_message(t('Simplenews custom tokens have been deprecated. An attempt was made to replace custom tokens in the confirmation messages. Check the messages at <a href="!url">Simplenews subscription settings</a>. Manually replace Simplenews tokens in (unsent) newsletter issues.', array('!url' => url('admin/settings/simplenews/subscription')))); |
| 684 |
|
return $ret; |
| 685 |
} |
} |