2005-08-21 03:03:23 -04:00
< ? php
require_once ( 'admin.php' );
2006-11-18 02:31:29 -05:00
$title = __ ( 'Import' );
$parent_file = 'edit.php' ;
2005-08-21 03:03:23 -04:00
require_once ( 'admin-header.php' );
?>
< div class = " wrap " >
< h2 >< ? php _e ( 'Import' ); ?> </h2>
2006-12-05 02:15:12 -05: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 03:03:23 -04:00
< ? php
// Load all importers so that they can register.
$import_loc = 'wp-admin/import' ;
$import_root = ABSPATH . $import_loc ;
$imports_dir = @ dir ( $import_root );
if ( $imports_dir ) {
while (( $file = $imports_dir -> read ()) !== false ) {
if ( preg_match ( '|^\.+$|' , $file ))
continue ;
if ( preg_match ( '|\.php$|' , $file ))
require_once ( " $import_root / $file " );
}
}
$importers = get_importers ();
if ( empty ( $importers )) {
2005-12-02 17:37:02 -05:00
echo '<p>' . __ ( 'No importers are available.' ) . '</p>' ; // TODO: make more helpful
2005-08-21 03:03:23 -04:00
} else {
?>
2006-05-10 16:34:17 -04:00
< table class = " widefat " >
2005-08-21 03:03:23 -04:00
< ? php
$style = '' ;
foreach ( $importers as $id => $data ) {
$style = ( 'class="alternate"' == $style || 'class="alternate active"' == $style ) ? '' : 'alternate' ;
2006-07-05 18:33:58 -04:00
$action = " <a href='admin.php?import= $id ' title=' " . wptexturize ( strip_tags ( $data [ 1 ])) . " '> { $data [ 0 ] } </a> " ;
2005-08-21 03:03:23 -04:00
if ( $style != '' )
$style = 'class="' . $style . '"' ;
echo "
< tr $style >
2006-05-10 16:34:17 -04:00
< td class = 'import-system' > $action </ td >
< td class = 'desc' > { $data [ 1 ]} </ td >
2005-08-21 03:03:23 -04:00
</ tr > " ;
}
?>
</ table >
< ? php
}
?>
</ div >
< ? php
include ( 'admin-footer.php' );
?>