/[drupal]/contributions/modules/nudge/nudge.module
ViewVC logotype

Diff of /contributions/modules/nudge/nudge.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1, Sun Sep 16 17:39:58 2007 UTC revision 1.1.2.1, Fri Sep 21 00:46:47 2007 UTC
# Line 1  Line 1 
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');
# Line 94  function nudge_admin_settings() { Line 94  function nudge_admin_settings() {
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);
# Line 233  function nudge_email_user($nudgee, $nid, Line 233  function nudge_email_user($nudgee, $nid,
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  }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.1.2.1

  ViewVC Help
Powered by ViewVC 1.1.2