Lots of style and admin tweaks

git-svn-id: https://develop.svn.wordpress.org/trunk@3770 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg 2006-05-10 20:35:10 +00:00
parent a3d0bb059d
commit 104a56563c
10 changed files with 98 additions and 80 deletions

View File

@ -736,7 +736,7 @@ function user_row( $user_object, $style = '' ) {
<td><label for='user_{$user_object->ID}'>$user_object->first_name $user_object->last_name</label></td>
<td><a href='mailto:$email' title='" . sprintf(__('e-mail: %s'), $email) . "'>$email</a></td>
<td><a href='$url' title='website: $url'>$short_url</a></td>";
$r .= "\n\t\t<td align='right'>$numposts</td>";
$r .= "\n\t\t<td align='center'>$numposts</td>";
$r .= "\n\t\t<td>";
if (current_user_can('edit_users'))
$r .= "<a href='user-edit.php?user_id=$user_object->ID' class='edit'>".__('Edit')."</a>";
@ -1559,8 +1559,8 @@ function get_file_description($file) {
if (isset ($wp_file_descriptions[basename($file)])) {
return $wp_file_descriptions[basename($file)];
}
elseif (file_exists(ABSPATH.$file)) {
$template_data = implode('', file(ABSPATH.$file));
elseif ( file_exists( ABSPATH . $file ) && is_file( ABSPATH . $file ) ) {
$template_data = implode('', file( ABSPATH . $file ));
if (preg_match("|Template Name:(.*)|i", $template_data, $name))
return $name[1];
}
@ -1911,21 +1911,14 @@ function wp_import_cleanup($id) {
function wp_import_upload_form($action) {
?>
<script type="text/javascript">
function cancelUpload() {
o = document.getElementById('uploadForm');
o.method = 'GET';
o.action.value = 'view';
o.submit();
}
</script>
<form enctype="multipart/form-data" id="uploadForm" method="POST" action="<?php echo $action ?>">
<label for="upload"><?php _e('File:'); ?></label><input type="file" id="upload" name="import" />
<form enctype="multipart/form-data" id="import-upload-form" method="POST" action="<?php echo $action ?>">
<p>
<label for="upload"><?php _e('Choose a file from your computer:'); ?></label> <input type="file" id="upload" name="import" size="25" />
<input type="hidden" name="action" value="save" />
<div id="buttons">
<input type="submit" value="<?php _e('Import'); ?>" />
<input type="button" value="<?php _e('Cancel'); ?>" onclick="cancelUpload()" />
</div>
</p>
<p class="submit">
<input type="submit" value="<?php _e('Upload file and import'); ?> &raquo;" />
</p>
</form>
<?php
}
@ -1938,7 +1931,7 @@ function wp_import_handle_upload() {
return $file;
$url = $file['url'];
$file = $file['file'];
$file = addslashes( $file['file'] );
$filename = basename($file);
// Construct the object array

View File

@ -130,12 +130,12 @@ $messages[3] = __('Category updated.');
<?php else : ?>
<h2><?php _e('Categories') ?> </h2>
<?php endif; ?>
<table width="100%" cellpadding="3" cellspacing="3">
<table class="widefat">
<thead>
<tr>
<th scope="col"><?php _e('ID') ?></th>
<th scope="col"><?php _e('Name') ?></th>
<th scope="col"><?php _e('Description') ?></th>
<th scope="col" style="text-align: left"><?php _e('Name') ?></th>
<th scope="col" style="text-align: left"><?php _e('Description') ?></th>
<th scope="col" width="90"><?php _e('Posts') ?></th>
<th scope="col" width="90"><?php _e('Bookmarks') ?></th>
<th colspan="2"><?php _e('Action') ?></th>

View File

@ -39,7 +39,7 @@ function getNumChecked(form)
</script>
<div class="wrap">
<h2><?php _e('Comments'); ?></h2>
<form name="searchform" action="" method="get">
<form name="searchform" action="" method="get" id="editcomments">
<fieldset>
<legend><?php _e('Show Comments That Contain...') ?></legend>
<input type="text" name="s" value="<?php if (isset($_GET['s'])) echo wp_specialchars($_GET['s'], 1); ?>" size="17" />
@ -152,15 +152,17 @@ $post_title = ('' == $post_title) ? "# $comment->comment_post_ID" : $post_title;
if ($comments) {
echo '<form name="deletecomments" id="deletecomments" action="" method="post"> ';
wp_nonce_field('bulk-comments');
echo '<table width="100%" cellpadding="3" cellspacing="3">
echo '<table class="widefat">
<thead>
<tr>
<th scope="col">*</th>
<th scope="col">' . __('Name') . '</th>
<th scope="col">' . __('E-mail') . '</th>
<th scope="col">' . __('IP') . '</th>
<th scope="col">' . __('Comment Excerpt') . '</th>
<th scope="col"><input type="checkbox" onclick="checkAll(document.getElementById(\'deletecomments\'));" /></th>
<th scope="col" style="text-align: left">' . __('Name') . '</th>
<th scope="col" style="text-align: left">' . __('E-mail') . '</th>
<th scope="col" style="text-align: left">' . __('IP') . '</th>
<th scope="col" style="text-align: left">' . __('Comment Excerpt') . '</th>
<th scope="col" colspan="3">' . __('Actions') . '</th>
</tr>';
</tr>
</thead>';
foreach ($comments as $comment) {
$authordata = get_userdata($wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $comment->comment_post_ID"));
$comment_status = wp_get_comment_status($comment->comment_ID);
@ -183,14 +185,13 @@ $post_title = ('' == $post_title) ? "# $comment->comment_post_ID" : $post_title;
<td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
echo "<a href='comment.php?action=editcomment&amp;comment=$comment->comment_ID' class='edit'>" . __('Edit') . "</a>"; } ?></td>
<td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
echo "<a href=\"comment.php?action=deletecomment&amp;p=".$comment->comment_post_ID."&amp;comment=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . sprintf(__("You are about to delete this comment by &quot;%s&quot;.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to delete."), js_escape( $comment->comment_author )) . "' );\" class='edit'>" . __('Delete') . "</a> ";
echo "<a href=\"comment.php?action=deletecomment&amp;p=".$comment->comment_post_ID."&amp;comment=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . sprintf(__("You are about to delete this comment by &quot;%s&quot;.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to delete."), js_escape( $comment->comment_author )) . "' );\" class='delete'>" . __('Delete') . "</a> ";
} ?></td>
</tr>
<?php
} // end foreach
?></table>
<p><a href="javascript:;" onclick="checkAll(document.getElementById('deletecomments')); return false; "><?php _e('Invert Checkbox Selection') ?></a></p>
<p class="submit"><input type="submit" name="delete_button" value="<?php _e('Delete Checked Comments &raquo;') ?>" onclick="var numchecked = getNumChecked(document.getElementById('deletecomments')); if(numchecked < 1) { alert('<?php _e("Please select some comments to delete"); ?>'); return false } return confirm('<?php printf(__("You are about to delete %s comments permanently \\n \'Cancel\' to stop, \'OK\' to delete."), "' + numchecked + '"); ?>')" />
<p class="submit"><input type="submit" name="delete_button" value="<?php _e('Delete Checked Comments &raquo;') ?>" onclick="var numchecked = getNumChecked(document.getElementById('deletecomments')); if(numchecked < 1) { alert('<?php _e("Please select some comments to delete"); ?>'); return false } return confirm('<?php printf(__("You are about to delete %s comments permanently \\n \'Cancel\' to stop, \'OK\' to delete."), "' + numchecked + '"); ?>')" />
<input type="submit" name="spam_button" value="<?php _e('Mark Checked Comments as Spam &raquo;') ?>" onclick="return confirm('<?php _e("You are about to mark these comments as spam \\n \'Cancel\' to stop, \'OK\' to mark as spam.") ?>')" /></p>
</form>
<div id="ajax-response"></div>

View File

@ -28,16 +28,14 @@ else
if ($posts) {
?>
<table width="100%" cellpadding="3" cellspacing="3">
<table class="widefat">
<thead>
<tr>
<th scope="col"><?php _e('ID') ?></th>
<th scope="col"><?php _e('Title') ?></th>
<th scope="col"><?php _e('Owner') ?></th>
<th scope="col"><?php _e('Updated') ?></th>
<th scope="col"></th>
<th scope="col"></th>
<th scope="col"></th>
<th scope="col" style="text-align: left"><?php _e('Title') ?></th>
<th scope="col" style="text-align: left"><?php _e('Owner') ?></th>
<th scope="col" style="text-align: left"><?php _e('Updated') ?></th>
<th scope="col" colspan="3"><?php _e('Action'); ?></th>
</tr>
</thead>
<tbody id="the-list">

View File

@ -133,7 +133,7 @@ $posts_columns['control_delete'] = '';
?>
<table width="100%" cellpadding="3" cellspacing="3">
<table class="widefat">
<thead>
<tr>
@ -185,7 +185,7 @@ foreach($posts_columns as $column_name=>$column_display_name) {
case 'comments':
?>
<td><a href="edit.php?p=<?php echo $id ?>&amp;c=1">
<td style="text-align: center"><a href="edit.php?p=<?php echo $id ?>&amp;c=1">
<?php comments_number(__('0'), __('1'), __('%')) ?>
</a></td>
<?php

View File

@ -115,12 +115,12 @@ bookmarks ordered by
<input type="hidden" name="action" value="" />
<input type="hidden" name="order_by" value="<?php echo wp_specialchars($order_by, 1); ?>" />
<input type="hidden" name="cat_id" value="<?php echo (int) $cat_id ?>" />
<table width="100%" cellpadding="3" cellspacing="3">
<table class="widefat">
<thead>
<tr>
<th width="15%"><?php _e('Name') ?></th>
<th><?php _e('URI') ?></th>
<th><?php _e('Categories') ?></th>
<th width="15%" style="text-align: left"><?php _e('Name') ?></th>
<th style="text-align: left"><?php _e('URI') ?></th>
<th style="text-align: left"><?php _e('Categories') ?></th>
<th><?php _e('rel') ?></th>
<th><?php _e('Visible') ?></th>
<th colspan="2"><?php _e('Action') ?></th>

View File

@ -78,13 +78,15 @@ if (empty($plugins)) {
echo '</p>';
} else {
?>
<table width="100%" cellpadding="3" cellspacing="3">
<table class="widefat">
<thead>
<tr>
<th><?php _e('Plugin'); ?></th>
<th style="text-align: left"><?php _e('Plugin'); ?></th>
<th><?php _e('Version'); ?></th>
<th><?php _e('Description'); ?></th>
<th style="text-align: left"><?php _e('Description'); ?></th>
<th><?php _e('Action'); ?></th>
</tr>
</thead>
<?php
$style = '';

View File

@ -209,38 +209,40 @@ default:
<?php wp_nonce_field('bulk-users') ?>
<div class="wrap">
<h2><?php _e('User List by Role'); ?></h2>
<table cellpadding="3" cellspacing="3" width="100%">
<?php
foreach($roleclasses as $role => $roleclass) {
ksort($roleclass);
?>
<tr>
<th colspan="8" align="left"><h3><?php echo $wp_roles->role_names[$role]; ?></h3></th>
</tr>
<tr>
<th><?php _e('ID') ?></th>
<th><?php _e('Username') ?></th>
<th><?php _e('Name') ?></th>
<th><?php _e('E-mail') ?></th>
<th><?php _e('Website') ?></th>
<th><?php _e('Posts') ?></th>
<th>&nbsp;</th>
</tr>
<tbody id="role-<?php echo $role; ?>"><?php
$style = '';
foreach ($roleclass as $user_object) {
$style = (' class="alternate"' == $style) ? '' : ' class="alternate"';
echo "\n\t" . user_row( $user_object, $style );
}
?>
</tbody>
<table class="widefat">
<?php
}
foreach($roleclasses as $role => $roleclass) {
ksort($roleclass);
?>
</table>
<tr>
<th colspan="8" align="left"><h3><?php echo $wp_roles->role_names[$role]; ?></h3></th>
</tr>
<thead>
<tr>
<th style="text-align: left"><?php _e('ID') ?></th>
<th style="text-align: left"><?php _e('Username') ?></th>
<th style="text-align: left"><?php _e('Name') ?></th>
<th style="text-align: left"><?php _e('E-mail') ?></th>
<th style="text-align: left"><?php _e('Website') ?></th>
<th><?php _e('Posts') ?></th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody id="role-<?php echo $role; ?>"><?php
$style = '';
foreach ($roleclass as $user_object) {
$style = (' class="alternate"' == $style) ? '' : ' class="alternate"';
echo "\n\t" . user_row( $user_object, $style );
}
?>
</tbody>
<?php
}
?>
</table>
<h2><?php _e('Update Users'); ?></h2>

View File

@ -40,6 +40,28 @@ a.delete:hover {
overflow: hidden;
}
.widefat {
width: 100%;
}
.widefat td, .widefat th {
padding: 5px 6px;
}
.import-system {
font-size: 16px;
}
thead {
background: #dfdfdf
}
#import-upload-form {
width: 300px;
margin: auto;
text-align: center;
}
a.edit, a.delete, a.edit:hover, a.delete:hover {
border-bottom: none;
display: block;
@ -366,7 +388,7 @@ form#upload #post_content {
clear: both;
}
table .vers, table .name {
table .vers {
text-align: center;
}

View File

@ -348,7 +348,7 @@ function wp_insert_attachment($object, $file = false, $post_parent = 0) {
wp_set_post_cats('', $post_ID, $post_category);
if ( $file )
add_post_meta($post_ID, '_wp_attached_file', $file);
add_post_meta($post_ID, '_wp_attached_file', $file );
clean_post_cache($post_ID);