You are here

function _feeds_ui_format_options in Feeds 7.2

Same name and namespace in other branches
  1. 8.2 feeds_ui/feeds_ui.admin.inc \_feeds_ui_format_options()
  2. 6 feeds_ui/feeds_ui.admin.inc \_feeds_ui_format_options()
  3. 7 feeds_ui/feeds_ui.admin.inc \_feeds_ui_format_options()

Walk the result of FeedsParser::getMappingSources() or FeedsProcessor::getMappingTargets() and format them into a Form API options array.

2 calls to _feeds_ui_format_options()
feeds_ui_mapping_form in feeds_ui/feeds_ui.admin.inc
Edit mapping.
theme_feeds_ui_mapping_form in feeds_ui/feeds_ui.admin.inc
Theme function for feeds_ui_mapping_form().

File

feeds_ui/feeds_ui.admin.inc, line 853
Contains all page callbacks, forms and theming functions for Feeds administrative pages.

Code

function _feeds_ui_format_options($options, $show_deprecated = FALSE) {
  $result = array();
  foreach ($options as $k => $v) {
    if (!$show_deprecated && is_array($v) && !empty($v['deprecated'])) {
      continue;
    }
    if (is_array($v) && !empty($v['name'])) {
      $result[$k] = $v['name'] . ' (' . $k . ')';
      if (!empty($v['deprecated'])) {
        $result[$k] .= ' - ' . t('DEPRECATED');
      }
    }
    elseif (is_array($v)) {
      $result[$k] = $k;
    }
    else {
      $result[$k] = $v;
    }
  }
  asort($result);
  return $result;
}