Projet

Général

Profil

Paste
Télécharger (22,4 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / views_slideshow / contrib / views_slideshow_cycle / views_slideshow_cycle.views_slideshow.inc @ 6eb8d15f

1
<?php
2

    
3
/**
4
 * @file
5
 * The default options available with Views Slideshow: cycle.
6
 */
7

    
8
/**
9
 * Implements hook_views_slideshow_slideshow_info().
10
 */
11
function views_slideshow_cycle_views_slideshow_slideshow_info() {
12
  $options = array(
13
    'views_slideshow_cycle' => array(
14
      'name' => t('Cycle'),
15
      'accepts' => array(
16
        'goToSlide',
17
        'nextSlide',
18
        'pause',
19
        'play',
20
        'previousSlide',
21
      ),
22
      'calls' => array(
23
        'transitionBegin',
24
        'transitionEnd',
25
        'goToSlide',
26
        'pause',
27
        'play',
28
        'nextSlide',
29
        'previousSlide',
30
      ),
31
    ),
32
  );
33
  return $options;
34
}
35

    
36
/**
37
 * Implements hook_views_slideshow_option_definition().
38
 */
39
function views_slideshow_cycle_views_slideshow_option_definition() {
40
  $options['views_slideshow_cycle'] = array(
41
    'contains' => array(
42
      // Transition
43
      'effect' => array('default' => 'fade'),
44
      'transition_advanced' => array('default' => 0),
45
      'timeout' => array('default' => 5000),
46
      'speed' => array('default' => 700), //normal
47
      'delay' => array('default' => 0),
48
      'sync' => array('default' => 1),
49
      'random' => array('default' => 0),
50

    
51
      // Action
52
      'pause' => array('default' => 1),
53
      'pause_on_click' => array('default' => 0),
54
      'action_advanced' => array('default' => 0),
55
      'start_paused' => array('default', 0),
56
      'remember_slide' => array('default' => 0),
57
      'remember_slide_days' => array('default' => 1),
58
      'pause_in_middle' => array('default' => 0),
59
      'pause_when_hidden' => array('default' => 0),
60
      'pause_when_hidden_type' => array('default' => 'full'),
61
      'amount_allowed_visible' => array('default' => ''),
62
      'nowrap' => array('default' => 0),
63
      'fixed_height' => array('default' => 1),
64
      'items_per_slide' => array('default' => 1),
65
      'wait_for_image_load' => array('default' => 1),
66
      'wait_for_image_load_timeout' => array('default' => 3000),
67

    
68
      // Internet Explorer Tweaks
69
      'cleartype' => array('default' => 'true'),
70
      'cleartypenobg' => array('default' => 'false'),
71

    
72
      // Advanced
73
      'advanced_options' => array('default' => '{}'),
74
    ),
75
  );
76
  return $options;
77
}
78

    
79
/**
80
 * Implements hook_views_slideshow_slideshow_slideshow_type_form().
81
 */
82
function views_slideshow_cycle_views_slideshow_slideshow_type_form(&$form, &$form_state, &$view) {
83
  if (!$cycle_path = _views_slideshow_cycle_library_path()) {
84
    $form['views_slideshow_cycle']['no_cycle_js'] = array(
85
      '#markup' => '<div style="color: red">' . t('You need to install the jQuery cycle plugin. Create a directory in sites/all/libraries called jquery.cycle, and then copy jquery.cycle.all.min.js or jquery.cycle.all.js into it. You can find the plugin at !url.', array('!url' => l('http://malsup.com/jquery/cycle', 'http://malsup.com/jquery/cycle', array('attributes' => array('target' => '_blank'))))) . '</div>',
86
    );
87
  }
88

    
89
  // Transition
90
  $form['views_slideshow_cycle']['transition'] = array(
91
    '#markup' => '<h2>' . t('Transition') . '</h2>',
92
  );
93

    
94
  $effects = array(
95
    'none' => 'none',
96
    'blindX' => 'blindX',
97
    'blindY' => 'blindY',
98
    'blindZ' => 'blindZ',
99
    'cover' => 'cover',
100
    'curtainX' => 'curtainX',
101
    'curtainY' => 'curtainY',
102
    'fade' => 'fade',
103
    'fadeZoom' => 'fadeZoom',
104
    'growX' => 'growX',
105
    'growY' => 'growY',
106
    'scrollUp' => 'scrollUp',
107
    'scrollDown' => 'scrollDown',
108
    'scrollLeft' => 'scrollLeft',
109
    'scrollRight' => 'scrollRight',
110
    'scrollHorz' => 'scrollHorz',
111
    'scrollVert' => 'scrollVert',
112
    'shuffle' => 'shuffle',
113
    'slideX' => 'slideX',
114
    'slideY' => 'slideY',
115
    'toss' => 'toss',
116
    'turnUp' => 'turnUp',
117
    'turnDown' => 'turnDown',
118
    'turnLeft' => 'turnLeft',
119
    'turnRight' => 'turnRight',
120
    'uncover' => 'uncover',
121
    'wipe' => 'wipe',
122
    'zoom' => 'zoom'
123
  );
124
  $form['views_slideshow_cycle']['effect'] = array(
125
    '#type' => 'select',
126
    '#title' => t('Effect'),
127
    '#options' => $effects,
128
    '#default_value' => $view->options['views_slideshow_cycle']['effect'],
129
    '#description' => t('The transition effect that will be used to change between images. Not all options below may be relevant depending on the effect. ' . l('Follow this link to see examples of each effect.', 'http://jquery.malsup.com/cycle/browser.html', array('attributes' => array('target' => '_blank')))),
130
  );
131

    
132
  // Transition advanced options
133
  $form['views_slideshow_cycle']['transition_advanced'] = array(
134
    '#type' => 'checkbox',
135
    '#title' => t('View Transition Advanced Options'),
136
    '#default_value' => $view->options['views_slideshow_cycle']['transition_advanced'],
137
  );
138

    
139
  // Need to wrap this so it indents correctly.
140
  $form['views_slideshow_cycle']['transition_advanced_wrapper'] = array(
141
    '#markup' => '<div class="vs-dependent">',
142
  );
143

    
144
  $form['views_slideshow_cycle']['timeout'] = array(
145
    '#type' => 'textfield',
146
    '#title' => t('Timer delay'),
147
    '#default_value' => $view->options['views_slideshow_cycle']['timeout'],
148
    '#description' => t('Amount of time in milliseconds between transitions. Set the value to 0 to not rotate the slideshow automatically.'),
149
    '#states' => array(
150
      'visible' => array(
151
        ':input[name="style_options[views_slideshow_cycle][transition_advanced]"]' => array('checked' => TRUE),
152
      ),
153
    ),
154
  );
155
  $form['views_slideshow_cycle']['speed'] = array(
156
    '#type' => 'textfield',
157
    '#title' => t('Speed'),
158
    '#default_value' => $view->options['views_slideshow_cycle']['speed'],
159
    '#description' => t('Time in milliseconds that each transition lasts. Numeric only!'),
160
    '#states' => array(
161
      'visible' => array(
162
        ':input[name="style_options[views_slideshow_cycle][transition_advanced]"]' => array('checked' => TRUE),
163
      ),
164
    ),
165
  );
166
  $form['views_slideshow_cycle']['delay'] = array(
167
    '#type' => 'textfield',
168
    '#title' => t('Initial slide delay offset'),
169
    '#default_value' => $view->options['views_slideshow_cycle']['delay'],
170
    '#description' => t('Amount of time in milliseconds for the first slide to transition. This number will be added to Timer delay to create the initial delay.  For example if Timer delay is 4000 and Initial delay is 2000 then the first slide will change at 6000ms (6 seconds).  If Initial delay is -2000 then the first slide will change at 2000ms (2 seconds).'),
171
    '#states' => array(
172
      'visible' => array(
173
        ':input[name="style_options[views_slideshow_cycle][transition_advanced]"]' => array('checked' => TRUE),
174
      ),
175
    ),
176
  );
177
  $form['views_slideshow_cycle']['sync'] = array(
178
    '#type' => 'checkbox',
179
    '#title' => t('Sync'),
180
    '#default_value' => $view->options['views_slideshow_cycle']['sync'],
181
    '#description' => t('The sync option controls whether the slide transitions occur simultaneously. The default is selected which means that the current slide transitions out as the next slide transitions in. By unselecting this option you can get some interesting twists on your transitions.'),
182
    '#states' => array(
183
      'visible' => array(
184
        ':input[name="style_options[views_slideshow_cycle][transition_advanced]"]' => array('checked' => TRUE),
185
      ),
186
    ),
187
  );
188
  $form['views_slideshow_cycle']['random'] = array(
189
    '#type' => 'checkbox',
190
    '#title' => t('Random'),
191
    '#description' => t('This option controls the order items are displayed. The default setting, unselected, uses the views ordering. Selected will cause the images to display in a random order.'),
192
    '#default_value' => $view->options['views_slideshow_cycle']['random'],
193
    '#states' => array(
194
      'visible' => array(
195
        ':input[name="style_options[views_slideshow_cycle][transition_advanced]"]' => array('checked' => TRUE),
196
      ),
197
    ),
198
  );
199

    
200
  $form['views_slideshow_cycle']['transition_advanced_wrapper_close'] = array(
201
    '#markup' => '</div>',
202
  );
203

    
204
  // Action
205
  $form['views_slideshow_cycle']['action'] = array(
206
    '#markup' => '<h2>' . t('Action') . '</h2>',
207
  );
208
  $form['views_slideshow_cycle']['pause'] = array(
209
    '#type' => 'checkbox',
210
    '#title' => t('Pause on hover'),
211
    '#default_value' => $view->options['views_slideshow_cycle']['pause'],
212
    '#description' => t('Pause when hovering on the slideshow image.'),
213
  );
214
  $form['views_slideshow_cycle']['pause_on_click'] = array(
215
    '#type' => 'checkbox',
216
    '#title' => t('Pause On Click'),
217
    '#default_value' => $view->options['views_slideshow_cycle']['pause_on_click'],
218
    '#description' => t('Pause when the slide is clicked.'),
219
  );
220

    
221
  // Action Advanced Options
222
  $form['views_slideshow_cycle']['action_advanced'] = array(
223
    '#type' => 'checkbox',
224
    '#title' => t('View Action Advanced Options'),
225
    '#default_value' => $view->options['views_slideshow_cycle']['action_advanced'],
226
  );
227

    
228
  // Need to wrap this so it indents correctly.
229
  $form['views_slideshow_cycle']['action_advanced_wrapper'] = array(
230
    '#markup' => '<div class="vs-dependent">',
231
  );
232

    
233
  $form['views_slideshow_cycle']['start_paused'] = array(
234
    '#type' => 'checkbox',
235
    '#title' => t('Start Slideshow Paused'),
236
    '#default_value' => $view->options['views_slideshow_cycle']['start_paused'],
237
    '#description' => t('Start the slideshow in the paused state.'),
238
    '#states' => array(
239
      'visible' => array(
240
        ':input[name="style_options[views_slideshow_cycle][action_advanced]"]' => array('checked' => TRUE),
241
      ),
242
    ),
243
  );
244
  $form['views_slideshow_cycle']['remember_slide'] = array(
245
    '#type' => 'checkbox',
246
    '#title' => t('Start On Last Slide Viewed'),
247
    '#default_value' => $view->options['views_slideshow_cycle']['remember_slide'],
248
    '#description' => t('When the user leaves a page with a slideshow and comes back start them on the last slide viewed.'),
249
    '#states' => array(
250
      'visible' => array(
251
        ':input[name="style_options[views_slideshow_cycle][action_advanced]"]' => array('checked' => TRUE),
252
      ),
253
    ),
254
  );
255
  $form['views_slideshow_cycle']['remember_slide_days'] = array(
256
    '#type' => 'textfield',
257
    '#title' => t('Length of Time to Remember Last Slide'),
258
    '#default_value' => $view->options['views_slideshow_cycle']['remember_slide_days'],
259
    '#description' => t('The number of days to have the site remember the last slide. Default is 1'),
260
    '#prefix' => '<div class="vs-dependent">',
261
    '#suffix' => '</div>',
262
    '#size' => 4,
263
    '#states' => array(
264
      'visible' => array(
265
        ':input[name="style_options[views_slideshow_cycle][action_advanced]"]' => array('checked' => TRUE),
266
        ':input[name="style_options[views_slideshow_cycle][remember_slide]"]' => array('checked' => TRUE),
267
      ),
268
    ),
269
  );
270

    
271
  if (!$pause_path = _views_slideshow_cycle_pause_library_path()) {
272
    $form['views_slideshow_cycle']['pause_in_middle'] = array(
273
      '#type' => 'checkbox',
274
      '#title' => t('Pause The Slideshow In The Middle of the Transition'),
275
      '#default_value' => $view->options['views_slideshow_cycle']['pause_in_middle'],
276
      '#description' => t('When pausing the slideshow allow it to pause in the middle of tranistioning and not finish the transition until unpaused.'),
277
      '#states' => array(
278
        'visible' => array(
279
          ':input[name="style_options[views_slideshow_cycle][transition_advanced]"]' => array('checked' => TRUE),
280
        ),
281
      ),
282
    );
283
  }
284

    
285
  $form['views_slideshow_cycle']['pause_when_hidden'] = array(
286
    '#type' => 'checkbox',
287
    '#title' => t('Pause When the Slideshow is Not Visible'),
288
    '#default_value' => $view->options['views_slideshow_cycle']['pause_when_hidden'],
289
    '#description' => t('When the slideshow is scrolled out of view or when a window is resized that hides the slideshow, this will pause the slideshow.'),
290
    '#states' => array(
291
      'visible' => array(
292
        ':input[name="style_options[views_slideshow_cycle][action_advanced]"]' => array('checked' => TRUE),
293
      ),
294
    ),
295
  );
296
  $form['views_slideshow_cycle']['pause_when_hidden_type'] = array(
297
    '#type' => 'select',
298
    '#title' => t('How to Calculate Amount of Slide that Needs to be Shown'),
299
    '#options' => array(
300
      'full' => t('Entire slide'),
301
      'vertical' => t('Set amount of vertical'),
302
      'horizontal' => t('Set amount of horizontal'),
303
      'area' => t('Set total area of the slide'),
304
    ),
305
    '#default_value' => $view->options['views_slideshow_cycle']['pause_when_hidden_type'],
306
    '#description' => t('Choose how to calculate how much of the slide has to be shown. Entire Slide: All the slide has to be shown. Vertical: Set amount of height that has to be shown. Horizontal: Set amount of width that has to be shown. Area: Set total area that has to be shown.'),
307
    '#prefix' => '<div class="vs-dependent">',
308
    '#suffix' => '</div>',
309
    '#states' => array(
310
      'visible' => array(
311
        ':input[name="style_options[views_slideshow_cycle][action_advanced]"]' => array('checked' => TRUE),
312
        ':input[name="style_options[views_slideshow_cycle][pause_when_hidden]"]' => array('checked' => TRUE),
313
      ),
314
    ),
315
  );
316
  $form['views_slideshow_cycle']['amount_allowed_visible'] = array(
317
    '#type' => 'textfield',
318
    '#title' => t('Amount of Slide Needed to be Shown'),
319
    '#default_value' => $view->options['views_slideshow_cycle']['amount_allowed_visible'],
320
    '#description' => t("The amount of the slide that needs to be shown to have it rotate. You can set the value in percentage (ex: 50%) or in pixels (ex: 250). The slidehsow will not rotate until it's height/width/total area, depending on the calculation method you have chosen above, is less than the value you have entered in this field."),
321
    '#size' => 4,
322
    '#process' => array('views_slideshow_cycle_form_options_js'),
323
  );
324
  $form['views_slideshow_cycle']['nowrap'] = array(
325
    '#type' => 'checkbox',
326
    '#title' => t('End slideshow after last slide'),
327
    '#default_value' => $view->options['views_slideshow_cycle']['nowrap'],
328
    '#description' => t('If selected the slideshow will end when it gets to the last slide.'),
329
    '#states' => array(
330
      'visible' => array(
331
        ':input[name="style_options[views_slideshow_cycle][action_advanced]"]' => array('checked' => TRUE),
332
      ),
333
    ),
334
  );
335
  $form['views_slideshow_cycle']['fixed_height'] = array(
336
    '#type' => 'checkbox',
337
    '#title' => t('Make the slide window height fit the largest slide'),
338
    '#default_value' => $view->options['views_slideshow_cycle']['fixed_height'],
339
    '#description' => t('If unselected then if the slides are different sizes the height of the slide area will change as the slides change.'),
340
    '#states' => array(
341
      'visible' => array(
342
        ':input[name="style_options[views_slideshow_cycle][action_advanced]"]' => array('checked' => TRUE),
343
      ),
344
    ),
345
  );
346
  $form['views_slideshow_cycle']['items_per_slide'] = array(
347
    '#type' => 'textfield',
348
    '#title' => t('Items per slide'),
349
    '#default_value' => $view->options['views_slideshow_cycle']['items_per_slide'],
350
    '#description' => t('The number of items per slide'),
351
    '#size' => 4,
352
    '#states' => array(
353
      'visible' => array(
354
        ':input[name="style_options[views_slideshow_cycle][action_advanced]"]' => array('checked' => TRUE),
355
      ),
356
    ),
357
  );
358
  $form['views_slideshow_cycle']['wait_for_image_load'] = array(
359
    '#type' => 'checkbox',
360
    '#title' => t('Wait for all the slide images to load'),
361
    '#default_value' => $view->options['views_slideshow_cycle']['wait_for_image_load'],
362
    '#description' => t('If selected the slideshow will not start unless all the slide images are loaded.  This will fix some issues on IE7/IE8/Chrome/Opera.'),
363
    '#states' => array(
364
      'visible' => array(
365
        ':input[name="style_options[views_slideshow_cycle][action_advanced]"]' => array('checked' => TRUE),
366
      ),
367
    ),
368
  );
369
  $form['views_slideshow_cycle']['wait_for_image_load_timeout'] = array(
370
    '#type' => 'textfield',
371
    '#title' => t('Timeout'),
372
    '#default_value' => $view->options['views_slideshow_cycle']['wait_for_image_load_timeout'],
373
    '#description' => t('How long should it wait until it starts the slideshow anyway. Time is in milliseconds.'),
374
    '#prefix' => '<div class="vs-dependent">',
375
    '#suffix' => '</div>',
376
    '#states' => array(
377
      'visible' => array(
378
        ':input[name="style_options[views_slideshow_cycle][action_advanced]"]' => array('checked' => TRUE),
379
        ':input[name="style_options[views_slideshow_cycle][wait_for_image_load]"]' => array('checked' => TRUE),
380
      ),
381
    ),
382
  );
383

    
384
  // Need to wrap this so it indents correctly.
385
  $form['views_slideshow_cycle']['action_advanced_wrapper_close'] = array(
386
    '#markup' => '</div>',
387
  );
388

    
389
  // Internet Explorer Tweaks
390
  $form['views_slideshow_cycle']['ie_tweaks'] = array(
391
    '#markup' => '<h2>' . t('Internet Explorer Tweaks') . '</h2>',
392
  );
393
  $form['views_slideshow_cycle']['cleartype'] = array(
394
    '#type' => 'checkbox',
395
    '#title' => t('ClearType'),
396
    '#default_value' => $view->options['views_slideshow_cycle']['cleartype'],
397
    '#description' => t('Select if clearType corrections should be applied (for IE).  Some background issues could be fixed by unselecting this option.'),
398
  );
399
  $form['views_slideshow_cycle']['cleartypenobg'] = array(
400
    '#type' => 'checkbox',
401
    '#title' => t('ClearType Background'),
402
    '#default_value' => $view->options['views_slideshow_cycle']['cleartypenobg'],
403
    '#description' => t('Select to disable extra cleartype fixing.  Unselect to force background color setting on slides)'),
404
  );
405

    
406

    
407

    
408

    
409
  // Advanced Options
410
  $form['views_slideshow_cycle']['advanced_options_header'] = array(
411
    '#markup' => '<h2>' . t('jQuery Cycle Custom Options') . '</h2>',
412
  );
413

    
414
  $json2_path = libraries_get_path('json2');
415
  if (empty($json2_path) || !file_exists($json2_path . '/json2.js')) {
416
    $form['views_slideshow_cycle']['no_json_js'] = array(
417
      '#markup' => '<div>' . t('To use the advanced options you need to download json2.js. You can do this by clicking the download button at !url and extract json2.js to sites/all/libraries/json2', array('!url' => l('https://github.com/douglascrockford/JSON-js', 'https://github.com/douglascrockford/JSON-js', array('attributes' => array('target' => '_blank'))))) . '</div>',
418
    );
419
  }
420
  else {
421
    $form['views_slideshow_cycle']['advanced_options_info'] = array(
422
      '#markup' => '<p>' . t('You can find a list of all the available options at !url.  If one of the options you add uses a function, example fxFn, then you need to only enter what goes inside the function call. The variables that are in the documentation on the jquery cycle site will be available to you.', array('!url' => l('http://malsup.com/jquery/cycle/options.html', 'http://malsup.com/jquery/cycle/options.html'))) . '</p>',
423
    );
424

    
425
    // All the jquery cycle options according to
426
    // http://malsup.com/jquery/cycle/options.html
427
    $cycle_options = array(
428
      0 => 'Select One',
429
      'activePagerClass' => 'activePagerClass',
430
      'after' => 'after',
431
      'allowPagerClickBubble' => 'allowPagerClickBubble',
432
      'animIn' => 'animIn',
433
      'animOut' => 'animOut',
434
      'autostop' => 'autostop',
435
      'autostopCount' => 'autostopCount',
436
      'backwards' => 'backwards',
437
      'before' => 'before',
438
      'bounce' => 'bounce',
439
      'cleartype' => 'cleartype',
440
      'cleartypeNoBg' => 'cleartypeNoBg',
441
      'containerResize' => 'containerResize',
442
      'continuous' => 'continuous',
443
      'cssAfter' => 'cssAfter',
444
      'cssBefore' => 'cssBefore',
445
      'delay' => 'delay',
446
      'easeIn' => 'easeIn',
447
      'easeOut' => 'easeOut',
448
      'easing' => 'easing',
449
      'end' => 'end',
450
      'fastOnEvent' => 'fastOnEvent',
451
      'fit' => 'fit',
452
      'fx' => 'fx',
453
      'fxFn' => 'fxFn',
454
      'height' => 'height',
455
      'manualTrump' => 'manualTrump',
456
      'metaAttr' => 'metaAttr',
457
      'next' => 'next',
458
      'nowrap' => 'nowrap',
459
      'onPagerEvent' => 'onPagerEvent',
460
      'onPrevNextEvent' => 'onPrevNextEvent',
461
      'pager' => 'pager',
462
      'pagerAnchorBuilder' => 'pagerAnchorBuilder',
463
      'pagerEvent' => 'pagerEvent',
464
      'pause' => 'pause',
465
      'paused' => 'paused',
466
      'pauseOnPagerHover' => 'pauseOnPagerHover',
467
      'prev' => 'prev',
468
      'prevNextEvent' => 'prevNextEvent',
469
      'random' => 'random',
470
      'randomizeEffects' => 'randomizeEffects',
471
      'requeueOnImageNotLoaded' => 'requeueOnImageNotLoaded',
472
      'requeueTimeout' => 'requeueTimeout',
473
      'resumed' => 'resumed',
474
      'rev' => 'rev',
475
      'shuffle' => 'shuffle',
476
      'slideExpr' => 'slideExpr',
477
      'slideResize' => 'slideResize',
478
      'speed' => 'speed',
479
      'speedIn' => 'speedIn',
480
      'speedOut' => 'speedOut',
481
      'startingSlide' => 'startingSlide',
482
      'sync' => 'sync',
483
      'timeout' => 'timeout',
484
      'timeoutFn' => 'timeoutFn',
485
      'updateActivePagerLink' => 'updateActivePagerLink',
486
      'width' => 'width',
487
    );
488

    
489
    $form['views_slideshow_cycle']['advanced_options_choices'] = array(
490
      '#type' => 'select',
491
      '#title' => t('Advanced Options'),
492
      '#options' => $cycle_options,
493
      '#process' => array('views_slideshow_cycle_form_options_js'),
494
    );
495

    
496
    $form['views_slideshow_cycle']['advanced_options_entry'] = array(
497
      '#type' => 'textarea',
498
      '#title' => t('Advanced Option Value'),
499
      '#description' => t('It is important that you click the Update link when you make any changes to the options or those changes will not be saved when you save the form.'),
500
    );
501

    
502
    $form['views_slideshow_cycle']['advanced_options'] = array(
503
      '#type' => 'textarea',
504
      '#default_value' => $view->options['views_slideshow_cycle']['advanced_options'],
505
    );
506

    
507
    $form['views_slideshow_cycle']['advanced_options_table'] = array(
508
      '#markup' => '<table style="width: 400px; margin-left: 10px;" id="edit-style-options-views-slideshow-cycle-advanced-options-table"></table>'
509
    );
510
  }
511
}
512

    
513
function views_slideshow_cycle_form_options_js($element, &$form_state, &$form) {
514
  ctools_add_js('formoptions', 'views_slideshow_cycle');
515
  return $element;
516
}
517

    
518
/**
519
 * Implements hook_views_slideshow_options_form_validate().
520
 */
521
function views_slideshow_cycle_views_slideshow_options_form_validate(&$form, &$form_state, &$view) {
522
  if (!is_numeric($form_state['values']['style_options']['views_slideshow_cycle']['speed'])) {
523
    form_error($form['views_slideshow_cycle']['speed'], t('!setting must be numeric!', array('Speed')));
524
  }
525
  if (!is_numeric($form_state['values']['style_options']['views_slideshow_cycle']['timeout'])) {
526
    form_error($form['views_slideshow_cycle']['speed'], t('!setting must be numeric!', array('timeout')));
527
  }
528
  if (!is_numeric($form_state['values']['style_options']['views_slideshow_cycle']['remember_slide_days'])) {
529
    form_error($form['views_slideshow_cycle']['remember_slide_days'], t('!setting must be numeric!', array('Slide days')));
530
  }
531
}