- 237B6B3C050348CBBD984C97B5030637A17A3C98C6252E4BE8D68FBB82AE327B2DC90DE81F4BD99C081361E65359F9ADF00C1D6F2FA330D94BEF05E3959E9F91
+ 2C6F9FD702518C4606DAE01232495E2ABE75C6C3147C7A9AF2EAB3193AC23FBFD8AB862D72F91CF36871BAE341B6263FFB720D9C91A3E543911E3B709B9133FB
mp-wp/wp-admin/includes/dashboard.php
(31 . 58)(31 . 10)
21203 $recent_comments_title = __( 'Recent Comments' );
21204 wp_add_dashboard_widget( 'dashboard_recent_comments', $recent_comments_title, 'wp_dashboard_recent_comments' );
21205
21206 // Incoming Links Widget
21207 if ( !isset( $widget_options['dashboard_incoming_links'] ) || !isset( $widget_options['dashboard_incoming_links']['home'] ) || $widget_options['dashboard_incoming_links']['home'] != get_option('home') ) {
21208 $update = true;
21209 $widget_options['dashboard_incoming_links'] = array(
21210 'home' => get_option('home'),
21211 'link' => apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?hl=en&scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
21212 'url' => apply_filters( 'dashboard_incoming_links_feed', 'http://blogsearch.google.com/blogsearch_feeds?hl=en&scoring=d&ie=utf-8&num=10&output=rss&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
21213 'items' => isset($widget_options['dashboard_incoming_links']['items']) ? $widget_options['dashboard_incoming_links']['items'] : 10,
21214 'show_date' => isset($widget_options['dashboard_incoming_links']['show_date']) ? $widget_options['dashboard_incoming_links']['show_date'] : false
21215 );
21216 }
21217 wp_add_dashboard_widget( 'dashboard_incoming_links', __( 'Incoming Links' ), 'wp_dashboard_incoming_links', 'wp_dashboard_incoming_links_control' );
21218
21219 // WP Plugins Widget
21220 if ( current_user_can( 'activate_plugins' ) )
21221 wp_add_dashboard_widget( 'dashboard_plugins', __( 'Plugins' ), 'wp_dashboard_plugins' );
21222
21223 // QuickPress Widget
21224 if ( current_user_can('edit_posts') )
21225 wp_add_dashboard_widget( 'dashboard_quick_press', __( 'QuickPress' ), 'wp_dashboard_quick_press' );
21226
21227 // Recent Drafts
21228 if ( current_user_can('edit_posts') )
21229 wp_add_dashboard_widget( 'dashboard_recent_drafts', __('Recent Drafts'), 'wp_dashboard_recent_drafts' );
21230
21231 // Primary feed (Dev Blog) Widget
21232 if ( !isset( $widget_options['dashboard_primary'] ) ) {
21233 $update = true;
21234 $widget_options['dashboard_primary'] = array(
21235 'link' => apply_filters( 'dashboard_primary_link', __( 'http://wordpress.org/development/' ) ),
21236 'url' => apply_filters( 'dashboard_primary_feed', __( 'http://wordpress.org/development/feed/' ) ),
21237 'title' => apply_filters( 'dashboard_primary_title', __( 'WordPress Development Blog' ) ),
21238 'items' => 2,
21239 'show_summary' => 1,
21240 'show_author' => 0,
21241 'show_date' => 1
21242 );
21243 }
21244 wp_add_dashboard_widget( 'dashboard_primary', $widget_options['dashboard_primary']['title'], 'wp_dashboard_primary', 'wp_dashboard_primary_control' );
21245
21246 // Secondary Feed (Planet) Widget
21247 if ( !isset( $widget_options['dashboard_secondary'] ) ) {
21248 $update = true;
21249 $widget_options['dashboard_secondary'] = array(
21250 'link' => apply_filters( 'dashboard_secondary_link', __( 'http://planet.wordpress.org/' ) ),
21251 'url' => apply_filters( 'dashboard_secondary_feed', __( 'http://planet.wordpress.org/feed/' ) ),
21252 'title' => apply_filters( 'dashboard_secondary_title', __( 'Other WordPress News' ) ),
21253 'items' => 5
21254 );
21255 }
21256 wp_add_dashboard_widget( 'dashboard_secondary', $widget_options['dashboard_secondary']['title'], 'wp_dashboard_secondary', 'wp_dashboard_secondary_control' );
21257
21258 // Hook to register new widgets
21259 do_action( 'wp_dashboard_setup' );
21260
(175 . 7)(127 . 6)
21262
21263 $num_comm = wp_count_comments( );
21264
21265 echo "\n\t".'<p class="sub">' . __('At a Glance') . '</p>';
21266 echo "\n\t".'<div class="table">'."\n\t".'<table>';
21267 echo "\n\t".'<tr class="first">';
21268
(278 . 91)(229 . 11)
21270 }
21271
21272 echo '</p>';
21273
21274 echo sprintf('<span id="wp-version-message">You are using <span class="b">WordPress %s</span></span>', $GLOBALS['wp_version']);
21275
21276 echo "\n\t".'</div>';
21277 do_action( 'rightnow_end' );
21278 do_action( 'activity_box_end' );
21279 }
21280
21281 function wp_dashboard_quick_press() {
21282 $drafts = false;
21283 if ( 'post' === strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['action'] ) && 0 === strpos( $_POST['action'], 'post-quickpress' ) && (int) $_POST['post_ID'] ) {
21284 $view = get_permalink( $_POST['post_ID'] );
21285 $edit = clean_url( get_edit_post_link( $_POST['post_ID'] ) );
21286 if ( 'post-quickpress-publish' == $_POST['action'] ) {
21287 if ( current_user_can('publish_posts') )
21288 printf( '<div class="message"><p>' . __( 'Post Published. <a href="%s">View post</a> | <a href="%s">Edit post</a>' ) . '</p></div>', clean_url( $view ), $edit );
21289 else
21290 printf( '<div class="message"><p>' . __( 'Post submitted. <a href="%s">Preview post</a> | <a href="%s">Edit post</a>' ) . '</p></div>', clean_url( add_query_arg( 'preview', 1, $view ) ), $edit );
21291 } else {
21292 printf( '<div class="message"><p>' . __( 'Draft Saved. <a href="%s">Preview post</a> | <a href="%s">Edit post</a>' ) . '</p></div>', clean_url( add_query_arg( 'preview', 1, $view ) ), $edit );
21293 $drafts_query = new WP_Query( array(
21294 'post_type' => 'post',
21295 'what_to_show' => 'posts',
21296 'post_status' => 'draft',
21297 'author' => $GLOBALS['current_user']->ID,
21298 'posts_per_page' => 1,
21299 'orderby' => 'modified',
21300 'order' => 'DESC'
21301 ) );
21302
21303 if ( $drafts_query->posts )
21304 $drafts =& $drafts_query->posts;
21305 }
21306 printf('<p class="textright">' . __('You can also try %s, easy blogging from anywhere on the Web.') . '</p>', '<a href="tools.php">' . __('Press This') . '</a>' );
21307 $_REQUEST = array(); // hack for get_default_post_to_edit()
21308 }
21309
21310 $post = get_default_post_to_edit();
21311 ?>
21312
21313 <form name="post" action="<?php echo clean_url( admin_url( 'post.php' ) ); ?>" method="post" id="quick-press">
21314 <h4 id="quick-post-title"><label for="title"><?php _e('Title') ?></label></h4>
21315 <div class="input-text-wrap">
21316 <input type="text" name="post_title" id="title" tabindex="1" autocomplete="off" value="<?php echo attribute_escape( $post->post_title ); ?>" />
21317 </div>
21318
21319 <?php if ( current_user_can( 'upload_files' ) ) : ?>
21320 <div id="media-buttons" class="hide-if-no-js">
21321 <?php do_action( 'media_buttons' ); ?>
21322 </div>
21323 <?php endif; ?>
21324
21325 <h4 id="content-label"><label for="content"><?php _e('Content') ?></label></h4>
21326 <div class="textarea-wrap">
21327 <textarea name="content" id="content" rows="3" cols="15" tabindex="2"><?php echo $post->post_content; ?></textarea>
21328 </div>
21329
21330 <script type="text/javascript">edCanvas = document.getElementById('content');edInsertContent = null;</script>
21331
21332 <h4><label for="tags-input"><?php _e('Tags') ?></label></h4>
21333 <div class="input-text-wrap">
21334 <input type="text" name="tags_input" id="tags-input" tabindex="3" value="<?php echo get_tags_to_edit( $post->ID ); ?>" />
21335 </div>
21336
21337 <p class="submit">
21338 <input type="hidden" name="action" id="quickpost-action" value="post-quickpress-save" />
21339 <input type="hidden" name="quickpress_post_ID" value="<?php echo (int) $post->ID; ?>" />
21340 <?php wp_nonce_field('add-post'); ?>
21341 <input type="submit" name="save" id="save-post" class="button" tabindex="4" value="<?php _e('Save Draft'); ?>" />
21342 <input type="reset" value="<?php _e( 'Cancel' ); ?>" class="cancel" />
21343 <?php if ( current_user_can('publish_posts') ) { ?>
21344 <input type="submit" name="publish" id="publish" accesskey="p" tabindex="5" class="button-primary" value="<?php _e('Publish'); ?>" />
21345 <?php } else { ?>
21346 <input type="submit" name="publish" id="publish" accesskey="p" tabindex="5" class="button-primary" value="<?php _e('Submit for Review'); ?>" />
21347 <?php } ?>
21348 <br class="clear" />
21349 </p>
21350
21351 </form>
21352
21353 <?php
21354 if ( $drafts )
21355 wp_dashboard_recent_drafts( $drafts );
21356 }
21357
21358 function wp_dashboard_recent_drafts( $drafts = false ) {
21359 if ( !$drafts ) {
21360 $drafts_query = new WP_Query( array(
(474 . 8)(345 . 6)
21362 $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>';
21363 $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>';
21364 $actions['edit'] = "<a href='comment.php?action=editcomment&c={$comment->comment_ID}' title='" . __('Edit comment') . "'>". __('Edit') . '</a>';
21365 //$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>';
21366 $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>';
21367 $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' ) . "'>" . _c( 'Spam|verb' ) . '</a>';
21368 $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete vim-d vim-destructive'>" . __('Delete') . '</a>';
21369
(486 . 10)(355 . 6)
21371 ++$i;
21372 ( ( ('approve' == $action || 'unapprove' == $action) && 2 === $i ) || 1 === $i ) ? $sep = '' : $sep = ' | ';
21373
21374 // Reply and quickedit need a hide-if-no-js span
21375 if ( 'reply' == $action || 'quickedit' == $action )
21376 $action .= ' hide-if-no-js';
21377
21378 $actions_string .= "<span class='$action'>$sep$link</span>";
21379 }
21380 }
(668 . 66)(533 . 6)
21382 echo "</div>";
21383 }
21384
21385 function wp_dashboard_plugins() {
21386 wp_dashboard_cached_rss_widget( 'dashboard_plugins', 'wp_dashboard_plugins_output', array(
21387 'http://wordpress.org/extend/plugins/rss/browse/popular/',
21388 'http://wordpress.org/extend/plugins/rss/browse/new/',
21389 'http://wordpress.org/extend/plugins/rss/browse/updated/'
21390 ) );
21391 }
21392
21393 /**
21394 * Display plugins most popular, newest plugins, and recently updated widget text.
21395 *
21396 * @since unknown
21397 */
21398 function wp_dashboard_plugins_output() {
21399 $popular = @fetch_rss( 'http://wordpress.org/extend/plugins/rss/browse/popular/' );
21400 $new = @fetch_rss( 'http://wordpress.org/extend/plugins/rss/browse/new/' );
21401 $updated = @fetch_rss( 'http://wordpress.org/extend/plugins/rss/browse/updated/' );
21402
21403 foreach ( array( 'popular' => __('Most Popular'), 'new' => __('Newest Plugins'), 'updated' => __('Recently Updated') ) as $feed => $label ) {
21404 if ( !isset($$feed->items) || 0 == count($$feed->items) )
21405 continue;
21406
21407 $$feed->items = array_slice($$feed->items, 0, 5);
21408 $item_key = array_rand($$feed->items);
21409
21410 // Eliminate some common badly formed plugin descriptions
21411 while ( ( null !== $item_key = array_rand($$feed->items) ) && false !== strpos( $$feed->items[$item_key]['description'], 'Plugin Name:' ) )
21412 unset($$feed->items[$item_key]);
21413
21414 if ( !isset($$feed->items[$item_key]) )
21415 continue;
21416
21417 $item = $$feed->items[$item_key];
21418
21419 // current bbPress feed item titles are: user on "topic title"
21420 if ( preg_match( '/"(.*)"/s', $item['title'], $matches ) )
21421 $title = $matches[1];
21422 else // but let's make it forward compatible if things change
21423 $title = $item['title'];
21424 $title = wp_specialchars( $title );
21425
21426 $description = wp_specialchars( strip_tags(html_entity_decode($item['description'], ENT_QUOTES)) );
21427
21428 list($link, $frag) = explode( '#', $item['link'] );
21429
21430 $link = clean_url($link);
21431 if( preg_match('|/([^/]+?)/?$|', $link, $matches) )
21432 $slug = $matches[1];
21433 else
21434 $slug = '';
21435
21436 $ilink = wp_nonce_url('plugin-install.php?tab=plugin-information&plugin=' . $slug, 'install-plugin_' . $slug) .
21437 '&TB_iframe=true&width=600&height=800';
21438
21439 echo "<h4>$label</h4>\n";
21440 echo "<h5><a href='$link'>$title</a></h5> <span>(<a href='$ilink' class='thickbox' title='$title'>" . __( 'Install' ) . "</a>)</span>\n";
21441 echo "<p>$description</p>\n";
21442 }
21443 }
21444
21445 /**
21446 * Checks to see if all of the feed url in $check_urls are cached.
21447 *