Crowdsignal Dashboard – Polls, Surveys & more - Version 3.0.8

Version Description

Minor bugfix release

Download this release

Release Info

Developer cgastrell
Plugin Icon 128x128 Crowdsignal Dashboard – Polls, Surveys & more
Version 3.0.8
Comparing to
See all releases

Code changes from version 3.0.7 to 3.0.8

Files changed (3) hide show
  1. partials/poll-edit-form.php +819 -0
  2. polldaddy.php +36 -755
  3. readme.txt +5 -1
partials/poll-edit-form.php ADDED
@@ -0,0 +1,819 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php // phpcs:ignore NeutronStandard.StrictTypes.RequireStrictTypes.StrictTypes -- we're not ready yet
2
+ /**
3
+ * Crowdsignal legacy plugin
4
+ *
5
+ * @package crowdsignal
6
+ */
7
+ ?>
8
+
9
+ <?php
10
+ // phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable -- vars coming from view renderer
11
+ // phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase -- legacy class, won't fix
12
+ // phpcs:disable NeutronStandard.Arrays.DisallowLongformArray.LongformArray -- TODO
13
+ // phpcs:disable WordPress.WP.I18n.MissingTranslatorsComment -- TODO
14
+
15
+ $delete_media_link = '<a href="#" class="delete-media delete hidden" title="' . esc_attr( __( 'delete this image' ) ) . '"><img src="' . $base_url . 'img/icon-clear-search.png" width="16" height="16" /></a>';
16
+ ?>
17
+ <form enctype="multipart/form-data" name="send-media" action="admin-ajax.php" method="post">
18
+ <?php wp_nonce_field( 'send-media' ); ?>
19
+ <input type="hidden" value="" name="action">
20
+ <input type="hidden" value="<?php echo $controller->user_code; ?>" name="uc">
21
+ <input type="hidden" value="" name="attach-id">
22
+ <input type="hidden" value="" name="media-id">
23
+ <input type="hidden" value="" name="url">
24
+ </form>
25
+
26
+ <form name="add-answer" action="admin-ajax.php" method="post">
27
+ <?php wp_nonce_field( 'add-answer' ); ?>
28
+ <input type="hidden" value="" name="action">
29
+ <input type="hidden" value="" name="aa">
30
+ <input type="hidden" value="" name="src">
31
+ <input type="hidden" value="<?php echo isset( $_GET['iframe'] ) ? '1' : '0'; ?>" name="popup">
32
+ </form>
33
+
34
+ <form action="" method="post">
35
+ <div id="poststuff">
36
+ <div id="post-body" class="has-sidebar has-right-sidebar">
37
+
38
+ <div class="inner-sidebar" id="side-info-column">
39
+ <div id="submitdiv" class="postbox">
40
+ <h2 class="postbox-title"><?php _e( 'Save', 'polldaddy' ); ?></h2>
41
+ <div class="inside">
42
+ <div class="minor-publishing">
43
+ <ul id="answer-options">
44
+
45
+ <?php
46
+ $poll_options = [
47
+ 'randomiseAnswers' => __( 'Randomize answer order', 'polldaddy' ),
48
+ 'otherAnswer' => __( 'Allow other answers', 'polldaddy' ),
49
+ 'multipleChoice' => __( 'Multiple choice', 'polldaddy' ),
50
+ 'sharing' => __( 'Sharing', 'polldaddy' ),
51
+ ];
52
+ foreach ( $poll_options as $option => $label ) :
53
+ if ( $is_post ) {
54
+ $checked = isset( $_POST[ $option ] ) && 'yes' === $_POST[ $option ] ? ' checked="checked"' : '';
55
+ } else {
56
+ $checked = 'yes' === $poll->$option ? ' checked="checked"' : '';
57
+ }
58
+ ?>
59
+
60
+ <li>
61
+ <label for="<?php echo $option; ?>">
62
+ <input type="checkbox"<?php echo $checked; ?> value="yes" id="<?php echo $option; ?>" name="<?php echo $option; ?>" /> <?php echo esc_html( $label ); ?>
63
+ </label>
64
+ </li>
65
+
66
+ <?php endforeach; ?>
67
+ </ul>
68
+ <?php
69
+ if ( $is_post ) {
70
+ $style = isset( $_POST['multipleChoice'] ) && 'yes' === $_POST['multipleChoice'] ? 'display:block;' : 'display:none;';
71
+ } else {
72
+ $style = 'yes' === $poll->multipleChoice ? 'display:block;' : 'display:none;';
73
+ }
74
+ ?>
75
+ <div id="numberChoices" name="numberChoices" style="padding-left:15px;<?php echo $style; ?>">
76
+ <p>
77
+ <?php _e( 'Number of choices', 'polldaddy' ); ?>:
78
+ <select name="choices" id="choices">
79
+ <option value="1"><?php _e( 'No Limit', 'polldaddy' ); ?></option>
80
+ <?php
81
+ if ( $is_post && isset( $_POST['choices'] ) ) {
82
+ $choices = (int) $_POST['choices'];
83
+ } else {
84
+ $choices = (int) $poll->choices;
85
+ }
86
+
87
+ $a = count( $answers ) - 1;
88
+
89
+ if ( $a > 1 ) :
90
+ for ( $i = 2; $i <= $a; $i++ ) :
91
+ $selected = $i === $choices ? 'selected="selected"' : '';
92
+ printf( "<option value='%d' %s>%d</option>", $i, $selected, $i );
93
+ endfor;
94
+ endif;
95
+ ?>
96
+ </select>
97
+ </p>
98
+ </div>
99
+ </div>
100
+ <div id="major-publishing-actions">
101
+ <div id="publishing-action">
102
+ <?php wp_nonce_field( $poll_id ? "edit-poll_$poll_id" : 'create-poll' ); ?>
103
+ <input type="hidden" name="action" value="<?php echo $poll_id ? 'edit-poll' : 'create-poll'; ?>" />
104
+ <input type="hidden" class="polldaddy-poll-id" name="poll" value="<?php echo $poll_id; ?>" />
105
+ <input type="submit" class="button-primary" value="<?php echo esc_attr( __( 'Save Poll', 'polldaddy' ) ); ?>" />
106
+
107
+ <?php if ( isset( $_GET['iframe'] ) && $poll_id ) : ?>
108
+ <div id="delete-action">
109
+ <input type="button" class="button polldaddy-send-to-editor" style="margin-top:8px;" value="<?php echo esc_attr( __( 'Embed in Post', 'polldaddy' ) ); ?>" />
110
+ </div>
111
+ <?php endif; ?>
112
+
113
+ </div>
114
+ <br class="clear" />
115
+ </div>
116
+ </div>
117
+ </div>
118
+
119
+ <div class="postbox">
120
+ <h2 class="postbox-title"><?php _e( 'Results Display', 'polldaddy' ); ?></h2>
121
+ <div class="inside">
122
+ <ul class="poll-options">
123
+
124
+ <?php
125
+ $result_options = [
126
+ 'show' => __( 'Show results to voters', 'polldaddy' ),
127
+ 'percent' => __( 'Only show percentages', 'polldaddy' ),
128
+ 'hide' => __( 'Hide all results', 'polldaddy' ),
129
+ ];
130
+ foreach ( $result_options as $value => $label ) :
131
+ if ( $is_post ) {
132
+ $checked = $value === $_POST['resultsType'] ? ' checked="checked"' : '';
133
+ } else {
134
+ $checked = $value === $poll->resultsType ? ' checked="checked"' : '';
135
+ }
136
+ ?>
137
+
138
+ <li>
139
+ <label for="resultsType-<?php echo $value; ?>">
140
+ <input type="radio"<?php echo $checked; ?> value="<?php echo $value; ?>" name="resultsType" id="resultsType-<?php echo $value; ?>" /> <?php echo esc_html( $label ); ?>
141
+ </label>
142
+ </li>
143
+
144
+ <?php endforeach; ?>
145
+
146
+ </ul>
147
+ </div>
148
+ </div>
149
+
150
+ <div class="postbox">
151
+ <h2 class="postbox-title"><?php _e( 'Repeat Voting', 'polldaddy' ); ?></h2>
152
+ <div class="inside">
153
+ <ul class="poll-options">
154
+
155
+ <?php
156
+ $vote_options = [
157
+ 'off' => __( "Don't block repeat voters", 'polldaddy' ),
158
+ 'cookie' => __( 'Block by cookie (recommended)', 'polldaddy' ),
159
+ 'cookieip' => __( 'Block by cookie and by IP address', 'polldaddy' ),
160
+ ];
161
+ foreach ( $vote_options as $value => $label ) :
162
+ if ( $is_post ) {
163
+ $checked = $value === $_POST['blockRepeatVotersType'] ? ' checked="checked"' : '';
164
+ } else {
165
+ $checked = $value === $poll->blockRepeatVotersType ? ' checked="checked"' : '';
166
+ }
167
+ ?>
168
+
169
+ <li>
170
+ <label for="blockRepeatVotersType-<?php echo $value; ?>">
171
+ <input class="block-repeat" type="radio"<?php echo $checked; ?> value="<?php echo $value; ?>" name="blockRepeatVotersType" id="blockRepeatVotersType-<?php echo $value; ?>" /> <?php echo esc_html( $label ); ?>
172
+ </label>
173
+ </li>
174
+
175
+ <?php endforeach; ?>
176
+
177
+ </ul>
178
+
179
+ <?php
180
+ if ( (int) $poll->blockExpiration === 0 || $poll->blockExpiration > 604800 ) {
181
+ $poll->blockExpiration = 604800;
182
+ }
183
+ ?>
184
+ <span style="margin:6px 6px 8px;<?php echo $poll->blockRepeatVotersType === 'off' ? 'display:none;' : ''; ?>" id="cookieip_expiration_label"><label><?php _e( 'Expires: ', 'polldaddy' ); ?></label></span>
185
+ <select id="cookieip_expiration" name="cookieip_expiration" style="width: auto;<?php echo $poll->blockRepeatVotersType === 'off' ? 'display:none;' : ''; ?>">
186
+ <option value="3600" <?php echo (int) $poll->blockExpiration === 3600 ? 'selected' : ''; ?>><?php printf( __( '%d hour', 'polldaddy' ), 1 ); ?></option>
187
+ <option value="10800" <?php echo (int) $poll->blockExpiration === 10800 ? 'selected' : ''; ?>><?php printf( __( '%d hours', 'polldaddy' ), 3 ); ?></option>
188
+ <option value="21600" <?php echo (int) $poll->blockExpiration === 21600 ? 'selected' : ''; ?>><?php printf( __( '%d hours', 'polldaddy' ), 6 ); ?></option>
189
+ <option value="43200" <?php echo (int) $poll->blockExpiration === 43200 ? 'selected' : ''; ?>><?php printf( __( '%d hours', 'polldaddy' ), 12 ); ?></option>
190
+ <option value="86400" <?php echo (int) $poll->blockExpiration === 86400 ? 'selected' : ''; ?>><?php printf( __( '%d day', 'polldaddy' ), 1 ); ?></option>
191
+ <option value="604800" <?php echo (int) $poll->blockExpiration === 604800 ? 'selected' : ''; ?>><?php printf( __( '%d week', 'polldaddy' ), 1 ); ?></option>
192
+ </select>
193
+ <p><?php _e( 'Note: Blocking by cookie and IP address can be problematic for some voters.', 'polldaddy' ); ?></p>
194
+ </div>
195
+ </div>
196
+
197
+ <div class="postbox">
198
+ <h2 class="postbox-title"><?php _e( 'Comments', 'polldaddy' ); ?></h2>
199
+ <div class="inside">
200
+ <ul class="poll-options">
201
+
202
+ <?php
203
+ $comment_options = [
204
+ 'allow' => __( 'Allow comments', 'polldaddy' ),
205
+ 'moderate' => __( 'Moderate first', 'polldaddy' ),
206
+ 'off' => __( 'No comments', 'polldaddy' ),
207
+ ];
208
+ foreach ( $comment_options as $value => $label ) :
209
+ if ( $is_post ) {
210
+ $checked = $value === $_POST['comments'] ? ' checked="checked"' : '';
211
+ } else {
212
+ $checked = $value === $poll->comments->___content ? ' checked="checked"' : '';
213
+ }
214
+ ?>
215
+
216
+ <li>
217
+ <label for="comments-<?php echo $value; ?>">
218
+ <input type="radio"<?php echo $checked; ?> value="<?php echo $value; ?>" name="comments" id="comments-<?php echo $value; ?>" /> <?php echo esc_html( $label ); ?>
219
+ </label>
220
+ </li>
221
+
222
+ <?php endforeach; ?>
223
+
224
+ </ul>
225
+ </div>
226
+ </div>
227
+ </div>
228
+
229
+ <div id="post-body-content" class="has-sidebar-content">
230
+
231
+ <div id="titlediv" style="margin-top:0px;">
232
+ <div id="titlewrap">
233
+
234
+ <table class="question">
235
+
236
+ <tr>
237
+ <td class="question-input">
238
+ <input type="text" autocomplete="off" id="title" placeholder="<?php _e( 'Enter Question Here', 'polldaddy' ); ?>" value="<?php echo $question; ?>" tabindex="1" size="30" name="question" />
239
+ </td>
240
+ <td class="answer-media-icons" <?php echo isset( $_GET['iframe'] ) ? 'style="width: 55px !important;"' : ''; ?>>
241
+ <ul class="answer-media" <?php echo isset( $_GET['iframe'] ) ? 'style="min-width: 30px;"' : ''; ?>>
242
+ <?php if ( isset( $media_type[999999999] ) && (int) $media_type[999999999] === 2 ) { ?>
243
+ <li class="media-preview image-added" style="width: 20px; height: 16px; padding-left: 5px;"><img height="16" width="16" src="<?php echo $base_url; ?>img/icon-report-ip-analysis.png" alt="Video Embed"><?php echo $delete_media_link; ?></li>
244
+ <?php
245
+ } else {
246
+ $url = '';
247
+ if ( isset( $media[999999999] ) ) {
248
+ $url = urldecode( $media[999999999]->img_small );
249
+
250
+ if ( is_ssl() ) {
251
+ $url = preg_replace( '/http\:/', 'https:', $url );
252
+ }
253
+ }
254
+ ?>
255
+ <li class="media-preview <?php echo ! empty( $url ) ? 'image-added' : ''; ?>" style="width: 20px; height: 16px; padding-left: 5px;">
256
+ <?php echo $url; ?><?php echo $delete_media_link; ?>
257
+ </li>
258
+ <?php
259
+ }
260
+
261
+ if ( ! isset( $_GET['iframe'] ) ) :
262
+ ?>
263
+ <li><a title="<?php echo esc_attr( __( 'Add an Image', 'polldaddy' ) ); ?>" class="thickbox media image" id="add_poll_image999999999" href="#"><img style="vertical-align:middle;" alt="<?php echo esc_attr( __( 'Add an Image', 'polldaddy' ) ); ?>" src="images/media-button-image.gif"></a></li>
264
+ <li><a title="<?php echo esc_attr( __( 'Add Audio', 'polldaddy' ) ); ?>" class="thickbox media video" id="add_poll_video999999999" href="#"><img style="vertical-align:middle;" alt="<?php echo esc_attr( __( 'Add Audio', 'polldaddy' ) ); ?>" src="images/media-button-video.gif"></a></li>
265
+ <li><a title="<?php echo esc_attr( __( 'Add Video', 'polldaddy' ) ); ?>" class="thickbox media audio" id="add_poll_audio999999999" href="#"><img style="vertical-align:middle;" alt="<?php echo esc_attr( __( 'Add Video', 'polldaddy' ) ); ?>" src="images/media-button-music.gif"></a></li>
266
+ <?php endif; ?>
267
+ </ul>
268
+
269
+ <input type="hidden" value="<?php echo isset( $media[999999999] ) ? $media[999999999]->_id : ''; ?>" id="hMC999999999" name="media[999999999]">
270
+ <input type="hidden" value="<?php echo isset( $media_type[999999999] ) ? intval( $media_type[999999999] ) : ''; ?>" id="hMT999999999" name="mediaType[999999999]">
271
+
272
+ </td>
273
+ </tr>
274
+ </table>
275
+
276
+ <?php if ( isset( $poll->_id ) && ! isset( $_GET['iframe'] ) ) : ?>
277
+ <div class="inside">
278
+ <div id="edit-slug-box" style="margin-bottom:30px;">
279
+ <strong><?php _e( 'WordPress Shortcode:', 'polldaddy' ); ?></strong>
280
+ <input type="text" style="color:#999;" value="[crowdsignal poll=<?php echo $poll->_id; ?>]" id="shortcode-field" readonly="readonly" />
281
+ <span><a href="post-new.php?content=[crowdsignal poll=<?php echo $poll->_id; ?>]" class="button"><?php _e( 'Embed Poll in New Post' ); ?></a></span>
282
+ </div>
283
+ </div>
284
+ <?php endif; ?>
285
+
286
+ </div>
287
+ </div>
288
+
289
+ <div id="answersdiv" class="postbox">
290
+ <h2 class="postbox-title"><?php _e( 'Answers', 'polldaddy' ); ?></h2>
291
+
292
+ <div id="answerswrap" class="inside">
293
+ <ul id="answers">
294
+ <?php
295
+ $a = 0;
296
+ foreach ( $answers as $answer_id => $answer ) :
297
+ $a++;
298
+ $query_args = [
299
+ 'action' => 'delete-answer',
300
+ 'poll' => $poll_id,
301
+ 'answer' => $answer_id,
302
+ 'message' => false,
303
+ ];
304
+ $delete_link = esc_url( wp_nonce_url( add_query_arg( $query_args ), "delete-answer_$answer_id" ) );
305
+ ?>
306
+ <li>
307
+ <table class="answer">
308
+ <tr>
309
+ <th>
310
+ <span class="handle" title="<?php echo esc_attr( __( 'click and drag to reorder' ) ); ?>"><img src="<?php echo $base_url; ?>img/icon-reorder.png" alt="click and drag to reorder" width="6" height="9" /></span>
311
+ </th>
312
+ <td class="answer-input">
313
+ <input type="text" autocomplete="off" placeholder="<?php echo esc_attr( __( 'Enter an answer here', 'polldaddy' ) ); ?>" id="answer-<?php echo $answer_id; ?>" value="<?php echo $answer; ?>" tabindex="2" size="30" name="answer[<?php echo $answer_id; ?>]" />
314
+ </td>
315
+ <td class="answer-media-icons" <?php echo isset( $_GET['iframe'] ) ? 'style="width: 55px !important;"' : ''; ?>>
316
+ <ul class="answer-media" <?php echo isset( $_GET['iframe'] ) ? 'style="min-width: 30px;"' : ''; ?>>
317
+ <?php if ( isset( $media_type[ $answer_id ] ) && intval( $media_type[ $answer_id ] ) === 2 ) { ?>
318
+ <li class="media-preview image-added" style="width: 20px; height: 16px; padding-left: 5px;">
319
+ <img height="16" width="16" src="<?php echo $base_url; ?>img/icon-report-ip-analysis.png" alt="Video Embed" />
320
+ <?php echo $delete_media_link; ?>
321
+ </li>
322
+ <?php
323
+ } else {
324
+ $url = '';
325
+ if ( isset( $media[ $answer_id ] ) ) {
326
+ $url = urldecode( $media[ $answer_id ]->img_small );
327
+
328
+ if ( is_ssl() ) {
329
+ $url = preg_replace( '/http\:/', 'https:', $url );
330
+ }
331
+ }
332
+ ?>
333
+ <li class="media-preview <?php echo ! empty( $url ) ? 'image-added' : ''; ?>" style="width: 20px; height: 16px; padding-left: 5px;">
334
+ <?php echo $url; ?><?php echo $delete_media_link; ?>
335
+ </li>
336
+ <?php
337
+ }
338
+
339
+ if ( ! isset( $_GET['iframe'] ) ) :
340
+ ?>
341
+ <li><a title="<?php echo esc_attr( __( 'Add an Image', 'polldaddy' ) ); ?>" class="thickbox media image" id="add_poll_image<?php echo $answer_id; ?>" href="#"><img style="vertical-align:middle;" alt="<?php echo esc_attr( __( 'Add an Image', 'polldaddy' ) ); ?>" src="images/media-button-image.gif"></a></li>
342
+ <li><a title="<?php echo esc_attr( __( 'Add Audio', 'polldaddy' ) ); ?>" class="thickbox media video" id="add_poll_video<?php echo $answer_id; ?>" href="#"><img style="vertical-align:middle;" alt="<?php echo esc_attr( __( 'Add Audio', 'polldaddy' ) ); ?>" src="images/media-button-video.gif"></a></li>
343
+ <li><a title="<?php echo esc_attr( __( 'Add Video', 'polldaddy' ) ); ?>" class="thickbox media audio" id="add_poll_audio<?php echo $answer_id; ?>" href="#"><img style="vertical-align:middle;" alt="<?php echo esc_attr( __( 'Add Video', 'polldaddy' ) ); ?>" src="images/media-button-music.gif"></a></li>
344
+ <?php endif; ?>
345
+ <li>
346
+ <a href="<?php echo $delete_link; ?>" class="delete-answer delete" title="<?php echo esc_attr( __( 'delete this answer', 'polldaddy' ) ); ?>">
347
+ <img src="<?php echo $base_url; ?>img/icon-clear-search.png" width="16" height="16" />
348
+ </a>
349
+ </li>
350
+
351
+ </ul>
352
+
353
+ <input type="hidden" value="<?php echo isset( $media[ $answer_id ] ) ? $media[ $answer_id ]->_id : ''; ?>" id="hMC<?php echo $answer_id; ?>" name="media[<?php echo $answer_id; ?>]">
354
+ <input type="hidden" value="<?php echo isset( $media_type[ $answer_id ] ) ? $media_type[ $answer_id ] : ''; ?>" id="hMT<?php echo $answer_id; ?>" name="mediaType[<?php echo $answer_id; ?>]">
355
+
356
+ </td>
357
+ </tr>
358
+ </table>
359
+
360
+ </li>
361
+
362
+ <?php
363
+ endforeach;
364
+
365
+ while ( 3 - $a > 0 ) :
366
+ $a++;
367
+ ?>
368
+
369
+ <li>
370
+ <table class="answer">
371
+ <tr>
372
+ <th>
373
+ <span class="handle" title="<?php echo esc_attr( __( 'click and drag to reorder' ) ); ?>"><img src="<?php echo $base_url; ?>img/icon-reorder.png" alt="click and drag to reorder" width="6" height="9" /></span>
374
+ </th>
375
+ <td class="answer-input">
376
+ <input type="text" autocomplete="off" placeholder="<?php echo esc_attr( __( 'Enter an answer here', 'polldaddy' ) ); ?>" value="" tabindex="2" size="30" name="answer[new<?php echo $a; ?>]" />
377
+ </td>
378
+ <td class="answer-media-icons" <?php echo isset( $_GET['iframe'] ) ? 'style="width:55px !important;"' : ''; ?>>
379
+ <ul class="answer-media" <?php echo isset( $_GET['iframe'] ) ? 'style="min-width: 30px;"' : ''; ?>>
380
+ <li class="media-preview" style="width: 20px; height: 16px; padding-left: 5px;"></li>
381
+ <?php if ( ! isset( $_GET['iframe'] ) ) : ?>
382
+ <li><a title="<?php echo esc_attr( __( 'Add an Image', 'polldaddy' ) ); ?>" class="thickbox media image" id="add_poll_image<?php echo $a; ?>" href="#"><img style="vertical-align:middle;" alt="<?php echo esc_attr( __( 'Add an Image', 'polldaddy' ) ); ?>" src="images/media-button-image.gif"></a></a></li>
383
+ <li><a title="<?php echo esc_attr( __( 'Add Audio', 'polldaddy' ) ); ?>" class="thickbox media video" id="add_poll_video<?php echo $a; ?>" href="#"><img style="vertical-align:middle;" alt="<?php echo esc_attr( __( 'Add Audio', 'polldaddy' ) ); ?>" src="images/media-button-video.gif"></a></a></li>
384
+ <li><a title="<?php echo esc_attr( __( 'Add Video', 'polldaddy' ) ); ?>" class="thickbox media audio" id="add_poll_audio<?php echo $a; ?>" href="#"><img style="vertical-align:middle;" alt="<?php echo esc_attr( __( 'Add Video', 'polldaddy' ) ); ?>" src="images/media-button-music.gif"></a></li>
385
+ <?php endif; ?>
386
+ <li><a href="#" class="delete-answer delete" title="<?php echo esc_attr( __( 'delete this answer', 'polldaddy' ) ); ?>"><img src="<?php echo $base_url; ?>img/icon-clear-search.png" width="16" height="16" /></a></li>
387
+ </ul>
388
+
389
+ <input type="hidden" value="" id="hMC<?php echo $a; ?>" name="media[<?php echo $a; ?>]">
390
+ <input type="hidden" value="" id="hMT<?php echo $a; ?>" name="mediaType[<?php echo $a; ?>]">
391
+
392
+ </td>
393
+ </tr>
394
+ </table>
395
+ </li>
396
+
397
+ <?php
398
+ endwhile;
399
+ ?>
400
+
401
+ </ul>
402
+
403
+ <p id="add-answer-holder" class="<?php echo $base_url; ?>">
404
+ <button class="button"><?php echo esc_html( __( 'Add New Answer', 'polldaddy' ) ); ?></button>
405
+ </p>
406
+
407
+ </div>
408
+ </div>
409
+
410
+ <div class="hidden-links">
411
+ <div class="delete-media-link"><?php echo $delete_media_link; ?></div>
412
+ </div>
413
+
414
+ <div id="design" class="postbox">
415
+
416
+ <?php
417
+ $style_id = (int) ( $is_post ? $_POST['styleID'] : $poll->styleID );
418
+
419
+ $iframe_view = false;
420
+ if ( isset( $_GET['iframe'] ) ) {
421
+ $iframe_view = true;
422
+ }
423
+
424
+ $preset_styles = [
425
+ 101 => __( 'Aluminum Narrow', 'polldaddy' ),
426
+ 102 => __( 'Aluminum Medium', 'polldaddy' ),
427
+ 103 => __( 'Aluminum Wide', 'polldaddy' ),
428
+ 104 => __( 'Plain White Narrow', 'polldaddy' ),
429
+ 105 => __( 'Plain White Medium', 'polldaddy' ),
430
+ 106 => __( 'Plain White Wide', 'polldaddy' ),
431
+ 107 => __( 'Plain Black Narrow', 'polldaddy' ),
432
+ 108 => __( 'Plain Black Medium', 'polldaddy' ),
433
+ 109 => __( 'Plain Black Wide', 'polldaddy' ),
434
+ 110 => __( 'Paper Narrow', 'polldaddy' ),
435
+ 111 => __( 'Paper Medium', 'polldaddy' ),
436
+ 112 => __( 'Paper Wide', 'polldaddy' ),
437
+ 113 => __( 'Skull Dark Narrow', 'polldaddy' ),
438
+ 114 => __( 'Skull Dark Medium', 'polldaddy' ),
439
+ 115 => __( 'Skull Dark Wide', 'polldaddy' ),
440
+ 116 => __( 'Skull Light Narrow', 'polldaddy' ),
441
+ 117 => __( 'Skull Light Medium', 'polldaddy' ),
442
+ 118 => __( 'Skull Light Wide', 'polldaddy' ),
443
+ 157 => __( 'Micro', 'polldaddy' ),
444
+ 119 => __( 'Plastic White Narrow', 'polldaddy' ),
445
+ 120 => __( 'Plastic White Medium', 'polldaddy' ),
446
+ 121 => __( 'Plastic White Wide', 'polldaddy' ),
447
+ 122 => __( 'Plastic Grey Narrow', 'polldaddy' ),
448
+ 123 => __( 'Plastic Grey Medium', 'polldaddy' ),
449
+ 124 => __( 'Plastic Grey Wide', 'polldaddy' ),
450
+ 125 => __( 'Plastic Black Narrow', 'polldaddy' ),
451
+ 126 => __( 'Plastic Black Medium', 'polldaddy' ),
452
+ 127 => __( 'Plastic Black Wide', 'polldaddy' ),
453
+ 128 => __( 'Manga Narrow', 'polldaddy' ),
454
+ 129 => __( 'Manga Medium', 'polldaddy' ),
455
+ 130 => __( 'Manga Wide', 'polldaddy' ),
456
+ 131 => __( 'Tech Dark Narrow', 'polldaddy' ),
457
+ 132 => __( 'Tech Dark Medium', 'polldaddy' ),
458
+ 133 => __( 'Tech Dark Wide', 'polldaddy' ),
459
+ 134 => __( 'Tech Grey Narrow', 'polldaddy' ),
460
+ 135 => __( 'Tech Grey Medium', 'polldaddy' ),
461
+ 136 => __( 'Tech Grey Wide', 'polldaddy' ),
462
+ 137 => __( 'Tech Light Narrow', 'polldaddy' ),
463
+ 138 => __( 'Tech Light Medium', 'polldaddy' ),
464
+ 139 => __( 'Tech Light Wide', 'polldaddy' ),
465
+ 140 => __( 'Working Male Narrow', 'polldaddy' ),
466
+ 141 => __( 'Working Male Medium', 'polldaddy' ),
467
+ 142 => __( 'Working Male Wide', 'polldaddy' ),
468
+ 143 => __( 'Working Female Narrow', 'polldaddy' ),
469
+ 144 => __( 'Working Female Medium', 'polldaddy' ),
470
+ 145 => __( 'Working Female Wide', 'polldaddy' ),
471
+ 146 => __( 'Thinking Male Narrow', 'polldaddy' ),
472
+ 147 => __( 'Thinking Male Medium', 'polldaddy' ),
473
+ 148 => __( 'Thinking Male Wide', 'polldaddy' ),
474
+ 149 => __( 'Thinking Female Narrow', 'polldaddy' ),
475
+ 150 => __( 'Thinking Female Medium', 'polldaddy' ),
476
+ 151 => __( 'Thinking Female Wide', 'polldaddy' ),
477
+ 152 => __( 'Sunset Narrow', 'polldaddy' ),
478
+ 153 => __( 'Sunset Medium', 'polldaddy' ),
479
+ 154 => __( 'Sunset Wide', 'polldaddy' ),
480
+ 155 => __( 'Music Medium', 'polldaddy' ),
481
+ 156 => __( 'Music Wide', 'polldaddy' ),
482
+ ];
483
+
484
+ $polldaddy->reset();
485
+ $styles = $polldaddy->get_styles();
486
+
487
+ $show_custom = false;
488
+ if ( ! empty( $styles ) && ! empty( $styles->style ) && count( $styles->style ) > 0 ) {
489
+ foreach ( (array) $styles->style as $style ) {
490
+ $preset_styles[ (int) $style->_id ] = $style->title;
491
+ }
492
+ $show_custom = true;
493
+ }
494
+
495
+ if ( $style_id > 18 ) {
496
+ $standard_style_id = 0;
497
+ $custom_style_id = $style_id;
498
+ } else {
499
+ $standard_style_id = $style_id;
500
+ $custom_style_id = 0;
501
+ }
502
+ ?>
503
+ <h2 class="postbox-title"><?php _e( 'Poll Style', 'polldaddy' ); ?></h2>
504
+ <input type="hidden" name="styleID" id="styleID" value="<?php echo $style_id; ?>">
505
+ <div class="inside">
506
+
507
+ <ul class="pd-tabs">
508
+ <li class="selected" id="pd-styles"><a href="#"><?php _e( 'Crowdsignal Styles', 'polldaddy' ); ?></a><input type="checkbox" style="display:none;" id="regular"/></li>
509
+ <?php $hide = (bool) $show_custom === true ? ' style="display:block;"' : ' style="display:none;"'; ?>
510
+ <li id="pd-custom-styles" <?php echo $hide; ?>><a href="#"><?php _e( 'Custom Styles', 'polldaddy' ); ?></a><input type="checkbox" style="display:none;" id="custom"/></li>
511
+
512
+ </ul>
513
+
514
+ <div class="pd-tab-panel show" id="pd-styles-panel">
515
+ <?php if ( $iframe_view ) { ?>
516
+ <div id="design_standard" style="padding:0px;padding-top:10px;">
517
+ <div class="hide-if-no-js">
518
+ <table class="pollStyle">
519
+ <thead>
520
+ <tr>
521
+ <th>
522
+ <div style="display:none;">
523
+ <input type="radio" name="styleTypeCB" id="regular" onclick="javascript:pd_build_styles( 0 );"/>
524
+ </div>
525
+ </th>
526
+ </tr>
527
+ </thead>
528
+ <tr>
529
+ <td class="selector" style="width:120px;">
530
+ <table class="st_selector">
531
+ <tr>
532
+ <td class="dir_left" style="padding:0px;width:30px;">
533
+ <a href="javascript:pd_move('prev');" style="display: block;font-size: 3.2em;text-decoration: none;">&#171;</a>
534
+ </td>
535
+ <td class="img"><div class="st_image_loader"><div id="st_image" onmouseover="st_results(this, 'show');" onmouseout="st_results(this, 'hide');"></div></div></td>
536
+ <td class="dir_right" style="padding:0px;width:30px;">
537
+ <a href="javascript:pd_move('next');" style="display: block;padding-left:20px;font-size: 3.2em;text-decoration: none;">&#187;</a>
538
+ </td>
539
+ </tr>
540
+ <tr>
541
+ <td></td>
542
+ <td class="counter">
543
+ <div id="st_number"></div>
544
+ </td>
545
+ <td></td>
546
+ </tr>
547
+ <tr>
548
+ <td></td>
549
+ <td class="title">
550
+ <div id="st_name"></div>
551
+ </td>
552
+ <td></td>
553
+ </tr>
554
+ <tr>
555
+ <td></td>
556
+ <td>
557
+ <div id="st_sizes"></div>
558
+ </td>
559
+ <td></td>
560
+ </tr>
561
+ <tr>
562
+ <td colspan="3">
563
+ <div style="width:230px;" id="st_description"></div>
564
+ </td>
565
+ </tr>
566
+ </table>
567
+ </td>
568
+ </tr>
569
+ </table>
570
+ </div>
571
+
572
+ <p class="empty-if-js" id="no-js-styleID">
573
+ <select id="styleID" name="styleID">
574
+
575
+ <?php
576
+ foreach ( $preset_styles as $s_id => $label ) :
577
+ $selected = $s_id === $style_id ? ' selected="selected"' : '';
578
+ ?>
579
+ <option value="<?php echo (int) $s_id; ?>"<?php echo $selected; ?>><?php echo esc_html( $label ); ?></option>
580
+ <?php endforeach; ?>
581
+
582
+ </select>
583
+ </p>
584
+ </div>
585
+ <?php } else { ?>
586
+
587
+ <div class="design_standard">
588
+ <div class="hide-if-no-js">
589
+ <table class="pollStyle">
590
+ <thead>
591
+ <tr style="display:none;">
592
+ <th class="cb">
593
+
594
+ <input type="radio" name="styleTypeCB" id="regular" onclick="javascript:pd_build_styles( 0 );"/>
595
+ <label for="skin" onclick="javascript:pd_build_styles( 0 );"><?php _e( 'Crowdsignal Style', 'polldaddy' ); ?></label>
596
+
597
+ <?php $disabled = (bool) $show_custom === false ? ' disabled="true"' : ''; ?>
598
+
599
+ <input type="radio" name="styleTypeCB" id="custom" onclick="javascript:pd_change_style(_$('customSelect').value);" <?php echo $disabled; ?> />
600
+
601
+ <label onclick="javascript:pd_change_style(_$('customSelect').value);"><?php _e( 'Custom Style', 'polldaddy' ); ?></label>
602
+
603
+ <th>
604
+ </tr>
605
+ </thead>
606
+ <tbody>
607
+ <tr>
608
+ <td style="text-align:center">
609
+ <table class="st_selector" style="margin:20px auto;">
610
+ <tr>
611
+ <td class="dir_left">
612
+ <a href="javascript:pd_move('prev');" style="width: 1em;display: block;font-size: 4em;text-decoration: none;">&#171;</a>
613
+ </td>
614
+ <td class="img"><div class="st_image_loader"><div id="st_image" onmouseover="st_results(this, 'show');" onmouseout="st_results(this, 'hide');"></div></div></td>
615
+ <td class="dir_right">
616
+ <a href="javascript:pd_move('next');" style="width: 1em;display: block;font-size: 4em;text-decoration: none;">&#187;</a>
617
+ </td>
618
+ </tr>
619
+ <tr>
620
+ <td></td>
621
+ <td class="counter">
622
+ <div id="st_number"></div>
623
+ </td>
624
+ <td></td>
625
+ </tr>
626
+ <tr>
627
+ <td></td>
628
+ <td class="title">
629
+ <div id="st_name"></div>
630
+ </td>
631
+ <td></td>
632
+ </tr>
633
+ <tr>
634
+ <td></td>
635
+ <td>
636
+ <div id="st_sizes"></div>
637
+ </td>
638
+ <td></td>
639
+ </tr>
640
+ <tr>
641
+ <td colspan="3">
642
+ <div id="st_description"></div>
643
+ </td>
644
+ </tr>
645
+ </table>
646
+ </td>
647
+
648
+ </tr>
649
+ </tbody>
650
+ </table>
651
+ </div>
652
+ <p class="empty-if-js" id="no-js-styleID">
653
+ <select id="styleID" name="styleID">
654
+
655
+ <?php
656
+ foreach ( $preset_styles as $s_id => $label ) :
657
+ $selected = $s_id === $style_id ? ' selected="selected"' : '';
658
+ ?>
659
+ <option value="<?php echo (int) $s_id; ?>"<?php echo $selected; ?>><?php echo esc_html( $label ); ?></option>
660
+ <?php endforeach; ?>
661
+
662
+ </select>
663
+ </p>
664
+ </div>
665
+ <?php } ?>
666
+ </div>
667
+
668
+
669
+ <div class="pd-tab-panel" id="pd-custom-styles-panel">
670
+ <div style="padding:20px;">
671
+ <?php if ( $show_custom ) : ?>
672
+ <p>
673
+ <a href="<?php echo esc_url( add_query_arg( array( 'action' => 'list-styles', 'poll' => false, 'style' => false, 'message' => false, 'preload' => false ) ) ); ?>" class="add-new-h2">
674
+ All Styles
675
+ </a>
676
+ </p>
677
+ <select id="customSelect" name="customSelect" onchange="javascript:pd_change_style(this.value);">
678
+ <?php $selected = (int) $custom_style_id === 0 ? ' selected="selected"' : ''; ?>
679
+ <option value="x"<?php echo $selected; ?>><?php _e( 'Please choose a custom style…', 'polldaddy' ); ?></option>
680
+ <?php
681
+ foreach ( (array) $styles->style as $style ) :
682
+ $selected = (int) $style->_id === (int) $custom_style_id ? ' selected="selected"' : '';
683
+ ?>
684
+ <option value="<?php echo (int) $style->_id; ?>"<?php echo $selected; ?>><?php echo esc_html( $style->title ); ?></option>
685
+ <?php endforeach; ?>
686
+ </select>
687
+ <div id="styleIDErr" class="formErr" style="display:none;">
688
+ <?php _e( 'Please choose a style.', 'polldaddy' ); ?>
689
+ </div>
690
+ <?php else : ?>
691
+ <p>
692
+ <?php _e( 'You currently have no custom styles created.', 'polldaddy' ); ?>
693
+ <a href="/wp-admin/edit.php?post_type=feedback&page=polls&action=create-style" class="add-new-h2">
694
+ <?php _e( 'New Style', 'polldaddy' ); ?>
695
+ </a>
696
+ </p>
697
+ <p>
698
+ <?php
699
+ /* translators: link to support site for custom poll styles */
700
+ printf( __( 'Did you know we have a new editor for building your own custom poll styles? Find out more <a href="%s" target="_blank">here</a>.', 'polldaddy' ), 'https://crowdsignal.com/support/custom-poll-styles/' );
701
+ ?>
702
+ </p>
703
+ <?php endif; ?>
704
+ </div>
705
+ </div>
706
+
707
+ <script language="javascript">
708
+ jQuery( document ).ready(function(){
709
+ plugin = new Plugin( {
710
+ delete_rating: '<?php echo esc_attr( __( 'Are you sure you want to delete the rating for "%s"?', 'polldaddy' ) ); ?>',
711
+ delete_poll: '<?php echo esc_attr( __( 'Are you sure you want to delete "%s"?', 'polldaddy' ) ); ?>',
712
+ delete_answer: '<?php echo esc_attr( __( 'Are you sure you want to delete this answer?', 'polldaddy' ) ); ?>',
713
+ new_answer_test: '<?php echo esc_attr( __( 'Enter an answer here', 'polldaddy' ) ); ?>',
714
+ delete_answer_title: '<?php echo esc_attr( __( 'delete this answer', 'polldaddy' ) ); ?>',
715
+ reorder_answer_title: '<?php echo esc_attr( __( 'click and drag to reorder', 'polldaddy' ) ); ?>',
716
+ add_image_title: '<?php echo esc_attr( __( 'Add an Image', 'polldaddy' ) ); ?>',
717
+ add_audio_title: '<?php echo esc_attr( __( 'Add Audio', 'polldaddy' ) ); ?>',
718
+ add_video_title: '<?php echo esc_attr( __( 'Add Video', 'polldaddy' ) ); ?>',
719
+ standard_styles: '<?php echo esc_attr( __( 'Standard Styles', 'polldaddy' ) ); ?>',
720
+ custom_styles: '<?php echo esc_attr( __( 'Custom Styles', 'polldaddy' ) ); ?>',
721
+ base_url: '<?php echo esc_attr( $base_url ); ?>'
722
+ } );
723
+ });
724
+ </script>
725
+ <script language="javascript">
726
+ current_pos = 0;
727
+
728
+ for( var key in styles_array ) {
729
+ var name = styles_array[key].name;
730
+
731
+ switch( name ) {
732
+ case 'Aluminum':
733
+ styles_array[key].name = '<?php echo esc_attr( __( 'Aluminum', 'polldaddy' ) ); ?>';
734
+ break;
735
+ case 'Plain White':
736
+ styles_array[key].name = '<?php echo esc_attr( __( 'Plain White', 'polldaddy' ) ); ?>';
737
+ break;
738
+ case 'Plain Black':
739
+ styles_array[key].name = '<?php echo esc_attr( __( 'Plain Black', 'polldaddy' ) ); ?>';
740
+ break;
741
+ case 'Paper':
742
+ styles_array[key].name = '<?php echo esc_attr( __( 'Paper', 'polldaddy' ) ); ?>';
743
+ break;
744
+ case 'Skull Dark':
745
+ styles_array[key].name = '<?php echo esc_attr( __( 'Skull Dark', 'polldaddy' ) ); ?>';
746
+ break;
747
+ case 'Skull Light':
748
+ styles_array[key].name = '<?php echo esc_attr( __( 'Skull Light', 'polldaddy' ) ); ?>';
749
+ break;
750
+ case 'Micro':
751
+ styles_array[key].name = '<?php echo esc_attr( __( 'Micro', 'polldaddy' ) ); ?>';
752
+ styles_array[key].n_desc = '<?php echo esc_attr( __( 'Width 150px, the micro style is useful when space is tight.', 'polldaddy' ) ); ?>';
753
+ break;
754
+ case 'Plastic White':
755
+ styles_array[key].name = '<?php echo esc_attr( __( 'Plastic White', 'polldaddy' ) ); ?>';
756
+ break;
757
+ case 'Plastic Grey':
758
+ styles_array[key].name = '<?php echo esc_attr( __( 'Plastic Grey', 'polldaddy' ) ); ?>';
759
+ break;
760
+ case 'Plastic Black':
761
+ styles_array[key].name = '<?php echo esc_attr( __( 'Plastic Black', 'polldaddy' ) ); ?>';
762
+ break;
763
+ case 'Manga':
764
+ styles_array[key].name = '<?php echo esc_attr( __( 'Manga', 'polldaddy' ) ); ?>';
765
+ break;
766
+ case 'Tech Dark':
767
+ styles_array[key].name = '<?php echo esc_attr( __( 'Tech Dark', 'polldaddy' ) ); ?>';
768
+ break;
769
+ case 'Tech Grey':
770
+ styles_array[key].name = '<?php echo esc_attr( __( 'Tech Grey', 'polldaddy' ) ); ?>';
771
+ break;
772
+ case 'Tech Light':
773
+ styles_array[key].name = '<?php echo esc_attr( __( 'Tech Light', 'polldaddy' ) ); ?>';
774
+ break;
775
+ case 'Working Male':
776
+ styles_array[key].name = '<?php echo esc_attr( __( 'Working Male', 'polldaddy' ) ); ?>';
777
+ break;
778
+ case 'Working Female':
779
+ styles_array[key].name = '<?php echo esc_attr( __( 'Working Female', 'polldaddy' ) ); ?>';
780
+ break;
781
+ case 'Thinking Male':
782
+ styles_array[key].name = '<?php echo esc_attr( __( 'Thinking Male', 'polldaddy' ) ); ?>';
783
+ break;
784
+ case 'Thinking Female':
785
+ styles_array[key].name = '<?php echo esc_attr( __( 'Thinking Female', 'polldaddy' ) ); ?>';
786
+ break;
787
+ case 'Sunset':
788
+ styles_array[key].name = '<?php echo esc_attr( __( 'Sunset', 'polldaddy' ) ); ?>';
789
+ break;
790
+ case 'Music':
791
+ styles_array[key].name = '<?php echo esc_attr( __( 'Music', 'polldaddy' ) ); ?>';
792
+ break;
793
+ }
794
+ }
795
+ pd_map = {
796
+ wide : '<?php echo esc_attr( __( 'Wide', 'polldaddy' ) ); ?>',
797
+ medium : '<?php echo esc_attr( __( 'Medium', 'polldaddy' ) ); ?>',
798
+ narrow : '<?php echo esc_attr( __( 'Narrow', 'polldaddy' ) ); ?>',
799
+ style_desc_wide : '<?php echo esc_attr( __( 'Width: 630px, the wide style is good for blog posts.', 'polldaddy' ) ); ?>',
800
+ style_desc_medium : '<?php echo esc_attr( __( 'Width: 300px, the medium style is good for general use.', 'polldaddy' ) ); ?>',
801
+ style_desc_narrow : '<?php echo esc_attr( __( 'Width 150px, the narrow style is good for sidebars etc.', 'polldaddy' ) ); ?>',
802
+ style_desc_micro : '<?php echo esc_attr( __( 'Width 150px, the micro style is useful when space is tight.', 'polldaddy' ) ); ?>',
803
+ image_path : '<?php echo plugins_url( 'img', dirname( __FILE__ ) ); ?>'
804
+ }
805
+ pd_build_styles( current_pos );
806
+ <?php if ( $style_id > 0 && $style_id <= 1000 ) { ?>
807
+ pd_pick_style( <?php echo $style_id; ?> );
808
+ <?php } else { ?>
809
+ pd_change_style( <?php echo $style_id; ?> );
810
+ <?php } ?>
811
+ </script>
812
+ </div>
813
+
814
+ </div>
815
+
816
+ </div>
817
+ </div></div>
818
+ </form>
819
+ <br class="clear" />
polldaddy.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Create and manage Crowdsignal polls and ratings in WordPress
6
  * Author: Automattic, Inc.
