Ticket #19239: 19239.3.2.diff
File 19239.3.2.diff, 12.2 KB (added by , 11 years ago) |
---|
-
wp-admin/includes/ajax-actions.php
209 209 case 'dashboard_incoming_links' : 210 210 wp_dashboard_incoming_links(); 211 211 break; 212 case 'dashboard_primary' :213 wp_dashboard_primary();214 break;215 case 'dashboard_secondary' :216 wp_dashboard_secondary();217 break;218 case 'dashboard_plugins' :219 wp_dashboard_plugins();220 break;221 212 } 222 213 wp_die(); 223 214 } -
wp-admin/includes/dashboard.php
70 70 wp_add_dashboard_widget( 'dashboard_incoming_links', __( 'Incoming Links' ), 'wp_dashboard_incoming_links', 'wp_dashboard_incoming_links_control' ); 71 71 } 72 72 73 // WP Plugins Widget74 if ( ( ! is_multisite() && is_blog_admin() && current_user_can( 'install_plugins' ) ) || ( is_network_admin() && current_user_can( 'manage_network_plugins' ) && current_user_can( 'install_plugins' ) ) )75 wp_add_dashboard_widget( 'dashboard_plugins', __( 'Plugins' ), 'wp_dashboard_plugins' );76 77 73 // QuickPress Widget 78 74 if ( is_blog_admin() && current_user_can('edit_posts') ) 79 75 wp_add_dashboard_widget( 'dashboard_quick_press', __( 'QuickPress' ), 'wp_dashboard_quick_press' ); … … 82 78 if ( is_blog_admin() && current_user_can('edit_posts') ) 83 79 wp_add_dashboard_widget( 'dashboard_recent_drafts', __('Recent Drafts'), 'wp_dashboard_recent_drafts' ); 84 80 85 // Primary feed (Dev Blog) Widget86 if ( !isset( $widget_options['dashboard_primary'] ) ) {87 $update = true;88 $widget_options['dashboard_primary'] = array(89 'link' => apply_filters( 'dashboard_primary_link', __( 'http://wordpress.org/news/' ) ),90 'url' => apply_filters( 'dashboard_primary_feed', __( 'http://wordpress.org/news/feed/' ) ),91 'title' => apply_filters( 'dashboard_primary_title', __( 'WordPress Blog' ) ),92 'items' => 2,93 'show_summary' => 1,94 'show_author' => 0,95 'show_date' => 1,96 );97 }98 wp_add_dashboard_widget( 'dashboard_primary', $widget_options['dashboard_primary']['title'], 'wp_dashboard_primary', 'wp_dashboard_primary_control' );99 100 // Secondary Feed (Planet) Widget101 if ( !isset( $widget_options['dashboard_secondary'] ) ) {102 $update = true;103 $widget_options['dashboard_secondary'] = array(104 'link' => apply_filters( 'dashboard_secondary_link', __( 'http://planet.wordpress.org/' ) ),105 'url' => apply_filters( 'dashboard_secondary_feed', __( 'http://planet.wordpress.org/feed/' ) ),106 'title' => apply_filters( 'dashboard_secondary_title', __( 'Other WordPress News' ) ),107 'items' => 5,108 'show_summary' => 0,109 'show_author' => 0,110 'show_date' => 0,111 );112 }113 wp_add_dashboard_widget( 'dashboard_secondary', $widget_options['dashboard_secondary']['title'], 'wp_dashboard_secondary', 'wp_dashboard_secondary_control' );114 115 81 // Hook to register new widgets 116 82 // Filter widget order 117 83 if ( is_network_admin() ) { … … 163 129 } 164 130 165 131 if ( is_blog_admin () ) 166 $side_widgets = array('dashboard_quick_press', 'dashboard_recent_drafts' , 'dashboard_primary', 'dashboard_secondary');132 $side_widgets = array('dashboard_quick_press', 'dashboard_recent_drafts'); /* Needs new RSS widget added */ 167 133 else if (is_network_admin() ) 168 $side_widgets = array( 'dashboard_primary', 'dashboard_secondary');134 $side_widgets = array(); /* Needs new RSS widget added */ 169 135 else 170 136 $side_widgets = array(); 171 137 … … 860 826 wp_dashboard_rss_control( 'dashboard_incoming_links', array( 'title' => false, 'show_summary' => false, 'show_author' => false ) ); 861 827 } 862 828 863 function wp_dashboard_primary() {864 wp_dashboard_cached_rss_widget( 'dashboard_primary', 'wp_dashboard_rss_output' );865 }866 867 function wp_dashboard_primary_control() {868 wp_dashboard_rss_control( 'dashboard_primary' );869 }870 871 829 /** 872 * Display primary dashboard RSS widget feed.873 *874 * @since 2.5.0875 *876 * @param string $widget_id877 */878 function wp_dashboard_rss_output( $widget_id ) {879 $widgets = get_option( 'dashboard_widget_options' );880 echo '<div class="rss-widget">';881 wp_widget_rss_output( $widgets[$widget_id] );882 echo "</div>";883 }884 885 function wp_dashboard_secondary() {886 wp_dashboard_cached_rss_widget( 'dashboard_secondary', 'wp_dashboard_secondary_output' );887 }888 889 function wp_dashboard_secondary_control() {890 wp_dashboard_rss_control( 'dashboard_secondary' );891 }892 893 /**894 * Display secondary dashboard RSS widget feed.895 *896 * @since 2.5.0897 *898 * @return unknown899 */900 function wp_dashboard_secondary_output() {901 $widgets = get_option( 'dashboard_widget_options' );902 @extract( @$widgets['dashboard_secondary'], EXTR_SKIP );903 $rss = @fetch_feed( $url );904 905 if ( is_wp_error($rss) ) {906 if ( is_admin() || current_user_can('manage_options') ) {907 echo '<div class="rss-widget"><p>';908 printf(__('<strong>RSS Error</strong>: %s'), $rss->get_error_message());909 echo '</p></div>';910 }911 } elseif ( !$rss->get_item_quantity() ) {912 $rss->__destruct();913 unset($rss);914 return false;915 } else {916 echo '<div class="rss-widget">';917 wp_widget_rss_output( $rss, $widgets['dashboard_secondary'] );918 echo '</div>';919 $rss->__destruct();920 unset($rss);921 }922 }923 924 function wp_dashboard_plugins() {925 wp_dashboard_cached_rss_widget( 'dashboard_plugins', 'wp_dashboard_plugins_output', array(926 'http://wordpress.org/plugins/rss/browse/popular/',927 'http://wordpress.org/plugins/rss/browse/new/'928 ) );929 }930 931 /**932 * Display plugins most popular, newest plugins, and recently updated widget text.933 *934 * @since 2.5.0935 */936 function wp_dashboard_plugins_output() {937 $popular = fetch_feed( 'http://wordpress.org/plugins/rss/browse/popular/' );938 $new = fetch_feed( 'http://wordpress.org/plugins/rss/browse/new/' );939 940 if ( false === $plugin_slugs = get_transient( 'plugin_slugs' ) ) {941 $plugin_slugs = array_keys( get_plugins() );942 set_transient( 'plugin_slugs', $plugin_slugs, DAY_IN_SECONDS );943 }944 945 foreach ( array( 'popular' => __('Most Popular'), 'new' => __('Newest Plugins') ) as $feed => $label ) {946 if ( is_wp_error($$feed) || !$$feed->get_item_quantity() )947 continue;948 949 $items = $$feed->get_items(0, 5);950 951 // Pick a random, non-installed plugin952 while ( true ) {953 // Abort this foreach loop iteration if there's no plugins left of this type954 if ( 0 == count($items) )955 continue 2;956 957 $item_key = array_rand($items);958 $item = $items[$item_key];959 960 list($link, $frag) = explode( '#', $item->get_link() );961 962 $link = esc_url($link);963 if ( preg_match( '|/([^/]+?)/?$|', $link, $matches ) )964 $slug = $matches[1];965 else {966 unset( $items[$item_key] );967 continue;968 }969 970 // Is this random plugin's slug already installed? If so, try again.971 reset( $plugin_slugs );972 foreach ( $plugin_slugs as $plugin_slug ) {973 if ( $slug == substr( $plugin_slug, 0, strlen( $slug ) ) ) {974 unset( $items[$item_key] );975 continue 2;976 }977 }978 979 // If we get to this point, then the random plugin isn't installed and we can stop the while().980 break;981 }982 983 // Eliminate some common badly formed plugin descriptions984 while ( ( null !== $item_key = array_rand($items) ) && false !== strpos( $items[$item_key]->get_description(), 'Plugin Name:' ) )985 unset($items[$item_key]);986 987 if ( !isset($items[$item_key]) )988 continue;989 990 $title = esc_html( $item->get_title() );991 992 $description = esc_html( strip_tags(@html_entity_decode($item->get_description(), ENT_QUOTES, get_option('blog_charset'))) );993 994 $ilink = wp_nonce_url('plugin-install.php?tab=plugin-information&plugin=' . $slug, 'install-plugin_' . $slug) .995 '&TB_iframe=true&width=600&height=800';996 997 echo "<h4>$label</h4>\n";998 echo "<h5><a href='$link'>$title</a></h5> <span>(<a href='$ilink' class='thickbox' title='$title'>" . __( 'Install' ) . "</a>)</span>\n";999 echo "<p>$description</p>\n";1000 1001 $$feed->__destruct();1002 unset($$feed);1003 }1004 }1005 1006 /**1007 830 * Checks to see if all of the feed url in $check_urls are cached. 1008 831 * 1009 832 * If $check_urls is empty, look for the rss feed url found in the dashboard -
wp-admin/js/dashboard.js
29 29 30 30 // These widgets are sometimes populated via ajax 31 31 ajaxWidgets = [ 32 'dashboard_incoming_links', 33 'dashboard_primary', 34 'dashboard_secondary', 35 'dashboard_plugins' 32 'dashboard_incoming_links' 36 33 ]; 37 34 38 35 ajaxPopulateWidgets = function(el) { -
wp-admin/js/plugin-install.js
27 27 28 28 $(window).resize(function(){ tb_position(); }); 29 29 30 $(' #dashboard_plugins,.plugins').on( 'click', 'a.thickbox', function() {30 $('.plugins').on( 'click', 'a.thickbox', function() { 31 31 tb_click.call(this); 32 32 33 33 $('#TB_title').css({'background-color':'#222','color':'#cfcfcf'}); -
wp-admin/css/ie-rtl.css
86 86 margin-right: 335px !important; 87 87 } 88 88 89 #dashboard_plugins {90 direction: ltr;91 }92 93 #dashboard_plugins h3.hndle {94 direction: rtl;95 }96 97 89 #dashboard_incoming_links ul li, 98 #dashboard_secondary ul li,99 #dashboard_primary ul li,100 90 p.row-actions { 101 91 width: 100%; 102 92 } -
wp-admin/css/colors-fresh.css
552 552 border-color: #666; 553 553 } 554 554 555 #dashboard_secondary div.dashboard-widget-content ul li a {556 background-color: #f9f9f9;557 }558 559 555 input.readonly, textarea.readonly { 560 556 background-color: #ddd; 561 557 } -
wp-admin/css/wp-admin-rtl.css
2130 2130 #dashboard_right_now p.sub, 2131 2131 #dashboard-widgets h4, 2132 2132 a.rsswidget, 2133 #dashboard_plugins h4,2134 #dashboard_plugins h5,2135 2133 #dashboard_recent_comments .comment-meta .approve, 2136 2134 #dashboard_right_now td.b, 2137 2135 #dashboard_right_now .versions a { … … 2167 2165 clear: left; 2168 2166 } 2169 2167 2170 #dashboard_plugins .inside span {2171 padding-left: 0;2172 padding-right: 5px;2173 }2174 2175 2168 #dashboard-widgets h3 .postbox-title-action { 2176 2169 right: auto; 2177 2170 left: 10px; … … 2903 2896 .locale-he-il #dashboard_right_now p.sub, 2904 2897 .locale-he-il #dashboard-widgets h4, 2905 2898 .locale-he-il a.rsswidget, 2906 .locale-he-il #dashboard_plugins h4,2907 .locale-he-il #dashboard_plugins h5,2908 2899 .locale-he-il #dashboard_recent_comments .comment-meta .approve, 2909 2900 .locale-he-il #dashboard_right_now td.b, 2910 2901 .locale-he-il #dashboard_right_now .versions a, -
wp-admin/css/wp-admin.css
763 763 764 764 div.sidebar-name h3, 765 765 #menu-management .nav-tab, 766 #dashboard_plugins h5,767 766 a.rsswidget, 768 767 #dashboard_right_now td.b, 769 768 #dashboard-widgets h4, … … 7104 7103 content: '\2014'; 7105 7104 } 7106 7105 7107 /* Plugins */7108 #dashboard_plugins h4 {7109 line-height: 1.7em;7110 }7111 7112 #dashboard_plugins h5 {7113 font-weight: normal;7114 font-size: 13px;7115 margin: 0;7116 display: inline;7117 line-height: 1.4em;7118 }7119 7120 #dashboard_plugins h5 a {7121 line-height: 1.4em;7122 }7123 7124 #dashboard_plugins .inside span {7125 font-size: 12px;7126 padding-left: 5px;7127 }7128 7129 #dashboard_plugins p {7130 margin: 0.3em 0 1.4em;7131 line-height: 1.4em;7132 }7133 7134 7106 .dashboard-comment-wrap { 7135 7107 overflow: hidden; 7136 7108 word-wrap: break-word; -
wp-admin/css/colors-classic.css
550 550 border-color: #666; 551 551 } 552 552 553 #dashboard_secondary div.dashboard-widget-content ul li a {554 background-color: #f9f9f9;555 }556 557 553 input.readonly, textarea.readonly { 558 554 background-color: #ddd; 559 555 }