Révision 955823d8
Ajouté par Assos Assos il y a presque 9 ans
drupal7/sites/all/modules/flexslider/README.md | ||
---|---|---|
42 | 42 |
Tasks |
43 | 43 |
----- |
44 | 44 |
|
45 |
1. Download the FlexSlider library from https://github.com/woothemes/FlexSlider |
|
45 |
1. Download the FlexSlider library from https://github.com/woothemes/FlexSlider/tree/version/2.2
|
|
46 | 46 |
2. Unzip the file and rename the folder to "flexslider" (pay attention to the case of the letters) |
47 | 47 |
3. Put the folder in a libraries directory |
48 | 48 |
- Ex: sites/all/libraries |
drupal7/sites/all/modules/flexslider/flexslider.admin.inc | ||
---|---|---|
404 | 404 |
'#default_value' => $optionset->name, |
405 | 405 |
); |
406 | 406 |
|
407 |
// Show select boxes for the various image styles (thumbnail, normal, big) |
|
408 |
$image_style = image_style_options(FALSE); |
|
409 |
$form['image_style'] = array( |
|
410 |
'#type' => 'fieldset', |
|
411 |
'#title' => 'Image style', |
|
412 |
'#tree' => TRUE, |
|
413 |
); |
|
414 |
$form['image_style']['normal'] = array( |
|
415 |
'#type' => 'select', |
|
416 |
'#title' => t('Normal image style'), |
|
417 |
'#description' => t('Image style for the main stage images.'), |
|
418 |
'#empty_option' => t('None (original image)'), |
|
419 |
'#options' => $image_style, |
|
420 |
'#default_value' => $optionset->imagestyle_normal, |
|
421 |
); |
|
422 |
$form['image_style']['thumbnail'] = array( |
|
423 |
'#type' => 'select', |
|
424 |
'#title' => t('Thumbnail image style'), |
|
425 |
'#description' => t('Image style for the thumbnail images.'), |
|
426 |
'#empty_option' => t('None (original image)'), |
|
427 |
'#options' => $image_style, |
|
428 |
'#default_value' => $optionset->imagestyle_thumbnail, |
|
429 |
// @todo enable/disable this option based on the type of options selected |
|
430 |
// Ex: Thumbnails should be enabled |
|
431 |
); |
|
432 |
|
|
433 | 407 |
// Options Vertical Tab Group table |
434 | 408 |
$form['options'] = array( |
435 | 409 |
'#type' => 'vertical_tabs', |
... | ... | |
547 | 521 |
*/ |
548 | 522 |
function _flexslider_validate_minimum_version_22($element, &$form_state) { |
549 | 523 |
$lib = libraries_detect('flexslider'); |
550 |
$version = $lib['version']; |
|
551 |
$required = "2.2"; |
|
552 |
|
|
553 |
if (!version_compare($version, $required, '>=')) { |
|
554 |
form_error($element, t('To use %name you must install FlexSlider version !required or higher.', array( |
|
555 |
'%name' => $element['#title'], |
|
556 |
'!required' => l($required, 'https://github.com/woothemes/FlexSlider/tree/version/2.2'), |
|
557 |
))); |
|
524 |
if (!isset($lib['version'])) { |
|
525 |
drupal_set_message(t('Unable to detect FlexSlider library version. Some options may not function properly. Please review the README.md file for installation instructions.'), 'warning'); |
|
526 |
} |
|
527 |
else { |
|
528 |
$version = $lib['version']; |
|
529 |
$required = "2.2"; |
|
530 |
|
|
531 |
if (!version_compare($version, $required, '>=')) { |
|
532 |
form_error($element, t('To use %name you must install FlexSlider version !required or higher.', array( |
|
533 |
'%name' => $element['#title'], |
|
534 |
'!required' => l($required, 'https://github.com/woothemes/FlexSlider/tree/version/2.2'), |
|
535 |
))); |
|
536 |
} |
|
558 | 537 |
} |
559 | 538 |
} |
drupal7/sites/all/modules/flexslider/flexslider.flexslider_default_preset.inc | ||
---|---|---|
16 | 16 |
$preset->api_version = 1; |
17 | 17 |
$preset->name = 'default'; |
18 | 18 |
$preset->title = 'Default'; |
19 |
$preset->imagestyle_normal = 'flexslider_full'; |
|
20 |
$preset->imagestyle_thumbnail = 'flexslider_thumbnail'; |
|
21 | 19 |
$presets['default'] = $preset; |
22 | 20 |
|
23 | 21 |
return $presets; |
drupal7/sites/all/modules/flexslider/flexslider.info | ||
---|---|---|
15 | 15 |
; Configuration link |
16 | 16 |
configure = admin/config/media/flexslider |
17 | 17 |
|
18 |
; Information added by drupal.org packaging script on 2013-09-08
|
|
19 |
version = "7.x-2.0-alpha3"
|
|
18 |
; Information added by Drupal.org packaging script on 2015-07-30
|
|
19 |
version = "7.x-2.0-rc1"
|
|
20 | 20 |
core = "7.x" |
21 | 21 |
project = "flexslider" |
22 |
datestamp = "1378663043"
|
|
22 |
datestamp = "1438285141"
|
|
23 | 23 |
|
drupal7/sites/all/modules/flexslider/flexslider.install | ||
---|---|---|
43 | 43 |
'not null' => TRUE, |
44 | 44 |
'default' => 'classic', |
45 | 45 |
), |
46 |
'imagestyle_normal' => array( |
|
47 |
'description' => 'The image style for normal images.', |
|
48 |
'type' => 'varchar', |
|
49 |
'length' => 255, |
|
50 |
'not null' => TRUE, |
|
51 |
'default' => 'flexslider_full', |
|
52 |
), |
|
53 |
'imagestyle_thumbnail' => array( |
|
54 |
'description' => 'The image style for thumbnail images.', |
|
55 |
'type' => 'varchar', |
|
56 |
'length' => 255, |
|
57 |
'not null' => TRUE, |
|
58 |
'default' => 'flexslider_thumbnail', |
|
59 |
), |
|
60 | 46 |
'options' => array( |
61 | 47 |
'description' => 'The options array.', |
62 | 48 |
'type' => 'blob', |
... | ... | |
189 | 175 |
db_add_field('flexslider_optionset', 'imagestyle_thumbnail', $field_new, array()); |
190 | 176 |
} |
191 | 177 |
|
178 |
/** |
|
179 |
* Implements hook_update_N(). |
|
180 |
* |
|
181 |
* Remove the image style settings from the optionset |
|
182 |
*/ |
|
183 |
function flexslider_update_7202(&$sandbox) { |
|
184 |
db_drop_field('flexslider_optionset', 'imagestyle_normal'); |
|
185 |
db_drop_field('flexslider_optionset', 'imagestyle_thumbnail'); |
|
186 |
} |
|
187 |
|
|
192 | 188 |
/** |
193 | 189 |
* Check if the library is available |
194 | 190 |
* |
drupal7/sites/all/modules/flexslider/flexslider.module | ||
---|---|---|
388 | 388 |
|
389 | 389 |
// If the ID or optionset aren't set, it is assumed the settings will be set |
390 | 390 |
// manually via the calling module/theme |
391 |
if (!empty($id) && !empty($optionset)) { |
|
391 |
if (!empty($optionset) && !in_array($optionset->name, $cache)) { |
|
392 |
$cache[] = $optionset->name; |
|
393 |
$js_setting['optionsets'] = array( |
|
394 |
$optionset->name => $optionset->options, |
|
395 |
); |
|
396 |
drupal_add_js(array('flexslider' => $js_setting), 'setting'); |
|
397 |
} |
|
398 |
|
|
399 |
if (!empty($id)) { |
|
392 | 400 |
// JavaScript settings |
393 | 401 |
$js_settings = array( |
394 |
'optionsets' => array( |
|
395 |
$optionset->name => $optionset->options, |
|
396 |
), |
|
397 | 402 |
'instances' => array( |
398 | 403 |
$id => $optionset->name, |
399 | 404 |
), |
drupal7/sites/all/modules/flexslider/flexslider_example/flexslider_example.flexslider_default_preset.inc | ||
---|---|---|
16 | 16 |
$preset->name = 'flexslider_carousel_with_min_and_max_ranges'; |
17 | 17 |
$preset->title = 'FlexSlider carousel with min and max ranges'; |
18 | 18 |
$preset->theme = 'classic'; |
19 |
$preset->imagestyle_normal = 'flexslider_full'; |
|
20 |
$preset->imagestyle_thumbnail = 'flexslider_thumbnail'; |
|
21 | 19 |
$preset->options = array( |
22 | 20 |
'namespace' => 'flex-', |
23 | 21 |
'selector' => '.slides > li', |
... | ... | |
66 | 64 |
$preset->name = 'flexslider_default_basic_carousel'; |
67 | 65 |
$preset->title = 'Basic Carousel'; |
68 | 66 |
$preset->theme = 'classic'; |
69 |
$preset->imagestyle_normal = 'flexslider_full'; |
|
70 |
$preset->imagestyle_thumbnail = 'flexslider_thumbnail'; |
|
71 | 67 |
$preset->options = array( |
72 | 68 |
'namespace' => 'flex-', |
73 | 69 |
'selector' => '.slides > li', |
... | ... | |
116 | 112 |
$preset->name = 'flexslider_default_slider_thumbnail_controlnav'; |
117 | 113 |
$preset->title = 'slider w/thumbnail controlnav pattern'; |
118 | 114 |
$preset->theme = 'classic'; |
119 |
$preset->imagestyle_normal = 'flexslider_full'; |
|
120 |
$preset->imagestyle_thumbnail = 'flexslider_thumbnail'; |
|
121 | 115 |
$preset->options = array( |
122 | 116 |
'namespace' => 'flex-', |
123 | 117 |
'selector' => '.slides > li', |
... | ... | |
166 | 160 |
$preset->name = 'flexslider_default_slider_w_thumbnail_slider'; |
167 | 161 |
$preset->title = 'Slider w/thumbnail slider'; |
168 | 162 |
$preset->theme = 'classic'; |
169 |
$preset->imagestyle_normal = 'flexslider_full'; |
|
170 |
$preset->imagestyle_thumbnail = 'flexslider_thumbnail'; |
|
171 | 163 |
$preset->options = array( |
172 | 164 |
'namespace' => 'flex-', |
173 | 165 |
'selector' => '.slides > li', |
... | ... | |
216 | 208 |
$preset->name = 'flexslider_default_thumbnail_captions'; |
217 | 209 |
$preset->title = 'FlexSlider Default Thumbnail Captions'; |
218 | 210 |
$preset->theme = 'classic'; |
219 |
$preset->imagestyle_normal = 'flexslider_full'; |
|
220 |
$preset->imagestyle_thumbnail = 'flexslider_thumbnail'; |
|
221 | 211 |
$preset->options = array( |
222 | 212 |
'namespace' => 'flex-', |
223 | 213 |
'selector' => '.slides > li', |
... | ... | |
267 | 257 |
$preset->name = 'flexslider_default_thumbnail_slider'; |
268 | 258 |
$preset->title = 'Thumbnail Slider'; |
269 | 259 |
$preset->theme = 'classic'; |
270 |
$preset->imagestyle_normal = 'flexslider_full'; |
|
271 |
$preset->imagestyle_thumbnail = 'flexslider_thumbnail'; |
|
272 | 260 |
$preset->options = array( |
273 | 261 |
'namespace' => 'flex-', |
274 | 262 |
'selector' => '.slides > li', |
drupal7/sites/all/modules/flexslider/flexslider_example/flexslider_example.info | ||
---|---|---|
31 | 31 |
features[variable][] = field_bundle_settings_node__flexslider_example |
32 | 32 |
features[views_view][] = flexslider_views_example |
33 | 33 |
|
34 |
; Information added by drupal.org packaging script on 2013-09-08
|
|
35 |
version = "7.x-2.0-alpha3"
|
|
34 |
; Information added by Drupal.org packaging script on 2015-07-30
|
|
35 |
version = "7.x-2.0-rc1"
|
|
36 | 36 |
core = "7.x" |
37 | 37 |
project = "flexslider" |
38 |
datestamp = "1378663043"
|
|
38 |
datestamp = "1438285141"
|
|
39 | 39 |
|
drupal7/sites/all/modules/flexslider/flexslider_example/flexslider_example.install | ||
---|---|---|
7 | 7 |
* @author Mathew Winstone <mwinstone@coldfrontlabs.ca> |
8 | 8 |
*/ |
9 | 9 |
|
10 |
/** |
|
11 |
* Implements hook_uninstall(). |
|
12 |
*/ |
|
13 |
function flexslider_example_uninstall() { |
|
14 |
// Collect all the example nodes and delete them since core/features won't do |
|
15 |
// this for us |
|
16 |
// @see [#1840288] |
|
17 |
|
|
18 |
$query = new EntityFieldQuery(); |
|
19 |
$query->entityCondition('entity_type', 'node') |
|
20 |
->entityCondition('bundle', 'flexslider_example'); |
|
21 |
|
|
22 |
$results = $query->execute(); |
|
23 |
|
|
24 |
// Ensure we have some nodes |
|
25 |
if (!empty($results['node'])) { |
|
26 |
$nids = array_keys($results['node']); |
|
27 |
node_delete_multiple($nids); |
|
28 |
} |
|
29 |
} |
|
30 |
|
|
31 |
|
|
32 |
|
|
10 | 33 |
/** |
11 | 34 |
* Implements hook_update_N(). |
12 | 35 |
* |
drupal7/sites/all/modules/flexslider/flexslider_fields/flexslider_fields.info | ||
---|---|---|
4 | 4 |
package = FlexSlider |
5 | 5 |
|
6 | 6 |
dependencies[] = flexslider |
7 |
; Information added by drupal.org packaging script on 2013-09-08
|
|
8 |
version = "7.x-2.0-alpha3"
|
|
7 |
; Information added by Drupal.org packaging script on 2015-07-30
|
|
8 |
version = "7.x-2.0-rc1"
|
|
9 | 9 |
core = "7.x" |
10 | 10 |
project = "flexslider" |
11 |
datestamp = "1378663043"
|
|
11 |
datestamp = "1438285141"
|
|
12 | 12 |
|
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 |
drupal7/sites/all/modules/flexslider/flexslider_views/flexslider_views.info | ||
---|---|---|
9 | 9 |
files[] = flexslider_views.module |
10 | 10 |
files[] = flexslider_views.views.inc |
11 | 11 |
files[] = flexslider_views_plugin_style_flexslider.inc |
12 |
; Information added by drupal.org packaging script on 2013-09-08
|
|
13 |
version = "7.x-2.0-alpha3"
|
|
12 |
; Information added by Drupal.org packaging script on 2015-07-30
|
|
13 |
version = "7.x-2.0-rc1"
|
|
14 | 14 |
core = "7.x" |
15 | 15 |
project = "flexslider" |
16 |
datestamp = "1378663043"
|
|
16 |
datestamp = "1438285141"
|
|
17 | 17 |
|
drupal7/sites/all/modules/flexslider/plugins/export_ui/flexslider_ctools_export_ui.inc | ||
---|---|---|
66 | 66 |
// reference $form_state['item'] which is what CTools is looking for. |
67 | 67 |
$optionset = &$form_state['optionset']; |
68 | 68 |
$optionset->title = $form_state['values']['title']; |
69 |
$optionset->imagestyle_normal = $form_state['values']['image_style']['normal']; |
|
70 |
$optionset->imagestyle_thumbnail = $form_state['values']['image_style']['thumbnail']; |
|
71 | 69 |
|
72 | 70 |
// Assign the values to the option set |
73 | 71 |
$optionset->options = _flexslider_optionset_defaults(); |
Formats disponibles : Unified diff
Weekly update of contrib modules