Projet

Général

Profil

Révision a192dc0b

Ajouté par Assos Assos il y a environ 8 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/feeds/feeds_ui/feeds_ui.admin.inc
513 513
  if ($sources = $importer->parser->getMappingSources()) {
514 514
    $source_options = _feeds_ui_format_options($sources);
515 515
    foreach ($sources as $k => $source) {
516
      if (!empty($source['deprecated'])) {
517
        continue;
518
      }
516 519
      $legend['sources'][$k]['name']['#markup'] = empty($source['name']) ? $k : $source['name'];
517 520
      $legend['sources'][$k]['description']['#markup'] = empty($source['description']) ? '' : $source['description'];
518 521
    }
......
524 527
  $target_options = _feeds_ui_format_options($targets);
525 528
  $legend['targets'] = array();
526 529
  foreach ($targets as $k => $target) {
530
    if (!empty($target['deprecated'])) {
531
      continue;
532
    }
527 533
    $legend['targets'][$k]['name']['#markup'] = empty($target['name']) ? $k : $target['name'];
528 534
    $legend['targets'][$k]['description']['#markup'] = empty($target['description']) ? '' : $target['description'];
529 535
  }
......
830 836
 * FeedsProcessor::getMappingTargets() and format them into
831 837
 * a Form API options array.
832 838
 */
833
function _feeds_ui_format_options($options) {
839
function _feeds_ui_format_options($options, $show_deprecated = FALSE) {
834 840
  $result = array();
835 841
  foreach ($options as $k => $v) {
842
    if (!$show_deprecated && is_array($v) && !empty($v['deprecated'])) {
843
      continue;
844
    }
836 845
    if (is_array($v) && !empty($v['name'])) {
837 846
      $result[$k] = $v['name'] . ' (' . $k . ')';
847
      if (!empty($v['deprecated'])) {
848
        $result[$k] .= ' - ' . t('DEPRECATED');
849
      }
838 850
    }
839 851
    elseif (is_array($v)) {
840 852
      $result[$k] = $k;
......
930 942
  drupal_add_css(drupal_get_path('module', 'feeds_ui') . '/feeds_ui.css');
931 943

  
932 944
  // Outer wrapper.
933
  $output = '<div class="feeds-settings clear-block">';
945
  $output = '<div class="feeds-settings clearfix">';
934 946

  
935 947
  // Build left bar.
936 948
  $output .= '<div class="left-bar">';
......
1017 1029
function theme_feeds_ui_mapping_form($variables) {
1018 1030
  $form = $variables['form'];
1019 1031

  
1032
  $targets = feeds_importer($form['#importer'])->processor->getMappingTargets();
1033
  $targets = _feeds_ui_format_options($targets, TRUE);
1034

  
1035
  $sources = feeds_importer($form['#importer'])->parser->getMappingSources();
1036
  // Some parsers do not define source options.
1037
  $sources = $sources ? _feeds_ui_format_options($sources, TRUE) : array();
1038

  
1020 1039
  // Build the actual mapping table.
1021 1040
  $header = array(
1022 1041
    t('Source'),
......
1028 1047
  $rows = array();
1029 1048
  if (is_array($form['#mappings'])) {
1030 1049
    foreach ($form['#mappings'] as $i => $mapping) {
1031
      // Some parsers do not define source options.
1032
      $source = isset($form['source']['#options'][$mapping['source']]) ? $form['source']['#options'][$mapping['source']] : $mapping['source'];
1033
      $target = isset($form['target']['#options'][$mapping['target']]) ? check_plain($form['target']['#options'][$mapping['target']]) : '<em>' . t('Missing') . '</em>';
1050
      $source = isset($sources[$mapping['source']]) ? check_plain($sources[$mapping['source']]) : check_plain($mapping['source']);
1051
      $target = isset($targets[$mapping['target']]) ? check_plain($targets[$mapping['target']]) : '<em>' . t('Missing') . '</em>';
1034 1052
      // Add indicator to target if target configuration changed.
1035 1053
      if (isset($form['#mapping_settings'][$i])) {
1036 1054
        $target .= '<span class="warning">*</span>';
1037 1055
      }
1038 1056
      $rows[] = array(
1039 1057
        'data' => array(
1040
          check_plain($source),
1058
          $source,
1041 1059
          $target,
1042 1060
          drupal_render($form['config'][$i]),
1043 1061
          drupal_render($form['remove_flags'][$i]),

Formats disponibles : Unified diff