Projet

Général

Profil

Révision 7fe061e8

Ajouté par Assos Assos il y a plus de 8 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/ds/ds.module
613 613
    if ($vars['elements']['#entity_type'] == 'taxonomy_term') {
614 614
      $object = 'term';
615 615
    }
616

  
617
    // Get entity id and bundle
618
    list($id,, $bundle) = entity_extract_ids($vars['elements']['#entity_type'], $vars[$object]);
619

  
616 620
    if (isset($vars[$object]->preprocess_fields)) {
617 621
      foreach ($vars[$object]->preprocess_fields as $field) {
618 622

  
......
657 661
        $layout['layout'] = $layout['panels']['theme'];
658 662
      }
659 663

  
660
      $bundle = strtr($vars['elements']['#bundle'], '-', '_');
664
      $bundle = strtr($bundle, '-', '_');
661 665
      $vars['theme_hook_suggestions'][] = $layout['layout'];
662 666
      $vars['theme_hook_suggestions'][] = $layout['layout'] . '__' . $vars['elements']['#entity_type'];
663 667
      $vars['theme_hook_suggestions'][] = $layout['layout'] . '__' . $vars['elements']['#entity_type'] . '_' . $vars['elements']['#view_mode'];
664 668
      $vars['theme_hook_suggestions'][] = $layout['layout'] . '__' . $vars['elements']['#entity_type'] . '_' . $bundle;
665 669
      $vars['theme_hook_suggestions'][] = $layout['layout'] . '__' . $vars['elements']['#entity_type'] . '_' . $bundle . '_' . $vars['elements']['#view_mode'];
670
      $vars['theme_hook_suggestions'][] = $layout['layout'] . '__' . $vars['elements']['#entity_type'] . '__' . $id;
666 671
    }
667 672

  
668 673
    // If the layout has wrapper class lets add it.
......
766 771
      }
767 772
    }
768 773

  
774
    // Set field weights for all fields, including pre-process.
775
    foreach($layout_render_array as $region => &$fields) {
776
      foreach ($fields as $field_key => &$field) {
777
        $field['#weight'] = $field_key;
778
      }
779
    }
780

  
769 781
    // Let other modules alter the ds array before creating the region variables.
770 782
    $context = array('entity' => isset($vars[$object]) ? $vars[$object] : (isset($vars['elements']['#' . $object]) ? $vars['elements']['#' . $object] : ''), 'entity_type' => $vars['elements']['#entity_type'], 'bundle' => $vars['elements']['#bundle'], 'view_mode' => $vars['elements']['#view_mode']);
771 783
    drupal_alter('ds_pre_render', $layout_render_array, $context, $vars);
......
1031 1043
    else {
1032 1044
      $uri_info = entity_uri($field['entity_type'], $field['entity']);
1033 1045
    }
1046
    if (isset($settings['link class'])) {
1047
      $uri_info['options']['attributes']['class'][] = $settings['link class'];
1048
    }
1034 1049
    $output = l($output, $uri_info['path'], $uri_info['options']);
1035 1050
    if ($title_field) {
1036 1051
      $output = ds_edit_support('title', $output, $field);

Formats disponibles : Unified diff