diff options
Diffstat (limited to 'wp-admin')
-rw-r--r-- | wp-admin/admin-ajax.php | 4 | ||||
-rw-r--r-- | wp-admin/admin-functions.php | 18 | ||||
-rw-r--r-- | wp-admin/custom-header.php | 8 | ||||
-rw-r--r-- | wp-admin/import/blogger.php | 16 | ||||
-rw-r--r-- | wp-admin/import/greymatter.php | 14 | ||||
-rw-r--r-- | wp-admin/link-import.php | 120 | ||||
-rw-r--r-- | wp-admin/menu.php | 2 | ||||
-rw-r--r-- | wp-admin/options.php | 4 | ||||
-rw-r--r-- | wp-admin/page.php | 2 | ||||
-rw-r--r-- | wp-admin/post.php | 4 | ||||
-rw-r--r-- | wp-admin/upgrade-schema.php | 4 | ||||
-rw-r--r-- | wp-admin/upload-functions.php | 6 | ||||
-rw-r--r-- | wp-admin/upload-js.php | 4 |
13 files changed, 102 insertions, 104 deletions
diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php index c7b51d5..d3103d8 100644 --- a/wp-admin/admin-ajax.php +++ b/wp-admin/admin-ajax.php @@ -226,8 +226,8 @@ case 'autosave' : // The name of this action is hardcoded in edit_post() $_POST['post_status'] = 'draft'; $_POST['post_category'] = explode(",", $_POST['catslist']); if($_POST['post_type'] == 'page' || empty($_POST['post_category'])) - unset($_POST['post_category']); - + unset($_POST['post_category']); + if($_POST['post_ID'] < 0) { $_POST['temp_ID'] = $_POST['post_ID']; $id = wp_write_post(); diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index 583aca9..7e89d3b 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -681,7 +681,7 @@ function get_nested_categories( $default = 0, $parent = 0 ) { if ( count( $checked_categories ) == 0 ) { // No selected categories, strange $checked_categories[] = $default; - } + } } else { $checked_categories[] = $default; } @@ -741,7 +741,7 @@ function get_nested_link_categories( $default = 0, $parent = 0 ) { if ( count( $checked_categories ) == 0 ) { // No selected categories, strange $checked_categories[] = $default; - } + } } else { $checked_categories[] = $default; } @@ -788,7 +788,7 @@ function cat_rows( $parent = 0, $level = 0, $categories = 0 ) { } $output = ob_get_contents(); ob_end_clean(); - + $output = apply_filters('cat_rows', $output); echo $output; @@ -1329,7 +1329,7 @@ function user_can_access_admin_page() { if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$parent][$plugin_page] ) ) return false; - + if ( empty( $parent) ) { if ( isset( $_wp_menu_nopriv[$pagenow] ) ) return false; @@ -1341,7 +1341,7 @@ function user_can_access_admin_page() { if ( isset( $_wp_submenu_nopriv[$key][$pagenow] ) ) return false; if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$key][$plugin_page] ) ) - return false; + return false; } return true; } @@ -1463,14 +1463,14 @@ function get_admin_page_parent() { if ( isset( $_wp_real_parent_file[$parent_file] ) ) $parent_file = $_wp_real_parent_file[$parent_file]; return $parent_file; - } + } } if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$pagenow][$plugin_page] ) ) { $parent_file = $pagenow; if ( isset( $_wp_real_parent_file[$parent_file] ) ) $parent_file = $_wp_real_parent_file[$parent_file]; - return $parent_file; + return $parent_file; } foreach (array_keys( $submenu ) as $parent) { @@ -1910,7 +1910,7 @@ function wp_handle_upload( &$file, $overrides = false ) { // Compute the URL $url = $uploads['url'] . "/$filename"; - + $return = apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ) ); return $return; @@ -2069,7 +2069,7 @@ function update_home_siteurl( $old_value, $value ) { // Clear cookies for old paths. wp_clearcookie(); // Set cookies for new paths. - wp_setcookie( $user_login, $user_pass_md5, true, get_option( 'home' ), get_option( 'siteurl' )); + wp_setcookie( $user_login, $user_pass_md5, true, get_option( 'home' ), get_option( 'siteurl' )); } add_action( 'update_option_home', 'update_home_siteurl', 10, 2 ); diff --git a/wp-admin/custom-header.php b/wp-admin/custom-header.php index 4db9f71..1b913c2 100644 --- a/wp-admin/custom-header.php +++ b/wp-admin/custom-header.php @@ -17,7 +17,7 @@ class Custom_Image_Header { function js_includes() { wp_enqueue_script('cropper'); - wp_enqueue_script('colorpicker'); + wp_enqueue_script('colorpicker'); } function js() { @@ -115,7 +115,7 @@ class Custom_Image_Header { function colorDefault() { pickColor('<?php echo HEADER_TEXTCOLOR; ?>'); } - + function hide_text() { $('name').style.display = 'none'; $('desc').style.display = 'none'; @@ -126,7 +126,7 @@ class Custom_Image_Header { // $('hidetext').onclick = 'show_text()'; Event.observe( $('hidetext'), 'click', show_text ); } - + function show_text() { $('name').style.display = 'block'; $('desc').style.display = 'block'; @@ -134,7 +134,7 @@ class Custom_Image_Header { $('defaultcolor').style.display = 'inline'; $('textcolor').value = '<?php echo HEADER_TEXTCOLOR; ?>'; $('hidetext').value = '<?php _e('Hide Text'); ?>'; - Event.stopObserving( $('hidetext'), 'click', show_text ); + Event.stopObserving( $('hidetext'), 'click', show_text ); Event.observe( $('hidetext'), 'click', hide_text ); } diff --git a/wp-admin/import/blogger.php b/wp-admin/import/blogger.php index b5c1169..2908bbc 100644 --- a/wp-admin/import/blogger.php +++ b/wp-admin/import/blogger.php @@ -55,7 +55,7 @@ class Blogger_Import { return false;
}
$this->token = $matches[1];
-
+
wp_redirect( remove_query_arg( array( 'token', 'noheader' ) ) );
}
@@ -369,9 +369,9 @@ class Blogger_Import { $sock = $this->_get_blogger_sock( $blog['host'] );
if ( ! $sock ) return; // TODO: Error handling
$response = $this->_txrx( $sock, $request );
-
+
$response = $this->parse_response( $response );
-
+
// Extract the entries and send for insertion
preg_match_all( '/<entry[^>]*>.*?<\/entry>/s', $response['body'], $matches );
if ( count( $matches[0] ) ) {
@@ -437,7 +437,7 @@ class Blogger_Import { foreach ( $entries as $entry ) {
$entry = "<feed>$entry</feed>";
$AtomParser = new AtomParser();
- $AtomParser->parse( $entry );
+ $AtomParser->parse( $entry );
$this->import_comment($AtomParser->entry);
unset($AtomParser);
}
@@ -623,7 +623,7 @@ class Blogger_Import { $sel = ( $user->user_id == $current ) ? " selected='selected'" : '';
$options .= "<option value='$user->user_id'$sel>$user->display_name</option>";
}
-
+
return $options;
}
@@ -706,7 +706,7 @@ class Blogger_Import { function restart() {
global $wpdb;
$options = get_option( 'blogger_importer' );
-
+
if ( isset( $options['token'] ) )
$this->revoke( $options['token'] );
@@ -922,7 +922,7 @@ class AtomParser { } else if($tag == 'category') {
array_push($this->entry->categories, $attrs['term']);
}
-
+
$this->ns_decls = array();
}
@@ -950,7 +950,7 @@ class AtomParser { }
array_shift($this->ns_contexts);
-
+
#print str_repeat(" ", $this->depth * $this->indent) . "end_element('$name')" ."\n";
$this->depth--;
diff --git a/wp-admin/import/greymatter.php b/wp-admin/import/greymatter.php index 7332937..9203ff7 100644 --- a/wp-admin/import/greymatter.php +++ b/wp-admin/import/greymatter.php @@ -91,7 +91,7 @@ class GM_Import { if (!chdir($gmpath)) wp_die(sprintf(__("Wrong path, %s\ndoesn't exist\non the server"), $gmpath)); - + $this->header(); ?> <p><?php _e('The importer is running...') ?></p> @@ -128,7 +128,7 @@ class GM_Import { $user_info = array("user_login"=>"$user_login", "user_pass"=>"$pass1", "user_nickname"=>"$user_nickname", "user_email"=>"$user_email", "user_url"=>"$user_url", "user_ip"=>"$user_ip", "user_domain"=>"$user_domain", "user_browser"=>"$user_browser", "dateYMDhour"=>"$user_joindate", "user_level"=>"1", "user_idmode"=>"nickname"); $user_id = wp_insert_user($user_info); $this->gmnames[$userdata[0]] = $user_id; - + printf('<li>'.__('user %s...').' <strong>'.__('Done').'</strong></li>', "<em>$user_login</em>"); } @@ -213,21 +213,21 @@ class GM_Import { $user_email=$wpdb->escape("user@deleted.com"); $user_url=$wpdb->escape(""); $user_joindate=$wpdb->escape($user_joindate); - + $user_info = array("user_login"=>$user_login, "user_pass"=>$pass1, "user_nickname"=>$user_nickname, "user_email"=>$user_email, "user_url"=>$user_url, "user_ip"=>$user_ip, "user_domain"=>$user_domain, "user_browser"=>$user_browser, "dateYMDhour"=>$user_joindate, "user_level"=>0, "user_idmode"=>"nickname"); $user_id = wp_insert_user($user_info); $this->gmnames[$postinfo[1]] = $user_id; - + echo ': '; printf(__('registered deleted user %s at level 0 '), "<em>$user_login</em>"); } - + if (array_key_exists($postinfo[1], $this->gmnames)) { $post_author = $this->gmnames[$postinfo[1]]; } else { $post_author = $user_id; } - + $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_excerpt', 'post_status', 'comment_status', 'ping_status', 'post_modified', 'post_modified_gmt'); $post_ID = wp_insert_post($postdata); } @@ -309,5 +309,5 @@ class GM_Import { $gm_import = new GM_Import(); -register_importer('greymatter', __('Greymatter'), __('Import posts and comments from your Greymatter blog'), array ($gm_import, 'dispatch')); +register_importer('greymatter', __('GreyMatter'), __('Import users, posts, and comments from a Greymatter blog'), array ($gm_import, 'dispatch')); ?> diff --git a/wp-admin/link-import.php b/wp-admin/link-import.php index 6484dbb..f1f971d 100644 --- a/wp-admin/link-import.php +++ b/wp-admin/link-import.php @@ -12,16 +12,16 @@ if (!$step) $step = 0; ?> <?php switch ($step) { - case 0: - { - include_once('admin-header.php'); - if ( !current_user_can('manage_links') ) - wp_die(__('Cheatin’ uh?')); + case 0: { + include_once('admin-header.php'); + if ( !current_user_can('manage_links') ) + wp_die(__('Cheatin’ uh?')); - $opmltype = 'blogrolling'; // default. + $opmltype = 'blogrolling'; // default. ?> <div class="wrap"> + <h2><?php _e('Import your blogroll from another system') ?> </h2> <form enctype="multipart/form-data" action="link-import.php" method="post" name="blogroll"> <?php wp_nonce_field('import-bookmarks') ?> @@ -40,7 +40,6 @@ switch ($step) { <input id="userfile" name="userfile" type="file" size="30" /> </div> - </div> <p style="clear: both; margin-top: 1em;"><?php _e('Now select a category you want to put these links in.') ?><br /> @@ -60,72 +59,71 @@ foreach ($categories as $category) { </div> <?php - break; - } // end case 0 + break; + } // end case 0 - case 1: { + case 1: { check_admin_referer('import-bookmarks'); - include_once('admin-header.php'); - if ( !current_user_can('manage_links') ) - wp_die(__('Cheatin’ uh?')); + include_once('admin-header.php'); + if ( !current_user_can('manage_links') ) + wp_die(__('Cheatin’ uh?')); ?> <div class="wrap"> - <h2><?php _e('Importing...') ?></h2> +<h2><?php _e('Importing...') ?></h2> <?php - $cat_id = $_POST['cat_id']; - if (($cat_id == '') || ($cat_id == 0)) { - $cat_id = 1; - } - - $opml_url = $_POST['opml_url']; - if (isset($opml_url) && $opml_url != '' && $opml_url != 'http://') { - $blogrolling = true; - } - else // try to get the upload file. - { - $overrides = array('test_form' => false, 'test_type' => false); - $file = wp_handle_upload($_FILES['userfile'], $overrides); - - if ( isset($file['error']) ) - wp_die($file['error']); - - $url = $file['url']; - $opml_url = $file['file']; - $blogrolling = false; - } - - if (isset($opml_url) && $opml_url != '') { - $opml = wp_remote_fopen($opml_url); - include_once('link-parse-opml.php'); - - $link_count = count($names); - for ($i = 0; $i < $link_count; $i++) { - if ('Last' == substr($titles[$i], 0, 4)) - $titles[$i] = ''; - if ('http' == substr($titles[$i], 0, 4)) - $titles[$i] = ''; - $link = array( 'link_url' => $urls[$i], 'link_name' => $wpdb->escape($names[$i]), 'link_category' => array($cat_id), 'link_description' => $wpdb->escape($descriptions[$i]), 'link_owner' => $user_ID, 'link_rss' => $feeds[$i]); - wp_insert_link($link); - echo sprintf('<p>'.__('Inserted <strong>%s</strong>').'</p>', $names[$i]); - } + $cat_id = $_POST['cat_id']; + if ( $cat_id == '' || $cat_id == 0 ) + $cat_id = 1; + + $opml_url = $_POST['opml_url']; + if ( isset($opml_url) && $opml_url != '' && $opml_url != 'http://' ) { + $blogrolling = true; + } else { // try to get the upload file. + $overrides = array('test_form' => false, 'test_type' => false); + $file = wp_handle_upload($_FILES['userfile'], $overrides); + + if ( isset($file['error']) ) + wp_die($file['error']); + + $url = $file['url']; + $opml_url = $file['file']; + $blogrolling = false; + } + + if ( isset($opml_url) && $opml_url != '' ) { + $opml = wp_remote_fopen($opml_url); + include_once('link-parse-opml.php'); + + $link_count = count($names); + for ( $i = 0; $i < $link_count; $i++ ) { + if ('Last' == substr($titles[$i], 0, 4)) + $titles[$i] = ''; + if ( 'http' == substr($titles[$i], 0, 4) ) + $titles[$i] = ''; + $link = array( 'link_url' => $urls[$i], 'link_name' => $wpdb->escape($names[$i]), 'link_category' => array($cat_id), 'link_description' => $wpdb->escape($descriptions[$i]), 'link_owner' => $user_ID, 'link_rss' => $feeds[$i]); + wp_insert_link($link); + echo sprintf('<p>'.__('Inserted <strong>%s</strong>').'</p>', $names[$i]); + } ?> - <p><?php printf(__('Inserted %1$d links into category %2$s. All done! Go <a href="%3$s">manage those links</a>.'), $link_count, $cat_id, 'link-manager.php') ?></p> + +<p><?php printf(__('Inserted %1$d links into category %2$s. All done! Go <a href="%3$s">manage those links</a>.'), $link_count, $cat_id, 'link-manager.php') ?></p> + <?php - } // end if got url - else - { - echo "<p>" . __("You need to supply your OPML url. Press back on your browser and try again") . "</p>\n"; - } // end else - - if ( ! $blogrolling ) - @unlink($opml_url); +} // end if got url +else +{ + echo "<p>" . __("You need to supply your OPML url. Press back on your browser and try again") . "</p>\n"; +} // end else + +if ( ! $blogrolling ) + @unlink($opml_url); ?> </div> <?php - break; - } // end case 1 + break; + } // end case 1 } // end switch include('admin-footer.php'); diff --git a/wp-admin/menu.php b/wp-admin/menu.php index 59265d8..8c67b4a 100644 --- a/wp-admin/menu.php +++ b/wp-admin/menu.php @@ -119,7 +119,7 @@ foreach ( $menu as $id => $data ) { if ( $new_parent != $old_parent ) { $_wp_real_parent_file[$old_parent] = $new_parent; $menu[$id][2] = $new_parent; - + foreach ($submenu[$old_parent] as $index => $data) { $submenu[$new_parent][$index] = $submenu[$old_parent][$index]; unset($submenu[$old_parent][$index]); diff --git a/wp-admin/options.php b/wp-admin/options.php index f502a7d..8dbd161 100644 --- a/wp-admin/options.php +++ b/wp-admin/options.php @@ -94,7 +94,7 @@ function sanitize_option($option, $value) { // Remember to call stripslashes! break; } - return $value; + return $value; } switch($action) { @@ -169,7 +169,7 @@ foreach ( (array) $options as $option) : if (stristr($value, "\n")) echo "<textarea class='$class' name='$option->option_name' id='$option->option_name' cols='30' rows='5'>$value</textarea>"; else echo "<input class='$class' type='text' name='$option->option_name' id='$option->option_name' size='30' value='" . $value . "'$disabled />"; - + echo "</td> <td>$option->option_description</td> </tr>"; diff --git a/wp-admin/page.php b/wp-admin/page.php index c239809..d5bb932 100644 --- a/wp-admin/page.php +++ b/wp-admin/page.php @@ -108,7 +108,7 @@ case 'editpost': } if ( isset($_POST['save']) ) - $location = "page.php?action=edit&post=$page_ID"; + $location = "page.php?action=edit&post=$page_ID"; } else { if ($_POST['save']) { $location = "page.php?action=edit&post=$page_ID"; diff --git a/wp-admin/post.php b/wp-admin/post.php index 8f0cc53..163e220 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -47,7 +47,7 @@ case 'edit': $editing = true; $post_ID = $p = (int) $_GET['post']; $post = get_post($post_ID); - + if ( 'page' == $post->post_type ) { wp_redirect("page.php?action=edit&post=$post_ID"); exit(); @@ -119,7 +119,7 @@ case 'editpost': if ( !empty($_POST['referredby']) ) $referredby = preg_replace('|https?://[^/]+|i', '', $_POST['referredby']); $referer = preg_replace('|https?://[^/]+|i', '', wp_get_referer()); - + if ($_POST['save']) { $location = "post.php?action=edit&post=$post_ID"; } elseif ($_POST['updatemeta']) { diff --git a/wp-admin/upgrade-schema.php b/wp-admin/upgrade-schema.php index 0c070b4..12903eb 100644 --- a/wp-admin/upgrade-schema.php +++ b/wp-admin/upgrade-schema.php @@ -3,12 +3,12 @@ global $wp_queries; $charset_collate = ''; - + if ( version_compare(mysql_get_server_info(), '4.1.0', '>=') ) { if ( ! empty($wpdb->charset) ) $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset"; if ( ! empty($wpdb->collate) ) - $charset_collate .= " COLLATE $wpdb->collate"; + $charset_collate .= " COLLATE $wpdb->collate"; } $wp_queries="CREATE TABLE $wpdb->categories ( diff --git a/wp-admin/upload-functions.php b/wp-admin/upload-functions.php index 2ba76cd..c2b5519 100644 --- a/wp-admin/upload-functions.php +++ b/wp-admin/upload-functions.php @@ -13,13 +13,13 @@ function wp_upload_display( $dims = false, $href = '' ) { } if ( isset($attachment_data['width']) ) list($width,$height) = wp_shrink_dimensions($attachment_data['width'], $attachment_data['height'], 171, 128); - + ob_start(); the_title(); $post_title = attribute_escape(ob_get_contents()); ob_end_clean(); $post_content = apply_filters( 'content_edit_pre', $post->post_content ); - + $class = 'text'; $innerHTML = get_attachment_innerHTML( $id, false, $dims ); if ( $image_src = get_attachment_icon_src() ) { @@ -285,7 +285,7 @@ function wp_upload_posts_where( $where ) { function wp_upload_tab_browse() { global $wpdb, $action, $paged; $old_vars = compact( 'paged' ); - + switch ( $action ) : case 'edit' : case 'view' : diff --git a/wp-admin/upload-js.php b/wp-admin/upload-js.php index 50db0ac..b406355 100644 --- a/wp-admin/upload-js.php +++ b/wp-admin/upload-js.php @@ -189,7 +189,7 @@ addLoadEvent( function() { new Insertion.Top('upload-content', h); if (e) Event.stop(e); - return false; + return false; }, prepView: function(id) { @@ -264,7 +264,7 @@ addLoadEvent( function() { } return false; } - + }; theFileList.initializeVars(); theFileList.initializeLinks(); |