You are here

function redhen_fields_allowed_labels_string in RedHen CRM 7

Generates a string representation of an array of 'labels'.

This string format is suitable for edition in a textarea.

Parameters

array $values: An array of values, where array keys are values and array values are labels.

Return value

string The string representation of the $values array:

  • Values are separated by a carriage return.
  • Each value is in the format "value|label" or "value".
1 call to redhen_fields_allowed_labels_string()
redhen_fields_field_settings_form in modules/redhen_fields/redhen_fields.module
Implements hook_field_settings_form().

File

modules/redhen_fields/redhen_fields.module, line 138
Defines email, phone and address field types for RedHen CRM.

Code

function redhen_fields_allowed_labels_string($values) {
  $lines = array();
  foreach ($values as $key => $value) {
    $lines[] = "{$key}|{$value}";
  }
  return implode("\n", $lines);
}