| 1 |
<?php |
<?php |
| 2 |
// $Id$ |
// $Id: nudge.module,v 1.1 2007/09/16 17:39:58 kbahey Exp $ |
| 3 |
|
|
| 4 |
define('NUDGE_PERM_SEND', 'send nudges'); |
define('NUDGE_PERM_SEND', 'send nudges'); |
| 5 |
define('NUDGE_PERM_VIEW', 'view nudges'); |
define('NUDGE_PERM_VIEW', 'view nudges'); |
| 94 |
'#type' => 'textarea', |
'#type' => 'textarea', |
| 95 |
'#title' => t('Email text to send'), |
'#title' => t('Email text to send'), |
| 96 |
'#default_value' => variable_get(NUDGE_EMAIL_TEXT, NUDGE_EMAIL_TEXT_DEFAULT), |
'#default_value' => variable_get(NUDGE_EMAIL_TEXT, NUDGE_EMAIL_TEXT_DEFAULT), |
| 97 |
'#description' => t('Text of the email to send to the user. The values !site, !user, !title and !message are substituted with the site name, user name, node title and custom message respectively.'), |
'#description' => t('Text of the email to send to the user. The values !site, !user, !title, !url and !message are substituted with the site name, user name, node title, node url and custom message respectively.'), |
| 98 |
); |
); |
| 99 |
|
|
| 100 |
return system_settings_form($form); |
return system_settings_form($form); |
| 233 |
} |
} |
| 234 |
|
|
| 235 |
function theme_nudge_email($nudgee, $nudger, $node, $message) { |
function theme_nudge_email($nudgee, $nudger, $node, $message) { |
| 236 |
|
global $base_url; |
| 237 |
|
|
| 238 |
$data = array(); |
$data = array(); |
| 239 |
|
|
| 240 |
$data['subject'] = t('Nudge for post !title ', array('!title' => $node->title)); |
$data['subject'] = t('Nudge for post !title ', array('!title' => $node->title)); |
| 241 |
|
$url = $base_url . base_path() . 'node/' . $node->nid; |
| 242 |
$data['body'] = t(variable_get(NUDGE_EMAIL_TEXT, NUDGE_EMAIL_TEXT_DEFAULT), |
$data['body'] = t(variable_get(NUDGE_EMAIL_TEXT, NUDGE_EMAIL_TEXT_DEFAULT), |
| 243 |
array('!site' => variable_get('site_name', 'Drupal'), '!user' => $nudger->name, '!title' => $node->title, '!message' => $message)); |
array( |
| 244 |
|
'!site' => variable_get('site_name', 'Drupal'), |
| 245 |
|
'!user' => $nudger->name, |
| 246 |
|
'!title' => $node->title, |
| 247 |
|
'!url' => $url, |
| 248 |
|
'!message' => $message)); |
| 249 |
|
|
| 250 |
return $data; |
return $data; |
| 251 |
} |
} |