34
34
// Incoming Links Widget
35
35
if ( !isset( $widget_options['dashboard_incoming_links'] ) || !isset( $widget_options['dashboard_incoming_links']['home'] ) || $widget_options['dashboard_incoming_links']['home'] != get_option('home') ) {
37
$num_items = isset($widget_options['dashboard_incoming_links']['items']) ? $widget_options['dashboard_incoming_links']['items'] : 10;
37
38
$widget_options['dashboard_incoming_links'] = array(
38
39
'home' => get_option('home'),
39
'link' => apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?hl=en&scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
40
'url' => isset($widget_options['dashboard_incoming_links']['url']) ? apply_filters( 'dashboard_incoming_links_feed', $widget_options['dashboard_incoming_links']['url'] ) : apply_filters( 'dashboard_incoming_links_feed', 'http://blogsearch.google.com/blogsearch_feeds?hl=en&scoring=d&ie=utf-8&num=20&output=rss&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
41
'items' => isset($widget_options['dashboard_incoming_links']['items']) ? $widget_options['dashboard_incoming_links']['items'] : 10,
40
'link' => apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
41
'url' => isset($widget_options['dashboard_incoming_links']['url']) ? apply_filters( 'dashboard_incoming_links_feed', $widget_options['dashboard_incoming_links']['url'] ) : apply_filters( 'dashboard_incoming_links_feed', 'http://blogsearch.google.com/blogsearch_feeds?scoring=d&ie=utf-8&num=' . $num_items . '&output=rss&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
42
'items' => $num_items,
42
43
'show_date' => isset($widget_options['dashboard_incoming_links']['show_date']) ? $widget_options['dashboard_incoming_links']['show_date'] : false
132
133
function _wp_dashboard_control_callback( $dashboard, $meta_box ) {
133
134
echo '<form action="" method="post" class="dashboard-widget-control-form">';
134
135
wp_dashboard_trigger_widget_control( $meta_box['id'] );
135
echo "<p class='submit'><input type='hidden' name='widget_id' value='" . esc_attr($meta_box['id']) . "' /><input type='submit' value='" . esc_attr__( 'Submit' ) . "' /></p>";
136
echo '<p class="submit"><input type="hidden" name="widget_id" value="' . esc_attr($meta_box['id']) . '" /><input type="submit" value="' . esc_attr__( 'Submit' ) . '" /></p>';
238
239
// Total Comments
239
$num = number_format_i18n($num_comm->total_comments);
240
$num = '<span class="total-count">' . number_format_i18n($num_comm->total_comments) . '</span>';
240
241
$text = _n( 'Comment', 'Comments', $num_comm->total_comments );
241
242
if ( current_user_can( 'moderate_comments' ) ) {
242
243
$num = "<a href='edit-comments.php'>$num</a>";
258
259
echo '<td class="t pages">' . $text . '</td>';
260
261
// Approved Comments
261
$num = number_format_i18n($num_comm->approved);
262
$num = '<span class="approved-count">' . number_format_i18n($num_comm->approved) . '</span>';
262
263
$text = _nc( 'Approved|Right Now', 'Approved', $num_comm->approved );
263
264
if ( current_user_can( 'moderate_comments' ) ) {
264
265
$num = "<a href='edit-comments.php?comment_status=approved'>$num</a>";
280
281
echo '<td class="t cats">' . $text . '</td>';
282
283
// Pending Comments
283
$num = number_format_i18n($num_comm->moderated);
284
$num = '<span class="pending-count">' . number_format_i18n($num_comm->moderated) . '</span>';
284
285
$text = _n( 'Pending', 'Pending', $num_comm->moderated );
285
286
if ( current_user_can( 'moderate_comments' ) ) {
286
$num = "<a href='edit-comments.php?comment_status=moderated'><span class='pending-count'>$num</span></a>";
287
$num = "<a href='edit-comments.php?comment_status=moderated'>$num</a>";
287
288
$text = "<a class='waiting' href='edit-comments.php?comment_status=moderated'>$text</a>";
289
290
echo '<td class="b b-waiting">' . $num . '</td>';
340
341
if ( current_user_can( 'switch_themes' ) ) {
341
342
echo '<a href="themes.php" class="button rbutton">' . __('Change Theme') . '</a>';
342
printf('Theme <span class="b"><a href="themes.php">%1$s</a></span>', $ct->title);
343
printf( __('Theme <span class="b"><a href="themes.php">%1$s</a></span>'), $ct->title );
344
printf('Theme <span class="b">%1$s</span>', $ct->title);
345
printf( __('Theme <span class="b">%1$s</span>'), $ct->title );
447
448
foreach ( $drafts as $draft ) {
448
449
$url = get_edit_post_link( $draft->ID );
449
450
$title = _draft_or_post_title( $draft->ID );
450
$item = "<h4><a href='$url' title='" . sprintf( __( 'Edit “%s”' ), esc_attr( $title ) ) . "'>$title</a> <abbr title='" . get_the_time(__('Y/m/d g:i:s A'), $draft) . "'>" . get_the_time( get_option( 'date_format' ), $draft ) . '</abbr></h4>';
451
$item = "<h4><a href='$url' title='" . sprintf( __( 'Edit “%s”' ), esc_attr( $title ) ) . "'>" . esc_html($title) . "</a> <abbr title='" . get_the_time(__('Y/m/d g:i:s A'), $draft) . "'>" . get_the_time( get_option( 'date_format' ), $draft ) . '</abbr></h4>';
451
452
if ( $the_content = preg_split( '#\s#', strip_tags( $draft->post_content ), 11, PREG_SPLIT_NO_EMPTY ) )
452
453
$item .= '<p>' . join( ' ', array_slice( $the_content, 0, 10 ) ) . ( 10 < count( $the_content ) ? '…' : '' ) . '</p>';
527
529
$comment_post_link = "<a href='$comment_post_url'>$comment_post_title</a>";
528
530
$comment_link = '<a class="comment-link" href="' . esc_url(get_comment_link()) . '">#</a>';
530
$delete_url = esc_url( wp_nonce_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) );
531
$approve_url = esc_url( wp_nonce_url( "comment.php?action=approvecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "approve-comment_$comment->comment_ID" ) );
532
$unapprove_url = esc_url( wp_nonce_url( "comment.php?action=unapprovecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "unapprove-comment_$comment->comment_ID" ) );
533
$spam_url = esc_url( wp_nonce_url( "comment.php?action=deletecomment&dt=spam&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) );
537
532
$actions_string = '';
538
533
if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
534
// preorder it: Approve | Reply | Edit | Spam | Trash
536
'approve' => '', 'unapprove' => '',
540
'trash' => '', 'delete' => ''
543
$del_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "delete-comment_$comment->comment_ID" ) );
544
$approve_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "approve-comment_$comment->comment_ID" ) );
546
$approve_url = esc_url( "comment.php?action=approvecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$approve_nonce" );
547
$unapprove_url = esc_url( "comment.php?action=unapprovecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$approve_nonce" );
548
$spam_url = esc_url( "comment.php?action=spamcomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" );
549
$trash_url = esc_url( "comment.php?action=trashcomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" );
550
$delete_url = esc_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" );
539
552
$actions['approve'] = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
540
553
$actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved vim-u' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
541
554
$actions['edit'] = "<a href='comment.php?action=editcomment&c={$comment->comment_ID}' title='" . __('Edit comment') . "'>". __('Edit') . '</a>';
542
//$actions['quickedit'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$comment->comment_post_ID.'\',\'edit\');return false;" class="vim-q" title="'.__('Quick Edit').'" href="#">' . __('Quick Edit') . '</a>';
543
555
$actions['reply'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$comment->comment_post_ID.'\');return false;" class="vim-r hide-if-no-js" title="'.__('Reply to this comment').'" href="#">' . __('Reply') . '</a>';
544
556
$actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . __( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>';
545
$actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete vim-d vim-destructive'>" . __('Delete') . '</a>';
557
if ( !EMPTY_TRASH_DAYS )
558
$actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-d vim-destructive'>" . __('Delete Permanently') . '</a>';
560
$actions['trash'] = "<a href='$trash_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-d vim-destructive' title='" . __( 'Move this comment to the trash' ) . "'>" . _x('Trash', 'verb') . '</a>';
547
$actions = apply_filters( 'comment_row_actions', $actions, $comment );
562
$actions = apply_filters( 'comment_row_actions', array_filter($actions), $comment );
550
565
foreach ( $actions as $action => $link ) {
567
582
<?php echo get_avatar( $comment, 50 ); ?>
569
584
<div class="dashboard-comment-wrap">
570
<h4 class="comment-meta"><?php printf( __( 'From %1$s on %2$s%3$s' ), '<cite class="comment-author">' . get_comment_author_link() . '</cite>', $comment_post_link." ".$comment_link, ' <span class="approve">' . __( '[Pending]' ) . '</span>' ); ?></h4>
585
<h4 class="comment-meta"><?php printf( __( 'From %1$s on %2$s%3$s' ), '<cite class="comment-author">' . get_comment_author_link() . '</cite>', $comment_post_link.' '.$comment_link, ' <span class="approve">' . __( '[Pending]' ) . '</span>' ); ?></h4>
586
601
<div class="dashboard-comment-wrap">
587
602
<?php /* translators: %1$s is type of comment, %2$s is link to the post */ ?>
588
<h4 class="comment-meta"><?php printf( _x( '%1$s on %2$s', 'dashboard' ), "<strong>$type</strong>", $comment_post_link ); ?></h4>
603
<h4 class="comment-meta"><?php printf( _x( '%1$s on %2$s', 'dashboard' ), "<strong>$type</strong>", $comment_post_link." ".$comment_link ); ?></h4>
589
604
<p class="comment-author"><?php comment_author_link(); ?></p>
591
606
<?php endif; // comment_type ?>
592
607
<blockquote><p><?php comment_excerpt(); ?></p></blockquote>
593
608
<p class="row-actions"><?php echo $actions_string; ?></p>
595
<div id="inline-<?php echo $comment->comment_ID; ?>" class="hidden">
596
<textarea class="comment" rows="3" cols="10"><?php echo $comment->comment_content; ?></textarea>
597
<div class="author-email"><?php echo esc_attr( $comment->comment_author_email ); ?></div>
598
<div class="author"><?php echo esc_attr( $comment->comment_author ); ?></div>
599
<div class="author-url"><?php echo esc_attr( $comment->comment_author_url ); ?></div>
600
<div class="comment_status"><?php echo $comment->comment_approved; ?></div>
918
935
// title is optional. If black, fill it if possible
919
936
if ( !$widget_options[$widget_id]['title'] && isset($_POST['widget-rss'][$number]['title']) ) {
920
937
$rss = fetch_feed($widget_options[$widget_id]['url']);
921
if ( ! is_wp_error($rss) )
922
$widget_options[$widget_id]['title'] = htmlentities(strip_tags($rss->get_title()));
938
if ( is_wp_error($rss) ) {
924
939
$widget_options[$widget_id]['title'] = htmlentities(__('Unknown Feed'));
941
$widget_options[$widget_id]['title'] = htmlentities(strip_tags($rss->get_title()));
926
946
update_option( 'dashboard_widget_options', $widget_options );