-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsimple_timeline_row_plugin.inc
83 lines (75 loc) · 2.97 KB
/
simple_timeline_row_plugin.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
/**
* @file
* Contains the simple timeline row plugin.
* Created by JetBrains PhpStorm.
* User: alan
*/
/**
* Row plugin to render each item on a simple timeline.
*
* @ingroup views_row_plugins
*/
class simple_timeline_row_plugin extends views_plugin_row {
/**
* Extends the default options inherited by this plugin.
*
* @return array
* The list of options provided by this plugin.
*/
public function option_definition() {
$options = parent::option_definition();
$options['simple_timeline_date'] = array('default' => array());
$options['simple_timeline_date_separator'] = array('default' => array());
$options['simple_timeline_text'] = array('default' => array());
$options['simple_timeline_text_separator'] = array('default' => array());
$options['simple_timeline_image'] = array('default' => array());
return $options;
}
/**
* Extends the options form inherited by this plugin.
*
* @param array $form
* The form being generated.
* @param array $form_state
* The state that the form has been posted in.
*/
public function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
$form['simple_timeline_date'] = array(
'#type' => 'checkboxes',
'#title' => t('Timeline Date fields'),
'#options' => $this->display->handler->get_field_labels(),
'#default_value' => $this->options['simple_timeline_date'],
'#description' => t('Selected fields will be displayed next to each other in the Date section.'),
);
$form['simple_timeline_date_separator'] = array(
'#title' => t('Date Separator'),
'#type' => 'textfield',
'#size' => 10,
'#default_value' => $this->options['simple_timeline_date_separator'],
'#description' => t('The separator may be placed between inline fields to keep them from squishing up next to each other. You can use HTML in this field.'),
);
$form['simple_timeline_text'] = array(
'#type' => 'checkboxes',
'#title' => t('Timeline Text fields'),
'#options' => $this->display->handler->get_field_labels(),
'#default_value' => $this->options['simple_timeline_text'],
'#description' => t('Selected fields will be displayed next to each other in the Text section'),
);
$form['simple_timeline_text_separator'] = array(
'#title' => t('Text Separator'),
'#type' => 'textfield',
'#size' => 10,
'#default_value' => $this->options['simple_timeline_text_separator'],
'#description' => t('The separator may be placed between inline fields to keep them from squishing up next to each other. You can use HTML in this field.'),
);
$form['simple_timeline_image'] = array(
'#type' => 'radios',
'#title' => t('Timeline Image field'),
'#options' => $this->display->handler->get_field_labels(),
'#default_value' => $this->options['simple_timeline_image'],
'#description' => t('The image to be displayed with each item'),
);
}
}