]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/import.php
Wordpress 2.8-scripts
[autoinstalls/wordpress.git] / wp-admin / import.php
index 4e05527d4cf25e4c461f08514d5115b8426ca598..8b10fc844095b581c717cef5a8ba60bf112c05c6 100644 (file)
@@ -1,28 +1,39 @@
 <?php
+/**
+ * Import WordPress Administration Panel
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** Load WordPress Bootstrap */
 require_once ('admin.php');
 $title = __('Import');
-$parent_file = 'import.php';
 require_once ('admin-header.php');
+$parent_file = 'tools.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 screen_icon(); ?>
+<h2><?php echo esc_html( $title ); ?></h2>
+<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>
 
 <?php
 
 // Load all importers so that they can register.
 $import_loc = 'wp-admin/import';
 $import_root = ABSPATH.$import_loc;
-$imports_dir = @ dir($import_root);
+$imports_dir = @ opendir($import_root);
 if ($imports_dir) {
-       while (($file = $imports_dir->read()) !== false) {
-               if (preg_match('|^\.+$|', $file))
+       while (($file = readdir($imports_dir)) !== false) {
+               if ($file{0} == '.') {
                        continue;
-               if (preg_match('|\.php$|', $file))
-                       require_once("$import_root/$file");
+               } elseif (substr($file, -4) == '.php') {
+                       require_once($import_root . '/' . $file);
+               }
        }
 }
+@closedir($imports_dir);
 
 $importers = get_importers();
 
@@ -30,7 +41,7 @@ if (empty ($importers)) {
        echo '<p>'.__('No importers are available.').'</p>'; // TODO: make more helpful
 } else {
 ?>
-<table width="100%" cellpadding="3" cellspacing="3">
+<table class="widefat" cellspacing="0">
 
 <?php
        $style = '';
@@ -42,8 +53,8 @@ if (empty ($importers)) {
                        $style = 'class="'.$style.'"';
                echo "
                        <tr $style>
-                               <td class=\"togl\">$action</td>
-                               <td class=\"desc\">{$data[1]}</td>
+                               <td class='import-system row-title'>$action</td>
+                               <td class='desc'>{$data[1]}</td>
                        </tr>";
        }
 ?>