7
  * Author URL: https://crowdsignal.com/
8
- * Version: 3.0.7
9
  */
10
 
11
  // To hardcode your Polldaddy PartnerGUID (API Key), add the (uncommented) line below with the PartnerGUID to your `wp-config.php`
@@ -562,8 +562,8 @@ class WP_Polldaddy {
562
  <p>Here is a short demo video for how to set up this block, not that you would need it ;) </p>
563
  <!-- /wp:paragraph -->
564
 
565
- <!-- wp:video {"align":"center","className":"wp-block-embed is-type-video is-provider-videopress"} -->
566
- <figure class="wp-block-video aligncenter wp-block-embed is-type-video is-provider-videopress"><video controls src="https://crowdsignal.files.wordpress.com/2021/11/add-poll-tutorial-720.mp4"></video></figure>
567
  <!-- /wp:video -->
568
 
569
  <!-- wp:spacer {"height":60} -->
@@ -590,8 +590,8 @@ class WP_Polldaddy {
590
  <p>Don\'t miss out on your customers\' feedback. Keep your door open anytime and place a feedback button on all your pages. </p>
591
  <!-- /wp:paragraph -->
592
 
593
- <!-- wp:video {"align":"center","className":"wp-block-embed is-type-video is-provider-videopress"} -->
594
- <figure class="wp-block-video aligncenter wp-block-embed is-type-video is-provider-videopress"><video controls src="https://crowdsignal.files.wordpress.com/2021/11/add-feedback-button-tutorial.mp4"></video></figure>
595
  <!-- /wp:video -->
596
 
597
  <!-- wp:spacer {"height":60} -->
@@ -624,8 +624,8 @@ class WP_Polldaddy {
624
  <p>It’s a simple block that adds two voting buttons—thumbs up, thumbs down—to your post wherever you want to place them. Customize the block in different sizes and colors, with or without a border, and with or without a visible vote counter. Put several in a single post, next to different ideas, to see how they stack up for readers. Make the block your own!</p>
625
  <!-- /wp:paragraph -->
626
 
627
- <!-- wp:video {"align":"center","className":"wp-block-embed is-type-video is-provider-videopress"} -->
628
- <figure class="wp-block-video aligncenter wp-block-embed is-type-video is-provider-videopress"><video controls src="https://crowdsignal.files.wordpress.com/2021/11/add-vote-tutorial.mp4"></video></figure>
629
  <!-- /wp:video -->
630
 
631
  <!-- wp:spacer {"height":60} -->
@@ -658,8 +658,8 @@ class WP_Polldaddy {
658
  <p>The block currently comes in three different sizes, and can be customised with a button-like styling, including a border, border radius and some colour customisation options.</p>
659
  <!-- /wp:paragraph -->
660
 
661
- <!-- wp:video {"align":"center","className":"wp-block-embed is-type-video is-provider-videopress"} -->
662
- <figure class="wp-block-video aligncenter wp-block-embed is-type-video is-provider-videopress"><video controls src="https://crowdsignal.files.wordpress.com/2021/11/add-applause-block-tutorial.mp4"></video></figure>
663
  <!-- /wp:video -->
664
 
665
  <!-- wp:spacer {"height":60} -->
@@ -728,8 +728,8 @@ class WP_Polldaddy {
728
  <p>Here is a short demo video for you that shows you how it works in less than a minute:</p>
729
  <!-- /wp:paragraph -->
730
 
731
- <!-- wp:video {"align":"center","className":"wp-block-embed is-type-video is-provider-videopress"} -->
732
- <figure class="wp-block-video aligncenter wp-block-embed is-type-video is-provider-videopress"><video controls src="https://crowdsignal.files.wordpress.com/2021/11/add-survey-tutorial-yt.mp4"></video></figure>
733
  <!-- /wp:video -->
734
 
735
  <!-- wp:spacer {"height":60} -->
@@ -782,8 +782,8 @@ class WP_Polldaddy {
782
  <p>Here is a quick tutorial video on how it works.</p>
783
  <!-- /wp:paragraph -->
784
 
785
- <!-- wp:video {"align":"center","className":"wp-block-embed is-type-video is-provider-videopress"} -->
786
- <figure class="wp-block-video aligncenter wp-block-embed is-type-video is-provider-videopress"><video controls src="https://crowdsignal.files.wordpress.com/2021/11/add-nps-tutorial-long-3.mp4"></video></figure>
787
  <!-- /wp:video -->
788
 
789
  <!-- wp:crowdsignal-forms/feedback {"surveyId":"","title":"Demo Feedback block"} /-->
@@ -1752,7 +1752,13 @@ class WP_Polldaddy {
1752
  case 'edit-poll':
1753
  ?>
1754
  <h2 id="poll-list-header">
1755
- <?php printf( __( 'Edit Poll <a href="%s" class="add-new-h2">All Polls</a> <a href="%s" class="add-new-h2">View Results</a>', 'polldaddy' ), esc_url( add_query_arg( array( 'action' => 'polls', 'poll' => false, 'message' => false ) ) ), esc_url( add_query_arg( array( 'action' => 'results', 'poll' => $poll, 'message' => false ) ) ) ); ?>
 
 
 
 
 
 
1756
  </h2>
1757
  <?php
1758
 
@@ -2073,747 +2079,22 @@ class WP_Polldaddy {
2073
  }
2074
  $this->print_errors();
2075
 
2076
- $delete_media_link = '<a href="#" class="delete-media delete hidden" title="' . esc_attr( __( 'delete this image' ) ) . '"><img src="' . $this->base_url . 'img/icon-clear-search.png" width="16" height="16" /></a>';
2077
- ?>
2078
-
2079
- <form enctype="multipart/form-data" name="send-media" action="admin-ajax.php" method="post">
2080
- <?php wp_nonce_field( 'send-media' ); ?>
2081
- <input type="hidden" value="" name="action">
2082
- <input type="hidden" value="<?php echo $this->user_code; ?>" name="uc">
2083
- <input type="hidden" value="" name="attach-id">
2084
- <input type="hidden" value="" name="media-id">
2085
- <input type="hidden" value="" name="url">
2086
- </form>
2087
-
2088
- <form name="add-answer" action="admin-ajax.php" method="post">
2089
- <?php wp_nonce_field( 'add-answer' ); ?>
2090
- <input type="hidden" value="" name="action">
2091
- <input type="hidden" value="" name="aa">
2092
- <input type="hidden" value="" name="src">
2093
- <input type="hidden" value="<?php echo isset( $_GET['iframe'] ) ? '1': '0';?>" name="popup">
2094
- </form>
2095
-
2096
- <form action="" method="post">
2097
- <div id="poststuff"><div id="post-body" class="has-sidebar has-right-sidebar">
2098
-
2099
- <div class="inner-sidebar" id="side-info-column">
2100
- <div id="submitdiv" class="postbox">
2101
- <h2 class="postbox-title"><?php _e( 'Save', 'polldaddy' ); ?></h2>
2102
- <div class="inside">
2103
- <div class="minor-publishing">
2104
-
2105
- <ul id="answer-options">
2106
-
2107
- <?php
2108
- foreach ( array( 'randomiseAnswers' => __( 'Randomize answer order', 'polldaddy' ), 'otherAnswer' => __( 'Allow other answers', 'polldaddy' ), 'multipleChoice' => __( 'Multiple choice', 'polldaddy' ), 'sharing' => __( 'Sharing', 'polldaddy' ) ) as $option => $label ) :
2109
- if ( $is_POST )
2110
- $checked = isset( $_POST[$option] ) && 'yes' === $_POST[$option] ? ' checked="checked"' : '';
2111
- else
2112
- $checked = 'yes' === $poll->$option ? ' checked="checked"' : '';
2113
- ?>
2114
-
2115
- <li>
2116
- <label for="<?php echo $option; ?>"><input type="checkbox"<?php echo $checked; ?> value="yes" id="<?php echo $option; ?>" name="<?php echo $option; ?>" /> <?php echo esc_html( $label ); ?></label>
2117
- </li>
2118
-
2119
- <?php endforeach; ?>
2120
-
2121
- </ul>
2122
- <?php
2123
- if ( $is_POST )
2124
- $style = 'yes' === isset( $_POST[$option] ) && $_POST['multipleChoice'] ? 'display:block;' : 'display:none;';
2125
- else
2126
- $style = 'yes' === $poll->multipleChoice ? 'display:block;' : 'display:none;';
2127
- ?>
2128
- <div id="numberChoices" name="numberChoices" style="padding-left:15px;<?php echo $style; ?>">
2129
- <p><?php _e( 'Number of choices', 'polldaddy' ) ?>: <select name="choices" id="choices"><option value="1"><?php _e( 'No Limit', 'polldaddy' ) ?></option>
2130
- <?php
2131
- if ( $is_POST && isset( $_POST['choices'] ) )
2132
- $choices = (int) $_POST['choices'];
2133
- else
2134
- $choices = (int) $poll->choices;
2135
-
2136
- $a = count( $answers ) - 1;
2137
-
2138
- if ( $a > 1 ) :
2139
- for ( $i=2; $i<=$a; $i++ ) :
2140
- $selected = $i == $choices ? 'selected="selected"' : '';
2141
- printf( "<option value='%d' %s>%d</option>", $i, $selected, $i );
2142
- endfor;
2143
- endif; ?>
2144
- </select>
2145
- </p>
2146
- </div>
2147
- </div>
2148
- <div id="major-publishing-actions">
2149
- <div id="publishing-action">
2150
- <?php wp_nonce_field( $poll_id ? "edit-poll_$poll_id" : 'create-poll' ); ?>
2151
- <input type="hidden" name="action" value="<?php echo $poll_id ? 'edit-poll' : 'create-poll'; ?>" />
2152
- <input type="hidden" class="polldaddy-poll-id" name="poll" value="<?php echo $poll_id; ?>" />
2153
- <input type="submit" class="button-primary" value="<?php echo esc_attr( __( 'Save Poll', 'polldaddy' ) ); ?>" />
2154
-
2155
- <?php if ( isset( $_GET['iframe'] ) && $poll_id ) : ?>
2156
- <div id="delete-action">
2157
- <input type="button" class="button polldaddy-send-to-editor" style="margin-top:8px;" value="<?php echo esc_attr( __( 'Embed in Post', 'polldaddy' ) ); ?>" />
2158
- </div>
2159
- <?php endif; ?>
2160
-
2161
- </div>
2162
- <br class="clear" />
2163
- </div>
2164
- </div>
2165
- </div>
2166
-
2167
- <div class="postbox">
2168
- <h2 class="postbox-title"><?php _e( 'Results Display', 'polldaddy' ); ?></h2>
2169
- <div class="inside">
2170
- <ul class="poll-options">
2171
-
2172
- <?php
2173
- foreach ( array( 'show' => __( 'Show results to voters', 'polldaddy' ), 'percent' => __( 'Only show percentages', 'polldaddy' ), 'hide' => __( 'Hide all results', 'polldaddy' ) ) as $value => $label ) :
2174
- if ( $is_POST )
2175
- $checked = $value === $_POST['resultsType'] ? ' checked="checked"' : '';
2176
- else
2177
- $checked = $value === $poll->resultsType ? ' checked="checked"' : '';
2178
- ?>
2179
-
2180
- <li>
2181
- <label for="resultsType-<?php echo $value; ?>"><input type="radio"<?php echo $checked; ?> value="<?php echo $value; ?>" name="resultsType" id="resultsType-<?php echo $value; ?>" /> <?php echo esc_html( $label ); ?></label>
2182
- </li>
2183
-
2184
- <?php endforeach; ?>
2185
-
2186
- </ul>
2187
- </div>
2188
- </div>
2189
-
2190
- <div class="postbox">
2191
- <h2 class="postbox-title"><?php _e( 'Repeat Voting', 'polldaddy' ); ?></h2>
2192
- <div class="inside">
2193
- <ul class="poll-options">
2194
-
2195
- <?php
2196
- foreach ( array( 'off' => __( "Don't block repeat voters", 'polldaddy' ), 'cookie' => __( 'Block by cookie (recommended)', 'polldaddy' ), 'cookieip' => __( 'Block by cookie and by IP address', 'polldaddy' ) ) as $value => $label ) :
2197
- if ( $is_POST )
2198
- $checked = $value === $_POST['blockRepeatVotersType'] ? ' checked="checked"' : '';
2199
- else
2200
- $checked = $value === $poll->blockRepeatVotersType ? ' checked="checked"' : '';
2201
- ?>
2202
-
2203
- <li>
2204
- <label for="blockRepeatVotersType-<?php echo $value; ?>"><input class="block-repeat" type="radio"<?php echo $checked; ?> value="<?php echo $value; ?>" name="blockRepeatVotersType" id="blockRepeatVotersType-<?php echo $value; ?>" /> <?php echo esc_html( $label ); ?></label>
2205
- </li>
2206
-
2207
- <?php endforeach; ?>
2208
-
2209
- </ul>
2210
-
2211
- <?php
2212
- if ( $poll->blockExpiration == 0 || $poll->blockExpiration > 604800 )
2213
- $poll->blockExpiration = 604800;
2214
- ?>
2215
- <span style="margin:6px 6px 8px;<?php echo $poll->blockRepeatVotersType == 'off' ? 'display:none;' : ''; ?>" id="cookieip_expiration_label"><label><?php _e( 'Expires: ', 'polldaddy' ); ?></label></span>
2216
- <select id="cookieip_expiration" name="cookieip_expiration" style="width: auto;<?php echo $poll->blockRepeatVotersType == 'off' ? 'display:none;' : ''; ?>">
2217
- <option value="3600" <?php echo (int) $poll->blockExpiration == 3600 ? 'selected' : ''; ?>><?php printf( __( '%d hour', 'polldaddy' ), 1 ); ?></option>
2218
- <option value="10800" <?php echo (int) $poll->blockExpiration == 10800 ? 'selected' : ''; ?>><?php printf( __( '%d hours', 'polldaddy' ), 3 ); ?></option>
2219
- <option value="21600" <?php echo (int) $poll->blockExpiration == 21600 ? 'selected' : ''; ?>><?php printf( __( '%d hours', 'polldaddy' ), 6 ); ?></option>
2220
- <option value="43200" <?php echo (int) $poll->blockExpiration == 43200 ? 'selected' : ''; ?>><?php printf( __( '%d hours', 'polldaddy' ), 12 ); ?></option>
2221
- <option value="86400" <?php echo (int) $poll->blockExpiration == 86400 ? 'selected' : ''; ?>><?php printf( __( '%d day', 'polldaddy' ), 1 ); ?></option>
2222
- <option value="604800" <?php echo (int) $poll->blockExpiration == 604800 ? 'selected' : ''; ?>><?php printf( __( '%d week', 'polldaddy' ), 1 ); ?></option>
2223
- </select>
2224
- <p><?php _e( 'Note: Blocking by cookie and IP address can be problematic for some voters.', 'polldaddy' ); ?></p>
2225
- </div>
2226
- </div>
2227
-
2228
- <div class="postbox">
2229
- <h2 class="postbox-title"><?php _e( 'Comments', 'polldaddy' ); ?></h2>
2230
- <div class="inside">
2231
- <ul class="poll-options">
2232
-
2233
- <?php
2234
- foreach ( array( 'allow' => __( "Allow comments", 'polldaddy' ), 'moderate' => __( 'Moderate first', 'polldaddy' ), 'off' => __( 'No comments', 'polldaddy' ) ) as $value => $label ) :
2235
- if ( $is_POST )
2236
- $checked = $value === $_POST['comments'] ? ' checked="checked"' : '';
2237
- else
2238
- $checked = $value === $poll->comments->___content ? ' checked="checked"' : '';
2239
- ?>
2240
-
2241
- <li>
2242
- <label for="comments-<?php echo $value; ?>"><input type="radio"<?php echo $checked; ?> value="<?php echo $value; ?>" name="comments" id="comments-<?php echo $value; ?>" /> <?php echo esc_html( $label ); ?></label>
2243
- </li>
2244
-
2245
- <?php endforeach; ?>
2246
-
2247
- </ul>
2248
- </div>
2249
- </div>
2250
- </div>
2251
-
2252
-
2253
- <div id="post-body-content" class="has-sidebar-content">
2254
-
2255
- <div id="titlediv" style="margin-top:0px;">
2256
- <div id="titlewrap">
2257
-
2258
- <table class="question">
2259
-
2260
- <tr>
2261
- <td class="question-input">
2262
- <input type="text" autocomplete="off" id="title" placeholder="<?php _e( 'Enter Question Here', 'polldaddy' ); ?>" value="<?php echo $question; ?>" tabindex="1" size="30" name="question" />
2263
- </td>
2264
- <td class="answer-media-icons" <?php echo isset( $_GET['iframe'] ) ? 'style="width: 55px !important;"' : '';?>>
2265
- <ul class="answer-media" <?php echo isset( $_GET['iframe'] ) ? 'style="min-width: 30px;"' : '';?>>
2266
- <?php if ( isset( $mediaType[999999999] ) && $mediaType[999999999] == 2 ) { ?>
2267
- <li class="media-preview image-added" style="width: 20px; height: 16px; padding-left: 5px;"><img height="16" width="16" src="<?php echo $this->base_url; ?>img/icon-report-ip-analysis.png" alt="Video Embed"><?php echo $delete_media_link;?></li>
2268
- <?php } else {
2269
- $url = '';
2270
- if ( isset($media[999999999]) ) {
2271
- $url = urldecode( $media[999999999]->img_small );
2272
-
2273
- if ( is_ssl() )
2274
- $url = preg_replace( '/http\:/', 'https:', $url );
2275
- }?>
2276
- <li class="media-preview <?php echo !empty( $url ) ? 'image-added' : ''; ?>" style="width: 20px; height: 16px; padding-left: 5px;"><?php echo $url; ?><?php echo $delete_media_link;?></li>
2277
- <?php }
2278
-
2279
- if ( !isset( $_GET['iframe'] ) ) : ?>
2280
- <li><a title="<?php echo esc_attr( __( 'Add an Image', 'polldaddy' ) ); ?>" class="thickbox media image" id="add_poll_image999999999" href="#"><img style="vertical-align:middle;" alt="<?php echo esc_attr( __( 'Add an Image', 'polldaddy' ) ); ?>" src="images/media-button-image.gif"></a></li>
2281
- <li><a title="<?php echo esc_attr( __( 'Add Audio', 'polldaddy' ) ); ?>" class="thickbox media video" id="add_poll_video999999999" href="#"><img style="vertical-align:middle;" alt="<?php echo esc_attr( __( 'Add Audio', 'polldaddy' ) ); ?>" src="images/media-button-video.gif"></a></li>
2282
- <li><a title="<?php echo esc_attr( __( 'Add Video', 'polldaddy' ) ); ?>" class="thickbox media audio" id="add_poll_audio999999999" href="#"><img style="vertical-align:middle;" alt="<?php echo esc_attr( __( 'Add Video', 'polldaddy' ) ); ?>" src="images/media-button-music.gif"></a></li>
2283
- <?php endif; ?>
2284
- </ul>
2285
-
2286
- <input type="hidden" value="<?php echo isset( $media[999999999] ) ? $media[999999999]->_id : ''; ?>" id="hMC999999999" name="media[999999999]">
2287
- <input type="hidden" value="<?php echo isset( $mediaType[999999999] ) ? $mediaType[999999999] : ''; ?>" id="hMT999999999" name="mediaType[999999999]">
2288
-
2289
- </td>
2290
- </tr>
2291
- </table>
2292
-
2293
- <?php if ( isset( $poll->_id ) && !isset( $_GET['iframe']) ): ?>
2294
- <div class="inside">
2295
- <div id="edit-slug-box" style="margin-bottom:30px;">
2296
- <strong><?php _e( 'WordPress Shortcode:', 'polldaddy' ); ?></strong>
2297
- <input type="text" style="color:#999;" value="[crowdsignal poll=<?php echo $poll->_id; ?>]" id="shortcode-field" readonly="readonly" />
2298
- <span><a href="post-new.php?content=[crowdsignal poll=<?php echo $poll->_id; ?>]" class="button"><?php _e( 'Embed Poll in New Post' ); ?></a></span>
2299
- </div>
2300
- </div>
2301
- <?php endif; ?>
2302
-
2303
- </div>
2304
- </div>
2305
-
2306
- <div id="answersdiv" class="postbox">
2307
- <h2 class="postbox-title"><?php _e( 'Answers', 'polldaddy' ); ?></h2>
2308
-
2309
- <div id="answerswrap" class="inside">
2310
- <ul id="answers">
2311
- <?php
2312
- $a = 0;
2313
- foreach ( $answers as $answer_id => $answer ) :
2314
- $a++;
2315
- $delete_link = esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'delete-answer', 'poll' => $poll_id, 'answer' => $answer_id, 'message' => false ) ), "delete-answer_$answer_id" ) );
2316
- ?>
2317
- <li>
2318
- <table class="answer">
2319
-
2320
- <tr>
2321
- <th>
2322
- <span class="handle" title="<?php echo esc_attr( __( 'click and drag to reorder' ) ); ?>"><img src="<?php echo $this->base_url; ?>img/icon-reorder.png" alt="click and drag to reorder" width="6" height="9" /></span>
2323
- </th>
2324
- <td class="answer-input">
2325
- <input type="text" autocomplete="off" placeholder="<?php echo esc_attr( __( 'Enter an answer here', 'polldaddy' ) ); ?>" id="answer-<?php echo $answer_id; ?>" value="<?php echo $answer; ?>" tabindex="2" size="30" name="answer[<?php echo $answer_id; ?>]" />
2326
- </td>
2327
- <td class="answer-media-icons" <?php echo isset( $_GET['iframe'] ) ? 'style="width: 55px !important;"' : '';?>>
2328
- <ul class="answer-media" <?php echo isset( $_GET['iframe'] ) ? 'style="min-width: 30px;"' : '';?>>
2329
- <?php if ( isset( $mediaType[$answer_id] ) && $mediaType[$answer_id] == 2 ) { ?>
2330
- <li class="media-preview image-added" style="width: 20px; height: 16px; padding-left: 5px;"><img height="16" width="16" src="<?php echo $this->base_url; ?>img/icon-report-ip-analysis.png" alt="Video Embed"><?php echo $delete_media_link;?></li>
2331
- <?php } else {
2332
- $url = '';
2333
- if ( isset($media[$answer_id]) ) {
2334
- $url = urldecode( $media[$answer_id]->img_small );
2335
-
2336
- if ( is_ssl() )
2337
- $url = preg_replace( '/http\:/', 'https:', $url );
2338
- }?>
2339
- <li class="media-preview <?php echo !empty( $url ) ? 'image-added' : ''; ?>" style="width: 20px; height: 16px; padding-left: 5px;"><?php echo $url; ?><?php echo $delete_media_link;?></li>
2340
- <?php }
2341
-
2342
- if ( !isset( $_GET['iframe'] ) ) : ?>
2343
- <li><a title="<?php echo esc_attr( __( 'Add an Image', 'polldaddy' ) ); ?>" class="thickbox media image" id="add_poll_image<?php echo $answer_id; ?>" href="#"><img style="vertical-align:middle;" alt="<?php echo esc_attr( __( 'Add an Image', 'polldaddy' ) ); ?>" src="images/media-button-image.gif"></a></li>
2344
- <li><a title="<?php echo esc_attr( __( 'Add Audio', 'polldaddy' ) ); ?>" class="thickbox media video" id="add_poll_video<?php echo $answer_id; ?>" href="#"><img style="vertical-align:middle;" alt="<?php echo esc_attr( __( 'Add Audio', 'polldaddy' ) ); ?>" src="images/media-button-video.gif"></a></li>
2345
- <li><a title="<?php echo esc_attr( __( 'Add Video', 'polldaddy' ) ); ?>" class="thickbox media audio" id="add_poll_audio<?php echo $answer_id; ?>" href="#"><img style="vertical-align:middle;" alt="<?php echo esc_attr( __( 'Add Video', 'polldaddy' ) ); ?>" src="images/media-button-music.gif"></a></li>
2346
- <?php endif; ?>
2347
- <li><a href="<?php echo $delete_link; ?>" class="delete-answer delete" title="<?php echo esc_attr( __( 'delete this answer' ) ); ?>"><img src="<?php echo $this->base_url; ?>img/icon-clear-search.png" width="16" height="16" /></a></li>
2348
-
2349
- </ul>
2350
-
2351
- <input type="hidden" value="<?php echo isset( $media[$answer_id] ) ? $media[$answer_id]->_id : ''; ?>" id="hMC<?php echo $answer_id; ?>" name="media[<?php echo $answer_id; ?>]">
2352
- <input type="hidden" value="<?php echo isset( $mediaType[$answer_id] ) ? $mediaType[$answer_id] : ''; ?>" id="hMT<?php echo $answer_id; ?>" name="mediaType[<?php echo $answer_id; ?>]">
2353
-
2354
- </td>
2355
- </tr>
2356
- </table>
2357
-
2358
- </li>
2359
-
2360
- <?php
2361
- endforeach;
2362
-
2363
- while ( 3 - $a > 0 ) :
2364
- $a++;
2365
- ?>
2366
-
2367
- <li>
2368
- <table class="answer">
2369
-
2370
- <tr>
2371
- <th>
2372
- <span class="handle" title="<?php echo esc_attr( __( 'click and drag to reorder' ) ); ?>"><img src="<?php echo $this->base_url; ?>img/icon-reorder.png" alt="click and drag to reorder" width="6" height="9" /></span>
2373
- </th>
2374
- <td class="answer-input">
2375
- <input type="text" autocomplete="off" placeholder="<?php echo esc_attr( __( 'Enter an answer here', 'polldaddy' ) ); ?>" value="" tabindex="2" size="30" name="answer[new<?php echo $a; ?>]" />
2376
- </td>
2377
- <td class="answer-media-icons" <?php echo isset( $_GET['iframe'] ) ? 'style="width:55px !important;"' : '';?>>
2378
- <ul class="answer-media" <?php echo isset( $_GET['iframe'] ) ? 'style="min-width: 30px;"' : '';?>>
2379
- <li class="media-preview" style="width: 20px; height: 16px; padding-left: 5px;"></li>
2380
- <?php
2381
- if ( !isset( $_GET['iframe'] ) ) : ?>
2382
- <li><a title="<?php echo esc_attr( __( 'Add an Image', 'polldaddy' ) ); ?>" class="thickbox media image" id="add_poll_image<?php echo $a; ?>" href="#"><img style="vertical-align:middle;" alt="<?php echo esc_attr( __( 'Add an Image', 'polldaddy' ) ); ?>" src="images/media-button-image.gif"></a></a></li>
2383
- <li><a title="<?php echo esc_attr( __( 'Add Audio', 'polldaddy' ) ); ?>" class="thickbox media video" id="add_poll_video<?php echo $a; ?>" href="#"><img style="vertical-align:middle;" alt="<?php echo esc_attr( __( 'Add Audio', 'polldaddy' ) ); ?>" src="images/media-button-video.gif"></a></a></li>
2384
- <li><a title="<?php echo esc_attr( __( 'Add Video', 'polldaddy' ) ); ?>" class="thickbox media audio" id="add_poll_audio<?php echo $a; ?>" href="#"><img style="vertical-align:middle;" alt="<?php echo esc_attr( __( 'Add Video', 'polldaddy' ) ); ?>" src="images/media-button-music.gif"></a></li>
2385
- <?php endif; ?>
2386
- <li><a href="#" class="delete-answer delete" title="<?php echo esc_attr( __( 'delete this answer' ) ); ?>"><img src="<?php echo $this->base_url; ?>img/icon-clear-search.png" width="16" height="16" /></a></li>
2387
- </ul>
2388
-
2389
- <input type="hidden" value="" id="hMC<?php echo $a; ?>" name="media[<?php echo $a; ?>]">
2390
- <input type="hidden" value="" id="hMT<?php echo $a; ?>" name="mediaType[<?php echo $a; ?>]">
2391
-
2392
- </td>
2393
- </tr>
2394
-
2395
-
2396
- </table>
2397
-
2398
-
2399
-
2400
-
2401
-
2402
- </li>
2403
-
2404
- <?php
2405
- endwhile;
2406
- ?>
2407
-
2408
- </ul>
2409
-
2410
- <p id="add-answer-holder" class="<?php echo $this->base_url; ?>">
2411
- <button class="button"><?php echo esc_html( __( 'Add New Answer', 'polldaddy' ) ); ?></button>
2412
- </p>
2413
-
2414
- </div>
2415
- </div>
2416
-
2417
- <div class="hidden-links"><div class="delete-media-link"><?php echo $delete_media_link;?></div></div>
2418
-
2419
- <div id="design" class="postbox">
2420
-
2421
- <?php $style_ID = (int) ( $is_POST ? $_POST['styleID'] : $poll->styleID );
2422
-
2423
- $iframe_view = false;
2424
- if ( isset( $_GET['iframe'] ) )
2425
- $iframe_view = true;
2426
-
2427
- $options = array(
2428
- 101 => __( 'Aluminum Narrow', 'polldaddy' ),
2429
- 102 => __( 'Aluminum Medium', 'polldaddy' ),
2430
- 103 => __( 'Aluminum Wide', 'polldaddy' ),
2431
- 104 => __( 'Plain White Narrow', 'polldaddy' ),
2432
- 105 => __( 'Plain White Medium', 'polldaddy' ),
2433
- 106 => __( 'Plain White Wide', 'polldaddy' ),
2434
- 107 => __( 'Plain Black Narrow', 'polldaddy' ),
2435
- 108 => __( 'Plain Black Medium', 'polldaddy' ),
2436
- 109 => __( 'Plain Black Wide', 'polldaddy' ),
2437
- 110 => __( 'Paper Narrow', 'polldaddy' ),
2438
- 111 => __( 'Paper Medium', 'polldaddy' ),
2439
- 112 => __( 'Paper Wide', 'polldaddy' ),
2440
- 113 => __( 'Skull Dark Narrow', 'polldaddy' ),
2441
- 114 => __( 'Skull Dark Medium', 'polldaddy' ),
2442
- 115 => __( 'Skull Dark Wide', 'polldaddy' ),
2443
- 116 => __( 'Skull Light Narrow', 'polldaddy' ),
2444
- 117 => __( 'Skull Light Medium', 'polldaddy' ),
2445
- 118 => __( 'Skull Light Wide', 'polldaddy' ),
2446
- 157 => __( 'Micro', 'polldaddy' ),
2447
- 119 => __( 'Plastic White Narrow', 'polldaddy' ),
2448
- 120 => __( 'Plastic White Medium', 'polldaddy' ),
2449
- 121 => __( 'Plastic White Wide', 'polldaddy' ),
2450
- 122 => __( 'Plastic Grey Narrow', 'polldaddy' ),
2451
- 123 => __( 'Plastic Grey Medium', 'polldaddy' ),
2452
- 124 => __( 'Plastic Grey Wide', 'polldaddy' ),
2453
- 125 => __( 'Plastic Black Narrow', 'polldaddy' ),
2454
- 126 => __( 'Plastic Black Medium', 'polldaddy' ),
2455
- 127 => __( 'Plastic Black Wide', 'polldaddy' ),
2456
- 128 => __( 'Manga Narrow', 'polldaddy' ),
2457
- 129 => __( 'Manga Medium', 'polldaddy' ),
2458
- 130 => __( 'Manga Wide', 'polldaddy' ),
2459
- 131 => __( 'Tech Dark Narrow', 'polldaddy' ),
2460
- 132 => __( 'Tech Dark Medium', 'polldaddy' ),
2461
- 133 => __( 'Tech Dark Wide', 'polldaddy' ),
2462
- 134 => __( 'Tech Grey Narrow', 'polldaddy' ),
2463
- 135 => __( 'Tech Grey Medium', 'polldaddy' ),
2464
- 136 => __( 'Tech Grey Wide', 'polldaddy' ),
2465
- 137 => __( 'Tech Light Narrow', 'polldaddy' ),
2466
- 138 => __( 'Tech Light Medium', 'polldaddy' ),
2467
- 139 => __( 'Tech Light Wide', 'polldaddy' ),
2468
- 140 => __( 'Working Male Narrow', 'polldaddy' ),
2469
- 141 => __( 'Working Male Medium', 'polldaddy' ),
2470
- 142 => __( 'Working Male Wide', 'polldaddy' ),
2471
- 143 => __( 'Working Female Narrow', 'polldaddy' ),
2472
- 144 => __( 'Working Female Medium', 'polldaddy' ),
2473
- 145 => __( 'Working Female Wide', 'polldaddy' ),
2474
- 146 => __( 'Thinking Male Narrow', 'polldaddy' ),
2475
- 147 => __( 'Thinking Male Medium', 'polldaddy' ),
2476
- 148 => __( 'Thinking Male Wide', 'polldaddy' ),
2477
- 149 => __( 'Thinking Female Narrow', 'polldaddy' ),
2478
- 150 => __( 'Thinking Female Medium', 'polldaddy' ),
2479
- 151 => __( 'Thinking Female Wide', 'polldaddy' ),
2480
- 152 => __( 'Sunset Narrow', 'polldaddy' ),
2481
- 153 => __( 'Sunset Medium', 'polldaddy' ),
2482
- 154 => __( 'Sunset Wide', 'polldaddy' ),
2483
- 155 => __( 'Music Medium', 'polldaddy' ),
2484
- 156 => __( 'Music Wide', 'polldaddy' )
2485
- );
2486
-
2487
- $polldaddy->reset();
2488
- $styles = $polldaddy->get_styles();
2489
-
2490
- $show_custom = false;
2491
- if ( !empty( $styles ) && !empty( $styles->style ) && count( $styles->style ) > 0 ) {
2492
- foreach ( (array) $styles->style as $style ) {
2493
- $options[ (int) $style->_id ] = $style->title;
2494
- }
2495
- $show_custom = true;
2496
- }
2497
-
2498
- if ( $style_ID > 18 ) {
2499
- $standard_style_ID = 0;
2500
- $custom_style_ID = $style_ID;
2501
- }
2502
- else {
2503
- $standard_style_ID = $style_ID;
2504
- $custom_style_ID = 0;
2505
- }
2506
- ?>
2507
- <h2 class="postbox-title"><?php _e( 'Poll Style', 'polldaddy' ); ?></h2>
2508
- <input type="hidden" name="styleID" id="styleID" value="<?php echo $style_ID ?>">
2509
- <div class="inside">
2510
-
2511
- <ul class="pd-tabs">
2512
- <li class="selected" id="pd-styles"><a href="#"><?php _e( 'Crowdsignal Styles', 'polldaddy' ); ?></a><input type="checkbox" style="display:none;" id="regular"/></li>
2513
- <?php $hide = $show_custom == true ? ' style="display:block;"' : ' style="display:none;"'; ?>
2514
- <li id="pd-custom-styles" <?php echo $hide; ?>><a href="#"><?php _e( 'Custom Styles', 'polldaddy' ); ?></a><input type="checkbox" style="display:none;" id="custom"/></li>
2515
-
2516
- </ul>
2517
-
2518
- <div class="pd-tab-panel show" id="pd-styles-panel">
2519
-
2520
-
2521
- <?php if ( $iframe_view ) { ?>
2522
- <div id="design_standard" style="padding:0px;padding-top:10px;">
2523
- <div class="hide-if-no-js">
2524
- <table class="pollStyle">
2525
- <thead>
2526
- <tr>
2527
- <th>
2528
- <div style="display:none;">
2529
- <input type="radio" name="styleTypeCB" id="regular" onclick="javascript:pd_build_styles( 0 );"/>
2530
- </div>
2531
- </th>
2532
- </tr>
2533
- </thead>
2534
- <tr>
2535
- <td class="selector" style="width:120px;">
2536
- <table class="st_selector">
2537
- <tr>
2538
- <td class="dir_left" style="padding:0px;width:30px;">
2539
- <a href="javascript:pd_move('prev');" style="display: block;font-size: 3.2em;text-decoration: none;">&#171;</a>
2540
- </td>
2541
- <td class="img"><div class="st_image_loader"><div id="st_image" onmouseover="st_results(this, 'show');" onmouseout="st_results(this, 'hide');"></div></div></td>
2542
- <td class="dir_right" style="padding:0px;width:30px;">
2543
- <a href="javascript:pd_move('next');" style="display: block;padding-left:20px;font-size: 3.2em;text-decoration: none;">&#187;</a>
2544
- </td>
2545
- </tr>
2546
- <tr>
2547
- <td></td>
2548
- <td class="counter">
2549
- <div id="st_number"></div>
2550
- </td>
2551
- <td></td>
2552
- </tr>
2553
- <tr>
2554
- <td></td>
2555
- <td class="title">
2556
- <div id="st_name"></div>
2557
- </td>
2558
- <td></td>
2559
- </tr>
2560
- <tr>
2561
- <td></td>
2562
- <td>
2563
- <div id="st_sizes"></div>
2564
- </td>
2565
- <td></td>
2566
- </tr>
2567
- <tr>
2568
- <td colspan="3">
2569
- <div style="width:230px;" id="st_description"></div>
2570
- </td>
2571
- </tr>
2572
- </table>
2573
- </td>
2574
- </tr>
2575
- </table>
2576
- </div>
2577
-
2578
- <p class="empty-if-js" id="no-js-styleID">
2579
- <select id="styleID" name="styleID">
2580
-
2581
- <?php foreach ( $options as $styleID => $label ) :
2582
- $selected = $styleID == $style_ID ? ' selected="selected"' : ''; ?>
2583
- <option value="<?php echo (int) $styleID; ?>"<?php echo $selected; ?>><?php echo esc_html( $label ); ?></option>
2584
- <?php endforeach; ?>
2585
-
2586
- </select>
2587
- </p>
2588
- </div>
2589
- <?php } else {?>
2590
-
2591
- <div class="design_standard">
2592
- <div class="hide-if-no-js">
2593
- <table class="pollStyle">
2594
- <thead>
2595
- <tr style="display:none;">
2596
- <th class="cb">
2597
-
2598
- <input type="radio" name="styleTypeCB" id="regular" onclick="javascript:pd_build_styles( 0 );"/>
2599
- <label for="skin" onclick="javascript:pd_build_styles( 0 );"><?php _e( 'Crowdsignal Style', 'polldaddy' ); ?></label>
2600
-
2601
- <?php $disabled = $show_custom == false ? ' disabled="true"' : ''; ?>
2602
-
2603
- <input type="radio" name="styleTypeCB" id="custom" onclick="javascript:pd_change_style(_$('customSelect').value);" <?php echo $disabled; ?> />
2604
-
2605
- <label onclick="javascript:pd_change_style(_$('customSelect').value);"><?php _e( 'Custom Style', 'polldaddy' ); ?></label>
2606
-
2607
- <th>
2608
- </tr>
2609
- </thead>
2610
- <tbody>
2611
- <tr>
2612
- <td style="text-align:center">
2613
- <table class="st_selector" style="margin:20px auto;">
2614
- <tr>
2615
- <td class="dir_left">
2616
- <a href="javascript:pd_move('prev');" style="width: 1em;display: block;font-size: 4em;text-decoration: none;">&#171;</a>
2617
- </td>
2618
- <td class="img"><div class="st_image_loader"><div id="st_image" onmouseover="st_results(this, 'show');" onmouseout="st_results(this, 'hide');"></div></div></td>
2619
- <td class="dir_right">
2620
- <a href="javascript:pd_move('next');" style="width: 1em;display: block;font-size: 4em;text-decoration: none;">&#187;</a>
2621
- </td>
2622
- </tr>
2623
- <tr>
2624
- <td></td>
2625
- <td class="counter">
2626
- <div id="st_number"></div>
2627
- </td>
2628
- <td></td>
2629
- </tr>
2630
- <tr>
2631
- <td></td>
2632
- <td class="title">
2633
- <div id="st_name"></div>
2634
- </td>
2635
- <td></td>
2636
- </tr>
2637
- <tr>
2638
- <td></td>
2639
- <td>
2640
- <div id="st_sizes"></div>
2641
- </td>
2642
- <td></td>
2643
- </tr>
2644
- <tr>
2645
- <td colspan="3">
2646
- <div id="st_description"></div>
2647
- </td>
2648
- </tr>
2649
- </table>
2650
- </td>
2651
-
2652
- </tr>
2653
- </tbody>
2654
- </table>
2655
- </div>
2656
- <p class="empty-if-js" id="no-js-styleID">
2657
- <select id="styleID" name="styleID">
2658
-
2659
- <?php foreach ( $options as $styleID => $label ) :
2660
- $selected = $styleID == $style_ID ? ' selected="selected"' : ''; ?>
2661
- <option value="<?php echo (int) $styleID; ?>"<?php echo $selected; ?>><?php echo esc_html( $label ); ?></option>
2662
- <?php endforeach; ?>
2663
-
2664
- </select>
2665
- </p>
2666
- </div>
2667
- <?php } ?>
2668
-
2669
-
2670
-
2671
-
2672
- </div>
2673
-
2674
-
2675
- <div class="pd-tab-panel" id="pd-custom-styles-panel">
2676
- <div style="padding:20px;">
2677
- <?php if ( $show_custom ) : ?>
2678
- <p><a href="<?php echo esc_url( add_query_arg( array( 'action' => 'list-styles', 'poll' => false, 'style' => false, 'message' => false, 'preload' => false ) ) );?>" class="add-new-h2">All Styles</a></p>
2679
- <select id="customSelect" name="customSelect" onchange="javascript:pd_change_style(this.value);">
2680
- <?php $selected = $custom_style_ID == 0 ? ' selected="selected"' : ''; ?>
2681
- <option value="x"<?php echo $selected; ?>><?php _e( 'Please choose a custom style…', 'polldaddy' ); ?></option>
2682
- <?php foreach ( (array)$styles->style as $style ) :
2683
- $selected = $style->_id == $custom_style_ID ? ' selected="selected"' : ''; ?>
2684
- <option value="<?php echo (int) $style->_id; ?>"<?php echo $selected; ?>><?php echo esc_html( $style->title ); ?></option>
2685
- <?php endforeach; ?>
2686
- </select>
2687
- <div id="styleIDErr" class="formErr" style="display:none;"><?php _e( 'Please choose a style.', 'polldaddy' ); ?></div>
2688
- <?php else : ?>
2689
- <p><?php _e( 'You currently have no custom styles created.', 'polldaddy' ); ?> <a href="/wp-admin/edit.php?page=polls&amp;action=create-style" class="add-new-h2"><?php _e( 'New Style', 'polldaddy');?></a></p>
2690
- <p><?php printf( __( 'Did you know we have a new editor for building your own custom poll styles? Find out more <a href="%s" target="_blank">here</a>.', 'polldaddy' ), 'https://crowdsignal.com/support/custom-poll-styles/' ); ?></p>
2691
- <?php endif; ?>
2692
- </div>
2693
-
2694
-
2695
-
2696
-
2697
- </div>
2698
-
2699
-
2700
-
2701
-
2702
- <script language="javascript">
2703
- jQuery( document ).ready(function(){
2704
- plugin = new Plugin( {
2705
- delete_rating: '<?php echo esc_attr( __( 'Are you sure you want to delete the rating for "%s"?', 'polldaddy' ) ); ?>',
2706
- delete_poll: '<?php echo esc_attr( __( 'Are you sure you want to delete "%s"?', 'polldaddy' ) ); ?>',
2707
- delete_answer: '<?php echo esc_attr( __( 'Are you sure you want to delete this answer?', 'polldaddy' ) ); ?>',
2708
- new_answer_test: '<?php echo esc_attr( __( 'Enter an answer here', 'polldaddy' ) ); ?>',
2709
- delete_answer_title: '<?php echo esc_attr( __( 'delete this answer', 'polldaddy' ) ); ?>',
2710
- reorder_answer_title: '<?php echo esc_attr( __( 'click and drag to reorder', 'polldaddy' ) ); ?>',
2711
- add_image_title: '<?php echo esc_attr( __( 'Add an Image', 'polldaddy' ) ); ?>',
2712
- add_audio_title: '<?php echo esc_attr( __( 'Add Audio', 'polldaddy' ) ); ?>',
2713
- add_video_title: '<?php echo esc_attr( __( 'Add Video', 'polldaddy' ) ); ?>',
2714
- standard_styles: '<?php echo esc_attr( __( 'Standard Styles', 'polldaddy' ) ); ?>',
2715
- custom_styles: '<?php echo esc_attr( __( 'Custom Styles', 'polldaddy' ) ); ?>',
2716
- base_url: '<?php echo esc_attr( $this->base_url ); ?>'
2717
- } );
2718
- });
2719
- </script>
2720
- <script language="javascript">
2721
- current_pos = 0;
2722
-
2723
- for( var key in styles_array ) {
2724
- var name = styles_array[key].name;
2725
-
2726
- switch( name ){
2727
- case 'Aluminum':
2728
- styles_array[key].name = '<?php echo esc_attr( __( 'Aluminum', 'polldaddy' ) ); ?>';
2729
- break;
2730
- case 'Plain White':
2731
- styles_array[key].name = '<?php echo esc_attr( __( 'Plain White', 'polldaddy' ) ); ?>';
2732
- break;
2733
- case 'Plain Black':
2734
- styles_array[key].name = '<?php echo esc_attr( __( 'Plain Black', 'polldaddy' ) ); ?>';
2735
- break;
2736
- case 'Paper':
2737
- styles_array[key].name = '<?php echo esc_attr( __( 'Paper', 'polldaddy' ) ); ?>';
2738
- break;
2739
- case 'Skull Dark':
2740
- styles_array[key].name = '<?php echo esc_attr( __( 'Skull Dark', 'polldaddy' ) ); ?>';
2741
- break;
2742
- case 'Skull Light':
2743
- styles_array[key].name = '<?php echo esc_attr( __( 'Skull Light', 'polldaddy' ) ); ?>';
2744
- break;
2745
- case 'Micro':
2746
- styles_array[key].name = '<?php echo esc_attr( __( 'Micro', 'polldaddy' ) ); ?>';
2747
- styles_array[key].n_desc = '<?php echo esc_attr( __( 'Width 150px, the micro style is useful when space is tight.', 'polldaddy' ) ); ?>';
2748
- break;
2749
- case 'Plastic White':
2750
- styles_array[key].name = '<?php echo esc_attr( __( 'Plastic White', 'polldaddy' ) ); ?>';
2751
- break;
2752
- case 'Plastic Grey':
2753
- styles_array[key].name = '<?php echo esc_attr( __( 'Plastic Grey', 'polldaddy' ) ); ?>';
2754
- break;
2755
- case 'Plastic Black':
2756
- styles_array[key].name = '<?php echo esc_attr( __( 'Plastic Black', 'polldaddy' ) ); ?>';
2757
- break;
2758
- case 'Manga':
2759
- styles_array[key].name = '<?php echo esc_attr( __( 'Manga', 'polldaddy' ) ); ?>';
2760
- break;
2761
- case 'Tech Dark':
2762
- styles_array[key].name = '<?php echo esc_attr( __( 'Tech Dark', 'polldaddy' ) ); ?>';
2763
- break;
2764
- case 'Tech Grey':
2765
- styles_array[key].name = '<?php echo esc_attr( __( 'Tech Grey', 'polldaddy' ) ); ?>';
2766
- break;
2767
- case 'Tech Light':
2768
- styles_array[key].name = '<?php echo esc_attr( __( 'Tech Light', 'polldaddy' ) ); ?>';
2769
- break;
2770
- case 'Working Male':
2771
- styles_array[key].name = '<?php echo esc_attr( __( 'Working Male', 'polldaddy' ) ); ?>';
2772
- break;
2773
- case 'Working Female':
2774
- styles_array[key].name = '<?php echo esc_attr( __( 'Working Female', 'polldaddy' ) ); ?>';
2775
- break;
2776
- case 'Thinking Male':
2777
- styles_array[key].name = '<?php echo esc_attr( __( 'Thinking Male', 'polldaddy' ) ); ?>';
2778
- break;
2779
- case 'Thinking Female':
2780
- styles_array[key].name = '<?php echo esc_attr( __( 'Thinking Female', 'polldaddy' ) ); ?>';
2781
- break;
2782
- case 'Sunset':
2783
- styles_array[key].name = '<?php echo esc_attr( __( 'Sunset', 'polldaddy' ) ); ?>';
2784
- break;
2785
- case 'Music':
2786
- styles_array[key].name = '<?php echo esc_attr( __( 'Music', 'polldaddy' ) ); ?>';
2787
- break;
2788
- }
2789
- }
2790
- pd_map = {
2791
- wide : '<?php echo esc_attr( __( 'Wide', 'polldaddy' ) ); ?>',
2792
- medium : '<?php echo esc_attr( __( 'Medium', 'polldaddy' ) ); ?>',
2793
- narrow : '<?php echo esc_attr( __( 'Narrow', 'polldaddy' ) ); ?>',
2794
- style_desc_wide : '<?php echo esc_attr( __( 'Width: 630px, the wide style is good for blog posts.', 'polldaddy' ) ); ?>',
2795
- style_desc_medium : '<?php echo esc_attr( __( 'Width: 300px, the medium style is good for general use.', 'polldaddy' ) ); ?>',
2796
- style_desc_narrow : '<?php echo esc_attr( __( 'Width 150px, the narrow style is good for sidebars etc.', 'polldaddy' ) ); ?>',
2797
- style_desc_micro : '<?php echo esc_attr( __( 'Width 150px, the micro style is useful when space is tight.', 'polldaddy' ) ); ?>',
2798
- image_path : '<?php echo plugins_url( 'img', __FILE__ );?>'
2799
- }
2800
- pd_build_styles( current_pos );
2801
- <?php if ( $style_ID > 0 && $style_ID <= 1000 ) { ?>
2802
- pd_pick_style( <?php echo $style_ID ?> );
2803
- <?php }else { ?>
2804
- pd_change_style( <?php echo $style_ID ?> );
2805
- <?php } ?>
2806
- </script>
2807
- </div>
2808
-
2809
- </div>
2810
-
2811
- </div>
2812
- </div></div>
2813
- </form>
2814
- <br class="clear" />
2815
-
2816
- <?php
2817
  }
2818
 
2819
  function poll_results_page( $poll_id ) {
5
  * Description: Create and manage Crowdsignal polls and ratings in WordPress
6
  * Author: Automattic, Inc.
7
  * Author URL: https://crowdsignal.com/
8
+ * Version: 3.0.8
9
  */
10
 
11
  // To hardcode your Polldaddy PartnerGUID (API Key), add the (uncommented) line below with the PartnerGUID to your `wp-config.php`
562
  <p>Here is a short demo video for how to set up this block, not that you would need it ;) </p>
563
  <!-- /wp:paragraph -->
564
 
565
+ <!-- wp:video {"src":"https://crowdsignal.files.wordpress.com/2021/11/add-poll-tutorial-720.mp4"} -->
566
+ <figure class="wp-block-video"><video controls src="https://crowdsignal.files.wordpress.com/2021/11/add-poll-tutorial-720.mp4"></video></figure>
567
  <!-- /wp:video -->
568
 
569
  <!-- wp:spacer {"height":60} -->
590
  <p>Don\'t miss out on your customers\' feedback. Keep your door open anytime and place a feedback button on all your pages. </p>
591
  <!-- /wp:paragraph -->
592
 
593
+ <!-- wp:video {"src":"https://crowdsignal.files.wordpress.com/2021/11/add-feedback-button-tutorial.mp4"} -->
594
+ <figure class="wp-block-video"><video controls src="https://crowdsignal.files.wordpress.com/2021/11/add-feedback-button-tutorial.mp4"></video></figure>
595
  <!-- /wp:video -->
596
 
597
  <!-- wp:spacer {"height":60} -->
624
  <p>It’s a simple block that adds two voting buttons—thumbs up, thumbs down—to your post wherever you want to place them. Customize the block in different sizes and colors, with or without a border, and with or without a visible vote counter. Put several in a single post, next to different ideas, to see how they stack up for readers. Make the block your own!</p>
625
  <!-- /wp:paragraph -->
626
 
627
+ <!-- wp:video {"src":"https://crowdsignal.files.wordpress.com/2021/11/add-vote-tutorial.mp4"} -->
628
+ <figure class="wp-block-video"><video controls src="https://crowdsignal.files.wordpress.com/2021/11/add-vote-tutorial.mp4"></video></figure>
629
  <!-- /wp:video -->
630
 
631
  <!-- wp:spacer {"height":60} -->
658
  <p>The block currently comes in three different sizes, and can be customised with a button-like styling, including a border, border radius and some colour customisation options.</p>
659
  <!-- /wp:paragraph -->
660
 
661
+ <!-- wp:video {"src": "https://crowdsignal.files.wordpress.com/2021/11/add-applause-block-tutorial.mp4"} -->
662
+ <figure class="wp-block-video"><video controls src="https://crowdsignal.files.wordpress.com/2021/11/add-applause-block-tutorial.mp4"></video></figure>
663
  <!-- /wp:video -->
664
 
665
  <!-- wp:spacer {"height":60} -->
728
  <p>Here is a short demo video for you that shows you how it works in less than a minute:</p>
729
  <!-- /wp:paragraph -->
730
 
731
+ <!-- wp:video {"src": "https://crowdsignal.files.wordpress.com/2021/11/add-survey-tutorial-yt.mp4"} -->
732
+ <figure class="wp-block-video"><video controls src="https://crowdsignal.files.wordpress.com/2021/11/add-survey-tutorial-yt.mp4"></video></figure>
733
  <!-- /wp:video -->
734
 
735
  <!-- wp:spacer {"height":60} -->
782
  <p>Here is a quick tutorial video on how it works.</p>
783
  <!-- /wp:paragraph -->
784
 
785
+ <!-- wp:video {"src": "https://crowdsignal.files.wordpress.com/2021/11/add-nps-tutorial-long-3.mp4"} -->
786
+ <figure class="wp-block-video"><video controls src="https://crowdsignal.files.wordpress.com/2021/11/add-nps-tutorial-long-3.mp4"></video></figure>
787
  <!-- /wp:video -->
788
 
789
  <!-- wp:crowdsignal-forms/feedback {"surveyId":"","title":"Demo Feedback block"} /-->
1752
  case 'edit-poll':
1753
  ?>
1754
  <h2 id="poll-list-header">
1755
+ <?php
1756
+ printf(
1757
+ __( 'Edit Poll <a href="%s" class="add-new-h2">All Polls</a> <a href="%s" class="add-new-h2">View Results</a>', 'polldaddy' ),
1758
+ esc_url( add_query_arg( array( 'action' => 'polls', 'poll' => false, 'message' => false ) ) ),
1759
+ esc_url( add_query_arg( array( 'action' => 'results', 'poll' => $poll, 'message' => false ) ) )
1760
+ );
1761
+ ?>
1762
  </h2>
1763
  <?php
1764
 
2079
  }
