WordPress.org

Make WordPress Core

Changeset 2800


Ignore:
Timestamp:
08/21/05 07:03:23 (10 years ago)
Author:
ryan
Message:

New import system. Very rough draft.

Location:
trunk
Files:
9 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-functions.php

    r2797 r2800  
    13831383} 
    13841384 
     1385function register_importer($id, $name, $description, $callback) { 
     1386    global $wp_importers; 
     1387     
     1388    $wp_importers[$id] = array($name, $description, $callback); 
     1389} 
     1390 
     1391function get_importers() { 
     1392    global $wp_importers; 
     1393 
     1394    return $wp_importers; 
     1395} 
     1396 
    13851397?> 
  • trunk/wp-admin/admin.php

    r2701 r2800  
    6565 
    6666    exit(); 
     67} else if (isset($_GET['import'])) { 
     68     
     69    $importer = $_GET['import']; 
     70 
     71    if ( validate_file($importer) ) { 
     72        die(__('Invalid importer.')); 
     73    } 
     74         
     75    if (! file_exists(ABSPATH . "wp-admin/import/$importer.php")) 
     76        die(__('Cannot load importer.')); 
     77 
     78    include(ABSPATH . "wp-admin/import/$importer.php"); 
     79 
     80    $parent_file = 'import.php'; 
     81    $title = __('Import'); 
     82     
     83    if (! isset($_GET['noheader'])) 
     84        require_once(ABSPATH . 'wp-admin/admin-header.php'); 
     85 
     86    require_once(ABSPATH . 'wp-admin/upgrade-functions.php'); 
     87 
     88    call_user_func($wp_importers[$importer][2]); 
     89             
     90    include(ABSPATH . 'wp-admin/admin-footer.php'); 
     91 
     92    exit(); 
    6793} 
    6894 
  • trunk/wp-admin/menu.php

    r2765 r2800  
    1616    $menu[35] = array(__('Profile'), 'read', 'profile.php'); 
    1717$menu[40] = array(__('Options'), 'read', 'options-personal.php'); 
     18$menu[45] = array(__('Import'), 'import', 'import.php'); 
    1819 
    1920if ( get_option('use_fileupload') ) 
    20     $menu[45] = array(__('Upload'), 'upload_files', 'upload.php'); 
     21    $menu[50] = array(__('Upload'), 'upload_files', 'upload.php'); 
    2122 
    2223$submenu['post.php'][5] = array(__('Write Post'), 'edit_posts', 'post.php'); 
  • trunk/wp-admin/upgrade-schema.php

    r2748 r2800  
    257257                                                'edit_users' => true, 
    258258                                                'edit_files' => true, 
     259                                                'import' => true, 
    259260                                                'read' => true, 
    260261                                                'level_10' => true, 
  • trunk/wp-settings.php

    r2784 r2800  
    119119require (ABSPATH . WPINC . '/version.php'); 
    120120 
    121 if (!strstr($_SERVER['PHP_SELF'], 'install.php') && !strstr($_SERVER['PHP_SELF'], 'wp-admin/import')) : 
     121if (!strstr($_SERVER['PHP_SELF'], 'install.php')) : 
    122122    // Used to guarantee unique hash cookies 
    123123    $cookiehash = md5(get_settings('siteurl')); // Remove in 1.4 
Note: See TracChangeset for help on using the changeset viewer.