-
+ F6B402DB844D90D3AD27413BAFA675EB850618C500175351F9BFD097E25F648B0DF1C4B69C72D45B0D08A1EFD83AF097B90D09DA87F5CC2332E90E6A7B71FC2F
mp-wp/wp-admin/admin.php
(0 . 0)(1 . 142)
1473 <?php
1474 /**
1475 * WordPress Administration Bootstrap
1476 *
1477 * @package WordPress
1478 * @subpackage Administration
1479 */
1480
1481 /**
1482 * In WordPress Administration Panels
1483 *
1484 * @since unknown
1485 */
1486 define('WP_ADMIN', TRUE);
1487
1488 if ( defined('ABSPATH') )
1489 require_once(ABSPATH . 'wp-load.php');
1490 else
1491 require_once('../wp-load.php');
1492
1493 if ( get_option('db_version') != $wp_db_version ) {
1494 wp_redirect(admin_url('upgrade.php?_wp_http_referer=' . urlencode(stripslashes($_SERVER['REQUEST_URI']))));
1495 exit;
1496 }
1497
1498 require_once(ABSPATH . 'wp-admin/includes/admin.php');
1499
1500 auth_redirect();
1501
1502 nocache_headers();
1503
1504 update_category_cache();
1505
1506 $posts_per_page = get_option('posts_per_page');
1507 $what_to_show = get_option('what_to_show');
1508 $date_format = get_option('date_format');
1509 $time_format = get_option('time_format');
1510
1511 wp_reset_vars(array('profile', 'redirect', 'redirect_url', 'a', 'popuptitle', 'popupurl', 'text', 'trackback', 'pingback'));
1512
1513 wp_admin_css_color('classic', __('Blue'), admin_url("css/colors-classic.css"), array('#073447', '#21759B', '#EAF3FA', '#BBD8E7'));
1514 wp_admin_css_color('fresh', __('Gray'), admin_url("css/colors-fresh.css"), array('#464646', '#6D6D6D', '#F1F1F1', '#DFDFDF'));
1515
1516 wp_enqueue_script( 'common' );
1517 wp_enqueue_script( 'jquery-color' );
1518
1519 $editing = false;
1520
1521 if (isset($_GET['page'])) {
1522 $plugin_page = stripslashes($_GET['page']);
1523 $plugin_page = plugin_basename($plugin_page);
1524 }
1525
1526 require(ABSPATH . 'wp-admin/menu.php');
1527
1528 do_action('admin_init');
1529
1530 // Handle plugin admin pages.
1531 if (isset($plugin_page)) {
1532 if( ! $page_hook = get_plugin_page_hook($plugin_page, $pagenow) ) {
1533 $page_hook = get_plugin_page_hook($plugin_page, $plugin_page);
1534 // backwards compatibility for plugins using add_management_page
1535 if ( empty( $page_hook ) && 'edit.php' == $pagenow && '' != get_plugin_page_hook($plugin_page, 'tools.php') ) {
1536 wp_redirect('tools.php?page=' . $plugin_page);
1537 exit;
1538 }
1539 }
1540
1541 if ( $page_hook ) {
1542 do_action('load-' . $page_hook);
1543 if (! isset($_GET['noheader']))
1544 require_once(ABSPATH . 'wp-admin/admin-header.php');
1545
1546 do_action($page_hook);
1547 } else {
1548 if ( validate_file($plugin_page) ) {
1549 wp_die(__('Invalid plugin page'));
1550 }
1551
1552 if (! ( file_exists(WP_PLUGIN_DIR . "/$plugin_page") && is_file(WP_PLUGIN_DIR . "/$plugin_page") ) )
1553 wp_die(sprintf(__('Cannot load %s.'), htmlentities($plugin_page)));
1554
1555 do_action('load-' . $plugin_page);
1556
1557 if (! isset($_GET['noheader']))
1558 require_once(ABSPATH . 'wp-admin/admin-header.php');
1559
1560 include(WP_PLUGIN_DIR . "/$plugin_page");
1561 }
1562
1563 include(ABSPATH . 'wp-admin/admin-footer.php');
1564
1565 exit();
1566 } else if (isset($_GET['import'])) {
1567
1568 $importer = $_GET['import'];
1569
1570 if ( ! current_user_can('import') )
1571 wp_die(__('You are not allowed to import.'));
1572
1573 if ( validate_file($importer) ) {
1574 wp_die(__('Invalid importer.'));
1575 }
1576
1577 // Allow plugins to define importers as well
1578 if ( !isset($wp_importers) || !isset($wp_importers[$importer]) || ! is_callable($wp_importers[$importer][2]))
1579 {
1580 if (! file_exists(ABSPATH . "wp-admin/import/$importer.php"))
1581 {
1582 wp_die(__('Cannot load importer.'));
1583 }
1584 include(ABSPATH . "wp-admin/import/$importer.php");
1585 }
1586
1587 $parent_file = 'tools.php';
1588 $submenu_file = 'import.php';
1589 $title = __('Import');
1590
1591 if (! isset($_GET['noheader']))
1592 require_once(ABSPATH . 'wp-admin/admin-header.php');
1593
1594 require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
1595
1596 define('WP_IMPORTING', true);
1597
1598 call_user_func($wp_importers[$importer][2]);
1599
1600 include(ABSPATH . 'wp-admin/admin-footer.php');
1601
1602 // Make sure rules are flushed
1603 global $wp_rewrite;
1604 $wp_rewrite->flush_rules();
1605
1606 exit();
1607 } else {
1608 do_action("load-$pagenow");
1609 }
1610
1611 if ( !empty($_REQUEST['action']) )
1612 do_action('admin_action_' . $_REQUEST['action']);
1613
1614 ?>