Ticket #35191: 35191.2.patch
File 35191.2.patch, 8.2 KB (added by , 8 years ago) |
---|
-
src/wp-admin/css/common.css
2173 2173 2174 2174 .importers td { 2175 2175 padding-right: 14px; 2176 line-height: 1.5em; 2176 2177 } 2177 2178 2178 2179 .importers { … … 2180 2181 width: auto; 2181 2182 } 2182 2183 2184 .importer-title, 2185 .importer-desc, 2186 .importer-status, 2187 .importer-action { 2188 display: block; 2189 margin: 0; 2190 padding: 0; 2191 } 2192 2193 .importer-action { 2194 margin-bottom: 1em; 2195 } 2196 2183 2197 #post-body #post-body-content #namediv h3, /* Back-compat for pre-4.4 */ 2184 2198 #post-body #post-body-content #namediv h2 { 2185 2199 margin-top: 0; -
src/wp-admin/import.php
29 29 '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' 30 30 ); 31 31 32 if ( current_user_can( 'install_plugins' ) ) 32 if ( current_user_can( 'install_plugins' ) ) { 33 // List of popular importer plugins from the WordPress.org API. 33 34 $popular_importers = wp_get_popular_importers(); 34 else 35 $popular_importers = array(); 35 } else { 36 $popular_importers = array(); 37 } 36 38 37 39 // Detect and redirect invalid importers like 'movabletype', which is registered as 'mt' 38 40 if ( ! empty( $_GET['invalid'] ) && isset( $popular_importers[ $_GET['invalid'] ] ) ) { … … 64 66 <p><?php _e('If you have posts or comments in another system, WordPress can import those into this site. To get started, choose a system to import from below:'); ?></p> 65 67 66 68 <?php 67 69 // Registered (already installed) importers. They're stored in the global $wp_importers. 68 70 $importers = get_importers(); 69 71 70 72 // If a popular importer is not registered, create a dummy registration that links to the plugin installer. … … 73 75 continue; 74 76 if ( isset( $importers[ $pop_data['importer-id'] ] ) ) 75 77 continue; 78 79 // Merge the importers from the WordPress.org API in the array of registered (already installed) importers. 76 80 $importers[ $pop_data['importer-id'] ] = array( $pop_data['name'], $pop_data['description'], 'install' => $pop_data['plugin-slug'] ); 77 81 } 78 82 … … 85 89 86 90 <?php 87 91 foreach ($importers as $importer_id => $data) { 88 $action = ''; 92 $action = $status = $status_class = ''; 93 89 94 if ( isset( $data['install'] ) ) { 90 95 $plugin_slug = $data['install']; 91 96 if ( file_exists( WP_PLUGIN_DIR . '/' . $plugin_slug ) ) { 92 // Looks like Importer is installed, But not active97 // Looks like an importer is installed, but not active. 93 98 $plugins = get_plugins( '/' . $plugin_slug ); 94 99 if ( !empty($plugins) ) { 95 100 $keys = array_keys($plugins); 96 101 $plugin_file = $plugin_slug . '/' . $keys[0]; 97 $action = '<a href="' . esc_url(wp_nonce_url(admin_url('plugins.php?action=activate&plugin=' . $plugin_file . '&from=import'), 'activate-plugin_' . $plugin_file)) . 98 '"title="' . esc_attr__('Activate importer') . '"">' . $data[0] . '</a>'; 102 $status = _x( 'Installed and not activated', 'importer plugin' ); 103 $status_class = ' importer-inactive'; 104 $action = '<a href="' . esc_url( wp_nonce_url( admin_url( 'plugins.php?action=activate&plugin=' . $plugin_file . 105 '&from=import' ), 'activate-plugin_' . $plugin_file ) ) . '">' . __( 'Activate and run the importer' ) . '</a>'; 99 106 } 100 107 } 101 108 if ( empty($action) ) { 102 109 if ( is_main_site() ) { 103 110 $action = '<a href="' . esc_url( network_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_slug . 104 '&from=import&TB_iframe=true&width=600&height=550' ) ) . '" class="thickbox open-plugin-details-modal" title="' . 105 esc_attr__('Install importer') . '">' . $data[0] . '</a>'; 111 '&from=import&TB_iframe=true&width=600&height=550' ) ) . '" class="thickbox">' . __( 'Details and installation' ) . '</a>'; 106 112 } else { 107 $action = $data[0]; 108 $data[1] = sprintf( __( 'This importer is not installed. Please install importers from <a href="%s">the main site</a>.' ), get_admin_url( $current_site->blog_id, 'import.php' ) ); 113 $action = sprintf( __( 'This importer is not installed. Please install importers from <a href="%s">the main site</a>.' ), 114 get_admin_url( $current_site->blog_id, 'import.php' ) 115 ); 109 116 } 117 $status = _x( 'Not installed', 'importer plugin' ); 110 118 } 111 119 } else { 112 $action = "<a href='" . esc_url( "admin.php?import=$importer_id" ) . "' title='" . esc_attr( wptexturize( strip_tags( $data[1] ) ) ) ."'>{$data[0]}</a>"; 120 $action = '<a href="' . esc_url( 'admin.php?import=$importer_id' ) . '">' . __( 'Run the importer' ) . '</a>'; 121 $status = _x( 'Installed and activated', 'importer plugin' ); 122 $status_class = ' importer-active'; 113 123 } 114 124 115 125 echo " 116 <tr> 117 <td class='import-system row-title'>$action</td> 118 <td class='desc'>{$data[1]}</td> 126 <tr class='importer-item{$status_class}'> 127 <td class='import-system'> 128 <span class='importer-title row-title'>{$data[0]}</span> 129 <span class='importer-status'>{$status}</span> 130 </td> 131 <td class='desc'> 132 <span class='importer-desc'>{$data[1]}</span> 133 <span class='importer-action'>{$action}</span> 134 </td> 119 135 </tr>"; 120 136 } 121 137 ?> -
src/wp-admin/includes/import.php
157 157 // slug => name, description, plugin slug, and register_importer() slug 158 158 'blogger' => array( 159 159 'name' => __( 'Blogger' ), 160 'description' => __( 'I nstall the Blogger importer to import posts, comments, and users from a Blogger blog.' ),160 'description' => __( 'Import posts, comments, and users from a Blogger blog.' ), 161 161 'plugin-slug' => 'blogger-importer', 162 162 'importer-id' => 'blogger', 163 163 ), 164 164 'wpcat2tag' => array( 165 165 'name' => __( 'Categories and Tags Converter' ), 166 'description' => __( ' Install the category/tag converter to convert existing categories to tags or tags to categories, selectively.' ),166 'description' => __( 'Convert existing categories to tags or tags to categories, selectively.' ), 167 167 'plugin-slug' => 'wpcat2tag-importer', 168 168 'importer-id' => 'wp-cat2tag', 169 169 ), 170 170 'livejournal' => array( 171 171 'name' => __( 'LiveJournal' ), 172 'description' => __( 'I nstall the LiveJournal importer to import posts from LiveJournal using their API.' ),172 'description' => __( 'Import posts from LiveJournal using their API.' ), 173 173 'plugin-slug' => 'livejournal-importer', 174 174 'importer-id' => 'livejournal', 175 175 ), 176 176 'movabletype' => array( 177 177 'name' => __( 'Movable Type and TypePad' ), 178 'description' => __( 'I nstall the Movable Type importer to import posts and comments from a Movable Type or TypePad blog.' ),178 'description' => __( 'Import posts and comments from a Movable Type or TypePad blog.' ), 179 179 'plugin-slug' => 'movabletype-importer', 180 180 'importer-id' => 'mt', 181 181 ), 182 182 'opml' => array( 183 183 'name' => __( 'Blogroll' ), 184 'description' => __( 'I nstall the blogroll importer to import links in OPML format.' ),184 'description' => __( 'Import links in OPML format.' ), 185 185 'plugin-slug' => 'opml-importer', 186 186 'importer-id' => 'opml', 187 187 ), 188 188 'rss' => array( 189 189 'name' => __( 'RSS' ), 190 'description' => __( 'I nstall the RSS importer to import posts from an RSS feed.' ),190 'description' => __( 'Import posts from an RSS feed.' ), 191 191 'plugin-slug' => 'rss-importer', 192 192 'importer-id' => 'rss', 193 193 ), 194 194 'tumblr' => array( 195 195 'name' => __( 'Tumblr' ), 196 'description' => __( 'I nstall the Tumblr importer to import posts & media from Tumblr using their API.' ),196 'description' => __( 'Import posts & media from Tumblr using their API.' ), 197 197 'plugin-slug' => 'tumblr-importer', 198 198 'importer-id' => 'tumblr', 199 199 ), 200 200 'wordpress' => array( 201 201 'name' => 'WordPress', 202 'description' => __( 'I nstall the WordPress importer to import posts, pages, comments, custom fields, categories, and tags from a WordPress export file.' ),202 'description' => __( 'Import posts, pages, comments, custom fields, categories, and tags from a WordPress export file.' ), 203 203 'plugin-slug' => 'wordpress-importer', 204 204 'importer-id' => 'wordpress', 205 205 ),