function _form_options_to_text

cis7 options_element.inc _form_options_to_text($options, $key_type)
cle7 options_element.inc _form_options_to_text($options, $key_type)
elmsmedia7 options_element.inc _form_options_to_text($options, $key_type)
icor7 options_element.inc _form_options_to_text($options, $key_type)
meedjum_blog7 options_element.inc _form_options_to_text($options, $key_type)
mooc7 options_element.inc _form_options_to_text($options, $key_type)

Logic function for form_options_to_text(). Do not call directly.

See also

form_options_to_text()

1 call to _form_options_to_text()
form_options_to_text in sites/all/modules/ulmus/options_element/options_element.module
Create a textual representation of options from an array.

File

sites/all/modules/ulmus/options_element/options_element.inc, line 316
All logic for options_element form elements.

Code

function _form_options_to_text($options, $key_type) {
  $output = '';
  $previous_key = false;

  foreach ($options as $key => $value) {
    // Convert groups.
    if (is_array($value)) {
      $output .= '<' . $key . '>' . "\n";
      foreach ($value as $subkey => $subvalue) {
        $output .= (($key_type == 'mixed' || $key_type == 'numeric' || $key_type == 'custom') ? $subkey . '|' : '') . $subvalue . "\n";
      }
      $previous_key = $key;
    }
    // Typical key|value pairs.
    else {
      // Exit out of any groups.
      if (isset($options[$previous_key]) && is_array($options[$previous_key])) {
        $output .= "<>\n";
      }
      // Skip empty rows.
      if ($options[$key] !== '') {
        if ($key_type == 'mixed' || $key_type == 'numeric' || $key_type == 'custom') {
          $output .= $key . '|' . $value . "\n";
        }
        else {
          $output .= $value . "\n";
        }
      }
      $previous_key = $key;
    }
  }

  return $output;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.