-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpopups.php
94 lines (87 loc) · 3.96 KB
/
popups.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
<?php
if ( function_exists( 'add_action' ) == false )
die( "Cheatin' eh?" );
function pd_video_shortcodes_help($video_form) {
return '
<table class="describe"><tbody>
<tr>
<th valign="top" scope="row" class="label">
<span class="alignleft"><label for="insertonly[href]">' . __('URL', 'polldaddy') . '</label></span>
<span class="alignright"><abbr title="required" class="required">*</abbr></span>
</th>
<td class="field"><input type="text" id="insertonly[href]" name="insertonly[href]" value="" /></td>
</tr>
<tr>
<td colspan="2">
<p>' . __('Paste your YouTube or Google Video URL above, or use the examples below.', 'polldaddy') . '</p>
<ul class="short-code-list">
<li>' . sprintf( __('<a href="%s" target="_blank">YouTube instructions</a> %s', 'polldaddy'), 'http://support.wordpress.com/videos/youtube/', '<code>[youtube=http://www.youtube.com/watch?v=cXXm696UbKY]</code>' ) .'</li>
<li>' . sprintf( __('<a href="%s" target="_blank">Google instructions</a> %s', 'polldaddy') , 'http://support.wordpress.com/videos/google-video/', '<code>[googlevideo=http://video.google.com/googleplayer.swf?docId=-8459301055248673864]</code>' ) . '</li>
<li>' . sprintf( __('<a href="%s" target="_blank">DailyMotion instructions</a> %s', 'polldaddy'), 'http://support.wordpress.com/videos/dailymotion/', '<code>[dailymotion id=5zYRy1JLhuGlP3BGw]</code>' ) . '</li>
</ul>
</td>
</tr>
<tr>
<td></td>
<td>
<input type="submit" class="button" name="insertonlybutton" value="' . esc_attr( __('Insert into Poll', 'polldaddy') ) . '" />
</td>
</tr>
</tbody></table>
';
}
function pd_audio_shortcodes_help($audio_form) {
return '
<table class="describe"><tbody>
<tr>
<th valign="top" scope="row" class="label">
<span class="alignleft"><label for="insertonly[href]">' . __('Audio File URL', 'polldaddy') . '</label></span>
<span class="alignright"><abbr title="required" class="required">*</abbr></span>
</th>
<td class="field"><input id="insertonly[href]" name="insertonly[href]" value="" type="text" aria-required="true"></td>
</tr>
<tr>
<td></td>
<td>
<input type="submit" class="button" name="insertonlybutton" value="' . esc_attr( __('Insert into Poll', 'polldaddy') ) . '" />
</td>
</tr>
</tbody></table>
';
}
function pd_image_shortcodes_help($image_form) {
return '
<h4 class="media-sub-title">' . __('Insert an image from another web site', 'polldaddy') . '</h4>
<table class="describe"><tbody>
<tr>
<th valign="top" scope="row" class="label" style="width:130px;">
<span class="alignleft"><label for="src">' . __('Image URL', 'polldaddy') . '</label></span>
<span class="alignright"><abbr id="status_img" title="required" class="required">*</abbr></span>
</th>
<td class="field"><input id="src" name="src" value="" type="text" aria-required="true" onblur="addExtImage.getImageData()" /></td>
</tr>
<tr>
<th valign="top" scope="row" class="label">
<span class="alignleft"><label for="title">' . __('Image Title', 'polldaddy') . '</label></span>
<span class="alignright"><abbr title="required" class="required">*</abbr></span>
</th>
<td class="field"><input id="alt" name="alt" value="" type="hidden" /><input id="url" name="url" value="" type="hidden" /><input id="caption" name="caption" value="" type="hidden" /><input id="title" name="title" value="" type="text" aria-required="true" /></td>
</tr>
<tr>
<td></td>
<td>
<input type="button" value="' . esc_attr( __('Insert into Poll', 'polldaddy') ) . '" onclick="addExtImage.insert()" style="color: rgb(187, 187, 187);" id="go_button" class="button">
</td>
</tr>
</tbody></table>
';
}
function polldaddy_popups_init() {
if( isset( $_REQUEST['polls_media'] ) ){
add_filter( 'type_url_form_video', 'pd_video_shortcodes_help');
add_filter( 'type_url_form_audio', 'pd_audio_shortcodes_help');
add_filter( 'type_url_form_image', 'pd_image_shortcodes_help');
}
}
add_action( 'admin_init', 'polldaddy_popups_init' );
?>