author | Anthony Ly <anthonyly.com@gmail.com> |
Wed, 19 Dec 2012 17:46:52 -0800 | |
changeset 204 | 09a1c134465b |
parent 194 | 32102edaa81b |
permissions | -rw-r--r-- |
136 | 1 |
<?php |
2 |
/** |
|
3 |
* Press This Display and Handler. |
|
4 |
* |
|
5 |
* @package WordPress |
|
6 |
* @subpackage Press_This |
|
7 |
*/ |
|
8 |
||
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
9 |
define('IFRAME_REQUEST' , true); |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
10 |
|
136 | 11 |
/** WordPress Administration Bootstrap */ |
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
12 |
require_once('./admin.php'); |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
13 |
|
136 | 14 |
header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); |
15 |
||
204
09a1c134465b
man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents:
194
diff
changeset
|
16 |
if ( ! current_user_can( 'edit_posts' ) || ! current_user_can( get_post_type_object( 'post' )->cap->create_posts ) ) |
136 | 17 |
wp_die( __( 'Cheatin’ uh?' ) ); |
18 |
||
19 |
/** |
|
20 |
* Press It form handler. |
|
21 |
* |
|
22 |
* @package WordPress |
|
23 |
* @subpackage Press_This |
|
24 |
* @since 2.6.0 |
|
25 |
* |
|
26 |
* @return int Post ID |
|
27 |
*/ |
|
28 |
function press_it() { |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
29 |
|
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
30 |
$post = get_default_post_to_edit(); |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
31 |
$post = get_object_vars($post); |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
32 |
$post_ID = $post['ID'] = (int) $_POST['post_id']; |
136 | 33 |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
34 |
if ( !current_user_can('edit_post', $post_ID) ) |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
35 |
wp_die(__('You are not allowed to edit this post.')); |
136 | 36 |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
37 |
$post['post_category'] = isset($_POST['post_category']) ? $_POST['post_category'] : ''; |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
38 |
$post['tax_input'] = isset($_POST['tax_input']) ? $_POST['tax_input'] : ''; |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
39 |
$post['post_title'] = isset($_POST['title']) ? $_POST['title'] : ''; |
136 | 40 |
$content = isset($_POST['content']) ? $_POST['content'] : ''; |
41 |
||
42 |
$upload = false; |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
43 |
if ( !empty($_POST['photo_src']) && current_user_can('upload_files') ) { |
136 | 44 |
foreach( (array) $_POST['photo_src'] as $key => $image) { |
45 |
// see if files exist in content - we don't want to upload non-used selected files. |
|
46 |
if ( strpos($_POST['content'], htmlspecialchars($image)) !== false ) { |
|
47 |
$desc = isset($_POST['photo_description'][$key]) ? $_POST['photo_description'][$key] : ''; |
|
48 |
$upload = media_sideload_image($image, $post_ID, $desc); |
|
49 |
||
50 |
// Replace the POSTED content <img> with correct uploaded ones. Regex contains fix for Magic Quotes |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
51 |
if ( !is_wp_error($upload) ) |
136 | 52 |
$content = preg_replace('/<img ([^>]*)src=\\\?(\"|\')'.preg_quote(htmlspecialchars($image), '/').'\\\?(\2)([^>\/]*)\/*>/is', $upload, $content); |
53 |
} |
|
54 |
} |
|
55 |
} |
|
56 |
// set the post_content and status |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
57 |
$post['post_content'] = $content; |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
58 |
if ( isset( $_POST['publish'] ) && current_user_can( 'publish_posts' ) ) |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
59 |
$post['post_status'] = 'publish'; |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
60 |
elseif ( isset( $_POST['review'] ) ) |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
61 |
$post['post_status'] = 'pending'; |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
62 |
else |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
63 |
$post['post_status'] = 'draft'; |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
64 |
|
136 | 65 |
// error handling for media_sideload |
66 |
if ( is_wp_error($upload) ) { |
|
67 |
wp_delete_post($post_ID); |
|
68 |
wp_die($upload); |
|
69 |
} else { |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
70 |
// Post formats |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
71 |
if ( isset( $_POST['post_format'] ) ) { |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
72 |
if ( current_theme_supports( 'post-formats', $_POST['post_format'] ) ) |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
73 |
set_post_format( $post_ID, $_POST['post_format'] ); |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
74 |
elseif ( '0' == $_POST['post_format'] ) |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
75 |
set_post_format( $post_ID, false ); |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
76 |
} |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
77 |
|
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
78 |
$post_ID = wp_update_post($post); |
136 | 79 |
} |
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
80 |
|
136 | 81 |
return $post_ID; |
82 |
} |
|
83 |
||
84 |
// For submitted posts. |
|
85 |
if ( isset($_REQUEST['action']) && 'post' == $_REQUEST['action'] ) { |
|
86 |
check_admin_referer('press-this'); |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
87 |
$posted = $post_ID = press_it(); |
136 | 88 |
} else { |
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
89 |
$post = get_default_post_to_edit('post', true); |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
90 |
$post_ID = $post->ID; |
136 | 91 |
} |
92 |
||
93 |
// Set Variables |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
94 |
$title = isset( $_GET['t'] ) ? trim( strip_tags( html_entity_decode( stripslashes( $_GET['t'] ) , ENT_QUOTES) ) ) : ''; |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
95 |
|
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
96 |
$selection = ''; |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
97 |
if ( !empty($_GET['s']) ) { |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
98 |
$selection = str_replace(''', "'", stripslashes($_GET['s'])); |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
99 |
$selection = trim( htmlspecialchars( html_entity_decode($selection, ENT_QUOTES) ) ); |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
100 |
} |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
101 |
|
136 | 102 |
if ( ! empty($selection) ) { |
103 |
$selection = preg_replace('/(\r?\n|\r)/', '</p><p>', $selection); |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
104 |
$selection = '<p>' . str_replace('<p></p>', '', $selection) . '</p>'; |
136 | 105 |
} |
106 |
||
107 |
$url = isset($_GET['u']) ? esc_url($_GET['u']) : ''; |
|
108 |
$image = isset($_GET['i']) ? $_GET['i'] : ''; |
|
109 |
||
110 |
if ( !empty($_REQUEST['ajax']) ) { |
|
111 |
switch ($_REQUEST['ajax']) { |
|
112 |
case 'video': ?> |
|
204
09a1c134465b
man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents:
194
diff
changeset
|
113 |
<script type="text/javascript"> |
136 | 114 |
/* <![CDATA[ */ |
115 |
jQuery('.select').click(function() { |
|
116 |
append_editor(jQuery('#embed-code').val()); |
|
117 |
jQuery('#extra-fields').hide(); |
|
118 |
jQuery('#extra-fields').html(''); |
|
119 |
}); |
|
120 |
jQuery('.close').click(function() { |
|
121 |
jQuery('#extra-fields').hide(); |
|
122 |
jQuery('#extra-fields').html(''); |
|
123 |
}); |
|
124 |
/* ]]> */ |
|
125 |
</script> |
|
126 |
<div class="postbox"> |
|
127 |
<h2><label for="embed-code"><?php _e('Embed Code') ?></label></h2> |
|
128 |
<div class="inside"> |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
129 |
<textarea name="embed-code" id="embed-code" rows="8" cols="40"><?php echo esc_textarea( $selection ); ?></textarea> |
136 | 130 |
<p id="options"><a href="#" class="select button"><?php _e('Insert Video'); ?></a> <a href="#" class="close button"><?php _e('Cancel'); ?></a></p> |
131 |
</div> |
|
132 |
</div> |
|
133 |
<?php break; |
|
134 |
||
135 |
case 'photo_thickbox': ?> |
|
204
09a1c134465b
man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents:
194
diff
changeset
|
136 |
<script type="text/javascript"> |
136 | 137 |
/* <![CDATA[ */ |
138 |
jQuery('.cancel').click(function() { |
|
139 |
tb_remove(); |
|
140 |
}); |
|
141 |
jQuery('.select').click(function() { |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
142 |
image_selector(this); |
136 | 143 |
}); |
144 |
/* ]]> */ |
|
145 |
</script> |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
146 |
<h3 class="tb"><label for="tb_this_photo_description"><?php _e('Description') ?></label></h3> |
136 | 147 |
<div class="titlediv"> |
148 |
<div class="titlewrap"> |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
149 |
<input id="tb_this_photo_description" name="photo_description" class="tb_this_photo_description tbtitle text" onkeypress="if(event.keyCode==13) image_selector(this);" value="<?php echo esc_attr($title);?>"/> |
136 | 150 |
</div> |
151 |
</div> |
|
152 |
||
153 |
<p class="centered"> |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
154 |
<input type="hidden" name="this_photo" value="<?php echo esc_attr($image); ?>" id="tb_this_photo" class="tb_this_photo" /> |
136 | 155 |
<a href="#" class="select"> |
156 |
<img src="<?php echo esc_url($image); ?>" alt="<?php echo esc_attr(__('Click to insert.')); ?>" title="<?php echo esc_attr(__('Click to insert.')); ?>" /> |
|
157 |
</a> |
|
158 |
</p> |
|
159 |
||
160 |
<p id="options"><a href="#" class="select button"><?php _e('Insert Image'); ?></a> <a href="#" class="cancel button"><?php _e('Cancel'); ?></a></p> |
|
161 |
<?php break; |
|
162 |
case 'photo_images': |
|
163 |
/** |
|
164 |
* Retrieve all image URLs from given URI. |
|
165 |
* |
|
166 |
* @package WordPress |
|
167 |
* @subpackage Press_This |
|
168 |
* @since 2.6.0 |
|
169 |
* |
|
170 |
* @param string $uri |
|
171 |
* @return string |
|
172 |
*/ |
|
173 |
function get_images_from_uri($uri) { |
|
174 |
$uri = preg_replace('/\/#.+?$/','', $uri); |
|
204
09a1c134465b
man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents:
194
diff
changeset
|
175 |
if ( preg_match( '/\.(jpe?g|jpe|gif|png)\b/i', $uri ) && !strpos( $uri, 'blogger.com' ) ) |
136 | 176 |
return "'" . esc_attr( html_entity_decode($uri) ) . "'"; |
177 |
$content = wp_remote_fopen($uri); |
|
178 |
if ( false === $content ) |
|
179 |
return ''; |
|
180 |
$host = parse_url($uri); |
|
181 |
$pattern = '/<img ([^>]*)src=(\"|\')([^<>\'\"]+)(\2)([^>]*)\/*>/i'; |
|
182 |
$content = str_replace(array("\n","\t","\r"), '', $content); |
|
183 |
preg_match_all($pattern, $content, $matches); |
|
184 |
if ( empty($matches[0]) ) |
|
185 |
return ''; |
|
186 |
$sources = array(); |
|
187 |
foreach ($matches[3] as $src) { |
|
188 |
// if no http in url |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
189 |
if (strpos($src, 'http') === false) |
136 | 190 |
// if it doesn't have a relative uri |
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
191 |
if ( strpos($src, '../') === false && strpos($src, './') === false && strpos($src, '/') === 0) |
136 | 192 |
$src = 'http://'.str_replace('//','/', $host['host'].'/'.$src); |
193 |
else |
|
194 |
$src = 'http://'.str_replace('//','/', $host['host'].'/'.dirname($host['path']).'/'.$src); |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
195 |
$sources[] = esc_url($src); |
136 | 196 |
} |
197 |
return "'" . implode("','", $sources) . "'"; |
|
198 |
} |
|
199 |
$url = wp_kses(urldecode($url), null); |
|
200 |
echo 'new Array('.get_images_from_uri($url).')'; |
|
201 |
break; |
|
202 |
||
203 |
case 'photo_js': ?> |
|
204 |
// gather images and load some default JS |
|
205 |
var last = null |
|
206 |
var img, img_tag, aspect, w, h, skip, i, strtoappend = ""; |
|
207 |
if(photostorage == false) { |
|
208 |
var my_src = eval( |
|
209 |
jQuery.ajax({ |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
210 |
type: "GET", |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
211 |
url: "<?php echo esc_url($_SERVER['PHP_SELF']); ?>", |
136 | 212 |
cache : false, |
213 |
async : false, |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
214 |
data: "ajax=photo_images&u=<?php echo urlencode($url); ?>", |
136 | 215 |
dataType : "script" |
216 |
}).responseText |
|
217 |
); |
|
218 |
if(my_src.length == 0) { |
|
219 |
var my_src = eval( |
|
220 |
jQuery.ajax({ |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
221 |
type: "GET", |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
222 |
url: "<?php echo esc_url($_SERVER['PHP_SELF']); ?>", |
136 | 223 |
cache : false, |
224 |
async : false, |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
225 |
data: "ajax=photo_images&u=<?php echo urlencode($url); ?>", |
136 | 226 |
dataType : "script" |
227 |
}).responseText |
|
228 |
); |
|
229 |
if(my_src.length == 0) { |
|
230 |
strtoappend = '<?php _e('Unable to retrieve images or no images on page.'); ?>'; |
|
231 |
} |
|
232 |
} |
|
233 |
} |
|
234 |
for (i = 0; i < my_src.length; i++) { |
|
235 |
img = new Image(); |
|
236 |
img.src = my_src[i]; |
|
237 |
img_attr = 'id="img' + i + '"'; |
|
238 |
skip = false; |
|
239 |
||
240 |
maybeappend = '<a href="?ajax=photo_thickbox&i=' + encodeURIComponent(img.src) + '&u=<?php echo urlencode($url); ?>&height=400&width=500" title="" class="thickbox"><img src="' + img.src + '" ' + img_attr + '/></a>'; |
|
241 |
||
242 |
if (img.width && img.height) { |
|
243 |
if (img.width >= 30 && img.height >= 30) { |
|
244 |
aspect = img.width / img.height; |
|
245 |
scale = (aspect > 1) ? (71 / img.width) : (71 / img.height); |
|
246 |
||
247 |
w = img.width; |
|
248 |
h = img.height; |
|
249 |
||
250 |
if (scale < 1) { |
|
251 |
w = parseInt(img.width * scale); |
|
252 |
h = parseInt(img.height * scale); |
|
253 |
} |
|
254 |
img_attr += ' style="width: ' + w + 'px; height: ' + h + 'px;"'; |
|
255 |
strtoappend += maybeappend; |
|
256 |
} |
|
257 |
} else { |
|
258 |
strtoappend += maybeappend; |
|
259 |
} |
|
260 |
} |
|
261 |
||
262 |
function pick(img, desc) { |
|
263 |
if (img) { |
|
264 |
if('object' == typeof jQuery('.photolist input') && jQuery('.photolist input').length != 0) length = jQuery('.photolist input').length; |
|
265 |
if(length == 0) length = 1; |
|
266 |
jQuery('.photolist').append('<input name="photo_src[' + length + ']" value="' + img +'" type="hidden"/>'); |
|
267 |
jQuery('.photolist').append('<input name="photo_description[' + length + ']" value="' + desc +'" type="hidden"/>'); |
|
268 |
insert_editor( "\n\n" + encodeURI('<p style="text-align: center;"><a href="<?php echo $url; ?>"><img src="' + img +'" alt="' + desc + '" /></a></p>')); |
|
269 |
} |
|
270 |
return false; |
|
271 |
} |
|
272 |
||
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
273 |
function image_selector(el) { |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
274 |
var desc, src, parent = jQuery(el).closest('#photo-add-url-div'); |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
275 |
|
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
276 |
if ( parent.length ) { |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
277 |
desc = parent.find('input.tb_this_photo_description').val() || ''; |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
278 |
src = parent.find('input.tb_this_photo').val() || '' |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
279 |
} else { |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
280 |
desc = jQuery('#tb_this_photo_description').val() || ''; |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
281 |
src = jQuery('#tb_this_photo').val() || '' |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
282 |
} |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
283 |
|
136 | 284 |
tb_remove(); |
285 |
pick(src, desc); |
|
286 |
jQuery('#extra-fields').hide(); |
|
287 |
jQuery('#extra-fields').html(''); |
|
288 |
return false; |
|
289 |
} |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
290 |
|
204
09a1c134465b
man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents:
194
diff
changeset
|
291 |
jQuery('#extra-fields').html('<div class="postbox"><h2><?php _e( 'Add Photos' ); ?> <small id="photo_directions">(<?php _e("click images to select") ?>)</small></h2><ul class="actions"><li><a href="#" id="photo-add-url" class="button button-small"><?php _e("Add from URL") ?> +</a></li></ul><div class="inside"><div class="titlewrap"><div id="img_container"></div></div><p id="options"><a href="#" class="close button"><?php _e('Cancel'); ?></a><a href="#" class="refresh button"><?php _e('Refresh'); ?></a></p></div>'); |
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
292 |
jQuery('#img_container').html(strtoappend); |
136 | 293 |
<?php break; |
294 |
} |
|
295 |
die; |
|
296 |
} |
|
297 |
||
298 |
wp_enqueue_style( 'colors' ); |
|
299 |
wp_enqueue_script( 'post' ); |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
300 |
_wp_admin_html_begin(); |
136 | 301 |
?> |
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
302 |
<title><?php _e('Press This') ?></title> |
136 | 303 |
<script type="text/javascript"> |
304 |
//<![CDATA[ |
|
305 |
addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}}; |
|
306 |
var userSettings = {'url':'<?php echo SITECOOKIEPATH; ?>','uid':'<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>','time':'<?php echo time() ?>'}; |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
307 |
var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>', pagenow = 'press-this', isRtl = <?php echo (int) is_rtl(); ?>; |
136 | 308 |
var photostorage = false; |
309 |
//]]> |
|
310 |
</script> |
|
311 |
||
312 |
<?php |
|
313 |
do_action('admin_print_styles'); |
|
314 |
do_action('admin_print_scripts'); |
|
315 |
do_action('admin_head'); |
|
316 |
?> |
|
317 |
<script type="text/javascript"> |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
318 |
var wpActiveEditor = 'content'; |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
319 |
|
136 | 320 |
function insert_plain_editor(text) { |
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
321 |
if ( typeof(QTags) != 'undefined' ) |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
322 |
QTags.insertContent(text); |
136 | 323 |
} |
324 |
function set_editor(text) { |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
325 |
if ( '' == text || '<p></p>' == text ) |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
326 |
text = '<p><br /></p>'; |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
327 |
|
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
328 |
if ( tinyMCE.activeEditor ) |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
329 |
tinyMCE.execCommand('mceSetContent', false, text); |
136 | 330 |
} |
331 |
function insert_editor(text) { |
|
332 |
if ( '' != text && tinyMCE.activeEditor && ! tinyMCE.activeEditor.isHidden()) { |
|
333 |
tinyMCE.execCommand('mceInsertContent', false, '<p>' + decodeURI(tinymce.DOM.decode(text)) + '</p>', {format : 'raw'}); |
|
334 |
} else { |
|
335 |
insert_plain_editor(decodeURI(text)); |
|
336 |
} |
|
337 |
} |
|
338 |
function append_editor(text) { |
|
339 |
if ( '' != text && tinyMCE.activeEditor && ! tinyMCE.activeEditor.isHidden()) { |
|
340 |
tinyMCE.execCommand('mceSetContent', false, tinyMCE.activeEditor.getContent({format : 'raw'}) + '<p>' + text + '</p>'); |
|
341 |
} else { |
|
342 |
insert_plain_editor(text); |
|
343 |
} |
|
344 |
} |
|
345 |
||
346 |
function show(tab_name) { |
|
347 |
jQuery('#extra-fields').html(''); |
|
348 |
switch(tab_name) { |
|
349 |
case 'video' : |
|
350 |
jQuery('#extra-fields').load('<?php echo esc_url($_SERVER['PHP_SELF']); ?>', { ajax: 'video', s: '<?php echo esc_attr($selection); ?>'}, function() { |
|
351 |
<?php |
|
352 |
$content = ''; |
|
353 |
if ( preg_match("/youtube\.com\/watch/i", $url) ) { |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
354 |
list($domain, $video_id) = explode("v=", $url); |
136 | 355 |
$video_id = esc_attr($video_id); |
356 |
$content = '<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/' . $video_id . '"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/' . $video_id . '" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>'; |
|
357 |
||
358 |
} elseif ( preg_match("/vimeo\.com\/[0-9]+/i", $url) ) { |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
359 |
list($domain, $video_id) = explode(".com/", $url); |
136 | 360 |
$video_id = esc_attr($video_id); |
361 |
$content = '<object width="400" height="225"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://www.vimeo.com/moogaloop.swf?clip_id=' . $video_id . '&server=www.vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" /> <embed src="http://www.vimeo.com/moogaloop.swf?clip_id=' . $video_id . '&server=www.vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="225"></embed></object>'; |
|
362 |
||
363 |
if ( trim($selection) == '' ) |
|
364 |
$selection = '<p><a href="http://www.vimeo.com/' . $video_id . '?pg=embed&sec=' . $video_id . '">' . $title . '</a> on <a href="http://vimeo.com?pg=embed&sec=' . $video_id . '">Vimeo</a></p>'; |
|
365 |
||
366 |
} elseif ( strpos( $selection, '<object' ) !== false ) { |
|
367 |
$content = $selection; |
|
368 |
} |
|
369 |
?> |
|
370 |
jQuery('#embed-code').prepend('<?php echo htmlentities($content); ?>'); |
|
371 |
}); |
|
372 |
jQuery('#extra-fields').show(); |
|
373 |
return false; |
|
374 |
break; |
|
375 |
case 'photo' : |
|
376 |
function setup_photo_actions() { |
|
377 |
jQuery('.close').click(function() { |
|
378 |
jQuery('#extra-fields').hide(); |
|
379 |
jQuery('#extra-fields').html(''); |
|
380 |
}); |
|
381 |
jQuery('.refresh').click(function() { |
|
382 |
photostorage = false; |
|
383 |
show('photo'); |
|
384 |
}); |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
385 |
jQuery('#photo-add-url').click(function(){ |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
386 |
var form = jQuery('#photo-add-url-div').clone(); |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
387 |
jQuery('#img_container').empty().append( form.show() ); |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
388 |
}); |
136 | 389 |
jQuery('#waiting').hide(); |
390 |
jQuery('#extra-fields').show(); |
|
391 |
} |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
392 |
|
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
393 |
jQuery('#waiting').show(); |
136 | 394 |
if(photostorage == false) { |
395 |
jQuery.ajax({ |
|
396 |
type: "GET", |
|
397 |
cache : false, |
|
398 |
url: "<?php echo esc_url($_SERVER['PHP_SELF']); ?>", |
|
399 |
data: "ajax=photo_js&u=<?php echo urlencode($url)?>", |
|
400 |
dataType : "script", |
|
401 |
success : function(data) { |
|
402 |
eval(data); |
|
403 |
photostorage = jQuery('#extra-fields').html(); |
|
404 |
setup_photo_actions(); |
|
405 |
} |
|
406 |
}); |
|
407 |
} else { |
|
408 |
jQuery('#extra-fields').html(photostorage); |
|
409 |
setup_photo_actions(); |
|
410 |
} |
|
411 |
return false; |
|
412 |
break; |
|
413 |
} |
|
414 |
} |
|
415 |
jQuery(document).ready(function($) { |
|
416 |
//resize screen |
|
204
09a1c134465b
man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents:
194
diff
changeset
|
417 |
window.resizeTo(740,580); |
136 | 418 |
// set button actions |
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
419 |
jQuery('#photo_button').click(function() { show('photo'); return false; }); |
136 | 420 |
jQuery('#video_button').click(function() { show('video'); return false; }); |
421 |
// auto select |
|
422 |
<?php if ( preg_match("/youtube\.com\/watch/i", $url) ) { ?> |
|
423 |
show('video'); |
|
424 |
<?php } elseif ( preg_match("/vimeo\.com\/[0-9]+/i", $url) ) { ?> |
|
425 |
show('video'); |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
426 |
<?php } elseif ( preg_match("/flickr\.com/i", $url) ) { ?> |
136 | 427 |
show('photo'); |
428 |
<?php } ?> |
|
429 |
jQuery('#title').unbind(); |
|
204
09a1c134465b
man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents:
194
diff
changeset
|
430 |
jQuery('#publish, #save').click(function() { jQuery('.press-this #publishing-actions .spinner').css('display', 'inline-block'); }); |
136 | 431 |
|
432 |
$('#tagsdiv-post_tag, #categorydiv').children('h3, .handlediv').click(function(){ |
|
433 |
$(this).siblings('.inside').toggle(); |
|
434 |
}); |
|
435 |
}); |
|
436 |
</script> |
|
437 |
</head> |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
438 |
<?php |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
439 |
$admin_body_class = ( is_rtl() ) ? 'rtl' : ''; |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
440 |
$admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) ); |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
441 |
?> |
204
09a1c134465b
man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents:
194
diff
changeset
|
442 |
<body class="press-this wp-admin wp-core-ui <?php echo $admin_body_class; ?>"> |
136 | 443 |
<form action="press-this.php?action=post" method="post"> |
444 |
<div id="poststuff" class="metabox-holder"> |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
445 |
<div id="side-sortables" class="press-this-sidebar"> |
136 | 446 |
<div class="sleeve"> |
447 |
<?php wp_nonce_field('press-this') ?> |
|
448 |
<input type="hidden" name="post_type" id="post_type" value="text"/> |
|
449 |
<input type="hidden" name="autosave" id="autosave" /> |
|
450 |
<input type="hidden" id="original_post_status" name="original_post_status" value="draft" /> |
|
451 |
<input type="hidden" id="prev_status" name="prev_status" value="draft" /> |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
452 |
<input type="hidden" id="post_id" name="post_id" value="<?php echo (int) $post_ID; ?>" /> |
136 | 453 |
|
454 |
<!-- This div holds the photo metadata --> |
|
455 |
<div class="photolist"></div> |
|
456 |
||
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
457 |
<div id="submitdiv" class="postbox"> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
458 |
<div class="handlediv" title="<?php esc_attr_e( 'Click to toggle' ); ?>"><br /></div> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
459 |
<h3 class="hndle"><?php _e('Press This') ?></h3> |
136 | 460 |
<div class="inside"> |
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
461 |
<p id="publishing-actions"> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
462 |
<?php |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
463 |
submit_button( __( 'Save Draft' ), 'button', 'draft', false, array( 'id' => 'save' ) ); |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
464 |
if ( current_user_can('publish_posts') ) { |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
465 |
submit_button( __( 'Publish' ), 'primary', 'publish', false ); |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
466 |
} else { |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
467 |
echo '<br /><br />'; |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
468 |
submit_button( __( 'Submit for Review' ), 'primary', 'review', false ); |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
469 |
} ?> |
204
09a1c134465b
man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents:
194
diff
changeset
|
470 |
<span class="spinner" style="display: none;"></span> |
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
471 |
</p> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
472 |
<?php if ( current_theme_supports( 'post-formats' ) && post_type_supports( 'post', 'post-formats' ) ) : |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
473 |
$post_formats = get_theme_support( 'post-formats' ); |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
474 |
if ( is_array( $post_formats[0] ) ) : |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
475 |
$default_format = get_option( 'default_post_format', '0' ); |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
476 |
?> |
136 | 477 |
<p> |
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
478 |
<label for="post_format"><?php _e( 'Post Format:' ); ?> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
479 |
<select name="post_format" id="post_format"> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
480 |
<option value="0"><?php _ex( 'Standard', 'Post format' ); ?></option> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
481 |
<?php foreach ( $post_formats[0] as $format ): ?> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
482 |
<option<?php selected( $default_format, $format ); ?> value="<?php echo esc_attr( $format ); ?>"> <?php echo esc_html( get_post_format_string( $format ) ); ?></option> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
483 |
<?php endforeach; ?> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
484 |
</select></label> |
136 | 485 |
</p> |
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
486 |
<?php endif; endif; ?> |
136 | 487 |
</div> |
488 |
</div> |
|
489 |
||
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
490 |
<?php $tax = get_taxonomy( 'category' ); ?> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
491 |
<div id="categorydiv" class="postbox"> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
492 |
<div class="handlediv" title="<?php esc_attr_e( 'Click to toggle' ); ?>"><br /></div> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
493 |
<h3 class="hndle"><?php _e('Categories') ?></h3> |
136 | 494 |
<div class="inside"> |
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
495 |
<div id="taxonomy-category" class="categorydiv"> |
136 | 496 |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
497 |
<ul id="category-tabs" class="category-tabs"> |
204
09a1c134465b
man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents:
194
diff
changeset
|
498 |
<li class="tabs"><a href="#category-all"><?php echo $tax->labels->all_items; ?></a></li> |
09a1c134465b
man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents:
194
diff
changeset
|
499 |
<li class="hide-if-no-js"><a href="#category-pop"><?php _e( 'Most Used' ); ?></a></li> |
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
500 |
</ul> |
136 | 501 |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
502 |
<div id="category-pop" class="tabs-panel" style="display: none;"> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
503 |
<ul id="categorychecklist-pop" class="categorychecklist form-no-clear" > |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
504 |
<?php $popular_ids = wp_popular_terms_checklist( 'category' ); ?> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
505 |
</ul> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
506 |
</div> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
507 |
|
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
508 |
<div id="category-all" class="tabs-panel"> |
204
09a1c134465b
man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents:
194
diff
changeset
|
509 |
<ul id="categorychecklist" data-wp-lists="list:category" class="categorychecklist form-no-clear"> |
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
510 |
<?php wp_terms_checklist($post_ID, array( 'taxonomy' => 'category', 'popular_cats' => $popular_ids ) ) ?> |
136 | 511 |
</ul> |
512 |
</div> |
|
513 |
||
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
514 |
<?php if ( !current_user_can($tax->cap->assign_terms) ) : ?> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
515 |
<p><em><?php _e('You cannot modify this Taxonomy.'); ?></em></p> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
516 |
<?php endif; ?> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
517 |
<?php if ( current_user_can($tax->cap->edit_terms) ) : ?> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
518 |
<div id="category-adder" class="wp-hidden-children"> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
519 |
<h4> |
204
09a1c134465b
man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents:
194
diff
changeset
|
520 |
<a id="category-add-toggle" href="#category-add" class="hide-if-no-js"> |
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
521 |
<?php printf( __( '+ %s' ), $tax->labels->add_new_item ); ?> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
522 |
</a> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
523 |
</h4> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
524 |
<p id="category-add" class="category-add wp-hidden-child"> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
525 |
<label class="screen-reader-text" for="newcategory"><?php echo $tax->labels->add_new_item; ?></label> |
204
09a1c134465b
man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents:
194
diff
changeset
|
526 |
<input type="text" name="newcategory" id="newcategory" class="form-required form-input-tip" value="<?php echo esc_attr( $tax->labels->new_item_name ); ?>" aria-required="true"/> |
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
527 |
<label class="screen-reader-text" for="newcategory_parent"> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
528 |
<?php echo $tax->labels->parent_item_colon; ?> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
529 |
</label> |
204
09a1c134465b
man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents:
194
diff
changeset
|
530 |
<?php wp_dropdown_categories( array( 'taxonomy' => 'category', 'hide_empty' => 0, 'name' => 'newcategory_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '— ' . $tax->labels->parent_item . ' —' ) ); ?> |
09a1c134465b
man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents:
194
diff
changeset
|
531 |
<input type="button" id="category-add-submit" data-wp-lists="add:categorychecklist:category-add" class="button category-add-submit" value="<?php echo esc_attr( $tax->labels->add_new_item ); ?>" /> |
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
532 |
<?php wp_nonce_field( 'add-category', '_ajax_nonce-add-category', false ); ?> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
533 |
<span id="category-ajax-response"></span> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
534 |
</p> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
535 |
</div> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
536 |
<?php endif; ?> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
537 |
</div> |
136 | 538 |
</div> |
539 |
</div> |
|
540 |
||
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
541 |
<div id="tagsdiv-post_tag" class="postbox"> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
542 |
<div class="handlediv" title="<?php esc_attr_e( 'Click to toggle' ); ?>"><br /></div> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
543 |
<h3><span><?php _e('Tags'); ?></span></h3> |
136 | 544 |
<div class="inside"> |
545 |
<div class="tagsdiv" id="post_tag"> |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
546 |
<div class="jaxtag"> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
547 |
<label class="screen-reader-text" for="newtag"><?php _e('Tags'); ?></label> |
136 | 548 |
<input type="hidden" name="tax_input[post_tag]" class="the-tags" id="tax-input[post_tag]" value="" /> |
549 |
<div class="ajaxtag"> |
|
550 |
<input type="text" name="newtag[post_tag]" class="newtag form-input-tip" size="16" autocomplete="off" value="" /> |
|
204
09a1c134465b
man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents:
194
diff
changeset
|
551 |
<input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" /> |
136 | 552 |
</div> |
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
553 |
</div> |
136 | 554 |
<div class="tagchecklist"></div> |
555 |
</div> |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
556 |
<p class="tagcloud-link"><a href="#titlediv" class="tagcloud-link" id="link-post_tag"><?php _e('Choose from the most used tags'); ?></a></p> |
136 | 557 |
</div> |
558 |
</div> |
|
559 |
</div> |
|
560 |
</div> |
|
561 |
<div class="posting"> |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
562 |
|
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
563 |
<div id="wphead"> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
564 |
<img id="header-logo" src="<?php echo esc_url( includes_url( 'images/blank.gif' ) ); ?>" alt="" width="16" height="16" /> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
565 |
<h1 id="site-heading"> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
566 |
<a href="<?php echo get_option('home'); ?>/" target="_blank"> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
567 |
<span id="site-title"><?php bloginfo('name'); ?></span> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
568 |
</a> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
569 |
</h1> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
570 |
</div> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
571 |
|
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
572 |
<?php |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
573 |
if ( isset($posted) && intval($posted) ) { |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
574 |
$post_ID = intval($posted); ?> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
575 |
<div id="message" class="updated"> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
576 |
<p><strong><?php _e('Your post has been saved.'); ?></strong> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
577 |
<a onclick="window.opener.location.replace(this.href); window.close();" href="<?php echo get_permalink($post_ID); ?>"><?php _e('View post'); ?></a> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
578 |
| <a href="<?php echo get_edit_post_link( $post_ID ); ?>" onclick="window.opener.location.replace(this.href); window.close();"><?php _e('Edit Post'); ?></a> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
579 |
| <a href="#" onclick="window.close();"><?php _e('Close Window'); ?></a></p> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
580 |
</div> |
136 | 581 |
<?php } ?> |
582 |
||
583 |
<div id="titlediv"> |
|
584 |
<div class="titlewrap"> |
|
585 |
<input name="title" id="title" class="text" value="<?php echo esc_attr($title);?>"/> |
|
586 |
</div> |
|
587 |
</div> |
|
588 |
||
204
09a1c134465b
man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents:
194
diff
changeset
|
589 |
<div id="waiting" style="display: none"><span class="spinner"></span> <span><?php esc_html_e( 'Loading...' ); ?></span></div> |
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
590 |
|
136 | 591 |
<div id="extra-fields" style="display: none"></div> |
592 |
||
593 |
<div class="postdivrich"> |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
594 |
<?php |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
595 |
|
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
596 |
$editor_settings = array( |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
597 |
'teeny' => true, |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
598 |
'textarea_rows' => '15' |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
599 |
); |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
600 |
|
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
601 |
$content = ''; |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
602 |
if ( $selection ) |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
603 |
$content .= $selection; |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
604 |
|
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
605 |
if ( $url ) { |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
606 |
$content .= '<p>'; |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
607 |
|
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
608 |
if ( $selection ) |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
609 |
$content .= __('via '); |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
610 |
|
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
611 |
$content .= sprintf( "<a href='%s'>%s</a>.</p>", esc_url( $url ), esc_html( $title ) ); |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
612 |
} |
136 | 613 |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
614 |
remove_action( 'media_buttons', 'media_buttons' ); |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
615 |
add_action( 'media_buttons', 'press_this_media_buttons' ); |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
616 |
function press_this_media_buttons() { |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
617 |
_e( 'Add:' ); |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
618 |
|
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
619 |
if ( current_user_can('upload_files') ) { |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
620 |
?> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
621 |
<a id="photo_button" title="<?php esc_attr_e('Insert an Image'); ?>" href="#"> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
622 |
<img alt="<?php esc_attr_e('Insert an Image'); ?>" src="<?php echo esc_url( admin_url( 'images/media-button-image.gif?ver=20100531' ) ); ?>"/></a> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
623 |
<?php |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
624 |
} |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
625 |
?> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
626 |
<a id="video_button" title="<?php esc_attr_e('Embed a Video'); ?>" href="#"><img alt="<?php esc_attr_e('Embed a Video'); ?>" src="<?php echo esc_url( admin_url( 'images/media-button-video.gif?ver=20100531' ) ); ?>"/></a> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
627 |
<?php |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
628 |
} |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
629 |
|
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
630 |
wp_editor( $content, 'content', $editor_settings ); |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
631 |
|
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
632 |
?> |
136 | 633 |
</div> |
634 |
</div> |
|
635 |
</div> |
|
636 |
</form> |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
637 |
<div id="photo-add-url-div" style="display:none;"> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
638 |
<table><tr> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
639 |
<td><label for="this_photo"><?php _e('URL') ?></label></td> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
640 |
<td><input type="text" id="this_photo" name="this_photo" class="tb_this_photo text" onkeypress="if(event.keyCode==13) image_selector(this);" /></td> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
641 |
</tr><tr> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
642 |
<td><label for="this_photo_description"><?php _e('Description') ?></label></td> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
643 |
<td><input type="text" id="this_photo_description" name="photo_description" class="tb_this_photo_description text" onkeypress="if(event.keyCode==13) image_selector(this);" value="<?php echo esc_attr($title);?>"/></td> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
644 |
</tr><tr> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
645 |
<td><input type="button" class="button" onclick="image_selector(this)" value="<?php esc_attr_e('Insert Image'); ?>" /></td> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
646 |
</tr></table> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
647 |
</div> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
648 |
<?php |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
649 |
do_action('admin_footer'); |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
650 |
do_action('admin_print_footer_scripts'); |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
651 |
?> |
136 | 652 |
<script type="text/javascript">if(typeof wpOnload=='function')wpOnload();</script> |
653 |
</body> |
|
654 |
</html> |