You are here

function theme_signup_custom_data_field_text in Signup 6.2

Same name and namespace in other branches
  1. 6 theme/email.inc \theme_signup_custom_data_field_text()
  2. 7 theme/email.inc \theme_signup_custom_data_field_text()

Renders a single custom signup form field into unfiltered output.

Parameters

$key: Name of the custom signup field (the array key). If this is numeric, it is assumed that the $value contains its own label, in which case the $key is not output.

$value: Value of the custom signup field (the array value).

Return value

Plain text output to display this key/value pair.

See also

theme_signup_user_form()

2 theme calls to theme_signup_custom_data_field_text()
signup_handler_field_signup_user_form_data::pre_render in views/handlers/signup_handler_field_signup_user_form_data.inc
Set each field value to "$key: $value" when rendering all fields.
theme_signup_custom_data_email in theme/email.inc
Renders custom signup data into unfiltered output for use in email.

File

theme/email.inc, line 68
Theme functions for generating signup email messages.

Code

function theme_signup_custom_data_field_text($key, $value) {

  // 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';

  // If a key is numeric, we assume the module that set it knows what it is
  // doing and provides its own label.
  if (is_numeric($key)) {
    return $value;
  }
  else {
    return $tr($key) . ': ' . $value;
  }
}