Projet

Général

Profil

Révision 3dfa8105

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

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/ds/css/ds.admin.css
7 7
  margin-bottom: 1em;
8 8
}
9 9

  
10
#field-display-overview .field-formatter-settings-edit-form .ft-group {
11
  border-top: 1px solid #aaa;
12
  padding: 5px 0;
13
  overflow: auto;
14
}
15

  
16
#field-display-overview .field-formatter-settings-edit-form .ft-group.lb {
17
  border-top: none;
18
}
19

  
10 20
#field-display-overview .field-formatter-settings-edit-form .ft-group .form-item {
11 21
  margin: 0;
22
  white-space: normal;
12 23
}
13 24

  
14 25
.ds-layout-preview-title {
......
164 175
.vertical-tabs fieldset#edit-additional-settings-ds-page-title-options-page-option-contexts {
165 176
  margin: 1em 0;
166 177
  padding: 2.5em 0 0;
167
  border: 1px solid #CCCCCC;
178
  border: 1px solid #ccc;
168 179
}
169 180

  
170 181
#edit-additional-settings-ds-page-title-options-page-option-contexts legend {
drupal7/sites/all/modules/ds/ds.api.php
420 420
 *   - entity_type
421 421
 *   - bundle
422 422
 *   - view_mode
423
 * @param array $vars
424
 *   All variables available for render. You can use this to add css classes.
423 425
 */
424
function hook_ds_pre_render_alter(&$layout_render_array, $context) {
426
function hook_ds_pre_render_alter(&$layout_render_array, $context, &$vars) {
425 427
  $layout_render_array['left'][] = array('#markup' => 'cool!', '#weight' => 20);
428
  $vars['attributes_array']['class'][] = 'custom';
426 429
}
427 430

  
428 431
/**
......
593 596
  }
594 597
}
595 598

  
599
/**
600
 * Alter the field template settings form
601
 *
602
 * @param array $form
603
 *   The form containing the field settings
604
 * @param array $field_settings
605
 *   The settings of the field
606
 */
607
function hook_ds_field_theme_functions_settings_alter(&$form, $field_settings) {
608
  $form['something'] = array(
609
    '#type' => 'textfield',
610
    '#title' => 'test',
611
  );
612
}
613

  
596 614
/*
597 615
 * @} End of "addtogroup hooks".
598 616
 */
drupal7/sites/all/modules/ds/ds.info
13 13
files[] = tests/ds.forms.test
14 14
configure = admin/structure/ds
15 15

  
16
; Information added by drupal.org packaging script on 2013-09-04
17
version = "7.x-2.6"
16
; Information added by Drupal.org packaging script on 2014-10-28
17
version = "7.x-2.7"
18 18
core = "7.x"
19 19
project = "ds"
20
datestamp = "1378305390"
20
datestamp = "1414483431"
21 21

  
drupal7/sites/all/modules/ds/ds.install
229 229
      'label' => array(
230 230
        'description' => 'The label of the field.',
231 231
        'type' => 'varchar',
232
        'length' => 32,
232
        'length' => 128,
233 233
        'not null' => TRUE,
234 234
        'default' => '',
235 235
      ),
......
276 276
  if (!db_field_exists('ds_fields', 'ui_limit')) {
277 277
    db_add_field('ds_fields', 'ui_limit', $schema['ds_fields']['fields']['ui_limit']);
278 278
  }
279
}
279
}
280

  
281
/**
282
 * Increase the label storage length to 128.
283
 */
284
function ds_update_7202() {
285
  db_change_field('ds_fields', 'label', 'label',
286
    array(
287
      'description' => 'The label of the field.',
288
      'type' => 'varchar',
289
      'length' => 128,
290
      'not null' => TRUE,
291
      'default' => '',
292
    ));
293
}
drupal7/sites/all/modules/ds/ds.module
684 684
      // Add extras classes to the region.
685 685
      if (empty($layout['flexible'])) {
686 686
        $vars[$region_name . '_classes'] = !empty($layout['settings']['classes'][$region_name]) ? ' ' . implode(' ', $layout['settings']['classes'][$region_name]) : '';
687

  
688
        // Token support for region classes.
689
        if (module_exists('token')) {
690
          $vars[$region_name . '_classes'] = token_replace($vars[$region_name . '_classes'], array($object => $vars[$object]), array('clear' => TRUE, 'sanitize' => TRUE));
691
        }
687 692
      }
688 693
      // Add a wrapper to the region.
689 694
      if (empty($layout['flexible'])) {
......
712 717
      $vars['layout_attributes'] .= ' ' . drupal_attributes($vars['attributes_array']);
713 718
    }
714 719

  
720
    // Token support for layout classes.
721
    if (module_exists('token')) {
722
      foreach ($vars['classes_array'] as &$class) {
723
        $class = token_replace($class, array($object => $vars[$object]), array('clear' => TRUE, 'sanitize' => TRUE));
724
      }
725
    }
726

  
715 727
    // Add an onclick attribute on the wrapper.
