Changes from branches/3.0/wp-admin/includes/class-wp-upgrader.php at r15288 to trunk/wp-admin/includes/class-wp-upgrader.php at r17102
- File:
-
- 1 edited
-
trunk/wp-admin/includes/class-wp-upgrader.php (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/class-wp-upgrader.php
r15288 r17102 369 369 function upgrade_strings() { 370 370 $this->strings['up_to_date'] = __('The plugin is at the latest version.'); 371 $this->strings['no_package'] = __('Up grade package not available.');371 $this->strings['no_package'] = __('Update package not available.'); 372 372 $this->strings['downloading_package'] = __('Downloading update from <span class="code">%s</span>…'); 373 373 $this->strings['unpack_package'] = __('Unpacking the update…'); … … 375 375 $this->strings['remove_old'] = __('Removing the old version of the plugin…'); 376 376 $this->strings['remove_old_failed'] = __('Could not remove the old plugin.'); 377 $this->strings['process_failed'] = __('Plugin up grade failed.');378 $this->strings['process_success'] = __('Plugin up graded successfully.');377 $this->strings['process_failed'] = __('Plugin update failed.'); 378 $this->strings['process_success'] = __('Plugin updated successfully.'); 379 379 } 380 380 … … 469 469 $this->skin->bulk_header(); 470 470 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); 472 477 473 478 $results = array(); … … 604 609 function upgrade_strings() { 605 610 $this->strings['up_to_date'] = __('The theme is at the latest version.'); 606 $this->strings['no_package'] = __('Up grade package not available.');611 $this->strings['no_package'] = __('Update package not available.'); 607 612 $this->strings['downloading_package'] = __('Downloading update from <span class="code">%s</span>…'); 608 613 $this->strings['unpack_package'] = __('Unpacking the update…'); 609 614 $this->strings['remove_old'] = __('Removing the old version of the theme…'); 610 615 $this->strings['remove_old_failed'] = __('Could not remove the old theme.'); 611 $this->strings['process_failed'] = __('Theme up grade failed.');612 $this->strings['process_success'] = __('Theme up graded successfully.');616 $this->strings['process_failed'] = __('Theme update failed.'); 617 $this->strings['process_success'] = __('Theme updated successfully.'); 613 618 } 614 619 … … 713 718 $this->skin->bulk_header(); 714 719 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); 716 726 717 727 $results = array(); … … 781 791 if ( $theme != get_stylesheet() ) //If not current 782 792 return $return; 783 //Change to maint ainence mode now.793 //Change to maintenance mode now. 784 794 if ( ! $this->bulk ) 785 795 $this->maintenance_mode(true); … … 797 807 798 808 //Ensure stylesheet name hasnt changed after the upgrade: 809 // @TODO: Note, This doesnt handle the Template changing, or the Template name changing. 799 810 if ( $theme == get_stylesheet() && $theme != $this->result['destination_name'] ) { 800 811 $theme_info = $this->theme_info(); … … 804 815 } 805 816 806 //Time to remove maint ainence mode817 //Time to remove maintenance mode 807 818 if ( ! $this->bulk ) 808 819 $this->maintenance_mode(false); … … 851 862 function upgrade_strings() { 852 863 $this->strings['up_to_date'] = __('WordPress is at the latest version.'); 853 $this->strings['no_package'] = __('Up grade package not available.');864 $this->strings['no_package'] = __('Update package not available.'); 854 865 $this->strings['downloading_package'] = __('Downloading update from <span class="code">%s</span>…'); 855 866 $this->strings['unpack_package'] = __('Unpacking the update…'); … … 1007 1018 1008 1019 function __construct($args = array()) { 1009 $defaults = array( 'url' => '', 'plugin' => '', 'nonce' => '', 'title' => __('Up grade Plugin') );1020 $defaults = array( 'url' => '', 'plugin' => '', 'nonce' => '', 'title' => __('Update Plugin') ); 1010 1021 $args = wp_parse_args($args, $defaults); 1011 1022 … … 1027 1038 $update_actions = array( 1028 1039 'activate_plugin' => '<a href="' . wp_nonce_url('plugins.php?action=activate&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>' 1030 1041 ); 1031 1042 if ( $this->plugin_active ) … … 1036 1047 $update_actions = apply_filters('update_plugin_complete_actions', $update_actions, $this->plugin); 1037 1048 if ( ! empty($update_actions) ) 1038 $this->feedback( '<strong>' . __('Actions:') . '</strong> ' .implode(' | ', (array)$update_actions));1049 $this->feedback(implode(' | ', (array)$update_actions)); 1039 1050 } 1040 1051 … … 1070 1081 1071 1082 function add_strings() { 1072 $this->upgrader->strings['skin_upgrade_start'] = __('The update process is starting. This process may take a while on some hosts, so please be patient.');1073 $this->upgrader->strings['skin_update_failed_error'] = __('An error occur ed 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>.'); 1074 1085 $this->upgrader->strings['skin_update_failed'] = __('The update of %1$s failed.'); 1075 1086 $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>'; … … 1185 1196 parent::bulk_footer(); 1186 1197 $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>' 1189 1200 ); 1190 1201 1191 1202 $update_actions = apply_filters('update_bulk_plugins_complete_actions', $update_actions, $this->plugin_info); 1192 1203 if ( ! empty($update_actions) ) 1193 $this->feedback( '<strong>' . __('Actions:') . '</strong> ' .implode(' | ', (array)$update_actions));1204 $this->feedback(implode(' | ', (array)$update_actions)); 1194 1205 } 1195 1206 } … … 1216 1227 parent::bulk_footer(); 1217 1228 $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>' 1220 1231 ); 1221 1232 1222 1233 $update_actions = apply_filters('update_bulk_theme_complete_actions', $update_actions, $this->theme_info); 1223 1234 if ( ! empty($update_actions) ) 1224 $this->feedback( '<strong>' . __('Actions:') . '</strong> ' .implode(' | ', (array)$update_actions));1235 $this->feedback(implode(' | ', (array)$update_actions)); 1225 1236 } 1226 1237 } … … 1271 1282 $install_actions['activate_plugin'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin') . '" target="_parent">' . __('Activate Plugin') . '</a>'; 1272 1283 1273 if ( is_multisite() && current_user_can( 'manage_network_plugins' ) ) 1274 $install_actions['network_activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&networkwide=1&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&networkwide=1&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 } 1275 1288 1276 1289 if ( 'import' == $from ) 1277 1290 $install_actions['importers_page'] = '<a href="' . admin_url('import.php') . '" title="' . esc_attr__('Return to Importers') . '" target="_parent">' . __('Return to Importers') . '</a>'; 1278 1291 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>'; 1280 1293 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>'; 1282 1295 1283 1296 … … 1288 1301 $install_actions = apply_filters('install_plugin_complete_actions', $install_actions, $this->api, $plugin_file); 1289 1302 if ( ! empty($install_actions) ) 1290 $this->feedback( '<strong>' . __('Actions:') . '</strong> ' .implode(' | ', (array)$install_actions));1303 $this->feedback(implode(' | ', (array)$install_actions)); 1291 1304 } 1292 1305 } … … 1346 1359 1347 1360 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>'; 1349 1362 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() ) 1353 1366 unset( $install_actions['activate'], $install_actions['preview'] ); 1354 1367 1355 1368 $install_actions = apply_filters('install_theme_complete_actions', $install_actions, $this->api, $stylesheet, $theme_info); 1356 1369 if ( ! empty($install_actions) ) 1357 $this->feedback( '<strong>' . __('Actions:') . '</strong> ' .implode(' | ', (array)$install_actions));1370 $this->feedback(implode(' | ', (array)$install_actions)); 1358 1371 } 1359 1372 } … … 1376 1389 1377 1390 function __construct($args = array()) { 1378 $defaults = array( 'url' => '', 'theme' => '', 'nonce' => '', 'title' => __('Up grade Theme') );1391 $defaults = array( 'url' => '', 'theme' => '', 'nonce' => '', 'title' => __('Update Theme') ); 1379 1392 $args = wp_parse_args($args, $defaults); 1380 1393 … … 1405 1418 } 1406 1419 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>'; 1408 1421 1409 1422 $update_actions = apply_filters('update_theme_complete_actions', $update_actions, $this->theme); 1410 1423 if ( ! empty($update_actions) ) 1411 $this->feedback( '<strong>' . __('Actions:') . '</strong> ' .implode(' | ', (array)$update_actions));1424 $this->feedback(implode(' | ', (array)$update_actions)); 1412 1425 } 1413 1426 }
Note: See TracChangeset
for help on using the changeset viewer.