'', '!content_type', $tr('content type')); $tokens = array ( '!ccklabel_<fieldname>' => t('The label for the CCK field %fieldname, as defined for your !content_type.', $variables), '!cckvalue1_<fieldname>' => t('The value(s) of the CCK field %fieldname, as defined for your !content_type, comma-separated.', $variables), '!cckvalue2_<fieldname>' => t('The value(s) of the CCK field %fieldname, as defined for your !content_type, newline-separated.', $variables), ); return $tokens; } /** * Implementation of hook_subscriptions_get_mailvars(). * * Add the !cck... variables. * * @ingroup hooks */ function subscriptions_cck_subscriptions_get_mailvars($node) { $mailvars = array(); if (isset($node->type) && ($fields = content_fields(NULL, $node->type))) { foreach ($fields as $field_name => $field_info) { if (isset($node->$field_name)) { $values = $node->$field_name; $formatteds = array(); foreach ($values as $value) { if (!($formatted = html_entity_decode( content_format($field_info, $value, 'plain'), ENT_QUOTES, 'UTF-8'))) { $formatted = content_format($field_info, $value, 'default'); } $formatteds[] = $formatted; } $mailvars['!ccklabel_'. $field_name] = $field_info['widget']['label']; $mailvars['!cckvalue1_'. $field_name] = implode(', ', $formatteds); $mailvars['!cckvalue2_'. $field_name] = implode("\n", $formatteds); } } } return $mailvars; }