diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-10-09 11:39:17 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-10-09 11:39:17 +0000 |
| commit | 75e0ccc3a64e164d036da4f71f458520ddea3b24 (patch) | |
| tree | 94f00db692e25c95030f7984c27178e1bd7e1bcd /wp-admin | |
| parent | ca036ad95fc44c318275ab539a52f1eb6fddf060 (diff) | |
| download | wordpress-mu-75e0ccc3a64e164d036da4f71f458520ddea3b24.tar.gz wordpress-mu-75e0ccc3a64e164d036da4f71f458520ddea3b24.tar.xz wordpress-mu-75e0ccc3a64e164d036da4f71f458520ddea3b24.zip | |
WP Merge - needs testing.
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@797 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin')
| -rw-r--r-- | wp-admin/admin-functions.php | 28 | ||||
| -rw-r--r-- | wp-admin/comment.php | 3 | ||||
| -rw-r--r-- | wp-admin/edit-category-form.php | 6 | ||||
| -rw-r--r-- | wp-admin/edit-form-comment.php | 2 | ||||
| -rw-r--r-- | wp-admin/export.php | 1 | ||||
| -rw-r--r-- | wp-admin/import/mt.php | 43 | ||||
| -rw-r--r-- | wp-admin/import/wordpress.php | 8 | ||||
| -rw-r--r-- | wp-admin/options-privacy.php | 2 | ||||
| -rw-r--r-- | wp-admin/options-reading.php | 10 | ||||
| -rw-r--r-- | wp-admin/page.php | 8 | ||||
| -rw-r--r-- | wp-admin/profile-update.php | 5 | ||||
| -rw-r--r-- | wp-admin/themes.php | 8 | ||||
| -rw-r--r-- | wp-admin/upgrade-functions.php | 4 | ||||
| -rw-r--r-- | wp-admin/upgrade.php | 1 | ||||
| -rw-r--r-- | wp-admin/upload-functions.php | 68 | ||||
| -rw-r--r-- | wp-admin/upload-js.php | 62 | ||||
| -rw-r--r-- | wp-admin/upload.css | 11 | ||||
| -rw-r--r-- | wp-admin/upload.php | 2 | ||||
| -rw-r--r-- | wp-admin/user-edit.php | 3 | ||||
| -rw-r--r-- | wp-admin/users.php | 2 | ||||
| -rw-r--r-- | wp-admin/wp-admin.css | 73 |
21 files changed, 222 insertions, 128 deletions
diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index 7eef22d..64cbb1c 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -1984,27 +1984,35 @@ function the_attachment_links($id = false) { return false; $icon = get_attachment_icon($post->ID); - + $attachment_data = get_post_meta( $id, '_wp_attachment_metadata', true ); + $thumb = isset($attachment_data['thumb']); ?> <form id="the-attachment-links"> <table> + <col /> + <col class="widefat" /> <tr> - <th scope="row"><?php _e('Text linked to file') ?></th> - <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo $post->guid ?>" class="attachmentlink"><?php echo basename($post->guid) ?></a></textarea></td> - </tr> - <tr> - <th scope="row"><?php _e('Text linked to subpost') ?></th> - <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link($post->ID) ?>" rel="attachment" id="<?php echo $post->ID ?>"><?php echo $post->post_title ?></a></textarea></td> + <th scope="row"><?php _e('URL') ?></th> + <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><?php echo $post->guid ?></textarea></td> </tr> <?php if ( $icon ) : ?> <tr> - <th scope="row"><?php _e('Thumbnail linked to file') ?></th> - <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo $post->guid ?>" class="attachmentlink"><?php echo $icon ?></a></textarea></td> + <th scope="row"><?php $thumb ? _e('Thumbnail linked to file') : _e('Image linked to file'); ?></th> + <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo $post->guid; ?>" id="<?php echo $post->ID ?>"><?php echo $icon ?></a></textarea></td> </tr> <tr> - <th scope="row"><?php _e('Thumbnail linked to subpost') ?></th> + <th scope="row"><?php $thumb ? _e('Thumbnail linked to page') : _e('Image linked to file'); ?></th> <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link($post->ID) ?>" rel="attachment" id="<?php echo $post->ID ?>"><?php echo $icon ?></a></textarea></td> </tr> +<?php else : ?> + <tr> + <th scope="row"><?php _e('Link to file') ?></th> + <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo $post->guid ?>" class="attachmentlink"><?php echo basename($post->guid); ?></a></textarea></td> + </tr> + <tr> + <th scope="row"><?php _e('Link to page') ?></th> + <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link($post->ID) ?>" rel="attachment" id="<?php echo $post->ID ?>"><?php the_title(); ?></a></textarea></td> + </tr> <?php endif; ?> </table> </form> diff --git a/wp-admin/comment.php b/wp-admin/comment.php index 0b773b1..6589d8b 100644 --- a/wp-admin/comment.php +++ b/wp-admin/comment.php @@ -12,7 +12,8 @@ if ( isset( $_POST['deletecomment'] ) ) switch($action) { case 'editcomment': $title = __('Edit Comment'); - + if ( user_can_richedit() ) + wp_enqueue_script( 'wp_tiny_mce' ); require_once ('admin-header.php'); $comment = (int) $_GET['comment']; diff --git a/wp-admin/edit-category-form.php b/wp-admin/edit-category-form.php index 9b700af..66581ae 100644 --- a/wp-admin/edit-category-form.php +++ b/wp-admin/edit-category-form.php @@ -29,10 +29,8 @@ if ( ! empty($cat_ID) ) { <tr> <th scope="row" valign="top"><label for="category_parent"><?php _e('Category parent:') ?></label></th> <td> - <select name='category_parent' id='category_parent'> - <option value='0' <?php if (!$category->category_parent) echo " selected='selected'"; ?>><?php _e('None') ?></option> - <?php wp_dropdown_cats($category->cat_ID, $category->category_parent); ?> - </select></td> + <?php wp_dropdown_categories('hide_empty=0&name=category_parent&selected=' . $category->category_parent . '&hierarchical=1&show_option_none=' . __('None')); ?> + </td> </tr> <tr> <th scope="row" valign="top"><label for="category_description"><?php _e('Description: (optional)') ?></label></th> diff --git a/wp-admin/edit-form-comment.php b/wp-admin/edit-form-comment.php index e90e059..26d79eb 100644 --- a/wp-admin/edit-form-comment.php +++ b/wp-admin/edit-form-comment.php @@ -36,7 +36,7 @@ addLoadEvent(focusit); </div> </fieldset> -<fieldset style="clear: both;"> +<fieldset id="<?php echo user_can_richedit() ? 'commentdivrich' : 'commentdiv'; ?>" style="clear: both;"> <legend><?php _e('Comment') ?></legend> <?php the_editor($comment->comment_content, 'content', 'newcomment_author_url'); ?> </fieldset> diff --git a/wp-admin/export.php b/wp-admin/export.php index f0d7b7d..f50b8e0 100644 --- a/wp-admin/export.php +++ b/wp-admin/export.php @@ -19,6 +19,7 @@ require_once ('admin-header.php'); <input type="hidden" name="download" value="true" />
</p>
</form>
+<p><?php _e('If you are considering moving your blog to another host we recommend a number of <a href="http://wordpress.org/hosting/">hosting services</a>.'); ?></p>
</div>
</div>
diff --git a/wp-admin/import/mt.php b/wp-admin/import/mt.php index 014529e..b86ae33 100644 --- a/wp-admin/import/mt.php +++ b/wp-admin/import/mt.php @@ -52,25 +52,8 @@ class MT_Import { function checkauthor($author) { global $wpdb; //mtnames is an array with the names in the mt import file - $pass = 'changeme'; - if (!(in_array($author, $this->mtnames))) { //a new mt author name is found - ++ $this->j; - $this->mtnames[$this->j] = $author; //add that new mt author name to an array - $user_id = username_exists($this->newauthornames[$this->j]); //check if the new author name defined by the user is a pre-existing wp user - if (!$user_id) { //banging my head against the desk now. - if ($newauthornames[$this->j] == 'left_blank') { //check if the user does not want to change the authorname - $user_id = wp_create_user($author, $pass); - $this->newauthornames[$this->j] = $author; //now we have a name, in the place of left_blank. - } else { - $user_id = wp_create_user($this->newauthornames[$this->j], $pass); - } - } else { - return $user_id; // return pre-existing wp username if it exists - } - } else { - $key = array_search($author, $this->mtnames); //find the array key for $author in the $mtnames array - $user_id = username_exists($this->newauthornames[$key]); //use that key to get the value of the author's name from $newauthornames - } + $key = array_search($author, $this->mtnames); //find the array key for $author in the $mtnames array + $user_id = username_exists($this->newauthornames[$key]); //use that key to get the value of the author's name from $newauthornames return $user_id; } @@ -112,13 +95,6 @@ class MT_Import { $formnames = array (); $selectnames = array (); - foreach ($_POST['user'] as $key => $line) { - $newname = trim(stripslashes($line)); - if ($newname == '') - $newname = 'left_blank'; //passing author names from step 1 to step 2 is accomplished by using POST. left_blank denotes an empty entry in the form. - array_push($formnames, "$newname"); - } // $formnames is the array with the form entered names - foreach ($_POST['userselect'] as $user => $key) { $selected = trim(stripslashes($key)); array_push($selectnames, "$selected"); @@ -150,12 +126,12 @@ class MT_Import { $j = -1; foreach ($authors as $author) { ++ $j; - echo '<li>'.__('Current author:').' <strong>'.$author.'</strong><br />'.sprintf(__('Create user %1$s or map to existing'), ' <input type="text" value="'.$author.'" name="'.'user[]'.'" maxlength="30"> <br />'); + echo '<li><i>'.$author.'</i><br />'.'<input type="text" value="'.$author.'" name="'.'user[]'.'" maxlength="30">'; $this->users_form($j); echo '</li>'; } - echo '<input type="submit" value="'.__('Submit').'">'.'<br/>'; + echo '<input type="submit" value="Submit">'.'<br/>'; echo '</form>'; echo '</ol></div>'; @@ -164,10 +140,7 @@ class MT_Import { function select_authors() { $file = wp_import_handle_upload(); if ( isset($file['error']) ) { - $this->header(); - echo '<p>'.__('Sorry, there has been an error').'.</p>'; - echo '<p><strong>' . $file['error'] . '</strong></p>'; - $this->footer(); + echo $file['error']; return; } $this->file = $file['file']; @@ -199,7 +172,7 @@ class MT_Import { // We want the excerpt preg_match("|-----\nEXCERPT:(.*)|s", $post, $excerpt); - $post_excerpt = $wpdb->escape(trim($excerpt[1])); + $excerpt = $wpdb->escape(trim($excerpt[1])); $post = preg_replace("|(-----\nEXCERPT:.*)|s", '', $post); // We're going to put extended body into main body with a more tag @@ -336,7 +309,7 @@ class MT_Import { } } if ( $num_comments ) - printf(' '.__('(%s comments)'), $num_comments); + printf(__(' (%s comments)'), $num_comments); // Finally the pings // fix the double newline on the first one @@ -384,7 +357,7 @@ class MT_Import { } } if ( $num_pings ) - printf(' '.__('(%s pings)'), $num_pings); + printf(__(' (%s pings)'), $num_pings); echo "</li>"; } diff --git a/wp-admin/import/wordpress.php b/wp-admin/import/wordpress.php index 5c67eec..46f5892 100644 --- a/wp-admin/import/wordpress.php +++ b/wp-admin/import/wordpress.php @@ -26,7 +26,7 @@ class WP_Import { function greet() {
echo '<div class="narrow">';
- echo '<p>'.__('Howdy! Upload your WordPress eXtended RSS (WXR) file and we’ll import the posts and comments into this blog.').'</p>';
+ echo '<p>'.__('Howdy! Upload your WordPress eXtended RSS (WXR) file and we’ll import the posts, comments, custom fields, and categories into this blog.').'</p>';
wp_import_upload_form("admin.php?import=wordpress&step=1");
echo '</div>';
}
@@ -150,8 +150,8 @@ class WP_Import { $j = -1;
foreach ($authors as $author) {
++ $j;
- echo '<li>'.__('Current author:').' <strong>'.$author.'</strong><br />'.sprintf(__('Create user %1$s or map to existing'), ' <input type="text" value="'.$author.'" name="'.'user[]'.'" maxlength="30"> <br />');
- $this->users_form($j);
+ echo '<li>Current author: <strong>'.$author.'</strong><br />'.'Map to existing: ';
+ $this->users_form($author);
echo '</li>';
}
@@ -308,6 +308,6 @@ class WP_Import { $wp_import = new WP_Import();
-register_importer('wordpress', 'WordPress', __('Import posts from a WordPress export file'), array ($wp_import, 'dispatch'));
+register_importer('wordpress', 'WordPress', __('Import <strong>posts, comments, custom fields, and categories</strong> from a WordPress export file'), array ($wp_import, 'dispatch'));
?>
diff --git a/wp-admin/options-privacy.php b/wp-admin/options-privacy.php index 18f71c5..61a9ed6 100644 --- a/wp-admin/options-privacy.php +++ b/wp-admin/options-privacy.php @@ -22,7 +22,7 @@ if( trim( get_option('blog_public') ) == '' ) <label for="blog-public"><?php _e('I would like my blog to be visible to anyone who visits, including search engines, archivers and in public listings around this site.') ?></label> <br /> <input id="blog-norobots" type="radio" name="blog_public" value="0" <?php checked('0', get_option('blog_public')); ?> /> - <label for="blog-norobots"><?php _e('I would like to block search engines, but allow normal folks') ?></label> + <label for="blog-norobots"><?php _e( 'I would like to block search engines, but allow normal visitors' ); ?></label> <?php do_action('blog_privacy_selector'); ?> </td> </tr> diff --git a/wp-admin/options-reading.php b/wp-admin/options-reading.php index bb7bd9e..fc73637 100644 --- a/wp-admin/options-reading.php +++ b/wp-admin/options-reading.php @@ -5,6 +5,16 @@ $title = __('Reading Options'); $parent_file = 'options-general.php'; include('admin-header.php'); + +// Sanity checks +if ( 'page' == get_option('show_on_front') ) { + $front_page = get_option('page_on_front'); + if ( empty($front_page) ) { + update_option('show_on_front', 'posts'); + delete_option('page_for_posts'); + delete_option('page_on_front'); + } +} ?> <div class="wrap"> diff --git a/wp-admin/page.php b/wp-admin/page.php index 83bc1c4..4728b5d 100644 --- a/wp-admin/page.php +++ b/wp-admin/page.php @@ -45,14 +45,14 @@ case 'edit': $editing = true; $page_ID = $post_ID = $p = (int) $_GET['post']; $post = get_post_to_edit($page_ID); - if($post->post_status == 'draft') { - wp_enqueue_script('prototype'); - wp_enqueue_script('autosave'); - } if( $post->post_type == 'post' ) { header( "Location: " . str_replace( "page.php", "post.php", $_SERVER[ 'REQUEST_URI' ] ) ); die(); } + if($post->post_status == 'draft') { + wp_enqueue_script('prototype'); + wp_enqueue_script('autosave'); + } require_once('admin-header.php'); if ( !current_user_can('edit_page', $page_ID) ) diff --git a/wp-admin/profile-update.php b/wp-admin/profile-update.php index 2c6028f..944f799 100644 --- a/wp-admin/profile-update.php +++ b/wp-admin/profile-update.php @@ -21,6 +21,11 @@ if ( !isset( $_POST['rich_editing'] ) ) $_POST['rich_editing'] = 'false'; update_user_option( $current_user->id, 'rich_editing', $_POST['rich_editing'], true ); +if ( isset( $_POST['primary_blog'] ) ) { + $primary_blog = (int) $_POST['primary_blog']; + update_user_option( $current_user->id, 'primary_blog', $primary_blog, true ); +} + do_action('personal_options_update'); if ( 'profile' == $_POST['from'] ) diff --git a/wp-admin/themes.php b/wp-admin/themes.php index 3f7b2c6..9f6d7b5 100644 --- a/wp-admin/themes.php +++ b/wp-admin/themes.php @@ -69,9 +69,9 @@ require_once('admin-header.php'); <h2><?php _e('Current Theme'); ?></h2> <div id="currenttheme"> <?php if ( $ct->screenshot ) : ?> -<img src="<?php echo get_option('siteurl') . '/' . $ct->stylesheet_dir . '/' . $ct->screenshot; ?>" alt="<?php _e('Current theme preview'); ?>" /> +<img src="../<?php echo $ct->stylesheet_dir . '/' . $ct->screenshot; ?>" alt="<?php _e('Current theme preview'); ?>" /> <?php endif; ?> -<h3><?php printf(__('%1$s %2$s by %3$s'), $ct->title, $ct->version, $ct->author) ; ?></h3> +<h3><?php printf(__('%1$s %2$s by %3$s'), $ct->title, '', $ct->author) ; ?></h3> <p><?php echo $ct->description; ?></p> </div> @@ -98,11 +98,11 @@ foreach ($theme_names as $theme_name) { $activate_link = wp_nonce_url("themes.php?action=activate&template=$template&stylesheet=$stylesheet", 'switch-theme_' . $template); ?> <div class="available-theme"> -<h3><a href="<?php echo $activate_link; ?>"><?php echo "$title $version"; ?></a></h3> +<h3><a href="<?php echo $activate_link; ?>"><?php echo "$title"; ?></a></h3> <a href="<?php echo $activate_link; ?>" class="screenshot"> <?php if ( $screenshot ) : ?> -<img src="<?php echo get_option('siteurl') . '/' . $stylesheet_dir . '/' . $screenshot; ?>" alt="" /> +<img src="../<?php echo $stylesheet_dir . '/' . $screenshot; ?>" alt="" /> <?php endif; ?> </a> diff --git a/wp-admin/upgrade-functions.php b/wp-admin/upgrade-functions.php index a3cd623..6e54544 100644 --- a/wp-admin/upgrade-functions.php +++ b/wp-admin/upgrade-functions.php @@ -512,7 +512,7 @@ function upgrade_210() { $posts = $wpdb->get_results("SELECT ID, post_date FROM $wpdb->posts WHERE post_status ='future'"); if ( !empty($posts) ) foreach ( $posts as $post ) - wp_schedule_single_event(mysql2date('U', $post->post_date), 'publish_future_post', $post->ID); + wp_schedule_single_event(mysql2date('U', $post->post_date), 'publish_future_post', array($post->ID)); } if ( $wp_current_db_version < 3570 ) { // Create categories for link categories if a category with the same @@ -686,7 +686,7 @@ function dbDelta($queries, $execute = true) { // Create a tablename index for an array ($cqueries) of queries foreach($queries as $qry) { - if(preg_match("|CREATE TABLE ([^ ]*)|", $qry, $matches)) { + if(preg_match("|CREATE TABLE (?:IF NOT EXISTS )?([^ ]*)|", $qry, $matches)) { $cqueries[strtolower($matches[1])] = $qry; $for_update[$matches[1]] = 'Created table '.$matches[1]; } diff --git a/wp-admin/upgrade.php b/wp-admin/upgrade.php index a60e50a..c0a4f7e 100644 --- a/wp-admin/upgrade.php +++ b/wp-admin/upgrade.php @@ -46,7 +46,6 @@ switch($step) { } else { $wpdb->query( "INSERT INTO wp_blog_versions ( `blog_id` , `db_version` , `last_updated` ) VALUES ( '{$wpdb->blogid}', '{$wp_db_version}', NOW());" ); } - ?> <h2><?php _e('Step 1'); ?></h2> <p><?php printf(__("There's actually only one step. So if you see this, you're done. <a href='%s'>Have fun</a>!"), $backto); ?></p> diff --git a/wp-admin/upload-functions.php b/wp-admin/upload-functions.php index 29b48d8..623daeb 100644 --- a/wp-admin/upload-functions.php +++ b/wp-admin/upload-functions.php @@ -16,10 +16,16 @@ function wp_upload_display( $dims = false, $href = '' ) { if ( $image_src = strstr($innerHTML, 'src="') ) { $image_src = explode('"', $image_src); $image_src = $image_src[1]; + $image_rel = wp_make_link_relative($image_src); $class = 'image'; - $innerHTML = ' ' . $innerHTML; + $innerHTML = ' ' . str_replace($image_src, $image_rel, $innerHTML); + $image_base = str_replace($image_rel, '', $image_src); } + $src_base = get_the_guid(); + $src = wp_make_link_relative( $src_base ); + $src_base = str_replace($src, '', $src_base); + $r = ''; if ( $href ) @@ -29,10 +35,14 @@ function wp_upload_display( $dims = false, $href = '' ) { if ( $href ) $r .= "</a>\n"; $r .= "\n\t\t<div class='upload-file-data'>\n\t\t\t<p>\n"; - $r .= "\t\t\t\t<input type='hidden' name='attachment-url-$id' id='attachment-url-$id' value='" . get_the_guid() . "' />\n"; - - if ( $image_src ) - $r .= "\t\t\t\t<input type='hidden' name='attachment-thumb-url-$id' id='attachment-thumb-url-$id' value='$image_src' />\n"; + $r .= "\t\t\t\t<input type='hidden' name='attachment-url-$id' id='attachment-url-$id' value='$src' />\n"; + $r .= "\t\t\t\t<input type='hidden' name='attachment-url-base-$id' id='attachment-url-base-$id' value='$src_base' />\n"; + + if ( isset($attachment_data['thumb']) ) { + $r .= "\t\t\t\t<input type='hidden' name='attachment-thumb-url-$id' id='attachment-thumb-url-$id' value='$image_rel' />\n"; + $r .= "\t\t\t\t<input type='hidden' name='attachment-thumb-url-base-$id' id='attachment-thumb-url-base-$id' value='$image_base' />\n"; + } elseif ( $image_rel ) + $r .= "\t\t\t\t<input type='hidden' name='attachment-is-image-$id' id='attachment-is-image-$id' value='1' />\n"; if ( isset($width) ) { $r .= "\t\t\t\t<input type='hidden' name='attachment-width-$id' id='attachment-width-$id' value='$width' />\n"; $r .= "\t\t\t\t<input type='hidden' name='attachment-height-$id' id='attachment-height-$id' value='$height' />\n"; @@ -45,16 +55,16 @@ function wp_upload_display( $dims = false, $href = '' ) { } function wp_upload_view() { - global $style, $post_id; + global $style, $post_id, $style; $id = get_the_ID(); $attachment_data = get_post_meta( $id, '_wp_attachment_metadata', true ); ?> <div id="upload-file"> <div id="file-title"> - <h2><?php if ( !isset($attachment_data['width']) ) + <h2><?php if ( !isset($attachment_data['width']) && 'inline' != $style ) echo "<a href='" . get_the_guid() . "' title='" . __('Direct link to file') . "'>"; the_title(); - if ( !isset($attachment_data['width']) ) + if ( !isset($attachment_data['width']) && 'inline' != $style ) echo '</a>'; ?></h2> <span><?php @@ -68,15 +78,15 @@ function wp_upload_view() { </div> <div id="upload-file-view" class="alignleft"> -<?php if ( isset($attachment_data['width']) ) +<?php if ( isset($attachment_data['width']) && 'inline' != $style ) echo "<a href='" . get_the_guid() . "' title='" . __('Direct link to file') . "'>"; echo wp_upload_display( array(171, 128) ); - if ( isset($attachment_data['width']) ) + if ( isset($attachment_data['width']) && 'inline' != $style ) echo '</a>'; ?> </div> <?php the_attachment_links( $id ); ?> </div> -<?php echo "<form action='' id='browse-form'><input type='hidden' id='nonce-value' value='" . wp_create_nonce( 'inlineuploading' ) . "' /></form>\n"; +<?php echo "<form action='' id='browse-form'><input type='hidden' id='nonce-value' value='" . wp_create_nonce( 'inlineuploading' ) . "' /></form>\n"; } function wp_upload_form() { @@ -91,10 +101,10 @@ function wp_upload_form() { $attachment_data = get_post_meta( $id, '_wp_attachment_metadata', true ); ?> <div id="file-title"> - <h2><?php if ( !isset($attachment_data['width']) ) + <h2><?php if ( !isset($attachment_data['width']) && 'inline' != $style ) echo "<a href='" . get_the_guid() . "' title='" . __('Direct link to file') . "'>"; the_title(); - if ( !isset($attachment_data['width']) ) + if ( !isset($attachment_data['width']) && 'inline' != $style ) echo '</a>'; ?></h2> <span><?php @@ -108,31 +118,38 @@ function wp_upload_form() { </div> <div id="upload-file-view" class="alignleft"> -<?php if ( isset($attachment_data['width']) ) +<?php if ( isset($attachment_data['width']) && 'inline' != $style ) echo "<a href='" . get_the_guid() . "' title='" . __('Direct link to file') . "'>"; echo wp_upload_display( array(171, 128) ); - if ( isset($attachment_data['width']) ) + if ( isset($attachment_data['width']) && 'inline' != $style ) echo '</a>'; ?> </div> <?php endif; ?> - <table> -<?php if ( !$id ): ?> + <table><col /><col class="widefat" /> +<?php if ( $id ): ?> + <tr> + <th scope="row"><label for="url"><?php _e('URL'); ?></label></th> + <td><input type="text" id="url" class="readonly" value="<?php the_guid(); ?>" readonly="readonly" /></td> + </tr> +<?php else : ?> <tr> - <th scope="row"><label for="upload"><?php _e('File:'); ?></label></th> + <th scope="row"><label for="upload"><?php _e('File'); ?></label></th> <td><input type="file" id="upload" name="image" /></td> </tr> <?php endif; ?> <tr> - <th scope="row"><label for="post_title"><?php _e('Title:'); ?></label></th> + <th scope="row"><label for="post_title"><?php _e('Title'); ?></label></th> <td><input type="text" id="post_title" name="post_title" value="<?php echo $attachment->post_title; ?>" /></td> </tr> <tr> - <th scope="row"><label for="post_content"><?php _e('Description:'); ?></label></th> + <th scope="row"><label for="post_content"><?php _e('Description'); ?></label></th> <td><textarea name="post_content" id="post_content"><?php echo $attachment->post_content; ?></textarea></td> </tr> - <tr id="buttons"> - <th></th> - <td> + <tr id="buttons" class="submit"> + <td colspan='2'> +<?php if ( $id ) : ?> + <input type="submit" name="delete" id="delete" class="delete alignleft" value="<?php _e('Delete File'); ?>" /> +<?php endif; ?> <input type="hidden" name="from_tab" value="<?php echo $tab; ?>" /> <input type="hidden" name="action" value="<?php echo $id ? 'save' : 'upload'; ?>" /> <?php if ( $post_id ) : ?> @@ -143,9 +160,6 @@ function wp_upload_form() { <?php wp_nonce_field( 'inlineuploading' ); ?> <div class="submit"> <input type="submit" value="<?php $id ? _e('Save') : _e('Upload'); ?> »" /> -<?php if ( $id ) : ?> - <input type="submit" name="delete" class="delete" value="<?php _e('Delete'); ?>" /> -<?php endif; ?> </div> </td> </tr> @@ -349,7 +363,7 @@ function wp_upload_admin_head() { echo "<link rel='stylesheet' href='" . get_option('siteurl') . '/wp-admin/upload-rtl.css?version=' . get_bloginfo('version') . "' type='text/css' />\n"; if ( 'inline' == @$_GET['style'] ) { echo "<style type='text/css'>\n"; - echo "\tbody { height: 14em; overflow: hidden; }\n"; + echo "\tbody { height: 15em; overflow: hidden; }\n"; echo "\t#upload-content { overflow-y: auto; }\n"; echo "\t#upload-file { position: absolute; }\n"; echo "</style>"; diff --git a/wp-admin/upload-js.php b/wp-admin/upload-js.php index c03746f..4d5b21f 100644 --- a/wp-admin/upload-js.php +++ b/wp-admin/upload-js.php @@ -37,11 +37,18 @@ addLoadEvent( function() { if ( id == this.currentImage.ID ) return; var thumbEl = $('attachment-thumb-url-' + id); - if ( thumbEl ) + this.currentImage.isImage = true; + if ( thumbEl ) { this.currentImage.thumb = ( 0 == id ? '' : thumbEl.value ); - else + this.currentImage.thumbBase = ( 0 == id ? '' : $('attachment-thumb-url-base-' + id).value ); + } else { this.currentImage.thumb = false; + var isImageEl = $('attachment-is-image-' + id); + if ( !isImageEl ) + this.currentImage.isImage = false; + } this.currentImage.src = ( 0 == id ? '' : $('attachment-url-' + id).value ); + this.currentImage.srcBase = ( 0 == id ? '' : $('attachment-url-base-' + id).value ); this.currentImage.page = ( 0 == id ? '' : $('attachment-page-url-' + id).value ); this.currentImage.title = ( 0 == id ? '' : $('attachment-title-' + id).value ); this.currentImage.description = ( 0 == id ? '' : $('attachment-description-' + id).value ); @@ -65,13 +72,13 @@ addLoadEvent( function() { var params = $H(this.params); params.ID = ''; params.action = ''; - h += "<a href='" + this.urlData[0] + '?' + params.toQueryString() + "' title='Browse your files' class='back'>« Back</a>"; + h += "<a href='" + this.urlData[0] + '?' + params.toQueryString() + "' title='Browse your files' class='back'>« Back</a>"; } else { h += "<a href='#' onclick='theFileList.cancelView()' title='Browse your files' class='back'>« Back</a>"; } h += "<div id='file-title'>" - if ( !this.currentImage.thumb ) - h += "<h2><a href='" + this.currentImage.src + "' title='Direct link to file'>" + this.currentImage.title + "</a></h2>"; + if ( !this.currentImage.isImage ) + h += "<h2><a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='Direct link to file'>" + this.currentImage.title + "</a></h2>"; else h += "<h2>" + this.currentImage.title + "</h2>"; h += " — <span>"; @@ -79,9 +86,11 @@ addLoadEvent( function() { h += "</span>"; h += '</div>' h += "<div id='upload-file-view' class='alignleft'>"; - if ( this.currentImage.thumb ) - h += "<a href='" + this.currentImage.src + "' title='Direct link to file'><img src='" + this.currentImage.thumb + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' /></a>"; - else + if ( this.currentImage.isImage ) { + h += "<a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='Direct link to file'>"; + h += "<img src='" + ( this.currentImage.thumb ? this.currentImage.thumb : this.currentImage.src ) + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' />"; + h += "</a>"; + } else h += ' '; h += "</div>"; @@ -119,6 +128,7 @@ addLoadEvent( function() { var action = 'upload.php?style=' + this.style + '&tab=upload'; if ( this.postID ) action += '&post_id=' + this.postID; + h += "<form id='upload-file' method='post' action='" + action + "'>"; if ( this.ID ) { var params = $H(this.params); @@ -129,8 +139,8 @@ addLoadEvent( function() { h += "<a href='#' onclick='theFileList.cancelView()' title='Browse your files' class='back'>« Back</a>"; } h += "<div id='file-title'>" - if ( !this.currentImage.thumb ) - h += "<h2><a href='" + this.currentImage.src + "' title='Direct link to file'>" + this.currentImage.title + "</a></h2>"; + if ( !this.currentImage.isImage ) + h += "<h2><a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='Direct link to file'>" + this.currentImage.title + "</a></h2>"; else h += "<h2>" + this.currentImage.title + "</h2>"; h += " — <span>"; @@ -138,26 +148,31 @@ addLoadEvent( function() { h += "</span>"; h += '</div>' h += "<div id='upload-file-view' class='alignleft'>"; - if ( this.currentImage.thumb ) - h += "<a href='" + this.currentImage.src + "' title='Direct link to file'><img src='" + this.currentImage.thumb + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' /></a>"; - else + if ( this.currentImage.isImage ) { + h += "<a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='Direct link to file'>"; + h += "<img src='" + ( this.currentImage.thumb ? this.currentImage.thumb : this.currentImage.src ) + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' />"; + h += "</a>"; + } else h += ' '; h += "</div>"; - h += "<table><tr>" - h += "<th scope='row'><label for='post_title'>Title:</label></th>"; + h += "<table><col /><col class='widefat' /><tr>" + h += "<th scope='row'><label for='url'>URL</label></th>"; + h += "<td><input type='text' id='url' class='readonly' value='" + this.currentImage.srcBase + this.currentImage.src + "' readonly='readonly' /></td>"; + h += "</tr><tr>"; + h += "<th scope='row'><label for='post_title'>Title</label></th>"; h += "<td><input type='text' id='post_title' name='post_title' value='" + this.currentImage.title + "' /></td>"; h += "</tr><tr>"; - h += "<th scope='row'><label for='post_content'>Description:</label></th>"; + h += "<th scope='row'><label for='post_content'>Description</label></th>"; h += "<td><textarea name='post_content' id='post_content'>" + this.currentImage.description + "</textarea></td>"; - h += "</tr><tr id='buttons'><th><input type='button' name='delete' class='delete button' value='Delete' onclick='theFileList.deleteFile(" + id + ");' /></th><td>"; + h += "</tr><tr id='buttons' class='submit'><td colspan='2'><input type='button' id='delete' name='delete' class='delete alignleft' value='Delete File' onclick='theFileList.deleteFile(" + id + ");' />"; h += "<input type='hidden' name='from_tab' value='" + this.tab + "' />"; h += "<input type='hidden' name='action' id='action-value' value='save' />"; h += "<input type='hidden' name='ID' value='" + id + "' />"; h += "<input type='hidden' name='_wpnonce' value='" + this.nonce + "' />"; - h += "<div class='submit'><input type='submit' value='Save »' />"; - h += "</div></td></tr></table></form>"; + h += "<div class='submit'><input type='submit' value='Save »' /></div>"; + h += "</td></tr></table></form>"; new Insertion.Top('upload-content', h); if (e) Event.stop(e); @@ -202,11 +217,13 @@ addLoadEvent( function() { displayEl = $A(document.forms.uploadoptions.elements.display).detect( function(i) { return i.checked; } ) if ( displayEl ) display = displayEl.value; + else if ( this.currentImage.isImage ) + display = 'full'; if ( 'none' != link ) - h += "<a href='" + ( 'file' == link ? this.currentImage.src : this.currentImage.page ) + "' title='" + this.currentImage.title + "'>"; + h += "<a href='" + ( 'file' == link ? ( this.currentImage.srcBase + this.currentImage.src ) : ( this.currentImage.page + "' rel='attachment" ) ) + "' title='" + this.currentImage.title + "'>"; if ( display ) - h += "<img src='" + ( 'thumb' == display ? this.currentImage.thumb : this.currentImage.src ) + "' alt='" + this.currentImage.title + "' />"; + h += "<img src='" + ( 'thumb' == display ? ( this.currentImage.thumbBase + this.currentImage.thumb ) : ( this.currentImage.srcBase + this.currentImage.src ) ) + "' alt='" + this.currentImage.title + "' />"; else h += this.currentImage.title; if ( 'none' != link ) @@ -220,7 +237,8 @@ addLoadEvent( function() { win.tinyMCE.execCommand('mceInsertContent', false, h); else win.edInsertContent(win.edCanvas, h); - this.cancelView(); + if ( !this.ID ) + this.cancelView(); return false; }, diff --git a/wp-admin/upload.css b/wp-admin/upload.css index a04bdf6..0358471 100644 --- a/wp-admin/upload.css +++ b/wp-admin/upload.css @@ -57,17 +57,18 @@ body { background: #f9fcfe; } margin: 0 auto; top: 0; left: 0; - width: 45em; + width: 95%; height: 100%; background: #f9fcfe; } -#upload-file th { + +#uupload-file th { width: 8em; } form#upload-file input, form#upload-file textarea, div#upload-content.upload table { width: 100%; } -form#upload-file div.submit input { width: auto; } +form#upload-file .submit input { width: auto; } #upload-file-view { padding: 0 0 0 75px; } @@ -134,8 +135,6 @@ h2 { #upload-files a.file-link img { vertical-align: middle; } -#the-attachment-links { float: right; } - #the-attachment-links textarea { font-size: 10px; overflow: hidden; @@ -173,3 +172,5 @@ tr, td, th { #uploadoptions table { width: 300px; } + +input.readonly { background-color: #ddd; } diff --git a/wp-admin/upload.php b/wp-admin/upload.php index a992570..acf3a75 100644 --- a/wp-admin/upload.php +++ b/wp-admin/upload.php @@ -14,6 +14,8 @@ if ( !$tab ) do_action( "upload_files_$tab" ); +add_action( 'admin_head', 'wp_upload_admin_head' ); + $pid = 0; if ( $post_id < 0 ) $pid = $post_id; diff --git a/wp-admin/user-edit.php b/wp-admin/user-edit.php index ccb8c78..164464d 100644 --- a/wp-admin/user-edit.php +++ b/wp-admin/user-edit.php @@ -36,7 +36,10 @@ check_admin_referer('update-user_' . $user_id); if ( !current_user_can('edit_user', $user_id) ) wp_die(__('You do not have permission to edit this user.')); +$cap = $wpdb->get_var( "SELECT meta_value FROM {$wpdb->usermeta} WHERE user_id = '{$user_id}' AND meta_key = '{$wpmuBaseTablePrefix}{$wpdb->blogid}_capabilities' AND meta_value = 'a:0:{}'" ); $errors = edit_user($user_id); +if( $cap == null ) + $wpdb->query( "DELETE FROM {$wpdb->usermeta} WHERE user_id = '{$user_id}' AND meta_key = '{$wpmuBaseTablePrefix}{$wpdb->blogid}_capabilities' AND meta_value = 'a:0:{}'" ); if( !is_wp_error( $errors ) ) { $redirect = "user-edit.php?user_id=$user_id&updated=true"; diff --git a/wp-admin/users.php b/wp-admin/users.php index 96e9730..51e2b31 100644 --- a/wp-admin/users.php +++ b/wp-admin/users.php @@ -219,7 +219,7 @@ case 'delete': $go_delete = true; } } - $all_logins = $wpdb->get_results("SELECT ID, user_login FROM $wpdb->users, $wpdb->usermeta WHERE $wpdb->users.ID = $wpdb->usermeta.user_id AND meta_key = '".$wpdb->prefix."capabilities'"); + $all_logins = $wpdb->get_results("SELECT ID, user_login FROM $wpdb->users, $wpdb->usermeta WHERE $wpdb->users.ID = $wpdb->usermeta.user_id AND meta_key = '".$wpdb->prefix."capabilities' ORDER BY user_login"); $user_dropdown = '<select name="reassign_user">'; foreach ( (array) $all_logins as $login ) if ( $login->ID == $current_user->id || !in_array($login->ID, $userids) ) diff --git a/wp-admin/wp-admin.css b/wp-admin/wp-admin.css index 241c627..3b8595c 100644 --- a/wp-admin/wp-admin.css +++ b/wp-admin/wp-admin.css @@ -51,6 +51,7 @@ a.delete:hover { font-size: 18px; display: block; height: 60px; + overflow: hidden; } #planetnews .hidden { @@ -171,6 +172,19 @@ h2 { margin: 5px 10px; } +h2 small.quickjump { + display: block; + text-align: right; +} + +h2 small.quickjump a { + text-decoration: none; + border-bottom: 0; + font-size: 15px; + background: #f0f8ff; + padding: 5px 10px; +} + img, #footer a { border: 0; } @@ -205,7 +219,7 @@ textarea, input, select { border-style: none; padding: 0px; margin-bottom: 16px; - height: 16em; + height: 17em; width: 100%; /* overflow-y: hidden;*/ } @@ -574,7 +588,7 @@ input.delete:hover { color: #fff; } -#postdivrich #quicktags { +#postdivrich #quicktags, #commentdivrich #quicktags { background: #f0f0ee; padding: 0px; border: 1px solid #ccc; @@ -648,9 +662,6 @@ input.delete:hover { #footer { clear: both; text-align: center; - width: 500px; - margin: auto; - height: 100px; } #footer .docs { @@ -674,6 +685,12 @@ input.delete:hover { margin: 5em auto; padding: 20px 50px 0; width: 325px; + _width: 390px; +} + +#login form { + _width: 325px; + _margin: 0 auto; } #login #login_error { @@ -696,6 +713,8 @@ input.delete:hover { text-align: left; font-weight: normal; font-size: 1.1em; + _width: 325px; + _margin: 0 auto 15px; } #login h1 a { @@ -719,6 +738,21 @@ input.delete:hover { font-size: 20px; } +#register #login h2 { + border-bottom: 1px solid #1e6491; + padding-bottom: 15px; + color: #fff; + text-align: left; + font-weight: normal; + font-size: 1.7em; + font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana; + letter-spacing: -1px; + margin: 15px 0 0; + _width: 325px; + _padding: 15px 0; + _margin: 10px auto 5px; +} + #login input { padding: 4px; } @@ -727,7 +761,9 @@ input.delete:hover { background: url('images/login-bkg-bottom.gif') no-repeat bottom center; list-style: none; margin: 0 -50px; + _margin: 10px auto 0; padding: 10px 50px 25px;; + _padding: 0 0 5px 30px; } #login ul:after { @@ -738,6 +774,13 @@ input.delete:hover { visibility: hidden; } +#login ul {display: inline-block;} + +/* Hides from IE-mac \*/ +* html #login ul {height: 1%;} +#login ul {display: block;} +/* End hide from IE-mac */ + #login ul li { float: left; font-size: 12px; @@ -753,6 +796,10 @@ input.delete:hover { width: 160px; } +#register #login ul li a { + width: 106px; +} + #login ul li a:hover { background: #0e3350; border: 1px solid #2571ab; @@ -1282,7 +1329,7 @@ input #catadd { padding-left: 3px; } -#postdivrich #content, #postdivrich #content:active { +#postdivrich #content, #postdivrich #content:active, #commentdivrich #content, #commentdivrich #content:active { border: 1px solid #ccc; } @@ -1300,6 +1347,20 @@ input #catadd { border-bottom: 1px solid #ccc; } +#postdivrich .switched table, #postdivrich #quicktags, #commentdivrich .switched table, #commentdivrich #quicktags { + border-top: none; +} + +#postdivrich #quicktags, #commentdivrich #quicktags { + border-bottom: none; + padding-bottom: 2px; + margin-bottom: -1px; +} + +#edButtons { + border-bottom: 1px solid #ccc +} + .page-numbers { padding: 4px 7px; border: 1px solid #fff; |
