You are here

function _feed_import_fields_optgrup in Feed Import 7.3

Returns an array for select optgroup

Parameters

array $el: An array of available fields

Return value

array An array of optgroups.

See also

_feed_import_get_fields_opts()

1 call to _feed_import_fields_optgrup()
feed_import_static_fields_form in ./feed_import.module
Static fields form

File

./feed_import.module, line 1593
User interface, cron functions for feed_import module

Code

function _feed_import_fields_optgrup(array $el) {
  $opt = array();

  // Handle properties.
  if (isset($el['#'])) {
    $opt[t('Properties')] = $el['#'];
    unset($el['#']);
  }

  // Handle fields.
  foreach ($el as $f => &$val) {
    if ($val) {
      $p = t('Field @name', array(
        '@name' => $f,
      ));
      $opt[$p] = array_flip($val);
    }
  }
  return $opt;
}