Changeset 7100
- Timestamp:
- 02/29/2008 06:54:15 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/css/media.css
r7092 r7100 20 20 font-weight: bold; 21 21 color: #f00; 22 } 23 24 .file-error { 25 font-weight: bold; 26 color: #f00; 27 margin: 0 15px; 22 28 } 23 29 -
trunk/wp-includes/functions.php
r7063 r7100 1176 1176 } 1177 1177 1178 function wp_ext2type( $ext ) { 1179 $ext2type = apply_filters('ext2type', array( 1180 'audio' => array('aac','ac3','aif','aiff','mp1','mp2','mp3','m3a','m4a','m4b','ogg','ram','wav','wma'), 1181 'video' => array('asf','avi','divx','dv','mov','mpg','mpeg','mp4','mpv','ogm','qt','rm','vob','wmv'), 1182 'document' => array('doc','pages','odt','rtf','pdf'), 1183 'spreadsheet' => array('xls','numbers','ods'), 1184 'interactive' => array('ppt','key','odp','swf'), 1185 'text' => array('txt'), 1186 'archive' => array('tar','bz2','gz','cab','dmg','rar','sea','sit','sqx','zip'), 1187 'code' => array('css','html','php','js'), 1188 )); 1189 foreach ( $ext2type as $type => $exts ) 1190 if ( in_array($ext, $exts) ) 1191 return $type; 1192 } 1178 1193 1179 1194 function wp_check_filetype( $filename, $mimes = null ) { -
trunk/wp-includes/js/swfupload/handlers.js
r7092 r7100 118 118 // file-specific message 119 119 function wpFileError(fileObj, message) { 120 jQuery('#media-upload-error-' + fileObj.id).show().text(message); 120 jQuery('#media-item-' + fileObj.id + ' .filename').append('<span class="file-error">'+message+'</span> <button type="button" class="button dismiss">'+swfuploadL10n.dismiss+'</button>'); 121 jQuery('.dismiss').click(function(){jQuery(this).parents('.media-item').slideUp(200, function(){jQuery(this).remove();})}); 121 122 } 122 123 … … 127 128 } 128 129 else if ( error_code == SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT ) { 130 fileQueued(fileObj); 129 131 wpFileError(fileObj, swfuploadL10n.file_exceeds_size_limit); 130 132 } 131 133 else if ( error_code == SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE ) { 134 fileQueued(fileObj); 132 135 wpFileError(fileObj, swfuploadL10n.zero_byte_file); 133 136 } 134 137 else if ( error_code == SWFUpload.QUEUE_ERROR.INVALID_FILETYPE ) { 138 fileQueued(fileObj); 135 139 wpFileError(fileObj, swfuploadL10n.invalid_filetype); 136 140 } -
trunk/wp-includes/post.php
r7074 r7100 885 885 foreach ( (array) $wildcard_mime_types as $type ) { 886 886 $type = str_replace('*', $wild, $type); 887 $patternses[1][$type] = $type;887 $patternses[1][$type] = "^$type$"; 888 888 if ( false === strpos($type, '/') ) { 889 $patternses[2][$type] = "^$type/ $wild$";890 $patternses[3][$type] = "$wild$type$wild";889 $patternses[2][$type] = "^$type/"; 890 $patternses[3][$type] = $type; 891 891 } 892 892 } … … 2362 2362 if ( !is_numeric($mime) ) 2363 2363 $icon = wp_cache_get("mime_type_icon_$mime"); 2364 2365 2364 if ( empty($icon) ) { 2366 2365 $post_id = 0; … … 2371 2370 $post_id = (int) $post->ID; 2372 2371 $ext = preg_replace('/^.+?\.([^.]+)$/', '$1', $post->guid); 2373 if ( !empty($ext) ) 2372 if ( !empty($ext) ) { 2374 2373 $post_mimes[] = $ext; 2374 if ( $ext_type = wp_ext2type( $ext ) ) 2375 $post_mimes[] = $ext_type; 2376 } 2375 2377 $mime = $post->post_mime_type; 2376 2378 } else { … … 2384 2386 2385 2387 if ( !is_array($icon_files) ) { 2386 $icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images ' );2387 $icon_dir_uri = apply_filters( 'icon_dir_uri', trailingslashit(get_option('siteurl')) . WPINC . '/images ' );2388 $icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/crystal' ); 2389 $icon_dir_uri = apply_filters( 'icon_dir_uri', trailingslashit(get_option('siteurl')) . WPINC . '/images/crystal' ); 2388 2390 $dirs = apply_filters( 'icon_dirs', array($icon_dir => $icon_dir_uri) ); 2389 2391 $icon_files = array(); 2390 foreach ( $dirs as $dir => $uri) { 2392 while ( $dirs ) { 2393 $dir = array_shift(array_keys($dirs)); 2394 $uri = array_shift($dirs); 2391 2395 if ( $dh = opendir($dir) ) { 2392 2396 while ( false !== $file = readdir($dh) ) { 2393 2397 $file = basename($file); 2398 if ( substr($file, 0, 1) == '.' ) 2399 continue; 2394 2400 if ( !in_array(strtolower(substr($file, -4)), array('.png', '.gif', '.jpg') ) ) { 2395 if ( is_dir( $file) )2401 if ( is_dir("$dir/$file") ) 2396 2402 $dirs["$dir/$file"] = "$uri/$file"; 2397 2403 continue; -
trunk/wp-includes/script-loader.php
r7092 r7100 89 89 $this->add( 'swfupload-degrade', '/wp-includes/js/swfupload/plugins/swfupload.graceful_degradation.js', array('swfupload'), '2.0.2'); 90 90 $this->add( 'swfupload-queue', '/wp-includes/js/swfupload/plugins/swfupload.queue.js', array('swfupload'), '2.0.2'); 91 $this->add( 'swfupload-handlers', '/wp-includes/js/swfupload/handlers.js', array('swfupload'), '2.0.2-2008022 7');91 $this->add( 'swfupload-handlers', '/wp-includes/js/swfupload/handlers.js', array('swfupload'), '2.0.2-20080228'); 92 92 // these error messages came from the sample swfupload js, they might need changing. 93 93 $this->localize( 'swfupload-handlers', 'swfuploadL10n', array( 94 'queue_limit_exceeded' => 'You have attempted to queue too many files.',95 'file_exceeds_size_limit' => 'The file you have selected is too big.',96 'zero_byte_file' => 'The file you selected is empty. Please select another file.',97 'invalid_filetype' => 'The file you choose is not an allowed file type.',98 'default_error' => 'An error occurred in the upload. Please try again later.',99 'missing_upload_url' => 'There was a configuration error. Please contact the server administrator.',100 'upload_limit_exceeded' => 'You may only upload 1 file.',101 'http_error' => 'HTTP error.',102 'upload_failed' => 'Upload failed.',103 'io_error' => 'IO error.',104 'security_error' => 'Security error.',105 'file_cancelled' => 'File cancelled.',106 'upload_stopped' => 'Upload stopped.',107 94 'queue_limit_exceeded' => __('You have attempted to queue too many files.'), 95 'file_exceeds_size_limit' => __('This file is too big. See php.ini.'), 96 'zero_byte_file' => __('The file you selected is empty. Please select another file.'), 97 'invalid_filetype' => __('The file you choose is not an allowed file type.'), 98 'default_error' => __('An error occurred in the upload. Please try again later.'), 99 'missing_upload_url' => __('There was a configuration error. Please contact the server administrator.'), 100 'upload_limit_exceeded' => __('You may only upload 1 file.'), 101 'http_error' => __('HTTP error.'), 102 'upload_failed' => __('Upload failed.'), 103 'io_error' => __('IO error.'), 104 'security_error' => __('Security error.'), 105 'file_cancelled' => __('File cancelled.'), 106 'upload_stopped' => __('Upload stopped.'), 107 'dismiss' => __('Dismiss'), 108 108 ) ); 109 109
Note: See TracChangeset
for help on using the changeset viewer.