<?php
-// Links
-// Copyright (C) 2002 Mike Little -- mike@zed1.com
-
-require_once('admin.php');
-$parent_file = 'edit.php';
+/**
+ * Links Import Administration Panel.
+ *
+ * @copyright 2002 Mike Little <mike@zed1.com>
+ * @author Mike Little <mike@zed1.com>
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** Load WordPress Administration Bootstrap */
+$parent_file = 'tools.php';
+$submenu_file = 'import.php';
$title = __('Import Blogroll');
+class OPML_Import {
+
+ function dispatch() {
+ global $wpdb, $user_ID;
$step = $_POST['step'];
if (!$step) $step = 0;
?>
?>
<div class="wrap">
-
+<?php screen_icon(); ?>
<h2><?php _e('Import your blogroll from another system') ?> </h2>
-<form enctype="multipart/form-data" action="link-import.php" method="post" name="blogroll">
+<form enctype="multipart/form-data" action="admin.php?import=opml" method="post" name="blogroll">
<?php wp_nonce_field('import-bookmarks') ?>
<p><?php _e('If a program or website you use allows you to export your links or subscriptions as OPML you may import them here.'); ?></p>
$blogrolling = false;
}
+ global $opml, $updated_timestamp, $all_links, $map, $names, $urls, $targets, $descriptions, $feeds;
if ( isset($opml_url) && $opml_url != '' ) {
if ( $blogrolling === true ) {
$opml = wp_remote_fopen($opml_url);
$opml = file_get_contents($opml_url);
}
+ /** Load OPML Parser */
include_once('link-parse-opml.php');
$link_count = count($names);
break;
} // end case 1
} // end switch
+ }
-include('admin-footer.php');
+ function OPML_Import() {}
+}
-?>
\ No newline at end of file
+$opml_importer = new OPML_Import();
+
+register_importer('opml', __('Blogroll'), __('Import links in OPML format.'), array(&$opml_importer, 'dispatch'));
+
+?>