2 require_once ('admin.php');
4 $parent_file = 'import.php';
5 require_once ('admin-header.php');
9 <h2><?php _e('Import'); ?></h2>
10 <p><?php _e('If you have posts or comments in another system WordPress can import them into your current blog. To get started, choose a system to import from below:'); ?></p>
14 // Load all importers so that they can register.
15 $import_loc = 'wp-admin/import';
16 $import_root = ABSPATH.$import_loc;
17 $imports_dir = @ dir($import_root);
19 while (($file = $imports_dir->read()) !== false) {
20 if (preg_match('|^\.+$|', $file))
22 if (preg_match('|\.php$|', $file))
23 require_once("$import_root/$file");
27 $importers = get_importers();
29 if (empty ($importers)) {
30 echo '<p>'.__('No importers are available.').'</p>'; // TODO: make more helpful
33 <table width="100%" cellpadding="3" cellspacing="3">
37 foreach ($importers as $id => $data) {
38 $style = ('class="alternate"' == $style || 'class="alternate active"' == $style) ? '' : 'alternate';
39 $action = "<a href='admin.php?import=$id' title='".wptexturize(strip_tags($data[1]))."'>{$data[0]}</a>";
42 $style = 'class="'.$style.'"';
45 <td class=\"togl\">$action</td>
46 <td class=\"desc\">{$data[1]}</td>
60 include ('admin-footer.php');