Révision 955823d8
Ajouté par Assos Assos il y a presque 9 ans
drupal7/sites/all/modules/flexslider/flexslider_fields/flexslider_fields.module | ||
---|---|---|
63 | 63 |
'#options' => $image_styles, |
64 | 64 |
); |
65 | 65 |
|
66 |
// If the image field doesn't have the Title field enabled, tell the user. |
|
67 |
if ($instance['settings']['title_field'] == FALSE) { |
|
68 |
$form['caption'] = array( |
|
69 |
'#title' => t('Use image title as the caption'), |
|
70 |
'#type' => 'checkbox', |
|
71 |
'#disabled' => TRUE, |
|
72 |
'#description' => t('You need to <a href="@url">enable the Title field</a> for this image field to be able use it as a caption.', array('@url' => url('admin/structure/types/manage/' . $instance['bundle'] . '/fields/' . $instance['field_name'], array('fragment' => 'edit-instance-settings-title-field', 'query' => array('destination' => 'admin/structure/types/manage/' . $instance['bundle'] . '/display'))))), |
|
73 |
); |
|
74 |
} |
|
75 |
else { |
|
76 |
$form['caption'] = array( |
|
77 |
'#title' => t('Use image title as the caption'), |
|
78 |
'#type' => 'checkbox', |
|
79 |
'#default_value' => $settings['caption'], |
|
80 |
); |
|
66 |
if (!empty($instance['settings'])) { |
|
67 |
// If the image field doesn't have the Title field enabled, tell the user. |
|
68 |
if ($instance['settings']['title_field'] == FALSE and $instance['bundle'] != 'ctools') { |
|
69 |
$form['caption'] = array( |
|
70 |
'#title' => t('Use image title as the caption'), |
|
71 |
'#type' => 'checkbox', |
|
72 |
'#disabled' => TRUE, |
|
73 |
'#description' => t('You need to <a href="@url">enable the Title field</a> for this image field to be able use it as a caption.', array('@url' => url('admin/structure/types/manage/' . $instance['bundle'] . '/fields/' . $instance['field_name'], array('fragment' => 'edit-instance-settings-title-field', 'query' => array('destination' => 'admin/structure/types/manage/' . $instance['bundle'] . '/display'))))), |
|
74 |
); |
|
75 |
} |
|
76 |
else { |
|
77 |
$form['caption'] = array( |
|
78 |
'#title' => t('Use image title as the caption'), |
|
79 |
'#type' => 'checkbox', |
|
80 |
'#default_value' => $settings['caption'], |
|
81 |
); |
|
82 |
} |
|
81 | 83 |
} |
82 | 84 |
|
83 | 85 |
return $form; |
... | ... | |
130 | 132 |
if (count($items) > 0) { |
131 | 133 |
|
132 | 134 |
foreach ($items as $key => $item) { |
135 |
if(isset($item['item'])) continue; |
|
133 | 136 |
$tmp = $item; |
134 | 137 |
$item = array(); |
135 | 138 |
$item['item'] = $tmp; |
136 | 139 |
|
137 | 140 |
// Setup the variables for calling theme_image_style |
138 |
$item['slide']['path'] = $item['item']['uri']; |
|
139 |
$item['slide']['style_name'] = $display['settings']['image_style']; |
|
140 |
$item['slide']['width'] = $item['item']['width']; |
|
141 |
$item['slide']['height'] = $item['item']['height']; |
|
142 |
$item['slide']['alt'] = $item['item']['alt']; |
|
143 |
$item['slide']['title'] = $item['item']['title']; |
|
141 |
if (isset($item['item']['uri'])) { |
|
142 |
$item['slide']['path'] = $item['item']['uri']; |
|
143 |
} |
|
144 |
if (isset($display['settings']['image_style'])) { |
|
145 |
$item['slide']['style_name'] = $display['settings']['image_style']; |
|
146 |
} |
|
147 |
if (isset($item['item']['width'])) { |
|
148 |
$item['slide']['width'] = $item['item']['width']; |
|
149 |
} |
|
150 |
if (isset($item['item']['height'])) { |
|
151 |
$item['slide']['height'] = $item['item']['height']; |
|
152 |
} |
|
153 |
if (isset($item['item']['alt'])) { |
|
154 |
$item['slide']['alt'] = $item['item']['alt']; |
|
155 |
} |
|
156 |
if (isset($item['item']['title'])) { |
|
157 |
$item['slide']['title'] = $item['item']['title']; |
|
158 |
} |
|
144 | 159 |
|
145 | 160 |
// Render the slide item |
146 | 161 |
// If not style set, we have to call theme_image since theme_image_style |
Formats disponibles : Unified diff
Weekly update of contrib modules