summaryrefslogtreecommitdiffstats
path: root/wp-admin/import.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-06-22 18:31:50 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-06-22 18:31:50 +0000
commitd48e85e0ac5e675ca33fac173f30c75403d1033f (patch)
tree1164430fa3b83a4d9283961b09c1576f2885e6b2 /wp-admin/import.php
parent086dcde66603301531efc6d8087bd06d0546f148 (diff)
downloadwordpress-mu-d48e85e0ac5e675ca33fac173f30c75403d1033f.tar.gz
wordpress-mu-d48e85e0ac5e675ca33fac173f30c75403d1033f.tar.xz
wordpress-mu-d48e85e0ac5e675ca33fac173f30c75403d1033f.zip
Moved everything in wp-inst down a directory.
Uses's Ryan Boren's htaccess rules and mods If you're upgrading, try this on a test server first! git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@591 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin/import.php')
-rw-r--r--wp-admin/import.php62
1 files changed, 62 insertions, 0 deletions
diff --git a/wp-admin/import.php b/wp-admin/import.php
new file mode 100644
index 0000000..cd1951a
--- /dev/null
+++ b/wp-admin/import.php
@@ -0,0 +1,62 @@
+<?php
+require_once ('admin.php');
+$title = __('Import');
+$parent_file = 'edit.php';
+require_once ('admin-header.php');
+?>
+
+<div class="wrap">
+<h2><?php _e('Import'); ?></h2>
+<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>
+
+<?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)) {
+ echo '<p>'.__('No importers are available.').'</p>'; // TODO: make more helpful
+} else {
+?>
+<table class="widefat">
+
+<?php
+ $style = '';
+ foreach ($importers as $id => $data) {
+ $style = ('class="alternate"' == $style || 'class="alternate active"' == $style) ? '' : 'alternate';
+ $action = "<a href='admin.php?import=$id' title='{$data[1]}'>{$data[0]}</a>";
+
+ if ($style != '')
+ $style = 'class="'.$style.'"';
+ echo "
+ <tr $style>
+ <td class='import-system'>$action</td>
+ <td class='desc'>{$data[1]}</td>
+ </tr>";
+ }
+?>
+
+</table>
+<?php
+}
+?>
+
+</div>
+
+<?php
+
+include ('admin-footer.php');
+?>
+