Changeset 14985
- Timestamp:
- 05/27/2010 11:04:08 AM (14 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/import.php
r14970 r14985 23 23 '<p>' . sprintf(__('<a href="%s">Support Forums</a>'), 'http://wordpress.org/support/') . '</p>' 24 24 ); 25 26 $popular_importers = array(); 27 if ( current_user_can('install_plugins') ) 28 $popular_importers = array( 29 'blogger' => array( __('Blogger'), __('Install the Blogger importer to import posts, comments, and users from a Blogger blog.'), 'install' ), 30 'wpcat2tag' => array(__('Categories and Tags Converter'), __('Install the category/tag converter to convert existing categories to tags or tags to categories, selectively.'), 'install', 'wp-cat2tag' ), 31 'livejournal' => array( __( 'LiveJournal' ), __( 'Install the LiveJournal importer to import posts from LiveJournal using their API.' ), 'install' ), 32 'movabletype' => array( __('Movable Type and TypePad'), __('Install the Movable Type importer to import posts and comments from a Movable Type or TypePad blog.'), 'install', 'mt' ), 33 'opml' => array( __('Blogroll'), __('Install the blogroll importer to import links in OPML format.'), 'install' ), 34 'rss' => array( __('RSS'), __('Install the RSS importer to import posts from an RSS feed.'), 'install' ), 35 'wordpress' => array( 'WordPress', __('Install the WordPress importer to import posts, pages, comments, custom fields, categories, and tags from a WordPress export file.'), 'install' ) 36 ); 37 38 if ( ! empty( $_GET['invalid'] ) && !empty($popular_importers[$_GET['invalid']][3]) ) { 39 wp_redirect("import.php?import=" . $popular_importers[$_GET['invalid']][3]); 40 exit; 41 } 25 42 26 43 add_thickbox(); … … 54 71 @closedir($imports_dir); 55 72 56 $popular_importers = array();57 if ( current_user_can('install_plugins') )58 $popular_importers = array(59 'blogger' => array( __('Blogger'), __('Install the Blogger importer to import posts, comments, and users from a Blogger blog.'), 'install' ),60 'wpcat2tag' => array(__('Categories and Tags Converter'), __('Install the category/tag converter to convert existing categories to tags or tags to categories, selectively.'), 'install', 'wp-cat2tag' ),61 'livejournal' => array( __( 'LiveJournal' ), __( 'Install the LiveJournal importer to import posts from LiveJournal using their API.' ), 'install' ),62 'movabletype' => array( __('Movable Type and TypePad'), __('Install the Movable Type importer to import posts and comments from a Movable Type or TypePad blog.'), 'install', 'mt' ),63 'opml' => array( __('Blogroll'), __('Install the blogroll importer to import links in OPML format.'), 'install' ),64 'rss' => array( __('RSS'), __('Install the RSS importer to import posts from an RSS feed.'), 'install' ),65 'wordpress' => array( 'WordPress', __('Install the WordPress importer to import posts, pages, comments, custom fields, categories, and tags from a WordPress export file.'), 'install' )66 );67 68 73 $importers = get_importers(); 69 74 … … 93 98 $plugin_slug = $id . '-importer'; 94 99 $action = '<a href="' . admin_url('plugin-install.php?tab=plugin-information&plugin=' . $plugin_slug . 95 '& TB_iframe=true&width=600&height=550') . '" class="thickbox" title="' .100 '&from=import&TB_iframe=true&width=600&height=550') . '" class="thickbox" title="' . 96 101 esc_attr__('Install importer') . '">' . $data[0] . '</a>'; 97 102 } else { -
trunk/wp-admin/includes/class-wp-upgrader.php
r14924 r14985 1262 1262 $plugin_file = $this->upgrader->plugin_info(); 1263 1263 1264 $install_actions = array( 1265 '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>', 1266 ); 1264 $install_actions = array(); 1265 1266 $from = isset($_GET['from']) ? stripslashes($_GET['from']) : 'plugins'; 1267 1268 if ( 'import' == $from ) 1269 $install_actions['activate_plugin'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&from=import&plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin') . '" target="_parent">' . __('Activate Plugin & Run Importer') . '</a>'; 1270 else 1271 $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>'; 1267 1272 1268 1273 if ( is_multisite() && current_user_can( 'manage_network_plugins' ) ) 1269 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>'; 1270 1275 1271 if ( $this->type == 'web' ) 1276 if ( 'import' == $from ) 1277 $install_actions['importers_page'] = '<a href="' . admin_url('import.php') . '" title="' . esc_attr__('Return to Importers') . '" target="_parent">' . __('Return to Importers') . '</a>'; 1278 else if ( $this->type == 'web' ) 1272 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>'; 1273 1280 else -
trunk/wp-admin/includes/plugin-install.php
r14647 r14985 474 474 } 475 475 } 476 if ( isset($_GET['from']) ) 477 $url .= '&from=' . urlencode(stripslashes($_GET['from'])); 476 478 477 479 return compact('status', 'url', 'version'); -
trunk/wp-admin/plugins.php
r14956 r14985 52 52 $result = activate_plugin($plugin, 'plugins.php?error=true&plugin=' . $plugin, $network_wide); 53 53 if ( is_wp_error( $result ) ) { 54 if ( 'unexpected_output' == $result->get_error_code()) {54 if ( 'unexpected_output' == $result->get_error_code() ) { 55 55 $redirect = 'plugins.php?error=true&charsout=' . strlen($result->get_error_data()) . '&plugin=' . $plugin; 56 56 wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), $redirect)); … … 66 66 update_option('recently_activated', $recent); 67 67 } 68 69 wp_redirect("plugins.php?activate=true&plugin_status=$status&paged=$page"); // overrides the ?error=true one above 68 if ( isset($_GET['from']) && 'import' == $_GET['from'] ) { 69 wp_redirect("import.php?import=" . str_replace('-importer', '', dirname($plugin)) ); // overrides the ?error=true one above and redirects to the Imports page, striping the -importer suffix 70 } else { 71 wp_redirect("plugins.php?activate=true&plugin_status=$status&paged=$page"); // overrides the ?error=true one above 72 } 70 73 exit; 71 74 break; … … 438 441 $total_dropins_plugins = count($dropins_plugins); 439 442 440 // Searching.443 // Searching. 441 444 if ( !empty($_GET['s']) ) { 442 445 function _search_plugins_filter_callback($plugin) { -
trunk/wp-admin/update.php
r14348 r14985 111 111 $nonce = 'install-plugin_' . $plugin; 112 112 $url = 'update.php?action=install-plugin&plugin=' . $plugin; 113 if ( isset($_GET['from']) ) 114 $url .= '&from=' . urlencode(stripslashes($_GET['from'])); 115 113 116 $type = 'web'; //Install plugin type, From Web or an Upload. 114 117
Note: See TracChangeset
for help on using the changeset viewer.