2005-08-21 07:03:23 +00:00
<? php
2008-08-11 20:26:31 +00:00
/**
* Import WordPress Administration Panel
*
* @package WordPress
* @subpackage Administration
*/
/** Load WordPress Bootstrap */
2005-08-21 07:03:23 +00:00
require_once ( 'admin.php' );
2006-11-18 07:31:29 +00:00
$title = __ ( 'Import' );
2005-08-21 07:03:23 +00:00
require_once ( 'admin-header.php' );
2008-11-27 21:11:25 +00:00
$parent_file = 'tools.php' ;
2005-08-21 07:03:23 +00:00
?>
<div class="wrap">
2008-11-26 13:51:25 +00:00
<?php screen_icon(); ?>
2008-12-09 18:03:31 +00:00
<h2><?php echo wp_specialchars( $title ); ?></h2>
2006-12-05 07:15:12 +00:00
<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>
2005-08-21 07:03:23 +00:00
<?php
// Load all importers so that they can register.
$import_loc = 'wp-admin/import';
$import_root = ABSPATH.$import_loc;
2007-08-14 02:58:33 +00:00
$imports_dir = @ opendir($import_root);
2005-08-21 07:03:23 +00:00
if ($imports_dir) {
2007-08-17 01:59:37 +00:00
while (($file = readdir($imports_dir)) !== false) {
2007-04-07 15:46:09 +00:00
if ($file{0} == '.') {
2005-08-21 07:03:23 +00:00
continue;
2007-04-07 15:46:09 +00:00
} elseif (substr($file, -4) == '.php') {
require_once($import_root . '/' . $file);
}
2005-08-21 07:03:23 +00:00
}
}
2007-08-14 02:58:33 +00:00
@closedir($imports_dir);
2005-08-21 07:03:23 +00:00
$importers = get_importers();
if (empty ($importers)) {
2005-12-02 22:37:02 +00:00
echo '<p>'.__('No importers are available.').'</p>'; // TODO: make more helpful
2005-08-21 07:03:23 +00:00
} else {
?>
2008-11-17 18:01:00 +00:00
<table class="widefat" cellspacing="0">
2005-08-21 07:03:23 +00:00
<?php
$style = '';
foreach ($importers as $id => $data) {
$style = ('class="alternate"' == $style || 'class="alternate active"' == $style) ? '' : 'alternate';
2006-07-05 22:33:58 +00:00
$action = "<a href='admin.php?import=$id' title='".wptexturize(strip_tags($data[1]))."'>{$data[0]}</a>";
2005-08-21 07:03:23 +00:00
if ($style != '')
$style = 'class="'.$style.'"';
echo "
<tr $style>
2008-02-24 02:07:51 +00:00
<td class='import-system row-title'>$action</td>
2006-05-10 20:34:17 +00:00
<td class='desc'>{$data[1]}</td>
2005-08-21 07:03:23 +00:00
</tr>";
}
?>
</table>
<?php
}
?>
</div>
<?php
include ('admin-footer.php');
?>