git-svn-id: http://svn.automattic.com/wordpress/trunk@2377 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2005-02-25 00:20:48 +00:00
parent 8d7f5b8cae
commit 894c4cc880
4 changed files with 52 additions and 26 deletions

View File

@ -81,7 +81,7 @@ if (0 < $numcomms) $numcomms = number_format($numcomms);
$numcats = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->categories"); $numcats = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->categories");
if (0 < $numcats) $numcats = number_format($numcats); if (0 < $numcats) $numcats = number_format($numcats);
?> ?>
<p>There are currently <?php echo $numposts ?> <a href="edit.php" title="posts">posts</a> and <?php echo $numcomms ?> <a href="edit-comments.php" title="Comments">comments</a>, contained within <?php echo $numcats ?> <a href="categories.php" title="categories">categories</a>.</p> <p><?php printf(__('There are currently %1$d <a href="%2$s" title="Posts">posts</a> and %3$d <a href="%4$s" title="Comments">comments</a>, contained within %5$d <a href="%6$s" title="categories">categories</a>.'), $numposts, 'edit.php', $numcomms, 'edit-comments.php', $numcats, 'categories.php'); ?></p>
</div> </div>
<?php <?php

View File

@ -160,7 +160,7 @@ require('admin-header.php');
</td> </td>
</tr> </tr>
<tr> <tr>
<th scope="row"> family </th> <th scope="row"> <?php _e('family'); ?> </th>
<td> <td>
<label for="child"> <label for="child">
<input class="valinp" type="radio" name="family" value="child" id="child" <?php xfn_check('family', 'child', 'radio'); ?> /> <input class="valinp" type="radio" name="family" value="child" id="child" <?php xfn_check('family', 'child', 'radio'); ?> />

View File

