Changeset 4355 for trunk/wp-admin/upload-functions.php
- Timestamp:
- 10/07/2006 06:31:39 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/upload-functions.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/upload-functions.php
r4353 r4355 17 17 $image_src = explode('"', $image_src); 18 18 $image_src = $image_src[1]; 19 $ thumb_src= wp_make_link_relative($image_src);19 $image_rel = wp_make_link_relative($image_src); 20 20 $class = 'image'; 21 $innerHTML = ' ' . str_replace($image_src, $thumb_src, $innerHTML); 21 $innerHTML = ' ' . str_replace($image_src, $image_rel, $innerHTML); 22 $image_base = str_replace($image_rel, '', $image_src); 22 23 } 23 24 24 $src = wp_make_link_relative( get_the_guid() ); 25 $src_base = get_the_guid(); 26 $src = wp_make_link_relative( $src_base ); 27 $src_base = str_replace($src, '', $src_base); 25 28 26 29 $r = ''; … … 34 37 $r .= "\n\t\t<div class='upload-file-data'>\n\t\t\t<p>\n"; 35 38 $r .= "\t\t\t\t<input type='hidden' name='attachment-url-$id' id='attachment-url-$id' value='$src' />\n"; 36 37 if ( $image_src ) 38 $r .= "\t\t\t\t<input type='hidden' name='attachment-thumb-url-$id' id='attachment-thumb-url-$id' value='$thumb_src' />\n"; 39 $r .= "\t\t\t\t<input type='hidden' name='attachment-url-base-$id' id='attachment-url-base-$id' value='$src_base' />\n"; 40 41 if ( isset($attachment_data['thumb']) ) { 42 $r .= "\t\t\t\t<input type='hidden' name='attachment-thumb-url-$id' id='attachment-thumb-url-$id' value='$image_rel' />\n"; 43 $r .= "\t\t\t\t<input type='hidden' name='attachment-thumb-url-base-$id' id='attachment-thumb-url-base-$id' value='$image_base' />\n"; 44 } elseif ( $image_rel ) 45 $r .= "\t\t\t\t<input type='hidden' name='attachment-is-image-$id' id='attachment-is-image-$id' value='1' />\n"; 39 46 if ( isset($width) ) { 40 47 $r .= "\t\t\t\t<input type='hidden' name='attachment-width-$id' id='attachment-width-$id' value='$width' />\n"; … … 49 56 50 57 function wp_upload_view() { 51 global $style, $post_id ;58 global $style, $post_id, $style; 52 59 $id = get_the_ID(); 53 60 $attachment_data = get_post_meta( $id, '_wp_attachment_metadata', true ); … … 55 62 <div id="upload-file"> 56 63 <div id="file-title"> 57 <h2><?php if ( !isset($attachment_data['width']) )64 <h2><?php if ( !isset($attachment_data['width']) && 'inline' != $style ) 58 65 echo "<a href='" . get_the_guid() . "' title='" . __('Direct link to file') . "'>"; 59 66 the_title(); 60 if ( !isset($attachment_data['width']) )67 if ( !isset($attachment_data['width']) && 'inline' != $style ) 61 68 echo '</a>'; 62 69 ?></h2> … … 72 79 73 80 <div id="upload-file-view" class="alignleft"> 74 <?php if ( isset($attachment_data['width']) )81 <?php if ( isset($attachment_data['width']) && 'inline' != $style ) 75 82 echo "<a href='" . get_the_guid() . "' title='" . __('Direct link to file') . "'>"; 76 83 echo wp_upload_display( array(171, 128) ); 77 if ( isset($attachment_data['width']) )84 if ( isset($attachment_data['width']) && 'inline' != $style ) 78 85 echo '</a>'; ?> 79 86 </div> 80 87 <?php the_attachment_links( $id ); ?> 81 88 </div> 82 <?php 89 <?php echo "<form action='' id='browse-form'><input type='hidden' id='nonce-value' value='" . wp_create_nonce( 'inlineuploading' ) . "' /></form>\n"; 83 90 } 84 91 … … 95 102 ?> 96 103 <div id="file-title"> 97 <h2><?php if ( !isset($attachment_data['width']) )104 <h2><?php if ( !isset($attachment_data['width']) && 'inline' != $style ) 98 105 echo "<a href='" . get_the_guid() . "' title='" . __('Direct link to file') . "'>"; 99 106 the_title(); 100 if ( !isset($attachment_data['width']) )107 if ( !isset($attachment_data['width']) && 'inline' != $style ) 101 108 echo '</a>'; 102 109 ?></h2> … … 112 119 113 120 <div id="upload-file-view" class="alignleft"> 114 <?php if ( isset($attachment_data['width']) )121 <?php if ( isset($attachment_data['width']) && 'inline' != $style ) 115 122 echo "<a href='" . get_the_guid() . "' title='" . __('Direct link to file') . "'>"; 116 123 echo wp_upload_display( array(171, 128) ); 117 if ( isset($attachment_data['width']) )124 if ( isset($attachment_data['width']) && 'inline' != $style ) 118 125 echo '</a>'; ?> 119 126 </div> 120 127 <?php endif; ?> 121 <table> 122 <?php if ( !$id ): ?>128 <table><col /><col class="widefat" /> 129 <?php if ( $id ): ?> 123 130 <tr> 124 <th scope="row"><label for="upload"><?php _e('File:'); ?></label></th> 131 <th scope="row"><label for="url"><?php _e('URL'); ?></label></th> 132 <td><input type="text" id="url" class="readonly" value="<?php the_guid(); ?>" readonly="readonly" /></td> 133 </tr> 134 <?php else : ?> 135 <tr> 136 <th scope="row"><label for="upload"><?php _e('File'); ?></label></th> 125 137 <td><input type="file" id="upload" name="image" /></td> 126 138 </tr> 127 139 <?php endif; ?> 128 140 <tr> 129 <th scope="row"><label for="post_title"><?php _e('Title :'); ?></label></th>141 <th scope="row"><label for="post_title"><?php _e('Title'); ?></label></th> 130 142 <td><input type="text" id="post_title" name="post_title" value="<?php echo $attachment->post_title; ?>" /></td> 131 143 </tr> 132 144 <tr> 133 <th scope="row"><label for="post_content"><?php _e('Description :'); ?></label></th>145 <th scope="row"><label for="post_content"><?php _e('Description'); ?></label></th> 134 146 <td><textarea name="post_content" id="post_content"><?php echo $attachment->post_content; ?></textarea></td> 135 147 </tr> 136 <tr id="buttons"> 137 <th></th> 138 <td> 148 <tr id="buttons" class="submit"> 149 <td colspan='2'> 150 <?php if ( $id ) : ?> 151 <input type="submit" name="delete" id="delete" class="delete alignleft" value="<?php _e('Delete File'); ?>" /> 152 <?php endif; ?> 139 153 <input type="hidden" name="from_tab" value="<?php echo $tab; ?>" /> 140 154 <input type="hidden" name="action" value="<?php echo $id ? 'save' : 'upload'; ?>" /> … … 147 161 <div class="submit"> 148 162 <input type="submit" value="<?php $id ? _e('Save') : _e('Upload'); ?> »" /> 149 <?php if ( $id ) : ?>150 <input type="submit" name="delete" class="delete" value="<?php _e('Delete'); ?>" />151 <?php endif; ?>152 163 </div> 153 164 </td> … … 353 364 if ( 'inline' == @$_GET['style'] ) { 354 365 echo "<style type='text/css'>\n"; 355 echo "\tbody { height: 1 4em; overflow: hidden; }\n";366 echo "\tbody { height: 15em; overflow: hidden; }\n"; 356 367 echo "\t#upload-content { overflow-y: auto; }\n"; 357 368 echo "\t#upload-file { position: absolute; }\n";
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)