Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-upgrader.php

    r15288 r17102  
    369369    function upgrade_strings() {
    370370        $this->strings['up_to_date'] = __('The plugin is at the latest version.');
    371         $this->strings['no_package'] = __('Upgrade package not available.');
     371        $this->strings['no_package'] = __('Update package not available.');
    372372        $this->strings['downloading_package'] = __('Downloading update from <span class="code">%s</span>&#8230;');
    373373        $this->strings['unpack_package'] = __('Unpacking the update&#8230;');
     
    375375        $this->strings['remove_old'] = __('Removing the old version of the plugin&#8230;');
    376376        $this->strings['remove_old_failed'] = __('Could not remove the old plugin.');
    377         $this->strings['process_failed'] = __('Plugin upgrade failed.');
    378         $this->strings['process_success'] = __('Plugin upgraded successfully.');
     377        $this->strings['process_failed'] = __('Plugin update failed.');
     378        $this->strings['process_success'] = __('Plugin updated successfully.');
    379379    }
    380380
     
    469469        $this->skin->bulk_header();
    470470
    471         $this->maintenance_mode(true);
     471        // Only start maintenance mode if running in Multisite OR the plugin is in use
     472        $maintenance = is_multisite(); // @TODO: This should only kick in for individual sites if at all possible.
     473        foreach ( $plugins as $plugin )
     474            $maintenance = $maintenance || (is_plugin_active($plugin) && isset($current->response[ $plugin ]) ); // Only activate Maintenance mode if a plugin is active AND has an update available
     475        if ( $maintenance )
     476            $this->maintenance_mode(true);
    472477
    473478        $results = array();
     
    604609    function upgrade_strings() {
    605610        $this->strings['up_to_date'] = __('The theme is at the latest version.');
    606         $this->strings['no_package'] = __('Upgrade package not available.');
     611        $this->strings['no_package'] = __('Update package not available.');
    607612        $this->strings['downloading_package'] = __('Downloading update from <span class="code">%s</span>&#8230;');
    608613        $this->strings['unpack_package'] = __('Unpacking the update&#8230;');
    609614        $this->strings['remove_old'] = __('Removing the old version of the theme&#8230;');
    610615        $this->strings['remove_old_failed'] = __('Could not remove the old theme.');
    611         $this->strings['process_failed'] = __('Theme upgrade failed.');
    612         $this->strings['process_success'] = __('Theme upgraded successfully.');
     616        $this->strings['process_failed'] = __('Theme update failed.');
     617        $this->strings['process_success'] = __('Theme updated successfully.');
    613618    }
    614619
     
    713718        $this->skin->bulk_header();
    714719
    715         $this->maintenance_mode(true);
     720        // Only start maintenance mode if running in Multisite OR the theme is in use
     721        $maintenance = is_multisite(); // @TODO: This should only kick in for individual sites if at all possible.
     722        foreach ( $themes as $theme )
     723            $maintenance = $maintenance || $theme == get_stylesheet() || $theme == get_template();
     724        if ( $maintenance )
     725            $this->maintenance_mode(true);
    716726
    717727        $results = array();
     
    781791        if ( $theme != get_stylesheet() ) //If not current
    782792            return $return;
    783         //Change to maintainence mode now.
     793        //Change to maintenance mode now.
    784794        if ( ! $this->bulk )
    785795            $this->maintenance_mode(true);
     
    797807
    798808        //Ensure stylesheet name hasnt changed after the upgrade:
     809        // @TODO: Note, This doesnt handle the Template changing, or the Template name changing.
    799810        if ( $theme == get_stylesheet() && $theme != $this->result['destination_name'] ) {
    800811            $theme_info = $this->theme_info();
     
    804815        }
    805816
    806         //Time to remove maintainence mode
     817        //Time to remove maintenance mode
    807818        if ( ! $this->bulk )
    808819            $this->maintenance_mode(false);
     
    851862    function upgrade_strings() {
    852863        $this->strings['up_to_date'] = __('WordPress is at the latest version.');
    853         $this->strings['no_package'] = __('Upgrade package not available.');
     864        $this->strings['no_package'] = __('Update package not available.');
    854865        $this->strings['downloading_package'] = __('Downloading update from <span class="code">%s</span>&#8230;');
    855866        $this->strings['unpack_package'] = __('Unpacking the update&#8230;');
     
    10071018
    10081019    function __construct($args = array()) {
    1009         $defaults = array( 'url' => '', 'plugin' => '', 'nonce' => '', 'title' => __('Upgrade Plugin') );
     1020        $defaults = array( 'url' => '', 'plugin' => '', 'nonce' => '', 'title' => __('Update Plugin') );
    10101021        $args = wp_parse_args($args, $defaults);
    10111022
     
    10271038        $update_actions =  array(
    10281039            'activate_plugin' => '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;plugin=' . $this->plugin, 'activate-plugin_' . $this->plugin) . '" title="' . esc_attr__('Activate this plugin') . '" target="_parent">' . __('Activate Plugin') . '</a>',
    1029             'plugins_page' => '<a href="' . admin_url('plugins.php') . '" title="' . esc_attr__('Goto plugins page') . '" target="_parent">' . __('Return to Plugins page') . '</a>'
     1040            'plugins_page' => '<a href="' . self_admin_url('plugins.php') . '" title="' . esc_attr__('Go to plugins page') . '" target="_parent">' . __('Return to Plugins page') . '</a>'
    10301041        );
    10311042        if ( $this->plugin_active )
     
    10361047        $update_actions = apply_filters('update_plugin_complete_actions', $update_actions, $this->plugin);
    10371048        if ( ! empty($update_actions) )
    1038             $this->feedback('<strong>' . __('Actions:') . '</strong> ' . implode(' | ', (array)$update_actions));
     1049            $this->feedback(implode(' | ', (array)$update_actions));
    10391050    }
    10401051
     
    10701081
    10711082    function add_strings() {
    1072         $this->upgrader->strings['skin_upgrade_start'] = __('The update process is starting. This process may take awhile on some hosts, so please be patient.');
    1073         $this->upgrader->strings['skin_update_failed_error'] = __('An error occured while updating %1$s: <strong>%2$s</strong>.');
     1083        $this->upgrader->strings['skin_upgrade_start'] = __('The update process is starting. This process may take a while on some hosts, so please be patient.');
     1084        $this->upgrader->strings['skin_update_failed_error'] = __('An error occurred while updating %1$s: <strong>%2$s</strong>.');
    10741085        $this->upgrader->strings['skin_update_failed'] = __('The update of %1$s failed.');
    10751086        $this->upgrader->strings['skin_update_successful'] = __('%1$s updated successfully.').' <a onclick="%2$s" href="#" class="hide-if-no-js"><span>'.__('Show Details').'</span><span class="hidden">'.__('Hide Details').'</span>.</a>';
     
    11851196        parent::bulk_footer();
    11861197        $update_actions =  array(
    1187             'plugins_page' => '<a href="' . admin_url('plugins.php') . '" title="' . esc_attr__('Goto plugins page') . '" target="_parent">' . __('Return to Plugins page') . '</a>',
    1188             'updates_page' => '<a href="' . admin_url('update-core.php') . '" title="' . esc_attr__('Goto WordPress Updates page') . '" target="_parent">' . __('Return to WordPress Updates') . '</a>'
     1198            'plugins_page' => '<a href="' . self_admin_url('plugins.php') . '" title="' . esc_attr__('Go to plugins page') . '" target="_parent">' . __('Return to Plugins page') . '</a>',
     1199            'updates_page' => '<a href="' . self_admin_url('update-core.php') . '" title="' . esc_attr__('Go to WordPress Updates page') . '" target="_parent">' . __('Return to WordPress Updates') . '</a>'
    11891200        );
    11901201
    11911202        $update_actions = apply_filters('update_bulk_plugins_complete_actions', $update_actions, $this->plugin_info);
    11921203        if ( ! empty($update_actions) )
    1193             $this->feedback('<strong>' . __('Actions:') . '</strong> ' . implode(' | ', (array)$update_actions));
     1204            $this->feedback(implode(' | ', (array)$update_actions));
    11941205    }
    11951206}
     
    12161227        parent::bulk_footer();
    12171228        $update_actions =  array(
    1218             'themes_page' => '<a href="' . admin_url('themes.php') . '" title="' . esc_attr__('Goto themes page') . '" target="_parent">' . __('Return to Themes page') . '</a>',
    1219             'updates_page' => '<a href="' . admin_url('update-core.php') . '" title="' . esc_attr__('Goto WordPress Updates page') . '" target="_parent">' . __('Return to WordPress Updates') . '</a>'
     1229            'themes_page' => '<a href="' . self_admin_url('themes.php') . '" title="' . esc_attr__('Go to themes page') . '" target="_parent">' . __('Return to Themes page') . '</a>',
     1230            'updates_page' => '<a href="' . self_admin_url('update-core.php') . '" title="' . esc_attr__('Go to WordPress Updates page') . '" target="_parent">' . __('Return to WordPress Updates') . '</a>'
    12201231        );
    12211232
    12221233        $update_actions = apply_filters('update_bulk_theme_complete_actions', $update_actions, $this->theme_info);
    12231234        if ( ! empty($update_actions) )
    1224             $this->feedback('<strong>' . __('Actions:') . '</strong> ' . implode(' | ', (array)$update_actions));
     1235            $this->feedback(implode(' | ', (array)$update_actions));
    12251236    }
    12261237}
     
    12711282            $install_actions['activate_plugin'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin') . '" target="_parent">' . __('Activate Plugin') . '</a>';
    12721283
    1273         if ( is_multisite() && current_user_can( 'manage_network_plugins' ) )
    1274             $install_actions['network_activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;networkwide=1&amp;plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin for all sites in this network') . '" target="_parent">' . __('Network Activate') . '</a>';
     1284        if ( is_multisite() && current_user_can( 'manage_network_plugins' ) ) {
     1285            $install_actions['network_activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;networkwide=1&amp;plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin for all sites in this network') . '" target="_parent">' . __('Network Activate') . '</a>';
     1286            unset( $install_actions['activate_plugin'] );
     1287        }
    12751288
    12761289        if ( 'import' == $from )
    12771290            $install_actions['importers_page'] = '<a href="' . admin_url('import.php') . '" title="' . esc_attr__('Return to Importers') . '" target="_parent">' . __('Return to Importers') . '</a>';
    12781291        else if ( $this->type == 'web' )
    1279             $install_actions['plugins_page'] = '<a href="' . admin_url('plugin-install.php') . '" title="' . esc_attr__('Return to Plugin Installer') . '" target="_parent">' . __('Return to Plugin Installer') . '</a>';
     1292            $install_actions['plugins_page'] = '<a href="' . self_admin_url('plugin-install.php') . '" title="' . esc_attr__('Return to Plugin Installer') . '" target="_parent">' . __('Return to Plugin Installer') . '</a>';
    12801293        else
    1281             $install_actions['plugins_page'] = '<a href="' . admin_url('plugins.php') . '" title="' . esc_attr__('Return to Plugins page') . '" target="_parent">' . __('Return to Plugins page') . '</a>';
     1294            $install_actions['plugins_page'] = '<a href="' . self_admin_url('plugins.php') . '" title="' . esc_attr__('Return to Plugins page') . '" target="_parent">' . __('Return to Plugins page') . '</a>';
    12821295
    12831296
     
    12881301        $install_actions = apply_filters('install_plugin_complete_actions', $install_actions, $this->api, $plugin_file);
    12891302        if ( ! empty($install_actions) )
    1290             $this->feedback('<strong>' . __('Actions:') . '</strong> ' . implode(' | ', (array)$install_actions));
     1303            $this->feedback(implode(' | ', (array)$install_actions));
    12911304    }
    12921305}
     
    13461359
    13471360        if ( $this->type == 'web' )
    1348             $install_actions['themes_page'] = '<a href="' . admin_url('theme-install.php') . '" title="' . esc_attr__('Return to Theme Installer') . '" target="_parent">' . __('Return to Theme Installer') . '</a>';
     1361            $install_actions['themes_page'] = '<a href="' . self_admin_url('theme-install.php') . '" title="' . esc_attr__('Return to Theme Installer') . '" target="_parent">' . __('Return to Theme Installer') . '</a>';
    13491362        else
    1350             $install_actions['themes_page'] = '<a href="' . admin_url('themes.php') . '" title="' . esc_attr__('Themes page') . '" target="_parent">' . __('Return to Themes page') . '</a>';
    1351 
    1352         if ( ! $this->result || is_wp_error($this->result) )
     1363            $install_actions['themes_page'] = '<a href="' . self_admin_url('themes.php') . '" title="' . esc_attr__('Themes page') . '" target="_parent">' . __('Return to Themes page') . '</a>';
     1364
     1365        if ( ! $this->result || is_wp_error($this->result) || is_network_admin() )
    13531366            unset( $install_actions['activate'], $install_actions['preview'] );
    13541367
    13551368        $install_actions = apply_filters('install_theme_complete_actions', $install_actions, $this->api, $stylesheet, $theme_info);
    13561369        if ( ! empty($install_actions) )
    1357             $this->feedback('<strong>' . __('Actions:') . '</strong> ' . implode(' | ', (array)$install_actions));
     1370            $this->feedback(implode(' | ', (array)$install_actions));
    13581371    }
    13591372}
     
    13761389
    13771390    function __construct($args = array()) {
    1378         $defaults = array( 'url' => '', 'theme' => '', 'nonce' => '', 'title' => __('Upgrade Theme') );
     1391        $defaults = array( 'url' => '', 'theme' => '', 'nonce' => '', 'title' => __('Update Theme') );
    13791392        $args = wp_parse_args($args, $defaults);
    13801393
     
    14051418        }
    14061419
    1407         $update_actions['themes_page'] = '<a href="' . admin_url('themes.php') . '" title="' . esc_attr__('Return to Themes page') . '" target="_parent">' . __('Return to Themes page') . '</a>';
     1420        $update_actions['themes_page'] = '<a href="' . self_admin_url('themes.php') . '" title="' . esc_attr__('Return to Themes page') . '" target="_parent">' . __('Return to Themes page') . '</a>';
    14081421
    14091422        $update_actions = apply_filters('update_theme_complete_actions', $update_actions, $this->theme);
    14101423        if ( ! empty($update_actions) )
    1411             $this->feedback('<strong>' . __('Actions:') . '</strong> ' . implode(' | ', (array)$update_actions));
     1424            $this->feedback(implode(' | ', (array)$update_actions));
    14121425    }
    14131426}
Note: See TracChangeset for help on using the changeset viewer.