View source
<?php
define('SUBSCRIPTIONS_CONFIG_PATH', 'admin/config/system/subscriptions');
define('SUBSCRIPTIONS_CONFIG_PATH_LEVEL', count(explode('/', SUBSCRIPTIONS_CONFIG_PATH)));
function subscriptions_init() {
define('SUBSCRIPTIONS_UNAVAILABLE', '<span class="error" title="' . t('(unavailable to regular users)') . '">¤</span>');
if (subscriptions_arg(0) == 's' && subscriptions_arg(1) == 'del') {
$router_item = menu_get_item('subscriptions/rem/' . substr(current_path(), 6));
if (isset($router_item) && $router_item['access']) {
menu_set_item(current_path(), $router_item);
}
}
}
function subscriptions_menu() {
$items[SUBSCRIPTIONS_CONFIG_PATH] = array(
'title' => 'Subscriptions',
'description' => 'Site and user default settings for Subscriptions.',
'page callback' => 'drupal_get_form',
'file' => 'subscriptions.admin.inc',
'page arguments' => array(
'subscriptions_settings_form',
),
'access arguments' => array(
'administer site configuration',
),
);
$items[SUBSCRIPTIONS_CONFIG_PATH . '/settings'] = array(
'title' => 'Site settings',
'weight' => -10,
'type' => MENU_DEFAULT_LOCAL_TASK,
);
$items[SUBSCRIPTIONS_CONFIG_PATH . '/userdefaults'] = array(
'title' => 'User defaults',
'weight' => -5,
'file' => 'subscriptions.admin.inc',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'subscriptions_page_user_overview',
SUBSCRIPTIONS_CONFIG_PATH_LEVEL + 2,
),
'type' => MENU_LOCAL_TASK,
'access arguments' => array(
'administer site configuration',
),
);
$items[SUBSCRIPTIONS_CONFIG_PATH . '/userdefaults/settings'] = array(
'type' => MENU_DEFAULT_LOCAL_TASK,
'title' => 'Overview',
'weight' => -100,
);
$items[SUBSCRIPTIONS_CONFIG_PATH . '/userdefaults/bulk'] = array(
'title' => 'Bulk operation',
'weight' => -80,
'page callback' => 'drupal_get_form',
'file' => 'subscriptions.admin.inc',
'page arguments' => array(
'subscriptions_page_user_bulk',
),
'type' => MENU_LOCAL_TASK,
'access callback' => '_subscriptions_bulk_access',
);
$items[SUBSCRIPTIONS_CONFIG_PATH . '/intervals'] = array(
'title' => 'Interval',
'page callback' => 'drupal_get_form',
'file' => 'subscriptions.admin.inc',
'page arguments' => array(
'subscriptions_intervals',
),
'type' => MENU_LOCAL_TASK,
'access arguments' => array(
'administer site configuration',
),
);
$items['user/%user/subscriptions'] = array(
'title' => 'Subscriptions',
'file' => 'subscriptions.admin.inc',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'subscriptions_page_user_overview',
1,
),
'type' => MENU_LOCAL_TASK,
'access callback' => '_subscriptions_access',
'access arguments' => array(
1,
),
);
$hide_overview_page = variable_get('subscriptions_hide_overview_page', 0);
$minimum_weight = 0;
if (!$hide_overview_page) {
$items['user/%user/subscriptions/overview'] = array(
'type' => MENU_DEFAULT_LOCAL_TASK,
'title' => 'Overview',
'weight' => -100,
);
}
else {
foreach (subscriptions_types() as $stype => $data) {
if (isset($data['weight']) && $data['weight'] < $minimum_weight) {
$minimum_weight = $data['weight'];
}
}
}
foreach (subscriptions_types() as $stype => $data) {
$weight = isset($data['weight']) ? $data['weight'] : 0;
$items['subscriptions/add/' . $stype] = array(
'title' => 'Add subscription',
'type' => MENU_CALLBACK,
'file' => 'subscriptions.admin.inc',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'subscriptions_add_form',
$stype,
),
'access arguments' => array(
$data['access'],
),
);
$items['subscriptions/del/' . $stype] = array(
'type' => MENU_CALLBACK,
'file' => 'subscriptions.admin.inc',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'subscriptions_del_form',
$stype,
),
'access arguments' => array(
$data['access'],
),
);
if (empty($data['page'])) {
continue;
}
$items['user/%user/subscriptions/' . $stype] = array(
'title' => 'N/A',
'type' => MENU_LOCAL_TASK,
'file' => 'subscriptions.admin.inc',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'subscriptions_page_form',
1,
$stype,
),
'access callback' => '_subscriptions_access',
'access arguments' => array(
1,
$data['access'],
),
'weight' => $weight,
);
$items['user/%user/subscriptions/' . $stype]['title'] = $data['title'];
if ($hide_overview_page && $minimum_weight == $weight) {
$items['user/%user/subscriptions/' . $stype]['type'] = MENU_DEFAULT_LOCAL_TASK;
$default_item = $items['user/%user/subscriptions/' . $stype];
$items['user/%user/subscriptions'] = array_merge($items['user/%user/subscriptions'], array(
'file' => $default_item['file'],
'page callback' => $default_item['page callback'],
'page arguments' => $default_item['page arguments'],
'access callback' => $default_item['access callback'],
'access arguments' => $default_item['access arguments'],
));
$hide_overview_page = FALSE;
}
if ($stype == 'node') {
continue;
}
$items[SUBSCRIPTIONS_CONFIG_PATH . '/userdefaults/' . $stype] = array(
'title' => 'N/A',
'type' => MENU_LOCAL_TASK,
'file' => 'subscriptions.admin.inc',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'subscriptions_page_form',
SUBSCRIPTIONS_CONFIG_PATH_LEVEL + 2,
$stype,
),
'access callback' => '_subscriptions_bulk_or_site_access',
'weight' => $weight,
);
$items[SUBSCRIPTIONS_CONFIG_PATH . '/userdefaults/' . $stype]['title'] = $data['title'];
}
$items['subscriptions/rem/%'] = array(
'page callback' => 'drupal_get_form',
'page arguments' => array(
'subscriptions_delete_form',
2,
3,
4,
5,
6,
),
'type' => MENU_CALLBACK,
'access callback' => '_subscriptions_rem_access',
'access arguments' => array(
2,
3,
4,
5,
6,
7,
),
);
return $items;
}
function subscriptions_admin_paths() {
$paths = array(
'user/*/subscriptions' => TRUE,
'user/*/subscriptions/*' => TRUE,
);
return $paths;
}
function _subscriptions_rem_access($a2, $a3, $a4, $a5, $a6, $md) {
return $md == md5(drupal_get_private_key() . $a2 . $a3 . $a4 . $a5 . $a6);
}
function _subscriptions_access($account, $access = NULL) {
global $user;
if ($account && $account->uid) {
if (isset($access)) {
$has_access = user_access($access, $account);
}
else {
foreach (subscriptions_types() as $stype => $data) {
if (user_access($data['access'], $account)) {
$has_access = TRUE;
}
}
}
return !empty($has_access) && ($account->uid == $user->uid || user_access('administer user subscriptions'));
}
return FALSE;
}
function _subscriptions_bulk_access() {
return user_access('bulk-administer user subscriptions') && !empty($_SESSION['subscriptions']['bulk_op']);
}
function _subscriptions_bulk_or_site_access() {
return _subscriptions_bulk_access() || user_access('administer site configuration');
}
function subscriptions_permission() {
$placeholders = array(
'subscribe to content' => array(),
'subscribe to content types' => array(),
'subscribe to all content types' => array(),
);
$return = array_merge(array(
'administer user subscriptions' => array(
'title' => t('Administer user subscriptions'),
'description' => t('Administer the subscriptions of all other users.'),
'restrict access' => TRUE,
),
'bulk-administer user subscriptions' => array(
'title' => t('Administer user subscriptions using bulk user operations'),
'description' => t('Add subscriptions to or remove subscriptions from multiple users at once from the user list.'),
'restrict access' => TRUE,
),
), $placeholders, subscriptions_types('permission'), array(
'suspend own subscriptions' => array(
'title' => t('Suspend own subscriptions'),
'description' => t('Temporarily suspend subscriptions — resuming is always allowed.'),
),
));
foreach (array_keys($placeholders) as $key) {
if (empty($return[$key])) {
unset($return[$key]);
}
}
return $return;
}
function subscriptions_user_insert(array $edit, &$account, $category) {
$new_uid =& drupal_static('subscriptions_user_insert', 0);
db_insert('subscriptions_user')
->fields(array(
'uid' => $account->uid,
))
->execute();
$new_uid = $account->uid;
$rids = array();
foreach (array_keys($account->roles) as $rid) {
$rids[] = -$rid;
}
$query = db_select('subscriptions', 's')
->fields('s', array(
'module',
'field',
'value',
));
$query
->addExpression($new_uid, 'recipient_uid');
$query
->fields('s', array(
'send_interval',
'author_uid',
'send_updates',
'send_comments',
))
->condition('s.recipient_uid', $rids, 'IN');
db_insert('subscriptions', array(
'return' => Database::RETURN_NULL,
))
->from($query)
->execute();
}
function subscriptions_user_update(&$edit, $account, $category) {
if ($account->status === '0' && $account->original->status === '1') {
_subscriptions_module_load_include('subscriptions', 'admin.inc');
_subscriptions_user_suspend($account->uid, 2);
}
}
function subscriptions_user_cancel($edit, $account) {
subscriptions_user_delete($account);
}
function subscriptions_user_delete($account) {
db_delete('subscriptions_queue')
->condition('uid', $account->uid)
->execute();
db_delete('subscriptions_user')
->condition('uid', $account->uid)
->execute();
subscriptions_delete($account->uid);
db_delete('subscriptions_last_sent')
->condition('uid', $account->uid)
->execute();
}
function subscriptions_delete($recipient_uid, $module = NULL, $field = NULL, $value = NULL, $author_uid = NULL) {
$query = db_delete('subscriptions');
foreach (array(
'module',
'field',
'value',
'author_uid',
'recipient_uid',
) as $column) {
if (!empty(${$column})) {
$query
->condition($column, ${$column});
}
}
return $query
->execute();
}
function subscriptions_delete_for_all_users($module = NULL, $field = NULL, $value = NULL, $author_uid = NULL) {
return subscriptions_delete(NULL, $module, $field, $value, $author_uid);
}
function subscriptions_write($access_key, $module, $field, $value, $author_uid = -1, $recipient = NULL, $send_interval = 1, $send_updates = 0, $send_comments = 0) {
global $user;
$recipient_uid = isset($recipient) ? $recipient : $user->uid;
$access = subscriptions_types('access', $access_key);
if ($recipient_uid && $access && ($recipient_uid == $user->uid && user_access($access) || user_access('administer user subscriptions')) || $recipient_uid == 0 && user_access('administer site configuration')) {
subscriptions_write_subscription($module, $field, $value, $author_uid, $recipient_uid, $send_interval, $send_updates, $send_comments);
}
}
function subscriptions_queue(array $event) {
global $user;
if (isset($event['node']->nid) && strpos(' ' . variable_get('subscriptions_blocked_nodes', '') . ' ', ' ' . $event['node']->nid . ' ')) {
return;
}
$event += array(
'uid' => $user->uid,
'load_args' => '',
);
foreach (module_implements('subscriptions_queue_alter') as $module) {
$function = $module . '_subscriptions_queue_alter';
$function($event);
if (empty($event)) {
return;
}
}
if (is_array($event['load_args'])) {
$event['load_args'] = serialize($event['load_args']);
}
foreach (module_implements('subscriptions') as $subs_module) {
$subs_module_query = module_invoke($subs_module, 'subscriptions', 'queue', $event);
drupal_alter('subscriptions_queue_query', $subs_module_query);
if (!isset($subs_module_query)) {
continue;
}
foreach ($subs_module_query as $module => $module_query) {
foreach ($module_query as $field => $query) {
$select = db_select('subscriptions', 's');
$select
->innerJoin('subscriptions_user', 'su', 's.recipient_uid = su.uid');
$select
->innerJoin('users', 'u', 'su.uid = u.uid');
$select
->leftJoin('subscriptions_last_sent', 'sls', 'su.uid = sls.uid AND s.send_interval = sls.send_interval');
if (!empty($query['join'])) {
$joins = isset($query['join']['table']) ? array(
$query['join'],
) : $query['join'];
foreach ($joins as $join) {
$select
->innerJoin($join['table'], $join['alias'], $join['on']);
}
}
$select
->fields('u', array(
'uid',
'name',
'language',
))
->fields('s', array(
'module',
'field',
'value',
'author_uid',
'send_interval',
))
->fields('su', array(
'digest',
'suspended',
));
$select
->addExpression('COALESCE(sls.last_sent, 0)', 'last_sent');
$select
->addExpression("'" . $event['load_function'] . "'", 'load_function');
$select
->addExpression("'" . $event['load_args'] . "'", 'load_args');
$select
->addExpression((int) $event['is_new'], 'is_new');
$select
->condition('s.module', $module)
->condition('s.field', $field)
->condition('s.author_uid', array(
$module == 'node' && $event['type'] == 'comment' && isset($event['node']->uid) ? $event['node']->uid : $event['uid'],
-1,
), 'IN')
->groupBy('u.uid');
$select
->groupBy('u.uid')
->groupBy('u.name')
->groupBy('u.language')
->groupBy('s.module')
->groupBy('s.field')
->groupBy('s.value')
->groupBy('s.author_uid')
->groupBy('s.send_interval')
->groupBy('su.digest')
->groupBy('su.suspended')
->groupBy('last_sent');
if (!empty($query['where'])) {
foreach ($query['where'] as $cond) {
$select
->condition($cond[0], $cond[1], $cond[2]);
}
}
if (!empty($query['value'])) {
$select
->condition('s.value', $query['value']);
}
if ($user->uid && !_subscriptions_get_setting('send_self', $user)) {
$select
->condition('s.recipient_uid', $user->uid, '<>');
}
if (!empty($event['noqueue_uids'])) {
$select
->condition('s.recipient_uid', $event['noqueue_uids'], 'NOT IN');
}
if (!empty($query['groupby'])) {
$select
->groupBy($query['groupby']);
}
$insert = db_insert('subscriptions_queue', array(
'return' => Database::RETURN_NULL,
))
->from($select);
$insert
->execute();
}
}
}
}
function subscriptions_get_subscription($uid, $module, $field, $value, $author_uid = -1) {
static $subscriptions;
if (!isset($subscriptions[$uid][$module][$field][$value][$author_uid])) {
$subscriptions[$uid][$module][$field][$value][$author_uid] = db_query("SELECT sid FROM {subscriptions} WHERE module = :module AND field = :field AND value = :value AND author_uid = :author_uid AND recipient_uid = :recipient_uid", array(
':module' => $module,
':field' => $field,
':value' => $value,
':author_uid' => $author_uid,
':recipient_uid' => $uid,
))
->fetchField();
}
return $subscriptions[$uid][$module][$field][$value][$author_uid];
}
function subscriptions_write_subscription($module, $field, $value, $author_uid, $recipient_uid, $send_interval = 1, $send_updates = 0, $send_comments = 0) {
db_merge('subscriptions')
->key(array(
'module' => $module,
'field' => $field,
'value' => $value,
'recipient_uid' => $recipient_uid,
'author_uid' => $author_uid,
))
->fields(array(
'send_interval' => $send_interval,
'send_updates' => $send_updates ? 1 : 0,
'send_comments' => $send_comments ? 1 : 0,
))
->execute();
}
function subscriptions_delete_form(array $form, array &$form_state, $module, $field, $value, $author_uid, $recipient_uid) {
$form['data'] = array(
'#type' => 'value',
'#value' => array(
$module,
$field,
$value,
$author_uid,
$recipient_uid,
),
);
$form['#submit'][] = 'subscriptions_delete_form_submit';
return confirm_form($form, t('Are you sure you want to unsubscribe?'), '<front>', t('You can always resubscribe later. Any pending notifications may be lost.'), t('Unsubscribe'));
}
function subscriptions_delete_form_submit(array $form, array &$form_state) {
$data = $form_state['values']['data'];
subscriptions_delete($data['4'], $data['0'], $data['1'], $data['2'], $data['3']);
drupal_set_message(t('Your subscription was deactivated.'));
$form_state['redirect'] = '<front>';
}
function subscriptions_autosubscribe($module, $field, $value, $context) {
global $user;
if ($user->uid && _subscriptions_get_setting('autosub_' . $context, $user) && !subscriptions_get_subscription($user->uid, $module, $field, $value)) {
subscriptions_write_subscription($module, $field, $value, -1, $user->uid, _subscriptions_get_setting('send_interval', $user), 1, 1);
}
}
function subscriptions_get(array $params) {
$subscriptions = array();
$query = db_select('subscriptions', 's');
$query
->fields('s');
foreach ($params as $field => $value) {
$query
->condition($field, $value);
}
foreach ($query
->execute() as $s) {
$subscriptions[$s->recipient_uid][$s->module][$s->field][$s->value][$s->author_uid] = 1;
}
return $subscriptions;
}
function subscriptions_types($field = NULL, $type = NULL) {
$types =& drupal_static(__FUNCTION__ . '_types');
$list =& drupal_static(__FUNCTION__ . '_list');
if (!isset($types)) {
$types = module_invoke_all('subscriptions', 'types');
drupal_alter('subscriptions_types', $types);
foreach ($types as $stype => $data) {
if (!_subscriptions_validate_hook_result($stype, $data)) {
continue;
}
foreach ($data as $name => $value) {
$list[$name][$stype] = $value;
}
}
}
if ($type) {
return isset($types[$type][$field]) ? $types[$type][$field] : NULL;
}
elseif ($field) {
if ($field == 'permission' && isset($list['access']) && is_array($list['access'])) {
$result = array();
foreach ($list['access'] as $type => $access) {
if (isset($list['permission'][$type]) && is_array($list['permission'][$type])) {
$result[$access] = $list['permission'][$type];
}
}
return $result;
}
return isset($list[$field]) ? $list[$field] : array();
}
else {
return $types;
}
}
function _subscriptions_validate_hook_result($stype, array $data) {
if (isset($stype)) {
if (!is_numeric($stype) && is_array($data) && isset($data['title']) && isset($data['access']) && ($data['title'] === '' || isset($data['page']) && isset($data['fields']) && is_array($data['fields']))) {
return TRUE;
}
}
static $already_reported = FALSE;
if (!$already_reported) {
$modules = array();
$already_reported = TRUE;
foreach (module_implements('subscriptions') as $module) {
$hook = $module . '_subscriptions';
$types = $hook('types');
foreach ($types as $stype => $data) {
if (!_subscriptions_validate_hook_result($stype, $data)) {
$modules[$module] = $module;
}
}
}
drupal_set_message(t('The following modules return invalid data from %hook: !modules Either they are buggy !Subscriptions add-ons, or they are unrelated to !Subscriptions and should not define %hook!', array(
'%hook' => 'hook_subscriptions()',
'!modules' => '<ul><li>' . implode($modules, '</li><li>') . '</li></ul>',
'!Subscriptions' => 'Subscriptions',
)), 'error', FALSE);
}
return FALSE;
}
function subscriptions_theme() {
return array(
'subscriptions_form_table' => array(
'file' => 'subscriptions.admin.inc',
'render element' => 'element',
),
);
}
function subscriptions_node_is_blocked($nid) {
return strpos(' ' . variable_get('subscriptions_blocked_nodes', '') . ' ', ' ' . $nid . ' ');
}
function _subscriptions_cmp_by_weight(array $a, array $b) {
$a = isset($a['weight']) ? $a['weight'] : 0;
$b = isset($b['weight']) ? $b['weight'] : 0;
return $a < $b ? -1 : ($a == $b ? 0 : +1);
}
function _subscriptions_get_setting($name, $account) {
global $user;
$uid = -DRUPAL_AUTHENTICATED_RID;
if (empty($account) || is_object($account) && empty($account->uid) || is_numeric($account) && $account <= 0) {
unset($account);
}
elseif (is_numeric($account)) {
if ($account == $user->uid) {
$account = $user;
$uid = $user->uid;
}
else {
$uid = $account;
unset($account);
}
}
if (isset($account)) {
$uid = $account->uid;
}
static $defaults = array();
if (!isset($defaults[$uid][$name])) {
$result = db_select('subscriptions_user', 'su', array(
'fetch' => PDO::FETCH_ASSOC,
))
->fields('su', array(
'uid',
'digest',
'secure_links',
'send_interval',
'send_updates',
'send_comments',
'send_interval_visible',
'send_updates_visible',
'send_comments_visible',
'autosub_on_post',
'autosub_on_update',
'autosub_on_comment',
'send_self',
))
->condition('su.uid', array(
-DRUPAL_AUTHENTICATED_RID,
$uid,
), 'IN')
->orderBy('su.uid')
->execute();
foreach ($result as $s) {
$defaults[$s['uid']] = $s;
}
if (empty($defaults[$uid])) {
if ($uid > 0) {
$account = user_load($uid);
subscriptions_user_insert(array(), $account, NULL);
}
else {
db_insert('subscriptions_user')
->fields(array(
'uid' => $uid,
))
->execute();
}
return _subscriptions_get_setting($name, $uid);
}
$secure_links_site = _subscriptions_get_setting('secure_links', NULL);
if ($uid > 0) {
if ($secure_links_site >= 0 || $defaults[$uid]['secure_links'] == -1) {
$defaults[$uid]['secure_links'] = abs($secure_links_site) >= 2;
}
}
$defaults[$uid]['uses_defaults'] = FALSE;
foreach ($defaults[$uid] as $key => $value) {
if ($value < 0) {
$defaults[$uid][$key] = $defaults[-DRUPAL_AUTHENTICATED_RID][$key];
$defaults[$uid]['uses_defaults'] = TRUE;
}
}
foreach (array(
'interval',
'updates',
'comments',
) as $parm) {
if ($defaults[-DRUPAL_AUTHENTICATED_RID]['send_' . $parm . '_visible'] == -2) {
$defaults[$uid]['send_' . $parm] = $defaults[-DRUPAL_AUTHENTICATED_RID]['send_' . $parm];
}
}
}
return $defaults[$uid][$name];
}
function subscriptions_suspended($uid, $alert = FALSE) {
$result = db_query("SELECT suspended FROM {subscriptions_user} WHERE uid = :uid", array(
':uid' => $uid,
))
->fetchField();
if ($result && $alert && empty($_POST)) {
_subscriptions_module_load_include('subscriptions', 'admin.inc');
_subscriptions_suspended_alert($uid, $result);
}
return $result;
}
function subscriptions_form_user_profile_form_alter(array &$form, array &$form_state) {
subscriptions_suspended(subscriptions_arg(1, 'uid'), TRUE);
}
function subscriptions_data(array &$data, array $queue_item) {
$data = array_merge_recursive($data, array(
'subs' => $queue_item,
));
}
function _subscriptions_module_load_include($module, $ext) {
static $loaded = array();
$key = "{$module}.{$ext}";
if (empty($loaded[$key])) {
$loaded[$key] = (bool) module_load_include($ext, $module);
}
return $loaded[$key];
}
function subscriptions_user_operations() {
if (user_access('bulk-administer user subscriptions')) {
return array(
array(
'label' => t('Subscribe the selected users to...'),
'callback' => '_subscriptions_bulk_operation',
'callback arguments' => array(
'sub',
),
),
array(
'label' => t('Unsubscribe the selected users from...'),
'callback' => '_subscriptions_bulk_operation',
'callback arguments' => array(
'unsub',
),
),
);
}
return NULL;
}
function _subscriptions_bulk_operation(array $uids, $bulk_op) {
$_SESSION['subscriptions']['bulk_op'] = $bulk_op;
$_SESSION['subscriptions']['uids'] = serialize($uids);
$_SESSION['subscriptions']['back_url'] = current_path();
drupal_goto(SUBSCRIPTIONS_CONFIG_PATH . '/userdefaults/bulk');
}
function subscriptions_arg($index, $member_name = FALSE) {
if (($mgi = menu_get_item()) && isset($mgi['map'][$index])) {
$path_exploded = $mgi['map'];
}
else {
$path_exploded = explode('/', current_path());
}
$arg = NULL;
if (!empty($path_exploded[$index])) {
$arg = $path_exploded[$index];
if ($member_name) {
if (is_object($arg) && isset($arg->{$member_name})) {
$arg = $arg->{$member_name};
}
else {
$arg = NULL;
}
}
}
return $arg;
}
function subscriptions_coder_ignore() {
return array(
'path' => drupal_get_path('module', 'subscriptions'),
'line prefix' => drupal_get_path('module', 'subscriptions') . '/',
);
}
function subscriptions_user_cancel_methods_alter(&$methods) {
$methods['user_cancel_reassign']['title'] .= ' — <span class="warning">' . t('WARNING: Reassigning content and comments may trigger unwanted Subscriptions notifications!') . '</span>';
}