Projet

Général

Profil

Révision b08fce64

Ajouté par Assos Assos il y a environ 7 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/colorbox/colorbox.theme.inc
66 66
  $entity_title = entity_label($entity_type, $entity);
67 67

  
68 68
  switch ($settings['colorbox_caption']) {
69
     case 'auto':
69
    case 'auto':
70 70
      // If the title is empty use alt or the entity title in that order.
71 71
      if (!empty($image['title'])) {
72 72
        $caption = $image['title'];
......
81 81
        $caption = '';
82 82
      }
83 83
      break;
84

  
84 85
    case 'title':
85 86
      $caption = $image['title'];
86 87
      break;
88

  
87 89
    case 'alt':
88 90
      $caption = $image['alt'];
89 91
      break;
92

  
90 93
    case 'node_title':
91 94
      $caption = $entity_title;
92 95
      break;
96

  
93 97
    case 'custom':
94 98
      $caption = token_replace($settings['colorbox_caption_custom'], array($entity_type => $entity, 'file' => (object) $item), array('clear' => TRUE));
95 99
      break;
100

  
96 101
    default:
97 102
      $caption = '';
98 103
  }
......
111 116
    case 'post':
112 117
      $gallery_id = 'gallery-' . $entity_id;
113 118
      break;
119

  
114 120
    case 'page':
115 121
      $gallery_id = 'gallery-all';
116 122
      break;
123

  
117 124
    case 'field_post':
118 125
      $gallery_id = 'gallery-' . $entity_id . '-' . $field['field_name'];
119 126
      break;
127

  
120 128
    case 'field_page':
121 129
      $gallery_id = 'gallery-' . $field['field_name'];
122 130
      break;
131

  
123 132
    case 'custom':
124 133
      $gallery_id = $settings['colorbox_gallery_custom'];
125 134
      break;
135

  
126 136
    default:
127 137
      $gallery_id = '';
128 138
  }
......
183 193
      'title' => $variables['title'],
184 194
      'class' => $class,
185 195
      'data-colorbox-gallery' => $variables['gid'],
196
      'data-cbox-img-attrs' => '{"title": "' . $variables['image']['title'] . '", "alt": "' . $variables['image']['alt'] . '"}',
186 197
    ),
187 198
  );
188 199

  
......
240 251
    case 2:
241 252
      $variables['gallery_id'] = 'gallery-all';
242 253
      break;
254

  
243 255
    case 3:
244 256
      $variables['gallery_id'] = '';
245 257
      break;

Formats disponibles : Unified diff