108 $image = isset($_GET['i']) ? $_GET['i'] : ''; |
108 $image = isset($_GET['i']) ? $_GET['i'] : ''; |
109 |
109 |
110 if ( !empty($_REQUEST['ajax']) ) { |
110 if ( !empty($_REQUEST['ajax']) ) { |
111 switch ($_REQUEST['ajax']) { |
111 switch ($_REQUEST['ajax']) { |
112 case 'video': ?> |
112 case 'video': ?> |
113 <script type="text/javascript" charset="utf-8"> |
113 <script type="text/javascript"> |
114 /* <![CDATA[ */ |
114 /* <![CDATA[ */ |
115 jQuery('.select').click(function() { |
115 jQuery('.select').click(function() { |
116 append_editor(jQuery('#embed-code').val()); |
116 append_editor(jQuery('#embed-code').val()); |
117 jQuery('#extra-fields').hide(); |
117 jQuery('#extra-fields').hide(); |
118 jQuery('#extra-fields').html(''); |
118 jQuery('#extra-fields').html(''); |
170 * @param string $uri |
170 * @param string $uri |
171 * @return string |
171 * @return string |
172 */ |
172 */ |
173 function get_images_from_uri($uri) { |
173 function get_images_from_uri($uri) { |
174 $uri = preg_replace('/\/#.+?$/','', $uri); |
174 $uri = preg_replace('/\/#.+?$/','', $uri); |
175 if ( preg_match('/\.(jpg|jpe|jpeg|png|gif)$/', $uri) && !strpos($uri,'blogger.com') ) |
175 if ( preg_match( '/\.(jpe?g|jpe|gif|png)\b/i', $uri ) && !strpos( $uri, 'blogger.com' ) ) |
176 return "'" . esc_attr( html_entity_decode($uri) ) . "'"; |
176 return "'" . esc_attr( html_entity_decode($uri) ) . "'"; |
177 $content = wp_remote_fopen($uri); |
177 $content = wp_remote_fopen($uri); |
178 if ( false === $content ) |
178 if ( false === $content ) |
179 return ''; |
179 return ''; |
180 $host = parse_url($uri); |
180 $host = parse_url($uri); |
425 show('video'); |
425 show('video'); |
426 <?php } elseif ( preg_match("/flickr\.com/i", $url) ) { ?> |
426 <?php } elseif ( preg_match("/flickr\.com/i", $url) ) { ?> |
427 show('photo'); |
427 show('photo'); |
428 <?php } ?> |
428 <?php } ?> |
429 jQuery('#title').unbind(); |
429 jQuery('#title').unbind(); |
430 jQuery('#publish, #save').click(function() { jQuery('#saving').css('display', 'inline'); }); |
430 jQuery('#publish, #save').click(function() { jQuery('.press-this #publishing-actions .spinner').css('display', 'inline-block'); }); |
431 |
431 |
432 $('#tagsdiv-post_tag, #categorydiv').children('h3, .handlediv').click(function(){ |
432 $('#tagsdiv-post_tag, #categorydiv').children('h3, .handlediv').click(function(){ |
433 $(this).siblings('.inside').toggle(); |
433 $(this).siblings('.inside').toggle(); |
434 }); |
434 }); |
435 }); |
435 }); |
437 </head> |
437 </head> |
438 <?php |
438 <?php |
439 $admin_body_class = ( is_rtl() ) ? 'rtl' : ''; |
439 $admin_body_class = ( is_rtl() ) ? 'rtl' : ''; |
440 $admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) ); |
440 $admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) ); |
441 ?> |
441 ?> |
442 <body class="press-this wp-admin <?php echo $admin_body_class; ?>"> |
442 <body class="press-this wp-admin wp-core-ui <?php echo $admin_body_class; ?>"> |
443 <form action="press-this.php?action=post" method="post"> |
443 <form action="press-this.php?action=post" method="post"> |
444 <div id="poststuff" class="metabox-holder"> |
444 <div id="poststuff" class="metabox-holder"> |
445 <div id="side-sortables" class="press-this-sidebar"> |
445 <div id="side-sortables" class="press-this-sidebar"> |
446 <div class="sleeve"> |
446 <div class="sleeve"> |
447 <?php wp_nonce_field('press-this') ?> |
447 <?php wp_nonce_field('press-this') ?> |
465 submit_button( __( 'Publish' ), 'primary', 'publish', false ); |
465 submit_button( __( 'Publish' ), 'primary', 'publish', false ); |
466 } else { |
466 } else { |
467 echo '<br /><br />'; |
467 echo '<br /><br />'; |
468 submit_button( __( 'Submit for Review' ), 'primary', 'review', false ); |
468 submit_button( __( 'Submit for Review' ), 'primary', 'review', false ); |
469 } ?> |
469 } ?> |
470 <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" id="saving" style="display:none;" /> |
470 <span class="spinner" style="display: none;"></span> |
471 </p> |
471 </p> |
472 <?php if ( current_theme_supports( 'post-formats' ) && post_type_supports( 'post', 'post-formats' ) ) : |
472 <?php if ( current_theme_supports( 'post-formats' ) && post_type_supports( 'post', 'post-formats' ) ) : |
473 $post_formats = get_theme_support( 'post-formats' ); |
473 $post_formats = get_theme_support( 'post-formats' ); |
474 if ( is_array( $post_formats[0] ) ) : |
474 if ( is_array( $post_formats[0] ) ) : |
475 $default_format = get_option( 'default_post_format', '0' ); |
475 $default_format = get_option( 'default_post_format', '0' ); |
493 <h3 class="hndle"><?php _e('Categories') ?></h3> |
493 <h3 class="hndle"><?php _e('Categories') ?></h3> |
494 <div class="inside"> |
494 <div class="inside"> |
495 <div id="taxonomy-category" class="categorydiv"> |
495 <div id="taxonomy-category" class="categorydiv"> |
496 |
496 |
497 <ul id="category-tabs" class="category-tabs"> |
497 <ul id="category-tabs" class="category-tabs"> |
498 <li class="tabs"><a href="#category-all" tabindex="3"><?php echo $tax->labels->all_items; ?></a></li> |
498 <li class="tabs"><a href="#category-all"><?php echo $tax->labels->all_items; ?></a></li> |
499 <li class="hide-if-no-js"><a href="#category-pop" tabindex="3"><?php _e( 'Most Used' ); ?></a></li> |
499 <li class="hide-if-no-js"><a href="#category-pop"><?php _e( 'Most Used' ); ?></a></li> |
500 </ul> |
500 </ul> |
501 |
501 |
502 <div id="category-pop" class="tabs-panel" style="display: none;"> |
502 <div id="category-pop" class="tabs-panel" style="display: none;"> |
503 <ul id="categorychecklist-pop" class="categorychecklist form-no-clear" > |
503 <ul id="categorychecklist-pop" class="categorychecklist form-no-clear" > |
504 <?php $popular_ids = wp_popular_terms_checklist( 'category' ); ?> |
504 <?php $popular_ids = wp_popular_terms_checklist( 'category' ); ?> |
505 </ul> |
505 </ul> |
506 </div> |
506 </div> |
507 |
507 |
508 <div id="category-all" class="tabs-panel"> |
508 <div id="category-all" class="tabs-panel"> |
509 <ul id="categorychecklist" class="list:category categorychecklist form-no-clear"> |
509 <ul id="categorychecklist" data-wp-lists="list:category" class="categorychecklist form-no-clear"> |
510 <?php wp_terms_checklist($post_ID, array( 'taxonomy' => 'category', 'popular_cats' => $popular_ids ) ) ?> |
510 <?php wp_terms_checklist($post_ID, array( 'taxonomy' => 'category', 'popular_cats' => $popular_ids ) ) ?> |
511 </ul> |
511 </ul> |
512 </div> |
512 </div> |
513 |
513 |
514 <?php if ( !current_user_can($tax->cap->assign_terms) ) : ?> |
514 <?php if ( !current_user_can($tax->cap->assign_terms) ) : ?> |
515 <p><em><?php _e('You cannot modify this Taxonomy.'); ?></em></p> |
515 <p><em><?php _e('You cannot modify this Taxonomy.'); ?></em></p> |
516 <?php endif; ?> |
516 <?php endif; ?> |
517 <?php if ( current_user_can($tax->cap->edit_terms) ) : ?> |
517 <?php if ( current_user_can($tax->cap->edit_terms) ) : ?> |
518 <div id="category-adder" class="wp-hidden-children"> |
518 <div id="category-adder" class="wp-hidden-children"> |
519 <h4> |
519 <h4> |
520 <a id="category-add-toggle" href="#category-add" class="hide-if-no-js" tabindex="3"> |
520 <a id="category-add-toggle" href="#category-add" class="hide-if-no-js"> |
521 <?php printf( __( '+ %s' ), $tax->labels->add_new_item ); ?> |
521 <?php printf( __( '+ %s' ), $tax->labels->add_new_item ); ?> |
522 </a> |
522 </a> |
523 </h4> |
523 </h4> |
524 <p id="category-add" class="category-add wp-hidden-child"> |
524 <p id="category-add" class="category-add wp-hidden-child"> |
525 <label class="screen-reader-text" for="newcategory"><?php echo $tax->labels->add_new_item; ?></label> |
525 <label class="screen-reader-text" for="newcategory"><?php echo $tax->labels->add_new_item; ?></label> |
526 <input type="text" name="newcategory" id="newcategory" class="form-required form-input-tip" value="<?php echo esc_attr( $tax->labels->new_item_name ); ?>" tabindex="3" aria-required="true"/> |
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"/> |
527 <label class="screen-reader-text" for="newcategory_parent"> |
527 <label class="screen-reader-text" for="newcategory_parent"> |
528 <?php echo $tax->labels->parent_item_colon; ?> |
528 <?php echo $tax->labels->parent_item_colon; ?> |
529 </label> |
529 </label> |
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 . ' —', 'tab_index' => 3 ) ); ?> |
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 . ' —' ) ); ?> |
531 <input type="button" id="category-add-submit" class="add:categorychecklist:category-add button category-add-submit" value="<?php echo esc_attr( $tax->labels->add_new_item ); ?>" tabindex="3" /> |
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 ); ?>" /> |
532 <?php wp_nonce_field( 'add-category', '_ajax_nonce-add-category', false ); ?> |
532 <?php wp_nonce_field( 'add-category', '_ajax_nonce-add-category', false ); ?> |
533 <span id="category-ajax-response"></span> |
533 <span id="category-ajax-response"></span> |
534 </p> |
534 </p> |
535 </div> |
535 </div> |
536 <?php endif; ?> |
536 <?php endif; ?> |
546 <div class="jaxtag"> |
546 <div class="jaxtag"> |
547 <label class="screen-reader-text" for="newtag"><?php _e('Tags'); ?></label> |
547 <label class="screen-reader-text" for="newtag"><?php _e('Tags'); ?></label> |
548 <input type="hidden" name="tax_input[post_tag]" class="the-tags" id="tax-input[post_tag]" value="" /> |
548 <input type="hidden" name="tax_input[post_tag]" class="the-tags" id="tax-input[post_tag]" value="" /> |
549 <div class="ajaxtag"> |
549 <div class="ajaxtag"> |
550 <input type="text" name="newtag[post_tag]" class="newtag form-input-tip" size="16" autocomplete="off" value="" /> |
550 <input type="text" name="newtag[post_tag]" class="newtag form-input-tip" size="16" autocomplete="off" value="" /> |
551 <input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" tabindex="3" /> |
551 <input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" /> |
552 </div> |
552 </div> |
553 </div> |
553 </div> |
554 <div class="tagchecklist"></div> |
554 <div class="tagchecklist"></div> |
555 </div> |
555 </div> |
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> |
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> |