2080
  $this->print_errors();
2081
 
2082
+ $view_vars = [
2083
+ 'delete_media_link' => $delete_media_link,
2084
+ 'polldaddy' => $polldaddy,
2085
+ 'controller' => $this,
2086
+ 'poll' => $poll,
2087
+ 'poll_id' => $poll_id,
2088
+ 'is_post' => $is_POST,
2089
+ 'base_url' => $this->base_url,
2090
+ 'preview_img_dir' => plugins_url( 'img', __FILE__ ),
2091
+ 'question' => $question,
2092
+ 'answers' => $answers,
2093
+ 'media' => $media,
2094
+ 'media_type' => $mediaType,
2095
+ ];
2096
+
2097
+ $this->render_partial( 'poll-edit-form', $view_vars );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2098
  }
2099
 
2100
  function poll_results_page( $poll_id ) {
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: crowdsignal, polls, poll, polldaddy, wppolls, vote, polling, surveys, rate
4
  Requires at least: 5.5
5
  Requires PHP: 5.6
6
  Tested up to: 5.9
7
- Stable tag: 3.0.7
8
 
9
  == Description ==
10
 
@@ -93,6 +93,10 @@ Minor bugfix release
93
 
94
  == Changelog ==
95
 
 
 
 
 
96
  = 3.0.7
97
  * Small fixes to setting page styles. (78)
98
  * Fix the title of the Dashboard page. (79)
4
  Requires at least: 5.5
5
  Requires PHP: 5.6
6
  Tested up to: 5.9
7
+ Stable tag: 3.0.8
8
 
9
  == Description ==
10
 
93
 
94
  == Changelog ==
95
 
96
+ = 3.0.8
97
+ * Bug and security fixes
98
+ * Improve code readability
99
+
100
  = 3.0.7
101
  * Small fixes to setting page styles. (78)
102
  * Fix the title of the Dashboard page. (79)