trailing tabs and whitespace cleanup.

git-svn-id: https://develop.svn.wordpress.org/trunk@4953 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith
2007-02-27 15:24:54 +00:00
parent b3fa98f0d1
commit 5acfcd9fea
36 changed files with 200 additions and 202 deletions
+2 -2
View File
@@ -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();
+9 -9
View File
@@ -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;
}
@@ -737,7 +737,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;
}
@@ -778,7 +778,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;
@@ -1316,7 +1316,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;
@@ -1328,7 +1328,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;
}
@@ -1450,14 +1450,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) {
@@ -1897,7 +1897,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;
@@ -2056,7 +2056,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 );
+4 -4
View File
@@ -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 );
}
+8 -8
View File
@@ -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--;
+6 -6
View File
@@ -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);
}
+55 -57
View File
@@ -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&#8217; uh?'));
case 0: {
include_once('admin-header.php');
if ( !current_user_can('manage_links') )
wp_die(__('Cheatin&#8217; 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,74 +59,73 @@ 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&#8217; uh?'));
include_once('admin-header.php');
if ( !current_user_can('manage_links') )
wp_die(__('Cheatin&#8217; 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;
}
$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);
$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']);
if ( isset($file['error']) )
wp_die($file['error']);
$url = $file['url'];
$opml_url = $file['file'];
$blogrolling = false;
}
$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');
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]);
}
$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>
<?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);
<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);
?>
</div>
<?php
break;
} // end case 1
break;
} // end case 1
} // end switch
include('admin-footer.php');
?>
?>
+2 -2
View File
@@ -14,7 +14,7 @@ if ( strstr($_SERVER['REQUEST_URI'], 'page-new.php') )
$menu[10] = array(__('Manage'), 'edit_pages', 'edit-pages.php');
else
$menu[10] = array(__('Manage'), 'edit_posts', 'edit.php');
$menu[15] = array(__('Comments'), 'edit_posts', 'edit-comments.php');
$menu[20] = array(__('Blogroll'), 'manage_links', 'link-manager.php');
$menu[25] = array(__('Presentation'), 'switch_themes', 'themes.php');
@@ -104,7 +104,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]);
+2 -2
View File
@@ -78,7 +78,7 @@ function sanitize_option($option, $value) { // Remember to call stripslashes!
break;
}
return $value;
return $value;
}
switch($action) {
@@ -150,7 +150,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>";
+1 -1
View File
@@ -107,7 +107,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";
+2 -2
View File
@@ -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']) {
+2 -2
View File
@@ -2,12 +2,12 @@
// Here we keep the DB structure and option values
$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 (
+3 -3
View File
@@ -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' :
+2 -2
View File
@@ -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();