716 728
    if (!empty($layout['settings']['layout_link_attribute'])) {
717 729
      $url = '';
718 730
      switch ($layout['settings']['layout_link_attribute']) {
719 731
        case 'content':
720
          $uri = entity_uri($vars['elements']['#entity_type'], $vars[$object]);
732
          if ($object == 'user') {
733
            $uri = entity_uri($vars['elements']['#entity_type'], $vars['elements']['#account']);
734
          }
735
          else {
736
            $uri = entity_uri($vars['elements']['#entity_type'], $vars[$object]);
737
          }
721 738
          if (!empty($uri)) {
722 739
            $url = $uri['path'];
723 740
          }
......
726 743
          $url = $layout['settings']['layout_link_custom'];
727 744
          break;
728 745
        case 'tokens':
729
          $url = token_replace($layout['settings']['layout_link_custom'], array($vars['elements']['#entity_type'] => $vars[$object]));
746
          $url = token_replace($layout['settings']['layout_link_custom'], array($vars['elements']['#entity_type'] => $vars[$object]), array('clear' => TRUE));
730 747
          break;
731 748
      }
732 749

  
......
737 754

  
738 755
    // Let other modules alter the ds array before creating the region variables.
739 756
    $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']);
740
    drupal_alter('ds_pre_render', $layout_render_array, $context);
757
    drupal_alter('ds_pre_render', $layout_render_array, $context, $vars);
741 758
    foreach ($layout_render_array as $region_name => $content) {
742 759
      // In case this is a panels layout, add the region to the $content variable.
743 760
      if (isset($layout['module']) && $layout['module'] == 'panels') {
......
816 833
          foreach ($field['entity']->{$key}[$language] as $tkey => $item) {
817 834
            if (isset($item['tid']) && !isset($item['taxonomy_term'])) {
818 835
              if (!isset($terms_loaded[$item['tid']])) {
819
                $terms_loaded[$item['tid']] = taxonomy_term_load($item['tid']);
836
                $term = taxonomy_term_load($item['tid']);
837
                if (!is_object($term)) {
838
                  // This term is missing in the database.
839
                  continue;
840
                }
841
                $terms_loaded[$item['tid']];
820 842
              }
821 843
              $field['entity']->{$key}[$language][$tkey]['taxonomy_term'] = $terms_loaded[$item['tid']];
822 844
            }
......
873 895
  $contextual_links = array();
874 896
  $contextual = module_exists('contextual') && user_access('access contextual links');
875 897
  if ($contextual) {
876
    if (is_array($block['content']) && isset($block['content']['#contextual_links'])) {
898
    if (isset($block['content']) && is_array($block['content']) && isset($block['content']['#contextual_links'])) {
877 899
      $contextual_links = $block['content']['#contextual_links'];
878 900
    }
879 901
  }
......
892 914
    }
893 915

  
894 916
    global $theme_key;
895
    $full_block = db_query("SELECT * FROM {block} WHERE module = :module AND delta = :delta AND theme = :theme", array(':module' => $module, ':delta' => $delta, ':theme' => $theme_key))->fetchObject();
917
    if (module_exists('block')) {
918
      $full_block = db_query("SELECT * FROM {block} WHERE module = :module AND delta = :delta AND theme = :theme", array(':module' => $module, ':delta' => $delta, ':theme' => $theme_key))->fetchObject();
919
    }
896 920
    if (!empty($full_block)) {
897 921
      if ($full_block->title == '<none>') {
898 922
        $block['subject'] = '';
......
955 979
 * Render a field.
956 980
 */
957 981
function ds_render_field($field) {
958

  
959 982
  $title_field = FALSE;
960 983

  
961 984
  $output = '';
......
982 1005

  
983 1006
  // Link.
984 1007
  if ($settings['link']) {
985
    if (isset($field['entity']->uri['path'])) {
986
      $path = $field['entity']->uri['path'];
1008
    if (isset($field['entity']->uri)) {
1009
      $uri_info = $field['entity']->uri;
987 1010
    }
988 1011
    else {
989 1012
      $uri_info = entity_uri($field['entity_type'], $field['entity']);
990
      $path = $uri_info['path'];
991 1013
    }
992
    $output = l($output, $path);
1014
    $output = l($output, $uri_info['path'], $uri_info['options']);
993 1015
    if ($title_field) {
994 1016
      $output = ds_edit_support('title', $output, $field);
995 1017
    }
......
1098 1120
  $picture = ds_return_picture($field['entity']);
1099 1121

  
1100 1122
  if (!empty($picture)) {
1101
    $vars = array();
1102 1123
    $filepath = (isset($picture->uri)) ? $picture->uri : $picture;
1103
    $name = !empty($field['entity']->name) ? $field['entity']->name : variable_get('anonymous', t('Anonymous'));
1124
    $name = format_username($field['entity']);
1104 1125
    $alt = t("@user's picture", array('@user' => $name));
1105 1126
    $vars = array('path' => $filepath, 'alt' => $alt, 'title' => $alt);
1106 1127

  
......
1157 1178
      'label'       => t('Rendered taxonomy term'),
1158 1179
      'description' => t('Display the referenced term in a specific view mode'),
1159 1180
      'field types' => array('taxonomy_term_reference'),
1160
      'settings'    => array('taxonomy_term_reference_view_mode' => 'full'),
1181
      'settings'    => array(
1182
        'taxonomy_term_reference_view_mode' => 'full',
1183
        'use_content_language' => TRUE,
1184
      ),
1161 1185
    );
1162 1186
    $formatters['ds_taxonomy_separator'] = array(
1163 1187
      'label'       => t('Separated'),
......
1203 1227
      }
1204 1228
      else {
1205 1229
        $term = taxonomy_term_load($item['tid']);
1230
        if (!is_object($term)) {
1231
          // This term is missing in the database.
1232
          continue;
1233
        }
1234
        $settings = $display['settings'];
1235
        if ($settings['use_content_language'] && !empty($GLOBALS['language_content']->language)) {
1236
          $langcode = $GLOBALS['language_content']->language;
1237
        }
1206 1238
        if (!empty($term)) {
1207 1239
          $build = taxonomy_term_view($term, $view_mode, $langcode);
1208 1240
        }
......
1227 1259
      }
1228 1260
      else {
1229 1261
        $term = taxonomy_term_load($item['tid']);
1262
        if (!is_object($term)) {
1263
          // This term is missing in the database.
1264
          continue;
1265
        }
1230 1266
        if ($display['type'] == 'ds_taxonomy_separator_localized' && function_exists('i18n_taxonomy_term_name')) {
1231 1267
          $term->name = i18n_taxonomy_term_name($term, $language->language);
1232 1268
        }
drupal7/sites/all/modules/ds/includes/ds.displays.inc
146 146
    foreach ($remove as $key => $value) {
147 147
      if ($key === $value) {
148 148
        $variable_set = TRUE;
149
        db_delete('block')
150
          ->condition('delta', $key)
151
          ->condition('module', 'ds_extras')
152
          ->execute();
149
        if (module_exists('block')) {
150
          db_delete('block')
151
            ->condition('delta', $key)
152
            ->condition('module', 'ds_extras')
153
            ->execute();
154
        }
153 155
        unset($region_blocks[$key]);
154 156
      }
155 157
    }
drupal7/sites/all/modules/ds/includes/ds.field_ui.inc
982 982
      '#options' => $options,
983 983
      '#default_value' => $settings['taxonomy_term_reference_view_mode'],
984 984
    );
985
    $element['use_content_language'] = array(
986
      '#type' => 'checkbox',
987
      '#title' => t('Use current content language'),
988
      '#default_value' => $settings['use_content_language'],
989
    );
985 990
    return $element;
986 991
  }
987 992

  
......
1027 1032
    $entity_info = entity_get_info('taxonomy_term');
1028 1033
    $modes = $entity_info['view modes'];
1029 1034
    $mode = $modes[$settings['taxonomy_term_reference_view_mode']]['label'];
1030
    $summary = t('View mode: %mode', array('%mode' => $mode));
1035
    $summary .= t('View mode: %mode', array('%mode' => $mode)) . '<br />';;
1036
    $summary .= !empty($settings['use_content_language']) ? t('Use current content language') : t('Use field language');
1031 1037
  }
1032 1038

  
1033 1039
  if ($display['type'] === 'ds_taxonomy_separator' || $display['type'] == 'ds_taxonomy_separator_localized') {
......
1613 1619
  if (!empty($layout) && isset($layout->regions)) {
1614 1620

  
1615 1621
    // Add wrappers
1616
    $wrapper_options = array('div' => 'Div', 'span' => 'Span', 'section' => 'Section', 'article' => 'Article', 'header' => 'Header', 'footer' => 'Footer', 'aside' => 'Aside');
1622
    $wrapper_options = array(
1623
      'div' => 'Div',
1624
      'span' => 'Span',
1625
      'section' => 'Section',
1626
      'article' => 'Article',
1627
      'header' => 'Header',
1628
      'footer' => 'Footer',
1629
      'aside' => 'Aside',
1630
      'figure' => 'Figure'
1631
    );
1617 1632
    $form['additional_settings']['region_wrapper'] = array(
1618 1633
      '#type' => 'fieldset',
1619 1634
      '#title' => t('Custom wrappers'),
......
2027 2042
  foreach ($fields as $key => $field) {
2028 2043

  
2029 2044
    // Check on ui_limit.
2030
    if (isset($field['ui_limit'])) {
2045
    if (!empty($field['ui_limit'])) {
2031 2046

  
2032 2047
      $continue = TRUE;
2033 2048
      foreach ($field['ui_limit'] as $limitation) {
......
2252 2267

  
2253 2268
        // Load the form
2254 2269
        module_load_include('inc', 'ds_extras', 'includes/ds_extras.admin');
2270
        if (!is_array($settings_form)) $settings_form = array();
2255 2271
        ds_extras_field_template_settings_form($settings_form, $form_state, $context);
2256 2272
      }
2257 2273

  
......
2470 2486
    'custom_field' => t('Add a code field'),
2471 2487
    'manage_ctools' => t('Add a dynamic field'),
2472 2488
  );
2473
  if (module_exists('block')) {
2474
    $field_types['manage_block'] = t('Add a block field');
2475
  }
2489
  $field_types['manage_block'] = t('Add a block field');
2476 2490
  $field_types['manage_preprocess'] = t('Add a preprocess field');
2477 2491

  
2478 2492
  foreach ($field_types as $field_key => $field_title) {
drupal7/sites/all/modules/ds/modules/ds_devel/ds_devel.info
5 5
dependencies[] = ds
6 6
dependencies[] = devel
7 7

  
8
; Information added by drupal.org packaging script on 2013-09-04
9
version = "7.x-2.6"
8
; Information added by Drupal.org packaging script on 2014-10-28
9
version = "7.x-2.7"
10 10
core = "7.x"
11 11
project = "ds"
12
datestamp = "1378305390"
12
datestamp = "1414483431"
13 13

  
drupal7/sites/all/modules/ds/modules/ds_extras/ds_extras.info
5 5
dependencies[] = ds
6 6
configure = admin/structure/ds/list/extras
7 7

  
8
; Information added by drupal.org packaging script on 2013-09-04
9
version = "7.x-2.6"
8
; Information added by Drupal.org packaging script on 2014-10-28
9
version = "7.x-2.7"
10 10
core = "7.x"
11 11
project = "ds"
12
datestamp = "1378305390"
12
datestamp = "1414483431"
13 13

  
drupal7/sites/all/modules/ds/modules/ds_extras/ds_extras.module
729 729

  
730 730
  $config = $variables['ds-config'];
731 731

  
732
  // Set prefix
733
  if (!empty($config['prefix'])) {
734
    $output .= $config['prefix'];
735
  }
736

  
732 737
  // Render the label if it's not hidden.
733 738
  if (!$variables['label_hidden']) {
739
    $styled_label = $variables['label'];
740
    if (!isset($config['lb-col'])) $styled_label .= ':&nbsp;';
741

  
742
    // Style the label it self
734 743
    $label_wrapper = isset($config['lb-el']) ? $config['lb-el'] : 'div';
735 744
    $class = array('label-' . $variables['element']['#label_display']);
736 745
    if (!empty($config['lb-cl'])) $class[] = $config['lb-cl'];
......
739 748
    if (!empty($config['lb-at'])) $attributes[] = $config['lb-at'];
740 749
    if (!empty($config['lb-def-at'])) $attributes[] = $variables['title_attributes'];
741 750
    $attributes = (!empty($attributes)) ? ' ' . implode(' ', $attributes) : '';
742
    $output .= '<' . $label_wrapper . $class . $attributes . '>' . $variables['label'];
743
    if (!isset($config['lb-col'])) $output .= ':&nbsp;';
744
    $output .= '</' . $label_wrapper . '>';
751
    $styled_label = '<' . $label_wrapper . $class . $attributes . '>' . $styled_label . '</' . $label_wrapper . '>';
752

  
753
    // Place it inside a wrapper
754
    if (isset($config['lbw'])) {
755
      $class = !empty($config['lbw-cl']) ? ' class="' . $config['lbw-cl'] . '"' : '';
756
      $attributes = !empty($config['lbw-at']) ?  ' ' . $config['lbw-at'] : '';
757
      $styled_label = '<' . $config['lbw-el'] . $class . $attributes . '>' . $styled_label . '</' . $config['lbw-el'] . '>';
758
    }
759

  
760
    $output .= $styled_label;
745 761
  }
746 762

  
747 763
  // Field items wrapper
748 764
  if (isset($config['fis'])) {
749
    $class = (!empty($config['fis-cl'])) ? ' class="' . $config['fis-cl'] . '"' : '';
765
    $class = (!empty($config['fis-cl'])) ? ' class="' . token_replace($config['fis-cl'], array($variables['element']['#entity_type'] => $variables['element']['#object']), array('clear' => TRUE)) . '"' : '';
750 766
    $attributes = array();
751
    if (!empty($config['fis-at'])) $attributes[] = $config['fis-at'];
767
    if (!empty($config['fis-at'])) $attributes[] = token_replace($config['fis-at'], array($variables['element']['#entity_type'] => $variables['element']['#object']), array('clear' => TRUE));;
752 768
    if (!empty($config['fis-def-at'])) $attributes[] = $variables['content_attributes'];
753 769
    $attributes = (!empty($attributes)) ? ' ' . implode(' ', $attributes) : '';
754 770
    $output .= '<' . $config['fis-el'] . $class . $attributes . '>';
......
760 776
    if (isset($config['fi'])) {
761 777
      $class = array();
762 778
      if (!empty($config['fi-odd-even'])) {
763
        $class[] = $delta % 2 ? 'odd' : 'even';
779
        $class[] = $delta % 2 ? 'even' : 'odd';
764 780
      }
765 781
      if (!empty($config['fi-cl'])) {
766 782
        $class[] = $config['fi-cl'];
767 783
      }
768
      $class = !empty($class) ? ' class="'. implode(' ', $class)  .'"' : '';
784
      $class = !empty($class) ? ' class="'. token_replace(implode(' ', $class), array($variables['element']['#entity_type'] => $variables['element']['#object']), array('clear' => TRUE)) .'"' : '';
769 785
      $attributes = array();
770 786
      if (!empty($config['fi-at'])) {
771 787
        $attributes[] = token_replace($config['fi-at'], array($variables['element']['#entity_type'] => $variables['element']['#object']), array('clear' => TRUE));
......
794 810
  // Outer wrapper.
795 811
  if (isset($config['ow'])) {
796 812
    $class = array();
797
    if (!empty($config['ow-cl'])) $class[] = $config['ow-cl'];
813
    if (!empty($config['ow-cl'])) $class[] = token_replace($config['ow-cl'], array($variables['element']['#entity_type'] => $variables['element']['#object']), array('clear' => TRUE));
798 814
    if (!empty($config['ow-def-cl'])) $class[] = $variables['classes'];
799 815
    $class = (!empty($class)) ? ' class="' . implode(' ', $class) . '"' : '';
800 816
    $attributes = array();
801
    if (!empty($config['ow-at'])) $attributes[] = $config['ow-at'];
817
    if (!empty($config['ow-at'])) $attributes[] = token_replace($config['ow-at'], array($variables['element']['#entity_type'] => $variables['element']['#object']), array('clear' => TRUE));;
802 818
    if (!empty($config['ow-def-at'])) $attributes[] = $variables['attributes'];
803 819
    $attributes = (!empty($attributes)) ? ' ' . implode(' ', $attributes) : '';
804 820
    $output = '<' . $config['ow-el'] . $class . $attributes . '>' . $output . '</' . $config['ow-el'] . '>';
805 821
  }
806 822

  
823
  // Set suffix
824
  if (!empty($config['suffix'])) {
825
    $output .= $config['suffix'];
826
  }
827

  
807 828
  return $output;
808 829
}
809 830

  
......
850 871
    }
851 872

  
852 873
    // Label.
853
    if (isset($form_state['values']['fields'][$key]['label']) && $form_state['values']['fields'][$key]['label'] != 'hidden') {
874
    if (isset($form_state['values']['fields'][$key]['label'])) {
854 875
      if (!empty($values['lb'])) {
855 876
        $field_settings[$key]['formatter_settings']['ft']['lb'] = $values['lb'];
856 877
      }
......
869 890
      if (!(empty($values['lb-col']))) {
870 891
        $field_settings[$key]['formatter_settings']['ft']['lb-col'] = TRUE;
871 892
      }
893

  
894
      // label wrapper
895
      if (!empty($values['lbw'])) {
896
        $field_settings[$key]['formatter_settings']['ft']['lbw'] = $values['lbw'];
897
      }
898
      if (!(empty($values['lbw-el'])) && $function == 'theme_ds_field_expert') {
899
        $field_settings[$key]['formatter_settings']['ft']['lbw-el'] = check_plain($values['lbw-el']);
900
      }
901
      if (!(empty($values['lbw-cl'])) && $function == 'theme_ds_field_expert') {
902
        $field_settings[$key]['formatter_settings']['ft']['lbw-cl'] = check_plain($values['lbw-cl']);
903
      }
904
      if (!(empty($values['lbw-at'])) && $function == 'theme_ds_field_expert') {
905
       $field_settings[$key]['formatter_settings']['ft']['lbw-at'] = filter_xss($values['lbw-at']);
906
      }
907
    }
908

  
909
    if (!(empty($values['prefix']))) {
910
      $field_settings[$key]['formatter_settings']['ft']['prefix'] = $values['prefix'];
911
    }
912
    if (!(empty($values['suffix']))) {
913
      $field_settings[$key]['formatter_settings']['ft']['suffix'] = $values['suffix'];
872 914
    }
873 915

  
874 916
    // Custom field configuration.
drupal7/sites/all/modules/ds/modules/ds_extras/includes/ds_extras.admin.inc
114 114
    '#default_value' => variable_get('ds_extras_field_permissions', FALSE),
115 115
  );
116 116

  
117
  if (module_exists('block')) {
118
    $form['additional_settings']['fs4']['ds_extras_region_to_block'] = array(
119
      '#type' => 'checkbox',
120
      '#title' => t('Region to block'),
121
      '#description' => t('Create additional regions exposed as block. Note: this will not work on the default view mode.'),
122
      '#default_value' => variable_get('ds_extras_region_to_block', FALSE),
123
    );
124
  }
117
  $form['additional_settings']['fs4']['ds_extras_region_to_block'] = array(
118
    '#type' => 'checkbox',
119
    '#title' => t('Region to block'),
120
    '#description' => t('Create additional regions exposed as block. Note: this will not work on the default view mode.'),
121
    '#default_value' => variable_get('ds_extras_region_to_block', FALSE),
122
  );
125 123

  
126 124
  if (module_exists('views')) {
127 125
    $form['additional_settings']['fs4']['ds_extras_vd'] = array(
......
327 325
    );
328 326
  }
329 327

  
328
  // Add prefix
329
  $form['ft']['prefix'] = array(
330
    '#type' => 'textfield',
331
    '#title' => t('Prefix'),
332
    '#size' => '100',
333
    '#description' => t('You can enter any html in here.'),
334
    '#default_value' => isset($field_settings['prefix']) ? $field_settings['prefix'] : '',
335
    '#prefix' => '<div class="field-prefix">',
336
    '#suffix' => '</div>',
337
  );
338

  
330 339
  // Wrappers and label.
331 340
  $wrappers = array(
332 341
    'lb' => array('title' => t('Label')),
342
    'lbw' => array('title' => t('Label wrapper')),
333 343
    'ow' => array('title' => t('Outer wrapper')),
334 344
    'fis' => array('title' => t('Field items')),
335 345
    'fi' => array('title' => t('Field item')),
......
352 362
      '#size' => '10',
353 363
      '#description' => t('E.g. div, span, h2 etc.'),
354 364
      '#default_value' => isset($field_settings[$wrapper_key . '-el']) ? $field_settings[$wrapper_key . '-el'] : '',
365
      '#states' => array(
366
        'visible' => array(
367
          ':input[name$="[ft][' . $wrapper_key . ']"]' => array('checked' => TRUE),
368
        ),
369
      ),
355 370
    );
356 371
    $form['ft'][$wrapper_key . '-cl'] = array(
357 372
      '#type' => 'textfield',
......
359 374
      '#size' => '10',
360 375
      '#default_value' => isset($field_settings[$wrapper_key . '-cl']) ? $field_settings[$wrapper_key . '-cl'] : '',
361 376
      '#description' => t('E.g.') .' ' . implode(', ', $classes),
377
      '#states' => array(
378
        'visible' => array(
379
          ':input[name$="[ft][' . $wrapper_key . ']"]' => array('checked' => TRUE),
380
        ),
381
      ),
362 382
    );
363 383
    $form['ft'][$wrapper_key . '-at'] = array(
364 384
      '#type' => 'textfield',
......
366 386
      '#size' => '20',
367 387
      '#default_value' => isset($field_settings[$wrapper_key . '-at']) ? $field_settings[$wrapper_key . '-at'] : '',
368 388
      '#description' => t('E.g. name="anchor"'),
389
      '#states' => array(
390
        'visible' => array(
391
          ':input[name$="[ft][' . $wrapper_key . ']"]' => array('checked' => TRUE),
392
        ),
393
      ),
369 394
    );
370 395

  
371 396
    // Hide colon.
......
384 409
        '#type' => 'checkbox',
385 410
        '#title' => t('Add odd/even classes'),
386 411
        '#default_value' => isset($field_settings['fi-odd-even']) ? $field_settings['fi-odd-even'] : FALSE,
412
        '#states' => array(
413
          'visible' => array(
414
            ':input[name$="[ft][' . $wrapper_key . ']"]' => array('checked' => TRUE),
415
          ),
416
        ),
417
      );
418
    }
419
    if ($wrapper_key != 'lbw') {
420
      $form['ft'][$wrapper_key . '-def-at'] = array(
421
        '#type' => 'checkbox',
422
        '#title' => t('Add default attributes'),
423
        '#default_value' => isset($field_settings[$wrapper_key . '-def-at']) ? $field_settings[$wrapper_key . '-def-at'] : FALSE,
424
        '#suffix' => ($wrapper_key == 'ow') ? '' : '</div>',
425
        '#states' => array(
426
          'visible' => array(
427
            ':input[name$="[ft][' . $wrapper_key . ']"]' => array('checked' => TRUE),
428
          ),
429
        ),
430
      );
431
    }
432
    else {
433
      $form['ft'][$wrapper_key . '-def-at'] = array(
434
        '#markup' => '</div><div class="clearfix"></div>',
387 435
      );
388 436
    }
389
    $form['ft'][$wrapper_key . '-def-at'] = array(
390
      '#type' => 'checkbox',
391
      '#title' => t('Add default attributes'),
392
      '#default_value' => isset($field_settings[$wrapper_key . '-def-at']) ? $field_settings[$wrapper_key . '-def-at'] : FALSE,
393
      '#suffix' => ($wrapper_key == 'ow') ? '' : '</div><div class="clearfix"></div>',
394
    );
395 437

  
396 438
    // Default classes for outer wrapper.
397 439
    if ($wrapper_key == 'ow') {
......
399 441
        '#type' => 'checkbox',
400 442
        '#title' => t('Add default classes'),
401 443
        '#default_value' => isset($field_settings[$wrapper_key . '-def-cl']) ? $field_settings[$wrapper_key . '-def-cl'] : FALSE,
402
        '#suffix' => '</div><div class="clearfix"></div>',
444
        '#suffix' => '</div>',
445
        '#states' => array(
446
          'visible' => array(
447
            ':input[name$="[ft][' . $wrapper_key . ']"]' => array('checked' => TRUE),
448
          ),
449
        ),
403 450
      );
404 451
    }
405 452
  }
406 453

  
454
  // Add suffix
455
  $form['ft']['suffix'] = array(
456
    '#type' => 'textfield',
457
    '#title' => t('Suffix'),
458
    '#size' => '100',
459
    '#description' => t('You can enter any html in here.'),
460
    '#default_value' => isset($field_settings['suffix']) ? $field_settings['suffix'] : '',
461
    '#prefix' => '<div class="field-prefix">',
462
    '#suffix' => '</div>',
463
  );
464

  
407 465
  // Another label needs some other stuff.
408 466
  unset($form['ft']['lb']['#description']);
409 467
  $form['ft']['lb']['#type'] = 'textfield';
410 468
  $form['ft']['lb']['#size'] = '10';
411 469
  $form['ft']['lb']['#attributes'] = array('class' => array('label-change'));
412 470
  $form['ft']['lb']['#default_value'] = isset($field_settings['lb']) ? $field_settings['lb'] : '';
471

  
472
  // Let other modules make modifications to the settings form as needed.
473
  drupal_alter('ds_field_theme_functions_settings_form_alter', $form, $field_settings);
413 474
}
414 475

  
415 476
/**
......
504 565
    foreach ($remove as $key => $value) {
505 566
      if ($key === $value) {
506 567
        $variable_set = TRUE;
507
        db_delete('block')
508
          ->condition('delta', $key)
509
          ->condition('module', 'ds_extras')
510
          ->execute();
568
        if (module_exists('block')) {
569
          db_delete('block')
570
            ->condition('delta', $key)
571
            ->condition('module', 'ds_extras')
572
            ->execute();
573
        }
511 574
        unset($region_blocks[$key]);
512 575
      }
513 576
    }
drupal7/sites/all/modules/ds/modules/ds_extras/includes/ds_extras.registry.inc
83 83
  }
84 84

  
85 85
  // Remove ds_preprocess_field in case field templates is not enabled.
86
  if (!variable_get('ds_extras_field_template', FALSE)) {
86
  if (!variable_get('ds_extras_field_template', FALSE) && isset($theme_registry['field']['preprocess functions'])) {
87 87
    $key = array_search('ds_extras_preprocess_field', $theme_registry['field']['preprocess functions']);
88 88
    if (!empty($key)) {
89 89
      unset($theme_registry['field']['preprocess functions'][$key]);
drupal7/sites/all/modules/ds/modules/ds_extras/js/ds_extras.admin.js
77 77
        // Remove margin from update button.
78 78
        $('.ft-update', field).css({'margin-top': '-10px'});
79 79
        // Show wrappers.
80
        $('.ow, .fis, .fi', field).show();
80
        $('.lbw, .ow, .fis, .fi', field).show();
81
        // Show prefix and suffix
82
        $('.field-prefix', field).show();
83
        $('.field-suffix', field).show();
81 84
      }
82 85
      else {
83 86
        // Hide second, third, fourth, fifth and sixth  label.
......
85 88
        // Add margin on update button.
86 89
        $('.ft-update', field).css({'margin-top': '10px'});
87 90
        // Hide wrappers.
88
        $('.ow, .fis, .fi', field).hide();
91
        $('.lbw, .ow, .fis, .fi', field).hide();
92
        // Hide prefix and suffix
93
        $('.field-prefix', field).hide();
94
        $('.field-suffix', field).hide();
89 95
      }
90 96

  
91 97
      // Colon.
drupal7/sites/all/modules/ds/modules/ds_format/ds_format.info
5 5
dependencies[] = ds
6 6
configure = admin/structure/ds/list/extras
7 7

  
8
; Information added by drupal.org packaging script on 2013-09-04
9
version = "7.x-2.6"
8
; Information added by Drupal.org packaging script on 2014-10-28
9
version = "7.x-2.7"
10 10
core = "7.x"
11 11
project = "ds"
12
datestamp = "1378305390"
12
datestamp = "1414483431"
13 13

  
drupal7/sites/all/modules/ds/modules/ds_forms/ds_forms.info
4 4
package = "Display Suite"
5 5
dependencies[] = ds
6 6

  
7
; Information added by drupal.org packaging script on 2013-09-04
8
version = "7.x-2.6"
7
; Information added by Drupal.org packaging script on 2014-10-28
8
version = "7.x-2.7"
9 9
core = "7.x"
10 10
project = "ds"
11
datestamp = "1378305390"
11
datestamp = "1414483431"
12 12

  
drupal7/sites/all/modules/ds/modules/ds_forms/ds_forms.module
88 88
  }
89 89
}
90 90

  
91
/**
92
 * Implements hook_field_widget_WIDGET_TYPE_form_alter().
93
 */
94
function ds_forms_field_widget_field_collection_embed_form_alter(&$element, &$form_state, $context){
95
  if ($ds_form = ds_build_load($element, 'field_collection_embed')) {
96
    if ($layout = ds_get_layout($ds_form->entity_type, $ds_form->bundle, 'form', FALSE)) {
97
      // Add the theming function and add the layout as a class.
98
      $element['#theme'] = array('ds_forms_custom_form');
99
      $element['#form_id'] = 'field_collection_embed';
100
      $class = strtr($layout['layout'], '_', '-');
101
      if ((isset($element['#attributes']['class']) && is_array($element['#attributes']['class'])) || !(isset($element['#attributes']['class']))) {
102
        $element['#attributes']['class'][] = $class;
103
      }
104
      elseif (isset($element['#attributes']['class']) && is_string($element['#attributes']['class'])) {
105
        $element['#attributes']['class'] .= ' ' . $class . ' ';
106
      }
107
    }
108
  }
109
}
91 110
/**
92 111
 * Helper function to determine if this form can be loaded.
93 112
 */
......
162 181
      $vars['layout_attributes'] = '';
163 182
    }
164 183

  
184
    if (isset($layout['settings']['classes']['layout_class'])) {
185
      foreach ($layout['settings']['classes']['layout_class'] as $layout_class) {
186
        $vars['classes_array'][] = $layout_class;
187
      }
188
    }
189

  
165 190
    // Ensure there is a class
166
    $vars['classes'] = 'ds-form';
191
    $vars['classes_array'][] = 'ds-form';
192

  
193
    // Merge the classes into a string
194
    $vars['classes'] = implode(' ', $vars['classes_array']);
167 195

  
168 196
    // Add a layout wrapper
169 197
    $vars['layout_wrapper'] = isset($layout['settings']['layout_wrapper']) ? $layout['settings']['layout_wrapper'] : 'div';
drupal7/sites/all/modules/ds/modules/ds_search/ds_search.info
5 5
dependencies[] = ds
6 6
configure = admin/structure/ds/list/search
7 7

  
8
; Information added by drupal.org packaging script on 2013-09-04
9
version = "7.x-2.6"
8
; Information added by Drupal.org packaging script on 2014-10-28
9
version = "7.x-2.7"
10 10
core = "7.x"
11 11
project = "ds"
12
datestamp = "1378305390"
12
datestamp = "1414483431"
13 13

  
drupal7/sites/all/modules/ds/modules/ds_search/ds_search.module
496 496
      // Render the node.
497 497
      $rendered = drupal_render($build);
498 498
      // Attach extra information to the rendered output.
499
      $rendered .= ' ' . $node->search_extra;
499
      $rendered .= ' ' . implode('', $node->search_extra);
500 500
      // Generate the snippet based on rendered content.
501 501
      $node->snippet = search_excerpt($keys, $rendered);
502 502
    }
......
704 704

  
705 705
      $load = entity_load($result['fields']['entity_type'], array($result['fields']['entity_id']));
706 706
      $entity = reset($load);
707
      if (!$entity) {
708
        watchdog('ds_search', "Empty entity loaded from results, possibly corrupt solr index? (@entity_type, @id)", array('@entity_type' => $result['fields']['entity_type'], '@id' => $result['fields']['entity_id']), WATCHDOG_DEBUG);
709
        continue;
710
      }
707 711

  
708 712
      // Add the snippet, url and extra info on the object.
709 713
      $entity->search_snippet = $result['snippet'];
drupal7/sites/all/modules/ds/modules/ds_search/includes/ds_search.admin.inc
126 126

  
127 127
  $node_types = node_type_get_names();
128 128
  $ds_search_group_by_type_settings = variable_get('ds_search_group_by_type_settings');
129
  $wrapper_options = array(
130
    'fieldset' => t('Fieldset'),
131
    'markup' => t('Div with H3 headline'),
132
  );
129 133
  foreach ($node_types as $name => $label) {
130 134

  
131 135
    $form['ds_search_group_by_type_settings'][$name]['name'] = array(
......
150 154
      '#parents' => array('ds_search_group_by_type_settings', $name, 'label'),
151 155
    );
152 156

  
153
    $wrapper_options = array(
154
      'fieldset' => t('Fieldset'),
155
      'markup' => t('Div with H3 headline'),
156
    );
157 157
    $form['ds_search_group_by_type_settings'][$name]['wrapper'] = array(
158 158
      '#type' => 'select',
159 159
      '#options' => $wrapper_options,
drupal7/sites/all/modules/ds/modules/ds_ui/ds_ui.info
4 4
package = "Display Suite"
5 5
dependencies[] = ds
6 6

  
7
; Information added by drupal.org packaging script on 2013-09-04
8
version = "7.x-2.6"
7
; Information added by Drupal.org packaging script on 2014-10-28
8
version = "7.x-2.7"
9 9
core = "7.x"
10 10
project = "ds"
11
datestamp = "1378305390"
11
datestamp = "1414483431"
12 12

  
drupal7/sites/all/modules/ds/modules/ds_ui/ds_ui.module
145 145
    'access arguments' => array('admin_fields'),
146 146
    'type' => MENU_VISIBLE_IN_BREADCRUMB,
147 147
  );
148
  // Block can be disabled.
149
  if (module_exists('block')) {
150
    $items['admin/structure/ds/fields/manage_block'] = array(
151
      'title' => 'Add a block field',
152
      'description' => 'Manage a block field',
153
      'page callback' => 'drupal_get_form',
154
      'page arguments' => array('ds_edit_block_field_form'),
155
      'file' => 'includes/ds.fields.inc',
156
      'access arguments' => array('admin_fields'),
157
      'type' => MENU_LOCAL_ACTION,
158
      'weight' => 2,
159
    );
160
  }
148
  $items['admin/structure/ds/fields/manage_block'] = array(
149
    'title' => 'Add a block field',
150
    'description' => 'Manage a block field',
151
    'page callback' => 'drupal_get_form',
152
    'page arguments' => array('ds_edit_block_field_form'),
153
    'file' => 'includes/ds.fields.inc',
154
    'access arguments' => array('admin_fields'),
155
    'type' => MENU_LOCAL_ACTION,
156
    'weight' => 2,
157
  );
161 158

  
162 159
  // CTools Modal add field.
163 160
  $items['admin/structure/ds/%ctools_js/add_field/%'] = array(
drupal7/sites/all/modules/ds/modules/ds_ui/includes/ds.classes.inc
18 18
    '#description' => t('Configure CSS classes which you can add to regions on the "manage display" screens. Add multiple CSS classes line by line.<br />If you want to have a friendly name, separate class and friendly name by |, but this is not required. eg:<br /><em>class_name_1<br />class_name_2|Friendly name<br />class_name_3</em>')
19 19
  );
20 20

  
21
  if (module_exists('token')) {
22
    $tokens_mapping = token_get_entity_mapping();
23
    $tokens_list = array();
24
    foreach($tokens_mapping as $token_map => $entity_map) {
25
      $tokens_list[] = $token_map;
26
    }
27
    $form['token'] = array(
28
      '#type' => 'container',
29
      '#theme' => 'token_tree',
30
      '#token_types' => $tokens_list,
31
      '#dialog' => TRUE,
32
    );
33
  }
34

  
21 35
  $form['ds_classes_fields'] = array(
22 36
    '#type' => 'textarea',
23 37
    '#title' => t('CSS classes for fields'),
drupal7/sites/all/modules/ds/tests/ds.entities.test
114 114
    $this->assertRaw('group-footer', 'Template found (region footer)');
115 115
    $this->assertRaw('group-left', 'Template found (region left)');
116 116
    $this->assertRaw('group-right', 'Template found (region right)');
117
    $this->assertPattern('/<div[^>]*>Submitted[^<]*<a[^>]+href="\/user\/' . $node_author->uid . '"[^>]*>' . check_plain($node_author->name) . '<\/a>.<\/div>/', t('Submitted by line found'));
117
    $this->assertPattern('/<div[^>]*>Submitted[^<]*<a[^>]+href="' . preg_quote(base_path(), '/') . 'user\/' . $node_author->uid . '"[^>]*>' . check_plain($node_author->name) . '<\/a>.<\/div>/', t('Submitted by line found'));
118 118

  
119 119
    // Configure teaser layout.
120 120
    $teaser = array(
drupal7/sites/all/modules/ds/tests/ds_exportables_test/ds_exportables_test.info
4 4
core = 7.x
5 5
hidden = TRUE
6 6

  
7
; Information added by drupal.org packaging script on 2013-09-04
8
version = "7.x-2.6"
7
; Information added by Drupal.org packaging script on 2014-10-28
8
version = "7.x-2.7"
9 9
core = "7.x"
10 10
project = "ds"
11
datestamp = "1378305390"
11
datestamp = "1414483431"
12 12

  
drupal7/sites/all/modules/ds/tests/ds_test.info
5 5
dependencies[] = ds_extras
6 6
hidden = TRUE
7 7

  
8
; Information added by drupal.org packaging script on 2013-09-04
9
version = "7.x-2.6"
8
; Information added by Drupal.org packaging script on 2014-10-28
9
version = "7.x-2.7"
10 10
core = "7.x"
11 11
project = "ds"
12
datestamp = "1378305390"
12
datestamp = "1414483431"
13 13

  
drupal7/sites/all/modules/ds/views/views_plugin_ds_entity_view.inc
10 10
 */
11 11
class views_plugin_ds_entity_view extends views_plugin_row {
12 12

  
13
  protected $group_count;
14

  
13 15
  function init(&$view, &$display, $options = NULL) {
14 16
    parent::init($view, $display, $options);
15 17
    $this->base_table = $view->base_table;
......
18 20
      $this->base_table = 'node';
19 21
    }
20 22
    $this->base_field = $this->ds_views_3_support();
23

  
24
    $this->group_count = 0;
21 25
  }
22 26

  
23 27
  // Return base_field based on base_table. It might not be
......
59 63
    $options['grouping_fieldset'] = array(
60 64
      'contains' => array(
61 65
        'grouping' => array('default' => FALSE, 'bool' => TRUE),
66
        'group_odd_even' => array('default' => FALSE, 'bool' => TRUE),
62 67
        'group_field' => array('default' => ''),
63 68
        'group_field_function' => array('default' => ''),
64 69
      ),
......
241 246
      $form['grouping_fieldset']['grouping']['#description'] = t('Grouping is disabled because you do not have any sort fields.');
242 247
    }
243 248

  
249
    $form['grouping_fieldset']['group_odd_even'] = array(
250
      '#type' => 'checkbox',
251
      '#title' => t('Add odd/even group classes to the individual group elements'),
252
      '#default_value' => FALSE,
253
    );
254

  
244 255
    // Advanced function.
245 256
    $delta_fields = array();
246 257
    $field_api_fields = field_info_instances($this->entity_type);
......
362 373
   * Render each $row.
363 374
   */
364 375
  function render($row) {
365

  
366 376
    // Set a variable to indicate if comments need to be loaded or not.
367 377
    $load_comments = isset($this->options['load_comments']) ? $this->options['load_comments'] : FALSE;
368 378

  
......
440 450
      if (!isset($grouping[$view_name][$group_value])) {
441 451
        $group_value_content = '<h2 class="grouping-title">' . $group_value . '</h2>';
442 452
        $grouping[$view_name][$group_value] = $group_value;
453
        $this->group_count++;
443 454
      }
444 455
    }
445 456

  
......
448 459
      if (!empty($group_value_content)) {
449 460
        $content = $group_value_content . $content;
450 461
      }
451
      $content = '<div class="grouping-content">' . $content . '</div>';
462
      $classes = array('grouping-content');
463
      if ($this->options['grouping_fieldset']['group_odd_even']) {
464
        if ($this->group_count % 2 == 0) {
465
          $classes[] = 'even';
466
        }
467
        else {
468
          $classes[] = 'odd';
469
        }
470
      }
471

  
472
      $content = '<div class="' . implode(' ', $classes) . '">' . $content . '</div>';
452 473
    }
453 474

  
454 475
    // Return the content.

Formats disponibles : Unified diff