Make WordPress Core

Ticket #11651: patch11651_v4.diff

File patch11651_v4.diff, 12.5 KB (added by edwardw, 13 years ago)

[PATCH] Version 4 of patch for Welcome Screen

  • wp-admin/includes/upgrade.php

     
    8484
    8585        $wp_rewrite->flush_rules();
    8686
     87        /* New install - show welcome screen */
     88        $guessurl .= '/wp-admin/index.php?welcome=1';
     89
    8790        wp_new_blog_notification($blog_title, $guessurl, $user_id, ($email_password ? $user_password : __('The password you chose during the install.') ) );
    8891
    8992        wp_cache_flush();
  • wp-admin/includes/template.php

     
    17501750
    17511751?>
    17521752<div id="screen-meta">
     1753<?php if ( current_user_can('activate_plugins') && strpos($_SERVER['SCRIPT_FILENAME'],'index.php') !== false) { ?>
     1754<div id="welcome-screen-wrap" class="hidden">
     1755<div class="metabox-prefs">
     1756        <?php $additional_tabs = Array(); $additional_tabs = apply_filters('admin_welcome_screen_moretabs',$additional_tabs); ?>
     1757        <h1><?php echo sprintf(__("Welcome to WordPress %s!"),$GLOBALS['wp_version']); ?></h1>
     1758        <div id="welcometabs" class="widget">
     1759            <ul class="tabnav">
     1760                <li><a href="#welcome"><?php _e('Welcome to WordPress'); ?></a></li>
     1761                <li><a href="#privacy"><?php _e('Privacy'); ?></a></li>
     1762                <li><a href="#info">Server Information</a></li>
     1763                <?php foreach($additional_tabs as $key => $value) {
     1764                                echo '<li><a href="#' . sanitize_key($key) . "\">$key</a></li>";
     1765                        }; ?>
     1766            </ul>
     1767            <div id="welcome" class="tabdiv">
     1768            <?php echo sprintf(__('<p>Here\'s what\'s new in this version of WordPress: <br /><a href="http://codex.wordpress.org/Changelog/%1$s" title="WordPress Version %1$s">ChangeLog</a></p>'),$GLOBALS['wp_version']); ?>
     1769           <?php echo sprintf(__('
     1770           <p>Thank you for choosing WordPress. The following links will help you get started with your WordPress experience:</p>
     1771        <ul>
     1772                <li>Edit your personal information at <a href="%1$s/wp-admin/profile.php" title="Edit settings like your password, your display name and your contact information">Users &#8250; Your Profile</a></li>
     1773                <li>Tell WordPress what your site is all about with a short one-line tagline at <a href="%1$s/wp-admin/options-general.php" title="Edit your site\'s important settings such as your tagline">Settings &#8250; General</a></li>
     1774                <li>Start publishing at <a href="%1$s/wp-admin/post-new.php" title="Create a new post">Posts &#8250; Add New</a> and at <a href="%1$s/wp-admin/post-new.php?post_type=page" title="Create a new page">Pages &#8250; Add New</a></li>
     1775                <li>Browse and install plugins at <a href="%1$s/wp-admin/plugin-install.php" title="Browse and install plugins">Plugins &#8250; Add New</a></li>
     1776                <li>Browse and install themes at <a href="%1$s/wp-admin/theme-install.php" title="Browse and install themes">Appearance &#8250; Add New Themes</a></li>
     1777                <li>Modify your website&#8217;s link structure at <a href="%1$s/wp-admin/options-permalink.php" title="For example, select a link structure like: http://example.com/1999/12/post-name">Settings &#8250; Permalinks</a></li>
     1778                <li>Import content from another system or WordPress site at <a href="%1$s/wp-admin/import.php" title="WordPress comes with importers for the most common publishing systems">Tools &#8250; Import</a></li>
     1779        </ul>
     1780       
     1781        <p>Other external links of interest may include:</p>
     1782        <ul>
     1783                <li>Find answers to your questions at the <a href="http://www.wordpress.org/support/" title="The official WordPress forum">WordPress Forums</a></li>
     1784                <li>Learn more about WordPress at the <a href="http://codex.wordpress.org/" title="WordPress Codex">WordPress Codex</a></li>
     1785        </ul>
     1786       
     1787        <p>Happy publishing!</p>'),get_bloginfo('wpurl')); ?>
     1788            </div>
     1789            <div id="privacy" class="tabdiv"><p>
     1790            <?php _e('
     1791            WordPress makes requests to <span style="font-style: italic">api.wordpress.org</span> to check for software updates to WordPress core and plugins. Your WordPress and plugin versions are sent to check for the latest updates for your software. No personally-identifying information will be disclosed but non-personally identifying information may be used for aggregate statistics (e.g. tracking popular plugins).
     1792           
     1793            The service at WordPress.com, a popular WordPress host independent of this installation, available using a <a href="http://en.wordpress.com/api-keys/" title="API keys">WordPress.com API Key</a> is an independent service from your WordPress install and can optionally be used to activate WordPress.com plugins such as the Akismet spam filter. 
     1794             '); ?></p>
     1795            </div>
     1796            <div id="info" class="tabdiv">
     1797            <p><strong><?php _e('Server Information'); ?></strong></p>
     1798                <table class="sinfo">
     1799                        <tr>
     1800                                <th><?php _e('Product'); ?></th>
     1801                                <th><?php _e('Version'); ?></th>
     1802                        </tr>
     1803                        <tr>
     1804                                <td><a href="http://www.wordpress.org/">WordPress</a></td>
     1805                                <td><?php echo $GLOBALS['wp_version']; ?></td>
     1806                        </tr>
     1807                        <tr>
     1808                                <td><a href="http://www.mysql.com/">MySQL</a></td>
     1809                                <td><?php echo mysql_get_server_info(); ?></td>
     1810                        </tr>
     1811                        <tr>
     1812                                <td><a href="http://www.php.net/">PHP</a></td>
     1813                                <td><?php echo phpversion(); ?></td>
     1814                        </tr>
     1815                        <tr>
     1816                                <td><?php if(function_exists('apache_get_modules')) { echo '<a href="http://httpd.apache.org/">Apache</a>'; } else if(function_exists('iis_start_server')) { echo '<a href="http://www.iis.net/">IIS</a>'; } ?></td>
     1817                                <td><?php if(function_exists('apache_get_modules')) { echo apache_get_version(); } else if(function_exists('iis_start_server')) { $s = explode('/',$_SERVER['SERVER_SOFTWARE']); echo $s[1]; } ?></td>
     1818                        </tr>
     1819                        <tr>
     1820                                <td colspan="2" style="text-align: left;"><p><strong><?php _e('Important Directives'); ?></strong></p></td>
     1821                        </tr>
     1822                        <tr>
     1823                                <th><?php _e('Directive'); ?></th>
     1824                                <th><?php _e('Status'); ?></th>
     1825                        </tr>
     1826                        <tr>
     1827                                <td><a href="http://www.php.net/manual/en/features.safe-mode.php"><?php echo _('Safe Mode'); ?></a></td>
     1828                                <td><?php echo ((ini_get('safe_mode')) ? '<span style="color: red">' . __('On') . '</span>' : _('Off')); ?></td>
     1829                        </tr>
     1830                        <tr>
     1831                                <td><a href="http://www.php.net/magic_quotes"><?php echo _('Magic Quotes'); ?></a></td>
     1832                                <td><?php echo (get_magic_quotes_gpc() ? '<span style="color: red">' . __('On') . '</span>' : _('Off')); ?></td>
     1833                        </tr>
     1834                        <tr>
     1835                                <td><a href="http://www.php.net/register_globals"><?php echo _('Register Globals'); ?></a></td>
     1836                                <td><?php echo (ini_get('register_globals') ? '<span style="color: red">' . __('On') . '</span>' : __('Off')); ?></td>
     1837                        </tr>
     1838                        <?php if(function_exists('apache_get_modules')) { ?>
     1839                        <tr>
     1840                                <td><a href="http://httpd.apache.org/docs/current/mod/mod_rewrite.html">mod_rewrite</a></td>
     1841                                <td><?php (in_array('mod_rewrite',apache_get_modules()) ? _e('Available') : _e('Unavailable')); ?></td>
     1842                        </tr>
     1843                        <tr>
     1844                                <td><a href="http://httpd.apache.org/docs/current/mod/mod_deflate.html">mod_deflate</a></td>
     1845                                <td><?php (in_array('mod_deflate',apache_get_modules()) ? _e('Available') : _e('Unavailable')); ?></td>
     1846                        </tr>
     1847                        <tr>
     1848                                <td><a href="http://httpd.apache.org/docs/current/mod/mod_proxy.html">mod_proxy</a></td>
     1849                                <td><?php (in_array('mod_proxy',apache_get_modules()) ? _e('Available') : _e('Unavailable')); ?></td>
     1850                        </tr>
     1851                        <?php } ?>
     1852                </table>
     1853            </div>
     1854        <?php foreach($additional_tabs as $key => $value) {
     1855                                echo '<div id="' . sanitize_key($key) . "\" class=\"tabdiv\">$value</a></div>";
     1856                }; ?>
     1857    </div>
     1858</div>
     1859</div>
     1860<?php } ?>
    17531861<?php if ( $show_screen ) : ?>
    17541862<div id="screen-options-wrap" class="hidden">
    17551863        <form id="adv-settings" action="" method="post">
     
    18211929        </div>
    18221930
    18231931<div id="screen-meta-links">
     1932<?php if ( current_user_can('activate_plugins') && strpos($_SERVER['SCRIPT_FILENAME'],'index.php') !== false ) { ?>
     1933<div id="welcome-screen-link-wrap" class="hide-if-no-js screen-meta-toggle">
     1934<a href="#welcome-screen" id="welcome-screen-link" class="show-settings"><?php _e('Welcome Screen') ?></a>
     1935</div>
     1936<?php } ?>
    18241937<div id="contextual-help-link-wrap" class="hide-if-no-js screen-meta-toggle">
    18251938<a href="#contextual-help" id="contextual-help-link" class="show-settings"><?php _e('Help') ?></a>
    18261939</div>
  • wp-admin/js/common.dev.js

     
    183183
    184184screenMeta = {
    185185        links: {
     186                'welcome-screen-link-wrap': 'welcome-screen-wrap',
    186187                'screen-options-link-wrap': 'screen-options-wrap',
    187188                'contextual-help-link-wrap': 'contextual-help-wrap'
    188189        },
  • wp-admin/index.php

     
    1717wp_enqueue_script( 'dashboard' );
    1818wp_enqueue_script( 'plugin-install' );
    1919wp_enqueue_script( 'media-upload' );
     20wp_enqueue_script( 'jquery' );
     21wp_enqueue_script( 'jquery-ui-core' );
     22wp_enqueue_script( 'jquery-ui-tabs' );
    2023add_thickbox();
    2124
    2225$title = __('Dashboard');
     
    2730else
    2831        add_screen_option('layout_columns', array('max' => 4, 'default' => 2) );
    2932
     33function admin_index_addwelcome() {
     34        echo '
     35        <style>
     36                .tabnav li {
     37                        display: inline;
     38                }
     39                .sinfo {
     40                        width: 40%
     41                }
     42                .sinfo td {
     43                        text-align: center;
     44                        padding: 2px;
     45                }
     46        </style>';
     47        echo '<script type="text/javascript">jQuery.noConflict(); jQuery(document).ready(function() {
     48        ';
     49        if(array_key_exists('welcome',$_GET)) {
     50                echo '
     51                jQuery("#screen-options-link-wrap").css("visibility", "hidden");
     52                jQuery("#contextual-help-link-wrap").css("visibility", "hidden");
     53                jQuery("#welcome-screen-wrap").slideToggle("slow");
     54                ';
     55        }
     56        echo '
     57        jQuery("#welcometabs").tabs();
     58        });
     59        </script>';
     60 };
     61
     62add_action('admin_head', 'admin_index_addwelcome');
     63
    3064add_contextual_help($current_screen,
    3165
    3266        '<p>' . __( 'Welcome to your WordPress Dashboard! You will find helpful tips in the Help tab of each screen to assist you as you get to know the application.' ) . '</p>' .
  • wp-admin/css/wp-admin-rtl.dev.css

     
    383383        visibility: hidden;
    384384}
    385385
     386#welcome-screen-link-wrap,
    386387#screen-options-link-wrap,
    387388#contextual-help-link-wrap {
    388389        float: left;
  • wp-admin/css/wp-admin.dev.css

     
    15901590        visibility: hidden;
    15911591}
    15921592
     1593#welcome-screen-link-wrap,
    15931594#screen-options-link-wrap,
    15941595#contextual-help-link-wrap {
    15951596        float: right;
     
    16051606        border-bottom-right-radius: 3px;
    16061607}
    16071608
     1609#welcome-screen-wrap li,
    16081610#contextual-help-wrap li {
    16091611        list-style-type: disc;
    16101612        margin-left: 18px;
  • wp-admin/css/colors-classic.dev.css

     
    16441644        color: #D54E21;
    16451645}
    16461646
     1647#welcome-screen-wrap,
    16471648#screen-options-wrap,
    16481649#contextual-help-wrap {
    16491650        background-color: #f7fcfe;
    16501651        border-color: #D1e5ee;
    16511652}
    16521653
     1654#welcome-screen-link-wrap,
    16531655#screen-options-link-wrap,
    16541656#contextual-help-link-wrap {
    16551657        background-color: #eff8ff; /* Fallback */
  • wp-admin/css/colors-fresh.dev.css

     
    12791279        color: #D54E21;
    12801280}
    12811281
     1282#welcome-screen-wrap,
    12821283#screen-options-wrap,
    12831284#contextual-help-wrap {
    12841285        background-color: #f1f1f1;
    12851286        border-color: #dfdfdf;
    12861287}
    12871288
     1289#welcome-screen-link-wrap,
    12881290#screen-options-link-wrap,
    12891291#contextual-help-link-wrap {
    12901292        background-color: #e3e3e3; /* Fallback */
  • wp-admin/update-core.php

     
    362362                        show_message( __('Installation Failed') );
    363363        } else {
    364364                show_message( __('WordPress updated successfully') );
    365                 show_message( '<a href="' . esc_url( self_admin_url() ) . '">' . __('Go to Dashboard') . '</a>' );
     365                show_message( '<a href="' . esc_url( self_admin_url('index.php?welcome=1') ) . '">' . __('Go to Dashboard') . '</a>' );
    366366        }
    367367        echo '</div>';
    368368}