Projet

Général

Profil

Révision a60304ed

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

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/flexslider/flexslider.module
4 4
 * A light-weight, customizable image gallery plugin for Drupal based on jQuery
5 5
 */
6 6

  
7
define("FLEXSLIDER_VERSION", variable_get('flexslider_version', '2.0'));
7
define("FLEXSLIDER_COMPATIBLE_MAJOR_VERSION", '2');
8 8
define("FLEXSLIDER_DEBUG", variable_get('flexslider_debug', FALSE));
9 9

  
10 10
/**
......
17 17
    'download url' => 'https://github.com/woothemes/FlexSlider',
18 18
    'version arguments' => array(
19 19
      'file' => 'jquery.flexslider-min.js',
20
      // jQuery FlexSlider v2.1
21
      'pattern' => '/jQuery FlexSlider v(\d+\.+\d+)/',
20
      'pattern' => '/jQuery FlexSlider v([0-9a-zA-Z\.-]+)/',
22 21
      'lines' => 2,
23 22
    ),
24 23
    'files' => array(
......
66 65
 */
67 66
function flexslider_library() {
68 67
  $module_path = drupal_get_path('module', 'flexslider');
69
  $library_path = libraries_get_path('flexslider');
70
  
68
  $library = libraries_detect('flexslider');
69

  
71 70
  $libraries['flexslider'] = array(
72
    'title' => 'FlexSlider',
73
    'website' => 'http://flexslider.woothemes.com',
74
    'version' => FLEXSLIDER_VERSION,
71
    'title' => $library['name'],
72
    'website' => $library['vendor url'],
73
    'version' => $library['version'],
75 74
    'js' => array(
76
      $library_path . '/jquery.flexslider-min.js' => array(
75
      $library['library path'] . '/' . key($library['files']['js']) => array(
77 76
        'scope' => 'footer',
78 77
      ),
79 78
    ),
80 79
    'css' => array(
81
      $library_path . '/flexslider.css' => array(
80
      $library['library path'] . '/' . key($library['files']['css']) => array(
82 81
        'type' => 'file',
83 82
        'media' => 'screen',
84 83
      ),
85
      $module_path . '/assets/css/flexslider_img.css' => array(
84
      $module_path . key($library['integration files']['flexslider']['css']) => array(
86 85
        'type' => 'file',
87 86
        'media' => 'screen',
88 87
      ),
......
164 163
      'template' => 'theme/flexslider',
165 164
      'file' => 'theme/flexslider.theme.inc',
166 165
    ),
167
    
166

  
168 167
    // Slide container
169 168
    'flexslider_list' => array(
170 169
      'variables' => array('items' => array(), 'settings' => array()),
171 170
      'file' => 'theme/flexslider.theme.inc',
172 171
    ),
173
    
172

  
174 173
    // Slide item
175 174
    'flexslider_list_item' => array(
176 175
      'variables' => array('item' => array(), 'settings' => array(), 'caption' => ''),
......
254 253

  
255 254
  // Merge default settings with any given settings
256 255
  $optionset_defaults = _flexslider_optionset_defaults();
257
  $optionset->options = $optionset_defaults += $optionset->options;
256
  $optionset->options = $optionset->options + $optionset_defaults;
258 257

  
259 258
  return $optionset;
260 259
}
......
318 317

  
319 318
  // Merge default settings with any given settings
320 319
  $optionset_defaults = _flexslider_optionset_defaults();
321
  $optionset->options = $optionset_defaults += $optionset->options;
320
  $optionset->options = $optionset->options + $optionset_defaults;
321
  _flexslider_typecast_optionset($optionset->options);
322 322

  
323 323
  // Prepare the database values.
324 324
  $db_values = array(
325 325
    'name' => $optionset->name,
326 326
    'title' => $optionset->title,
327
    'options' => _flexslider_typecast_optionset($optionset->options),
327
    'options' => $optionset->options,
328 328
  );
329 329

  
330 330
  if ($new) {
......
339 339
    return $optionset;
340 340
  }
341 341

  
342
  // Otherwise, an error occured
342
  // Otherwise, an error occurred
343 343
  return FALSE;
344 344
}
345 345

  
......
350 350
 *  Optionset object or machine name
351 351
 */
352 352
function flexslider_optionset_delete($optionset) {
353
  if (isset($optionset->name)) {
354
    $name = $optionset->name;
355
  }
356
  else {
357
    $name = $optionset;
353
  if (!$optionset) {
354
    return;
355
  } elseif (!isset($optionset->name)) {
356
    $optionset = flexslider_optionset_load($optionset);
358 357
  }
359
  db_delete('flexslider_optionset')->condition('name', $name)->execute();
358
  ctools_include('export');
359
  ctools_export_crud_delete('flexslider_optionset', $optionset);
360
  ctools_export_load_object_reset('flexslider_optionset');
360 361
}
361 362

  
362 363
/*
......
395 396
    );
396 397
    drupal_add_js(array('flexslider' => $js_setting), 'setting');
397 398
  }
398
  
399

  
399 400
  if (!empty($id)) {
400 401
    // JavaScript settings
401 402
    $js_settings = array(
......
598 599
    "easeOutBounce" => "easeOutBounce",
599 600
    "easeInOutBounce" => "easeInOutBounce",
600 601
  );
601
}
602
}

Formats disponibles : Unified diff