diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2005-12-03 13:49:00 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2005-12-03 13:49:00 +0000 |
| commit | fba798a103256f5f400cb1a1dcb9cc5b45cf8166 (patch) | |
| tree | c3855c768b2e80ff237fb92101285733277f96c5 /wp-inst/wp-admin/inline-uploading.php | |
| parent | 5133ce3a39180e0fa922a1d403224f5650089d95 (diff) | |
| download | wordpress-mu-fba798a103256f5f400cb1a1dcb9cc5b45cf8166.tar.gz wordpress-mu-fba798a103256f5f400cb1a1dcb9cc5b45cf8166.tar.xz wordpress-mu-fba798a103256f5f400cb1a1dcb9cc5b45cf8166.zip | |
WP Merge and misc fixes, worth upgrading for!
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@460 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wp-admin/inline-uploading.php')
| -rw-r--r-- | wp-inst/wp-admin/inline-uploading.php | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/wp-inst/wp-admin/inline-uploading.php b/wp-inst/wp-admin/inline-uploading.php index 0295200..69c5c78 100644 --- a/wp-inst/wp-admin/inline-uploading.php +++ b/wp-inst/wp-admin/inline-uploading.php @@ -38,7 +38,7 @@ switch($action) { case 'delete':
if ( !current_user_can('edit_post', (int) $attachment) )
- die(printf(__('You are not allowed to delete this attachment. %sGo back</a>'), '<a href="'.basename(__FILE__)."?post=$post&all=$all&action=upload\">") );
+die(__('You are not allowed to delete this attachment.').' <a href="'.basename(__FILE__)."?post=$post&all=$all&action=upload\">".__('Go back').'</a>');
wp_delete_attachment($attachment);
@@ -55,7 +55,7 @@ if( isset( $file[ 'error' ] ) == false ) $file[ 'error' ] = apply_filters( "check_uploaded_file", $file[ 'error' ] );
if ( isset($file['error']) )
- die($file['error'] . '<a href="' . basename(__FILE__) . '?action=upload&post="' . $post . '">Back to Image Uploading</a>');
+ die($file['error'] . '<a href="' . basename(__FILE__) . '?action=upload&post="' . $post . '">'.__('Back to Image Uploading').'</a>');
$url = $file['url'];
$file = $file['file'];
@@ -97,7 +97,7 @@ if ( preg_match('!^image/!', $attachment['post_mime_type']) ) { }
header("Location: ".basename(__FILE__)."?post=$post&all=$all&action=view&last=true");
-die;
+die();
case 'upload':
@@ -164,7 +164,7 @@ if ( count($attachments) > 0 ) { $__linked_to_file = __('Linked to File');
$__using_thumbnail = __('Using Thumbnail');
$__using_original = __('Using Original');
- $__no_thumbnail = __('<del>No Thumbnail</del>');
+ $__no_thumbnail = '<del>'.__('No Thumbnail').'</del>';
$__close = __('Close Options');
$__confirmdelete = __('Delete this file from the server?');
$__nothumb = __('There is no thumbnail associated with this photo.');
@@ -174,6 +174,12 @@ linkedtopage = '$__linked_to_page'; linkedtofile = '$__linked_to_file';
usingthumbnail = '$__using_thumbnail';
usingoriginal = '$__using_original';
+var aa = new Array();
+var ab = new Array();
+var imga = new Array();
+var imgb = new Array();
+var srca = new Array();
+var srcb = new Array();
";
foreach ( $attachments as $key => $attachment ) {
$ID = $attachment['ID'];
@@ -195,8 +201,8 @@ usingoriginal = '$__using_original'; $image = & $attachment;
if ( ($image['width'] > 128 || $image['height'] > 96) && !empty($image['thumb']) && file_exists(dirname($image['file']).'/'.$image['thumb']) ) {
$src = str_replace(basename($image['guid']), $image['thumb'], $image['guid']);
- $script .= "src{$ID}a = '$src';
-src{$ID}b = '{$image['guid']}';
+ $script .= "srca[{$ID}] = '$src';
+srcb[{$ID}] = '{$image['guid']}';
";
$thumb = 'true';
$thumbtext = $__using_thumbnail;
@@ -210,10 +216,10 @@ src{$ID}b = '{$image['guid']}'; $xpadding = (128 - $image['uwidth']) / 2;
$ypadding = (96 - $image['uheight']) / 2;
$style .= "#target{$ID} img { padding: {$ypadding}px {$xpadding}px; }\n";
- $script .= "a{$ID}a = '<a id=\"{$ID}\" rel=\"attachment\" class=\"imagelink\" href=\"$href\" onclick=\"doPopup({$ID});return false;\" title=\"{$image['post_title']}\">';
-a{$ID}b = '<a class=\"imagelink\" href=\"{$image['guid']}\" onclick=\"doPopup({$ID});return false;\" title=\"{$image['post_title']}\">';
-img{$ID}a = '<img id=\"image{$ID}\" src=\"$src\" alt=\"{$image['post_title']}\" $height_width />';
-img{$ID}b = '<img id=\"image{$ID}\" src=\"{$image['guid']}\" alt=\"{$image['post_title']}\" $height_width />';
+ $script .= "aa[{$ID}] = '<a id=\"{$ID}\" rel=\"attachment\" class=\"imagelink\" href=\"$href\" onclick=\"doPopup({$ID});return false;\" title=\"{$image['post_title']}\">';
+ab[{$ID}] = '<a class=\"imagelink\" href=\"{$image['guid']}\" onclick=\"doPopup({$ID});return false;\" title=\"{$image['post_title']}\">';
+imga[{$ID}] = '<img id=\"image{$ID}\" src=\"$src\" alt=\"{$image['post_title']}\" $height_width />';
+imgb[{$ID}] = '<img id=\"image{$ID}\" src=\"{$image['guid']}\" alt=\"{$image['post_title']}\" $height_width />';
";
$html .= "<div id='target{$ID}' class='attwrap left'>
<div id='popup{$ID}' class='popup'>
@@ -250,7 +256,7 @@ $images_width = $uwidth_sum + ( count($images) * 6 ) + 35; break;
default:
-die('This script was not meant to be called directly.');
+die(__('This script was not meant to be called directly.'));
}
?>
@@ -293,15 +299,15 @@ function toggleLink(n) { ol=document.getElementById('L'+n);
oi=document.getElementById('I'+n);
if ( oi.innerHTML == usingthumbnail ) {
- img = eval('img'+n+'a');
+ img = imga[n];
} else {
- img = eval('img'+n+'b');
+ img = imgb[n];
}
if ( ol.innerHTML == notlinked ) {
- od.innerHTML = eval('a'+n+'b')+img+'</a>';
+ od.innerHTML = ab[n]+img+'</a>';
ol.innerHTML = linkedtoimage;
} else if ( ol.innerHTML == linkedtoimage ) {
- od.innerHTML = eval('a'+n+'a')+img+'</a>';
+ od.innerHTML = aa[n]+img+'</a>';
ol.innerHTML = linkedtopage;
} else {
od.innerHTML = img;
@@ -312,10 +318,10 @@ function toggleOtherLink(n) { od=document.getElementById('div'+n);
ol=document.getElementById('L'+n);
if ( ol.innerHTML == linkedtofile ) {
- od.innerHTML = eval('a'+n+'a');
+ od.innerHTML = aa[n];
ol.innerHTML = linkedtopage;
} else {
- od.innerHTML = eval('a'+n+'b');
+ od.innerHTML = ab[n];
ol.innerHTML = linkedtofile;
}
}
@@ -323,10 +329,10 @@ function toggleImage(n) { o = document.getElementById('image'+n);
oi = document.getElementById('I'+n);
if ( oi.innerHTML == usingthumbnail ) {
- o.src = eval('src'+n+'b');
+ o.src = srcb[n];
oi.innerHTML = usingoriginal;
} else {
- o.src = eval('src'+n+'a');
+ o.src = srca[n];
oi.innerHTML = usingthumbnail;
}
}
|