@ -108,7 +108,7 @@ switch ($action) {
?> ?>
<div class="wrap"> <div class="wrap">
<h2>Edit &#8220;<?php echo wp_specialchars($row->cat_name)?>&#8221; Category </h2> <h2><?php printf('Edit &#8220%s&#8221; Category', wp_specialchars($row->cat_name)); ?></h2>
<form name="editcat" method="post"> <form name="editcat" method="post">
<input type="hidden" name="action" value="editedcat" /> <input type="hidden" name="action" value="editedcat" />
@ -305,24 +305,50 @@ $results = $wpdb->get_results("SELECT cat_id, cat_name, auto_toggle, show_images
$i = 1; $i = 1;
foreach ($results as $row) { foreach ($results as $row) {
if ($row->list_limit == -1) { if ($row->list_limit == -1) {
$row->list_limit = 'none'; $row->list_limit = __('none');
} }
$style = ($i % 2) ? ' class="alternate"' : ''; $style = ($i % 2) ? ' class="alternate"' : '';
/*
Manually internationalize every sort order option.
*/
switch ($row->sort_order) {
case 'name':
$row->sort_order = __('name');
break;
case 'id':
$row->sort_order = __('id');
break;
case 'url':
$row->sort_order = __('url');
break;
case 'rating':
$row->sort_order = __('rating');
break;
case 'updated':
$row->sort_order = __('updated');
break;
case 'rand':
$row->sort_order = __('rand');
break;
case 'length':
$row->sort_order = __('length');
break;
}
?> ?>
<tr valign="middle" align="center" <?php echo $style ?> style="border-bottom: 1px dotted #9C9A9C;"> <tr valign="middle" align="center" <?php echo $style ?> style="border-bottom: 1px dotted #9C9A9C;">
<td><?php echo wp_specialchars($row->cat_name)?></td> <td><?php echo wp_specialchars($row->cat_name)?></td>
<td ><?php echo $row->cat_id?></td> <td ><?php echo $row->cat_id?></td>
<td><?php echo $row->auto_toggle?></td> <td><?php echo $row->auto_toggle == 'Y' ? __('Y') : __('N') ?></td>
<td><?php echo $row->show_images?></td> <td><?php echo $row->show_images == 'Y' ? __('Y') : __('N') ?></td>
<td><?php echo $row->show_description?></td> <td><?php echo $row->show_description == 'Y' ? __('Y') : __('N') ?></td>
<td><?php echo $row->show_rating?></td> <td><?php echo $row->show_rating == 'Y' ? __('Y') : __('N') ?></td>
<td><?php echo $row->show_updated?></td> <td><?php echo $row->show_updated == 'Y' ? __('Y') : __('N') ?></td>
<td><?php echo $row->sort_order?></td> <td><?php echo $row->sort_order ?></td>
<td><?php echo $row->sort_desc?></td> <td><?php echo $row->sort_desc == 'Y' ? __('Y') : __('N') ?></td>
<td nowrap="nowrap"><?php echo htmlentities($row->text_before_link)?>&nbsp;</td> <td nowrap="nowrap"><?php echo htmlentities($row->text_before_link)?>&nbsp;</td>
<td nowrap="nowrap"><?php echo htmlentities($row->text_after_link)?>&nbsp;</td> <td nowrap="nowrap"><?php echo htmlentities($row->text_after_link)?>&nbsp;</td>
<td nowrap="nowrap"><?php echo htmlentities($row->text_after_all)?></td> <td nowrap="nowrap"><?php echo htmlentities($row->text_after_all)?></td>
<td><?php echo $row->list_limit?></td> <td><?php echo $row->list_limit ?></td>
<td><a href="link-categories.php?cat_id=<?php echo $row->cat_id?>&amp;action=Edit" class="edit"><?php _e('Edit') ?></a></td> <td><a href="link-categories.php?cat_id=<?php echo $row->cat_id?>&amp;action=Edit" class="edit"><?php _e('Edit') ?></a></td>
<td><a href="link-categories.php?cat_id=<?php echo $row->cat_id?>&amp;action=Delete" onclick="return confirm('<?php _e("You are about to delete this category.\\n \'Cancel\' to stop, \'OK\' to delete.") ?>');" class="delete"><?php _e('Delete') ?></a></td> <td><a href="link-categories.php?cat_id=<?php echo $row->cat_id?>&amp;action=Delete" onclick="return confirm('<?php _e("You are about to delete this category.\\n \'Cancel\' to stop, \'OK\' to delete.") ?>');" class="delete"><?php _e('Delete') ?></a></td>
</tr> </tr>

View File

@ -26,7 +26,7 @@ switch($action) {
case 'post': case 'post':
if ( !user_can_create_draft($user_ID) ) if ( !user_can_create_draft($user_ID) )
die('You are not allowed to create posts or drafts on this blog.'); die( __('You are not allowed to create posts or drafts on this blog.') );
$post_pingback = (int) $_POST['post_pingback']; $post_pingback = (int) $_POST['post_pingback'];
$content = apply_filters('content_save_pre', $_POST['content']); $content = apply_filters('content_save_pre', $_POST['content']);
@ -201,7 +201,7 @@ case 'edit':
$post = $post_ID = $p = (int) $_GET['post']; $post = $post_ID = $p = (int) $_GET['post'];
if ( !user_can_edit_post($user_ID, $post_ID) ) if ( !user_can_edit_post($user_ID, $post_ID) )
die ('You are not allowed to edit this post.'); die ( __('You are not allowed to edit this post.') );
$postdata = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID = '$post_ID'"); $postdata = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID = '$post_ID'");
$content = $postdata->post_content; $content = $postdata->post_content;
@ -224,7 +224,7 @@ case 'edit':
$menu_order = $postdata->menu_order; $menu_order = $postdata->menu_order;
if( 'private' == $postdata->post_status && $postdata->post_author != $user_ID ) if( 'private' == $postdata->post_status && $postdata->post_author != $user_ID )
die ('You are not allowed to view other users\' private posts.'); die ( __('You are not allowed to view other users\' private posts.') );
if ($post_status == 'static') { if ($post_status == 'static') {
$page_template = get_post_meta($post_ID, '_wp_page_template', true); $page_template = get_post_meta($post_ID, '_wp_page_template', true);
@ -258,7 +258,7 @@ case 'editpost':
$post_ID = $_POST['post_ID']; $post_ID = $_POST['post_ID'];
if (!user_can_edit_post($user_ID, $post_ID, $blog_ID)) if (!user_can_edit_post($user_ID, $post_ID, $blog_ID))
die('You are not allowed to edit this post.'); die( __('You are not allowed to edit this post.') );
$post_categories = $_POST['post_category']; $post_categories = $_POST['post_category'];
if (!$post_categories) $post_categories[] = 1; if (!$post_categories) $post_categories[] = 1;
@ -440,11 +440,11 @@ case 'delete':
$post_id = (isset($_GET['post'])) ? intval($_GET['post']) : intval($_POST['post_ID']); $post_id = (isset($_GET['post'])) ? intval($_GET['post']) : intval($_POST['post_ID']);
if (!user_can_delete_post($user_ID, $post_id)) { if (!user_can_delete_post($user_ID, $post_id)) {
die('You are not allowed to delete this post.'); die( __('You are not allowed to delete this post.') );
} }
if (! wp_delete_post($post_id)) if (! wp_delete_post($post_id))
die(__('Error in deleting...')); die( __('Error in deleting...') );
$sendback = $_SERVER['HTTP_REFERER']; $sendback = $_SERVER['HTTP_REFERER'];
if (strstr($sendback, 'post.php')) $sendback = get_settings('siteurl') .'/wp-admin/post.php'; if (strstr($sendback, 'post.php')) $sendback = get_settings('siteurl') .'/wp-admin/post.php';
@ -465,7 +465,7 @@ case 'editcomment':
$commentdata = get_commentdata($comment, 1, true) or die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'javascript:history.go(-1)')); $commentdata = get_commentdata($comment, 1, true) or die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'javascript:history.go(-1)'));
if (!user_can_edit_post_comments($user_ID, $commentdata['comment_post_ID'])) { if (!user_can_edit_post_comments($user_ID, $commentdata['comment_post_ID'])) {
die('You are not allowed to edit comments on this post.'); die( __('You are not allowed to edit comments on this post.') );
} }
$content = $commentdata['comment_content']; $content = $commentdata['comment_content'];
@ -487,7 +487,7 @@ case 'confirmdeletecomment':
$commentdata = get_commentdata($comment, 1, true) or die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php')); $commentdata = get_commentdata($comment, 1, true) or die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
if (!user_can_delete_post_comments($user_ID, $commentdata['comment_post_ID'])) { if (!user_can_delete_post_comments($user_ID, $commentdata['comment_post_ID'])) {
die('You are not allowed to delete comments on this post.'); die( __('You are not allowed to delete comments on this post.') );
} }
echo "<div class=\"wrap\">\n"; echo "<div class=\"wrap\">\n";
@ -529,7 +529,7 @@ case 'deletecomment':
$commentdata = get_commentdata($comment, 1, true) or die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'post.php')); $commentdata = get_commentdata($comment, 1, true) or die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'post.php'));
if (!user_can_delete_post_comments($user_ID, $commentdata['comment_post_ID'])) { if (!user_can_delete_post_comments($user_ID, $commentdata['comment_post_ID'])) {
die('You are not allowed to edit comments on this post.'); die( __('You are not allowed to edit comments on this post.') );
} }
wp_set_comment_status($comment, "delete"); wp_set_comment_status($comment, "delete");
@ -560,7 +560,7 @@ case 'unapprovecomment':
$commentdata = get_commentdata($comment) or die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php')); $commentdata = get_commentdata($comment) or die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
if (!user_can_edit_post_comments($user_ID, $commentdata['comment_post_ID'])) { if (!user_can_edit_post_comments($user_ID, $commentdata['comment_post_ID'])) {
die('You are not allowed to edit comments on this post, so you cannot disapprove this comment.'); die( __('You are not allowed to edit comments on this post, so you cannot disapprove this comment.') );
} }
wp_set_comment_status($comment, "hold"); wp_set_comment_status($comment, "hold");
@ -580,7 +580,7 @@ case 'mailapprovecomment':
$commentdata = get_commentdata($comment, 1, true) or die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php')); $commentdata = get_commentdata($comment, 1, true) or die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
if (!user_can_edit_post_comments($user_ID, $commentdata['comment_post_ID'])) { if (!user_can_edit_post_comments($user_ID, $commentdata['comment_post_ID'])) {
die('You are not allowed to edit comments on this post, so you cannot approve this comment.'); die( __('You are not allowed to edit comments on this post, so you cannot approve this comment.') );
} }
if ('1' != $commentdata['comment_approved']) { if ('1' != $commentdata['comment_approved']) {
@ -605,7 +605,7 @@ case 'approvecomment':
$commentdata = get_commentdata($comment) or die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php')); $commentdata = get_commentdata($comment) or die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
if (!user_can_edit_post_comments($user_ID, $commentdata['comment_post_ID'])) { if (!user_can_edit_post_comments($user_ID, $commentdata['comment_post_ID'])) {
die('You are not allowed to edit comments on this post, so you cannot approve this comment.'); die( __('You are not allowed to edit comments on this post, so you cannot approve this comment.') );
} }
wp_set_comment_status($comment, "approve"); wp_set_comment_status($comment, "approve");
@ -632,7 +632,7 @@ case 'editedcomment':
$comment_status = $_POST['comment_status']; $comment_status = $_POST['comment_status'];
if (!user_can_edit_post_comments($user_ID, $comment_post_ID)) { if (!user_can_edit_post_comments($user_ID, $comment_post_ID)) {
die('You are not allowed to edit comments on this post, so you cannot edit this comment.'); die( __('You are not allowed to edit comments on this post, so you cannot edit this comment.') );
} }
if (user_can_edit_post_date($user_ID, $post_ID) && (!empty($_POST['edit_date']))) { if (user_can_edit_post_date($user_ID, $post_ID) && (!empty($_POST['edit_date']))) {
@ -676,7 +676,7 @@ default:
require_once ('./admin-header.php'); require_once ('./admin-header.php');
?> ?>
<?php if ( isset($_GET['posted']) ) : ?> <?php if ( isset($_GET['posted']) ) : ?>
<div class="updated"><p>Post saved. <a href="<?php bloginfo('home'); ?>">View site &raquo;</a></p></div> <div class="updated"><p><?php printf(__('Post saved. <a href="%s">View site &raquo;</a>'), get_bloginfo('home')); ?></p></div>
<?php endif; ?> <?php endif; ?>
<?php <?php
if (user_can_create_draft($user_ID)) { if (user_can_create_draft($user_ID)) {