Changeset 14759 for trunk/wp-admin/import.php
- Timestamp:
- 05/20/2010 07:20:25 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/import.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/import.php
r14313 r14759 7 7 */ 8 8 9 define('WP_LOAD_IMPORTERS', true); 10 9 11 /** Load WordPress Bootstrap */ 10 12 require_once ('admin.php'); … … 14 16 15 17 $title = __('Import'); 18 add_thickbox(); 16 19 require_once ('admin-header.php'); 17 20 $parent_file = 'tools.php'; … … 40 43 @closedir($imports_dir); 41 44 45 $popular_importers = array(); 46 if ( current_user_can('install_plugins') ) 47 $popular_importers = array( 48 'blogger' => array( __('Blogger'), __('Install the Blogger importer to import posts, comments, and users from a Blogger blog.'), 'install' ), 49 'livejournal' => array( __( 'LiveJournal' ), __( 'Install the LiveJounral importer to import posts from LiveJournal using their API.' ), 'install' ), 50 'mt' => array( __('Movable Type and TypePad'), __('Install the Movable Type importer to import posts and comments from a Movable Type or TypePad blog.'), 'install' ), 51 'opml' => array( __('Blogroll'), __('Install the blogroll importer to import links in OPML format.'), 'install' ), 52 'rss' => array( __('RSS'), __('Install the RSS importer to import posts from an RSS feed.'), 'install' ), 53 'wordpress' => array( 'WordPress', __('Install the WordPress importer to import posts, pages, comments, custom fields, categories, and tags from a WordPress export file.'), 'install' ) 54 ); 55 42 56 $importers = get_importers(); 57 58 // If a popular importer is not registered, create a dummy registration that links to the plugin installer. 59 foreach ( array_keys($popular_importers) as $pop_importer ) { 60 if ( isset($importers[$pop_importer] ) ) 61 continue; 62 63 $importers[$pop_importer] = $popular_importers[$pop_importer]; 64 } 65 66 uasort($importers, create_function('$a, $b', 'return strcmp($a[0], $b[0]);')); 43 67 44 68 if (empty ($importers)) { … … 52 76 foreach ($importers as $id => $data) { 53 77 $style = ('class="alternate"' == $style || 'class="alternate active"' == $style) ? '' : 'alternate'; 54 $action = "<a href='admin.php?import=$id' title='".wptexturize(strip_tags($data[1]))."'>{$data[0]}</a>"; 78 if ( 'install' == $data[2] ) { 79 $plugin_slug = $id . '-importer'; 80 $action = '<a href="' . admin_url('plugin-install.php?tab=plugin-information&plugin=' . $plugin_slug . 81 '&TB_iframe=true&width=600&height=550') . '" class="thickbox" title="' . 82 esc_attr__('Install importer') . '">' . $data[0] . '</a>'; 83 } else { 84 $action = "<a href='" . esc_url('admin.php?import=$id') . "' title='" . esc_attr( wptexturize(strip_tags($data[1])) ) ."'>{$data[0]}</a>"; 85 } 55 86 56 87 if ($style != '') … … 67 98 <?php 68 99 } 100 101 if ( current_user_can('install_plugins') ) 102 echo '<p>' . sprintf('If the importer you need is not listed, <a href="%s">search the plugins directory</a> to see if an importer is available.', admin_url('plugin-install.php?tab=search&type=tag&s=importer') ) . '</p>'; 69 103 ?> 70 104
Note: See TracChangeset
for help on using the changeset viewer.