]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/import/opml.php
Wordpress 2.7.1
[autoinstalls/wordpress.git] / wp-admin / import / opml.php
similarity index 82%
rename from wp-admin/link-import.php
rename to wp-admin/import/opml.php
index a2d6e4d565e3446d816abd2958020e09c09e3c18..8148acf6f42a2dabf00df5acb5dc2434298a7f43 100644 (file)
@@ -1,11 +1,22 @@
 <?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;
 ?>
@@ -20,9 +31,9 @@ switch ($step) {
 ?>
 
 <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>
@@ -91,6 +102,7 @@ foreach ($categories as $category) {
                        $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);
@@ -98,6 +110,7 @@ foreach ($categories as $category) {
                                $opml = file_get_contents($opml_url);
                        }
 
+                       /** Load OPML Parser */
                        include_once('link-parse-opml.php');
 
                        $link_count = count($names);
@@ -130,7 +143,13 @@ if ( ! $blogrolling )
                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'));
+
+?>