function theme_signup_custom_data_email in Signup 5.2
Same name and namespace in other branches
- 5 signup.module \theme_signup_custom_data_email()
- 6.2 theme/email.inc \theme_signup_custom_data_email()
- 6 theme/email.inc \theme_signup_custom_data_email()
- 7 theme/email.inc \theme_signup_custom_data_email()
Renders custom signup data into unfiltered output for use in email.
WARNING: This theme function is recursive (it calls itself for nested data), so if you override it, be sure not to change the part where it does "call_user_func(__FUNCTION__)".
Parameters
$data: Array of custom user signup data.
Return value
Plain text output with newlines.
See also
2 theme calls to theme_signup_custom_data_email()
- signup_build_signup_data in ./
signup.module - Deprecated function to render signup data in a human-readable form.
- theme_signup_email_token_custom_data in ./
signup.module - Return the value for the %user_signup_info email token for custom signup data.
File
- ./
signup.module, line 2469 - The Signup module (http://drupal.org/project/signup) manages replies to nodes. In particular, it's good for event management. Signup supports sending reminder emails and automatically closing signups for nodes with a start time, via the Event…
Code
function theme_signup_custom_data_email($data) {
$output = '';
// All of the possible array key values should already be translated as
// string literals in theme_signup_user_form() via the #title attributes, so
// passing a variable to t() is actually safe here. However, to avoid
// warnings when extracting strings, "hide" the call to t() by using a
// variable to hold the function name.
$tr = 't';
// Loop through each first level element.
foreach ($data as $key => $value) {
if (is_array($value)) {
// Element is nested, render it recursively.
// Instead of the overhead of theme(), just call ourself directly.
$output .= "\n\r" . call_user_func(__FUNCTION__, $value) . "\n\r";
}
else {
$output .= $tr($key) . ': ' . $value . "\n\r";
}
}
return $output;
}