- 5403C9FF616259F4927CC55A812B565E3D66A3D2940E069E470A0D773A0662F102D3EDCE7328BFCB76EB4F87EBA1B4B9BE7C05887A8B896AE4D6F9839B7FBE36
+ 4D859251298AFA201EFB8030AD57C8358E9D93F50CC19C0CC7460387CC79F090A13A565A06E06F483766D6749942B4336806A3510E3F3D7B58CB50BF67CFE0AB
mp-wp/wp-admin/upload.php
(8 . 9)(8 . 6)
30850
30851 /** WordPress Administration Bootstrap */
30852 require_once('admin.php');
30853 wp_enqueue_script( 'wp-ajax-response' );
30854 wp_enqueue_script( 'jquery-ui-draggable' );
30855 wp_enqueue_script( 'jquery-ui-resizable' );
30856
30857 if (!current_user_can('upload_files'))
30858 wp_die(__('You do not have permission to upload files.'));
(68 . 9)(65 . 9)
30860 exit;
30861 }
30862
30863 } elseif ( isset($_GET['action']) && isset($_GET['media']) && ( -1 != $_GET['action'] || -1 != $_GET['action2'] ) ) {
30864 } elseif ( isset($_GET['action']) && isset($_GET['media']) && -1 != $_GET['action'] ) {
30865 check_admin_referer('bulk-media');
30866 $doaction = ( -1 != $_GET['action'] ) ? $_GET['action'] : $_GET['action2'];
30867 $doaction = $_GET['action'];
30868
30869 if ( 'delete' == $doaction ) {
30870 foreach( (array) $_GET['media'] as $post_id_del ) {
(200 . 7)(197 . 6)
30872 $type_links[] = "<li><a href='upload.php?post_mime_type=$mime_type'$class>" . sprintf( __ngettext( $label[2][0], $label[2][1], $num_posts[$mime_type] ), number_format_i18n( $num_posts[$mime_type] )) . '</a>';
30873 }
30874 $class = isset($_GET['detached']) ? ' class="current"' : '';
30875 $type_links[] = '<li><a href="upload.php?detached=1"' . $class . '>' . __('Unattached') . '</a>';
30876
30877 echo implode( " |</li>\n", $type_links) . '</li>';
30878 unset($type_links);
(230 . 22)(226 . 19)
30880 'current' => $_GET['paged']
30881 ));
30882
30883 if ( $page_links ) : ?>
30884 if ( $page_links ) { ?>
30885 <div class="tablenav-pages"><?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s–%s of %s' ) . '</span>%s',
30886 number_format_i18n( ( $_GET['paged'] - 1 ) * $wp_query->query_vars['posts_per_page'] + 1 ),
30887 number_format_i18n( min( $_GET['paged'] * $wp_query->query_vars['posts_per_page'], $wp_query->found_posts ) ),
30888 number_format_i18n( $wp_query->found_posts ),
30889 $page_links
30890 ); echo $page_links_text; ?></div>
30891 <?php endif; ?>
30892 <?php } ?>
30893
30894 <div class="alignleft actions">
30895 <select name="action" class="select-action">
30896 <option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
30897 <option value="delete"><?php _e('Delete'); ?></option>
30898 <?php if ( isset($orphans) ) { ?>
30899 <option value="attach"><?php _e('Attach to a post'); ?></option>
30900 <?php } ?>
30901 </select>
30902 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
30903 <?php wp_nonce_field('bulk-media'); ?>
(299 . 22)(292 . 12)
30905 <table class="widefat" cellspacing="0">
30906 <thead>
30907 <tr>
30908 <th scope="col" class="check-column"><input type="checkbox" /></th>
30909 <th scope="col" class="check-column"> </th>
30910 <th scope="col"></th>
30911 <th scope="col"><?php echo _c('Media|media column header'); ?></th>
30912 <th scope="col"><?php echo _c('Date Added|media column header'); ?></th>
30913 </tr>
30914 </thead>
30915
30916 <tfoot>
30917 <tr>
30918 <th scope="col" class="check-column"><input type="checkbox" /></th>
30919 <th scope="col"></th>
30920 <th scope="col"><?php echo _c('Media|media column header'); ?></th>
30921 <th scope="col"><?php echo _c('Date Added|media column header'); ?></th>
30922 </tr>
30923 </tfoot>
30924
30925 <tbody id="the-list" class="list:post">
30926 <?php
30927 if ( $orphans ) {
(323 . 7)(306 . 7)
30929 $att_title = wp_specialchars( _draft_or_post_title($post->ID) );
30930 ?>
30931 <tr id='post-<?php echo $post->ID; ?>' class='<?php echo $class; ?>' valign="top">
30932 <th scope="row" class="check-column"><input type="checkbox" name="media[]" value="<?php echo $post->ID; ?>" /></th>
30933 <td scope="row" class="check-column"><input type="checkbox" name="media[]" value="<?php echo $post->ID; ?>" /></td>
30934
30935 <td class="media-icon"><?php
30936 if ( $thumb = wp_get_attachment_image( $post->ID, array(80, 60), true ) ) { ?>
(339 . 10)(322 . 8)
30938 if ( current_user_can('edit_post', $post->ID) )
30939 $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '">' . __('Edit') . '</a>';
30940 if ( current_user_can('delete_post', $post->ID) )
30941 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
30942 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "'>" . __('Delete') . "</a>";
30943 $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . attribute_escape(sprintf(__('View "%s"'), $title)) . '" rel="permalink">' . __('View') . '</a>';
30944 if ( current_user_can('edit_post', $post->ID) )
30945 $actions['attach'] = '<a href="#the-list" onclick="findPosts.open(\'media[]\',\''.$post->ID.'\');return false;">'.__('Attach').'</a>';
30946 $action_count = count($actions);
30947 $i = 0;
30948 foreach ( $actions as $action => $link ) {
(377 . 58)(358 . 27)
30950 </tbody>
30951 </table>
30952
30953 <?php find_posts_div();
30954
30955 <?php
30956 } else {
30957 include( 'edit-attachment-rows.php' );
30958 } ?>
30959
30960 <div id="ajax-response"></div>
30961
30962 <?php if ( $page_links ) { ?>
30963 <div class="tablenav">
30964 <div class="tablenav-pages"><?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s–%s of %s' ) . '</span>%s',
30965 number_format_i18n( ( $_GET['paged'] - 1 ) * $wp_query->query_vars['posts_per_page'] + 1 ),
30966 number_format_i18n( min( $_GET['paged'] * $wp_query->query_vars['posts_per_page'], $wp_query->found_posts ) ),
30967 number_format_i18n( $wp_query->found_posts ),
30968 $page_links
30969 ); echo $page_links_text; ?></div>
30970 <div class="tablenav">
30971
30972 <?php
30973 if ( $page_links )
30974 echo "<div class='tablenav-pages'>$page_links_text</div>";
30975 ?>
30976
30977 <div class="alignleft actions">
30978 <select name="action2" class="select-action">
30979 <option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
30980 <option value="delete"><?php _e('Delete'); ?></option>
30981 <?php if ( isset($orphans) ) { ?>
30982 <option value="attach"><?php _e('Attach to a post'); ?></option>
30983 <?php } ?>
30984 </select>
30985 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
30986 </div>
30987
30988 <br class="clear" />
30989 </div>
30990 </form>
30991 <br class="clear" />
30992
30993 </div>
30994
30995 <script type="text/javascript">
30996 /* <![CDATA[ */
30997 (function($){
30998 $(document).ready(function(){
30999 $('#doaction, #doaction2').click(function(e){
31000 if ( $('select[name^="action"]').val() == 'delete' ) {
31001 var m = '<?php echo js_escape(__("You are about to delete the selected attachments.\n 'Cancel' to stop, 'OK' to delete.")); ?>';
31002 return showNotice.warn(m);
31003 } else if ( $('select[name^="action"]').val() == 'attach' ) {
31004 e.preventDefault();
31005 findPosts.open();
31006 }
31007 });
31008 });
31009 })(jQuery);
31010 columns.init('upload');
31011 /* ]]> */
31012 </script>
31013
31014 <?php
31015
31016 include('admin-footer.php');