| 1 |
<?php
|
| 2 |
// $Id: views_rotator.module,v 1.3 2008/08/24 00:06:44 mfer Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* Implementation of views_plugin_style().
|
| 6 |
*/
|
| 7 |
class views_rotator_style_plugin extends views_plugin_style {
|
| 8 |
|
| 9 |
/**
|
| 10 |
* Set default options
|
| 11 |
*/
|
| 12 |
function options(&$options) {
|
| 13 |
$options['timeout'] = 5;
|
| 14 |
$options['speed'] = 1;
|
| 15 |
$options['pause'] = 0;
|
| 16 |
$options['back_next_buttons'] = 0;
|
| 17 |
$options['height'] = '';
|
| 18 |
}
|
| 19 |
|
| 20 |
function options_form(&$form, &$form_state) {
|
| 21 |
$form['timeout'] = array(
|
| 22 |
'#type' => 'textfield',
|
| 23 |
'#title' => t('Time between displaying items'),
|
| 24 |
'#size' => 10,
|
| 25 |
'#maxlength' => 60,
|
| 26 |
'#default_value' => $this->options['timeout'],
|
| 27 |
'#description' => t('The time in seconds.'),
|
| 28 |
);
|
| 29 |
$form['speed'] = array(
|
| 30 |
'#type' => 'textfield',
|
| 31 |
'#title' => t('Time for the transition'),
|
| 32 |
'#size' => 10,
|
| 33 |
'#maxlength' => 60,
|
| 34 |
'#default_value' => $this->options['speed'],
|
| 35 |
'#description' => t('The time in seconds.'),
|
| 36 |
);
|
| 37 |
$form['pause'] = array(
|
| 38 |
'#type' => 'checkbox',
|
| 39 |
'#title' => t('Pause rotation when the mouse is over the area.'),
|
| 40 |
'#default_value' => $this->options['pause'],
|
| 41 |
);
|
| 42 |
$form['back_next_buttons'] = array(
|
| 43 |
'#type' => 'checkbox',
|
| 44 |
'#title' => t('Display back and next buttons when the mouse is over the area.'),
|
| 45 |
'#default_value' => $this->options['back_next_buttons'],
|
| 46 |
);
|
| 47 |
$form['height'] = array(
|
| 48 |
'#type' => 'textfield',
|
| 49 |
'#title' => t('Height of container'),
|
| 50 |
'#size' => 10,
|
| 51 |
'#maxlength' => 60,
|
| 52 |
'#default_value' => $this->options['height'],
|
| 53 |
'#description' => t('If the height is left empty Views Rotator will attempt to detect the height. Enter a height as auto or a value in px or em to specify a height via CSS.'),
|
| 54 |
);
|
| 55 |
}
|
| 56 |
}
|