summaryrefslogtreecommitdiff
path: root/database
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2006-03-11 15:07:47 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2006-03-11 15:07:47 +0000
commitf0373449cbcca26abbe86226463bd8bfa1003371 (patch)
tree103a0850f525e8481abefa1448fc97b464cb08be /database
parent718b88e54fce78aff9f306c7748bde85d5b4a2a8 (diff)
downloadbrdo-f0373449cbcca26abbe86226463bd8bfa1003371.tar.gz
brdo-f0373449cbcca26abbe86226463bd8bfa1003371.tar.bz2
- #28868 fixes: better display of messages and code cleanup
Diffstat (limited to 'database')
-rw-r--r--database/updates.inc29
1 files changed, 16 insertions, 13 deletions
diff --git a/database/updates.inc b/database/updates.inc
index 8dcdff8ca..cb4943c14 100644
--- a/database/updates.inc
+++ b/database/updates.inc
@@ -1679,22 +1679,25 @@ function system_update_176() {
function system_update_177() {
$ret = array();
$message_ids = array(
- 'welcome_subject',
- 'welcome_body',
- 'approval_subject',
- 'approval_body',
- 'pass_subject',
- 'pass_body',
+ 'welcome_subject' => 'Welcome subject',
+ 'welcome_body' => 'Welcome body text',
+ 'approval_subject' => 'Approval subject',
+ 'approval_body' => 'Approval body text',
+ 'pass_subject' => 'Password reset subject',
+ 'pass_body' => 'Password reset body text',
);
- foreach ($message_ids as $message_id) {
- if ($admin_setting = variable_get('user_mail_' . $message_id, FALSE)) {
- $admin_setting = '<pre>'. $admin_setting .'</pre>'; //else it renders horrible
+ foreach ($message_ids as $message_id => $message_text) {
+ if ($admin_setting = variable_get('user_mail_'. $message_id, FALSE)) {
+ // Insert newlines and escape for display as HTML
+ $admin_setting = nl2br(check_plain($message_text ."\n\n". $admin_setting));
watchdog('legacy', $admin_setting);
$last = db_fetch_object(db_query('SELECT max(wid) AS wid FROM {watchdog}'));
- variable_del('user_mail_'. $message_id); //deleting is requird, because _user_mail_text() checks for existance.
- $i++;
- $ret[$i]['query'] = l(t('The mail template %message_id is reset to the default, and the old one is saved.', array('%message_id' => 'user_mail_'. $message_id)),'admin/logs/event/'. $last->wid);
- $ret[$i]['success'] = TRUE;
+ // Deleting is required, because _user_mail_text() checks for the existance of the variable.
+ variable_del('user_mail_'. $message_id);
+ $ret[] = array(
+ 'query' => strtr('The mail template %message_id has been reset to the default. The old template <a href="%url">has been saved</a>.', array('%message_id' => 'user_mail_'. $message_id, '%url' => url('admin/logs/event/'. $last->wid))),
+ 'success' => TRUE
+ );
}
}
return $ret;