raw
mp-wp_genesis           1 <?php
mp-wp_genesis 2 /**
mp-wp_genesis 3 * Import WordPress Administration Panel
mp-wp_genesis 4 *
mp-wp_genesis 5 * @package WordPress
mp-wp_genesis 6 * @subpackage Administration
mp-wp_genesis 7 */
mp-wp_genesis 8
mp-wp_genesis 9 /** Load WordPress Bootstrap */
mp-wp_genesis 10 require_once ('admin.php');
mp-wp_genesis 11 $title = __('Import');
mp-wp_genesis 12 require_once ('admin-header.php');
mp-wp_genesis 13 $parent_file = 'tools.php';
mp-wp_genesis 14 ?>
mp-wp_genesis 15
mp-wp_genesis 16 <div class="wrap">
mp-wp_genesis 17 <?php screen_icon(); ?>
mp-wp_genesis 18 <h2><?php echo wp_specialchars( $title ); ?></h2>
mp-wp_genesis 19 <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>
mp-wp_genesis 20
mp-wp_genesis 21 <?php
mp-wp_genesis 22
mp-wp_genesis 23 // Load all importers so that they can register.
mp-wp_genesis 24 $import_loc = 'wp-admin/import';
mp-wp_genesis 25 $import_root = ABSPATH.$import_loc;
mp-wp_genesis 26 $imports_dir = @ opendir($import_root);
mp-wp_genesis 27 if ($imports_dir) {
mp-wp_genesis 28 while (($file = readdir($imports_dir)) !== false) {
mp-wp_genesis 29 if ($file{0} == '.') {
mp-wp_genesis 30 continue;
mp-wp_genesis 31 } elseif (substr($file, -4) == '.php') {
mp-wp_genesis 32 require_once($import_root . '/' . $file);
mp-wp_genesis 33 }
mp-wp_genesis 34 }
mp-wp_genesis 35 }
mp-wp_genesis 36 @closedir($imports_dir);
mp-wp_genesis 37
mp-wp_genesis 38 $importers = get_importers();
mp-wp_genesis 39
mp-wp_genesis 40 if (empty ($importers)) {
mp-wp_genesis 41 echo '<p>'.__('No importers are available.').'</p>'; // TODO: make more helpful
mp-wp_genesis 42 } else {
mp-wp_genesis 43 ?>
mp-wp_genesis 44 <table class="widefat" cellspacing="0">
mp-wp_genesis 45
mp-wp_genesis 46 <?php
mp-wp_genesis 47 $style = '';
mp-wp_genesis 48 foreach ($importers as $id => $data) {
mp-wp_genesis 49 $style = ('class="alternate"' == $style || 'class="alternate active"' == $style) ? '' : 'alternate';
mp-wp_genesis 50 $action = "<a href='admin.php?import=$id' title='".wptexturize(strip_tags($data[1]))."'>{$data[0]}</a>";
mp-wp_genesis 51
mp-wp_genesis 52 if ($style != '')
mp-wp_genesis 53 $style = 'class="'.$style.'"';
mp-wp_genesis 54 echo "
mp-wp_genesis 55 <tr $style>
mp-wp_genesis 56 <td class='import-system row-title'>$action</td>
mp-wp_genesis 57 <td class='desc'>{$data[1]}</td>
mp-wp_genesis 58 </tr>";
mp-wp_genesis 59 }
mp-wp_genesis 60 ?>
mp-wp_genesis 61
mp-wp_genesis 62 </table>
mp-wp_genesis 63 <?php
mp-wp_genesis 64 }
mp-wp_genesis 65 ?>
mp-wp_genesis 66
mp-wp_genesis 67 </div>
mp-wp_genesis 68
mp-wp_genesis 69 <?php
mp-wp_genesis 70
mp-wp_genesis 71 include ('admin-footer.php');
mp-wp_genesis 72 ?>
mp-wp_genesis 73