[44] | 1 | <?php
|
---|
| 2 | /**
|
---|
| 3 | * Import WordPress Administration Panel
|
---|
| 4 | *
|
---|
| 5 | * @package WordPress
|
---|
| 6 | * @subpackage Administration
|
---|
| 7 | */
|
---|
| 8 |
|
---|
| 9 | /** Load WordPress Bootstrap */
|
---|
| 10 | require_once ('admin.php');
|
---|
| 11 | $title = __('Import');
|
---|
| 12 | require_once ('admin-header.php');
|
---|
| 13 | $parent_file = 'tools.php';
|
---|
| 14 | ?>
|
---|
| 15 |
|
---|
| 16 | <div class="wrap">
|
---|
| 17 | <?php screen_icon(); ?>
|
---|
| 18 | <h2><?php echo esc_html( $title ); ?></h2>
|
---|
| 19 | <p><?php _e('If you have posts or comments in another system, WordPress can import those into this blog. To get started, choose a system to import from below:'); ?></p>
|
---|
| 20 |
|
---|
| 21 | <?php
|
---|
| 22 |
|
---|
| 23 | // Load all importers so that they can register.
|
---|
| 24 | $import_loc = 'wp-admin/import';
|
---|
| 25 | $import_root = ABSPATH.$import_loc;
|
---|
| 26 | $imports_dir = @ opendir($import_root);
|
---|
| 27 | if ($imports_dir) {
|
---|
| 28 | while (($file = readdir($imports_dir)) !== false) {
|
---|
| 29 | if ($file{0} == '.') {
|
---|
| 30 | continue;
|
---|
| 31 | } elseif (substr($file, -4) == '.php') {
|
---|
| 32 | require_once($import_root . '/' . $file);
|
---|
| 33 | }
|
---|
| 34 | }
|
---|
| 35 | }
|
---|
| 36 | @closedir($imports_dir);
|
---|
| 37 |
|
---|
| 38 | $importers = get_importers();
|
---|
| 39 |
|
---|
| 40 | if (empty ($importers)) {
|
---|
| 41 | echo '<p>'.__('No importers are available.').'</p>'; // TODO: make more helpful
|
---|
| 42 | } else {
|
---|
| 43 | ?>
|
---|
| 44 | <table class="widefat" cellspacing="0">
|
---|
| 45 |
|
---|
| 46 | <?php
|
---|
| 47 | $style = '';
|
---|
| 48 | foreach ($importers as $id => $data) {
|
---|
| 49 | $style = ('class="alternate"' == $style || 'class="alternate active"' == $style) ? '' : 'alternate';
|
---|
| 50 | $action = "<a href='admin.php?import=$id' title='".wptexturize(strip_tags($data[1]))."'>{$data[0]}</a>";
|
---|
| 51 |
|
---|
| 52 | if ($style != '')
|
---|
| 53 | $style = 'class="'.$style.'"';
|
---|
| 54 | echo "
|
---|
| 55 | <tr $style>
|
---|
| 56 | <td class='import-system row-title'>$action</td>
|
---|
| 57 | <td class='desc'>{$data[1]}</td>
|
---|
| 58 | </tr>";
|
---|
| 59 | }
|
---|
| 60 | ?>
|
---|
| 61 |
|
---|
| 62 | </table>
|
---|
| 63 | <?php
|
---|
| 64 | }
|
---|
| 65 | ?>
|
---|
| 66 |
|
---|
| 67 | </div>
|
---|
| 68 |
|
---|
| 69 | <?php
|
---|
| 70 |
|
---|
| 71 | include ('admin-footer.php');
|
---|
| 72 | ?>
|
---|
| 73 |
|
---|