separator.php
3.9 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<?php
/**
* @class FLSeparatorModule
*/
class FLSeparatorModule extends FLBuilderModule {
/**
* @method __construct
*/
public function __construct()
{
parent::__construct(array(
'name' => __('分割线', 'fl-builder'),
'description' => __('A divider line to separate content.', 'fl-builder'),
'category' => __('基本模块', 'fl-builder'),
'editor_export' => false,
'partial_refresh' => true
));
}
}
/**
* Register the module and its form settings.
*/
FLBuilder::register_module('FLSeparatorModule', array(
'general' => array( // Tab
'title' => __('General', 'fl-builder'), // Tab title
'sections' => array( // Tab Sections
'general' => array( // Section
'title' => '', // Section Title
'fields' => array( // Section Fields
'color' => array(
'type' => 'color',
'label' => __('Color', 'fl-builder'),
'default' => 'cccccc',
'preview' => array(
'type' => 'css',
'selector' => '.fl-separator',
'property' => 'border-top-color'
)
),
'opacity' => array(
'type' => 'text',
'label' => __('Opacity', 'fl-builder'),
'default' => '100',
'description' => '%',
'maxlength' => '3',
'size' => '5',
'preview' => array(
'type' => 'css',
'selector' => '.fl-separator',
'property' => 'opacity',
'unit' => '%'
)
),
'height' => array(
'type' => 'text',
'label' => __('Height', 'fl-builder'),
'default' => '1',
'maxlength' => '2',
'size' => '3',
'description' => 'px',
'preview' => array(
'type' => 'css',
'selector' => '.fl-separator',
'property' => 'border-top-width',
'unit' => 'px'
)
),
'width' => array(
'type' => 'select',
'label' => __('Width', 'fl-builder'),
'default' => 'full',
'options' => array(
'full' => __('Full Width', 'fl-builder'),
'custom' => __('Custom', 'fl-builder')
),
'toggle' => array(
'full' => array(),
'custom' => array(
'fields' => array('align', 'custom_width')
)
)
),
'custom_width' => array(
'type' => 'text',
'label' => __('Custom Width', 'fl-builder'),
'default' => '10',
'maxlength' => '3',
'size' => '4',
'description' => '%'
),
'align' => array(
'type' => 'select',
'label' => __('Align', 'fl-builder'),
'default' => 'center',
'options' => array(
'center' => _x( 'Center', 'Alignment.', 'fl-builder' ),
'left' => _x( 'Left', 'Alignment.', 'fl-builder' ),
'right' => _x( 'Right', 'Alignment.', 'fl-builder' ),
),
),
'style' => array(
'type' => 'select',
'label' => __('Style', 'fl-builder'),
'default' => 'solid',
'options' => array(
'solid' => _x( 'Solid', 'Border type.', 'fl-builder' ),
'dashed' => _x( 'Dashed', 'Border type.', 'fl-builder' ),
'dotted' => _x( 'Dotted', 'Border type.', 'fl-builder' ),
'double' => _x( 'Double', 'Border type.', 'fl-builder' )
),
'preview' => array(
'type' => 'css',
'selector' => '.fl-separator',
'property' => 'border-top-style'
),
'help' => __('The type of border to use. Double borders must have a height of at least 3px to render properly.', 'fl-builder'),
)
)
)
)
)
));