-
Notifications
You must be signed in to change notification settings - Fork 0
/
pl-section-listen.php
186 lines (131 loc) · 5.65 KB
/
pl-section-listen.php
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<?php
/*
Plugin Name: PageLines Section Listen
Description: Add simple listen to your page. Text, nav, button, media, etc..
Author: World Webscapes
Author URI: http://www.worldwebscapes.com
Demo: http://worldwebscapes.com/listen-a-media-player-section-for-pagelines-five/
Version: 5.0.5
PageLines: PL_Listen
Filter: component
Tags: formats, component, hero, masthead
Category: framework, sections, featured, third-party
*/
/** Required for PageLines Sections installed as plugins. */
if( ! class_exists('PL_Section') )
return;
class PL_Listen extends PL_Section {
function section_opts(){
$opts = array(
array(
'type' => 'select',
'key' => 'format',
'label' => __( 'Listen Section Format', 'pl-section-listen' ),
'opts'=> array(
'masthead' => array( 'name' => __( 'Media On Top', 'pl-section-listen' ) ),
'masthead-flip' => array( 'name' => __( 'Media On Bottom', 'pl-section-listen' ) ),
'hero' => array( 'name' => __( 'Media On Right' , 'pl-section-listen' )),
'hero-flip' => array( 'name' => __( 'Media On Left' , 'pl-section-listen' )),
'callout' => array( 'name' => __( 'Inline Player Left', 'pl-section-listen' ) ),
'callout-flip' => array( 'name' => __( 'Inline Player Right', 'pl-section-listen' ) ),
),
),
array(
'type' => 'multi',
'opts' => array(
array(
'key' => 'header',
'default' => 'Listen Title.',
'type' => 'text',
'label' => __( 'Listen Title', 'pl-section-listen' ),
'help' => __( 'Put the name of your audio / video file here.', 'pl-section-listen' )
),
array(
'key' => 'subheader',
'type' => 'html',
'label' => __( 'Audio / Video File Location', 'pl-section-listen' ),
'help' => __( 'Place any HTML5 audio file location or Flash Player Code Here. Please visit http://shoutcastwidgets.com/flash_player_generator.php to generate this code.', 'pl-section-listen' )
),
array(
'type' => 'image_upload',
'key' => 'media',
'label' => __( 'Logo Or Media Image', 'pl-section-listen' )
),
)
),
array(
'type' => 'multi',
'title' => __( 'Listen Links', 'pl-section-listen' ),
'opts' => array(
array(
'title' => __( 'Listen Link One', 'pl-section-listen' ),
'type' => 'multi',
'stylize' => 'button-config',
'opts' => pl_button_link_options('button_primary')
),
array(
'title' => __( 'Listen Link Two', 'pl-section-listen' ),
'type' => 'multi',
'stylize' => 'button-config',
'opts' => pl_button_link_options('button_secondary')
),
),
),
array(
'type' => 'multi',
'title' => __( 'Footer And Player Scripts Region', 'pl-section-listen' ),
'opts' => array(
array(
'key' => 'text',
'type' => 'richtext',
'label' => __( 'Footer Area Text', 'pl-section-listen' ),
'help' => __( 'Put any additional information about your audio / video file. This will be placed below content.', 'pl-section-listen' )
),
array(
'type' => 'html',
'key' => 'media_html',
'label' => __( 'Shoutcast And Other Scripts Area', 'pl-section-listen' ),
'help' => __( 'Use CentroCast or other hosting scripts here to display your stream information', 'pl-section-listen' )
),
)
),
);
return $opts;
}
function media_config(){
$config = array(
'key' => 'media',
'src' => $this->opt('media'),
'html' => $this->opt('media_html'),
'classes' => array('listen-media'),
'default' => false
);
return $config;
}
function section_template(){
?>
<div class="listen-wrap pl-content-area" data-bind="class: 'format-' + format()">
<div class="listen-pad">
<div class="listen-hero">
<?php echo pl_dynamic_media( $this->media_config() ); ?>
<div class="listen-head">
<div class="listen-text">
<h1 class="listen-header" data-bind="plshortcode: header"><?php echo $this->opt('header'); ?></h1>
<h3 class="listen-subheader subhead" data-bind="plshortcode: subheader"><?php echo $this->opt('subheader'); ?></h3>
</div>
<div class="listen-nav">
<div class="listen-btns" data-bind="visible: button_primary || button_secondary">
<a class="pl-btn" href="#" data-bind="visible: button_primary, plbtn: 'button_primary', plattr: {'target': ( button_primary_newwindow() == 1 ) ? '_blank' : ''}" ></a>
<a class="pl-btn" href="#" data-bind="visible: button_secondary, plbtn: 'button_secondary', plattr: {'target': ( button_secondary_newwindow() == 1 ) ? '_blank' : ''}" ></a>
</div>
</div>
</div>
</div>
<div class="listen-richtext" data-bind="plshortcode: text">
<?php echo $this->opt('text'); ?>
</div>
</div>
</div>
<?php
}
}