Changeset 1818
- Timestamp:
- 10/19/2004 03:03:06 AM (20 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-functions.php
r1810 r1818 662 662 } 663 663 664 function add_options_menu($title, $access_level, $file) { 664 function get_admin_page_title() { 665 global $title; 665 666 global $submenu; 666 667 $submenu['options-general.php'][] = array($title, $access_level, $file); 667 global $pagenow; 668 global $plugin_page; 669 670 if (isset($title) && ! empty($title)) { 671 return $title; 672 } 673 674 foreach (array_keys($submenu) as $parent) { 675 foreach ($submenu[$parent] as $submenu_array) { 676 if (isset($submenu_array[3])) { 677 if ($submenu_array[2] == $pagenow) { 678 $title = $submenu_array[3]; 679 return $submenu_array[3]; 680 } else if (isset($plugin_page) && ($plugin_page == $submenu_array[2])) { 681 $title = $submenu_array[3]; 682 return $submenu_array[3]; 683 } 684 } 685 } 686 } 687 688 return ''; 689 } 690 691 function get_admin_page_parent() { 692 global $parent_file; 693 global $submenu; 694 global $pagenow; 695 global $plugin_page; 696 697 if (isset($parent_file) && ! empty($parent_file)) { 698 return $parent_file; 699 } 700 701 foreach (array_keys($submenu) as $parent) { 702 foreach ($submenu[$parent] as $submenu_array) { 703 if ($submenu_array[2] == $pagenow) { 704 $parent_file = $parent; 705 return $parent; 706 } else if (isset($plugin_page) && ($plugin_page == $submenu_array[2])) { 707 $parent_file = $parent; 708 return $parent; 709 } 710 } 711 } 712 713 $parent_file = ''; 714 return ''; 715 } 716 717 function add_options_page($page_title, $menu_title, $access_level, $file) { 718 global $submenu; 719 720 $file = basename($file); 721 722 $submenu['options-general.php'][] = array($menu_title, $access_level, $file, $page_title); 668 723 } 669 724 -
trunk/wp-admin/admin-header.php
r1810 r1818 1 <?php 2 3 if (strstr($_SERVER['PHP_SELF'], 'plugins/')) { 4 $wp_admin_path = '../../wp-admin/'; 5 $wp_path = '../../'; 6 } else { 7 $wp_admin_path = './'; 8 $wp_path = '../'; 9 } 10 11 require_once($wp_path . 'wp-config.php'); 12 13 require_once(ABSPATH . '/wp-admin/auth.php'); 14 require(ABSPATH . '/wp-admin/admin-functions.php'); 15 16 $dogs = $wpdb->get_results("SELECT * FROM $wpdb->categories"); 17 foreach ($dogs as $catt) { 18 $cache_categories[$catt->cat_ID] = $catt; 19 } 20 21 get_currentuserinfo(); 22 23 $posts_per_page = get_settings('posts_per_page'); 24 $what_to_show = get_settings('what_to_show'); 25 $date_format = get_settings('date_format'); 26 $time_format = get_settings('time_format'); 27 28 $wpvarstoreset = array('profile','standalone','redirect','redirect_url','a','popuptitle','popupurl','text', 'trackback', 'pingback'); 29 for ($i=0; $i<count($wpvarstoreset); $i += 1) { 30 $wpvar = $wpvarstoreset[$i]; 31 if (!isset($$wpvar)) { 32 if (empty($_POST["$wpvar"])) { 33 if (empty($_GET["$wpvar"])) { 34 $$wpvar = ''; 35 } else { 36 $$wpvar = $_GET["$wpvar"]; 37 } 38 } else { 39 $$wpvar = $_POST["$wpvar"]; 40 } 41 } 42 } 43 44 if ($standalone == 0) : 45 46 ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 1 <?php get_admin_page_title(); ?> 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 47 3 <html xmlns="http://www.w3.org/1999/xhtml"> 48 4 <head> 49 5 <title><?php bloginfo('name') ?> › <?php echo $title; ?> — WordPress</title> 50 <link rel="stylesheet" href=" <?php echo $wp_admin_path; ?>wp-admin.css" type="text/css" />51 <link rel="shortcut icon" href=" <?php echo $wp_path; ?>wp-images/wp-favicon.png" />6 <link rel="stylesheet" href="wp-admin.css" type="text/css" /> 7 <link rel="shortcut icon" href="../wp-images/wp-favicon.png" /> 52 8 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo get_settings('blog_charset'); ?>" /> 53 9 … … 120 76 121 77 <?php 122 require(ABSPATH . '/wp-admin/menu.php'); 123 endif; 78 require(ABSPATH . '/wp-admin/menu-header.php'); 79 80 if ( $parent_file == 'options-general.php' ) { 81 require(ABSPATH . '/wp-admin/options-head.php'); 82 } 124 83 ?> -
trunk/wp-admin/categories.php
r1744 r1818 1 1 <?php 2 require_once(' ../wp-includes/wp-l10n.php');2 require_once('admin.php'); 3 3 4 4 $title = __('Categories'); 5 5 $parent_file = 'edit.php'; 6 6 7 function add_magic_quotes($array) { 8 foreach ($array as $k => $v) { 9 if (is_array($v)) { 10 $array[$k] = add_magic_quotes($v); 11 } else { 12 $array[$k] = addslashes($v); 13 } 14 } 15 return $array; 16 } 17 18 if (!get_magic_quotes_gpc()) { 19 $_GET = add_magic_quotes($_GET); 20 $_POST = add_magic_quotes($_POST); 21 $_COOKIE = add_magic_quotes($_COOKIE); 22 } 23 24 $wpvarstoreset = array('action','standalone','cat'); 7 $wpvarstoreset = array('action','cat'); 25 8 for ($i=0; $i<count($wpvarstoreset); $i += 1) { 26 9 $wpvar = $wpvarstoreset[$i]; … … 42 25 case 'addcat': 43 26 44 $standalone = 1;45 require_once('admin-header.php');46 47 27 if ($user_level < 3) 48 28 die (__('Cheatin’ uh?')); … … 61 41 62 42 case 'Delete': 63 64 $standalone = 1;65 require_once('admin-header.php');66 43 67 44 check_admin_referer(); … … 120 97 case 'editedcat': 121 98 122 $standalone = 1;123 require_once('admin-header.php');124 125 99 if ($user_level < 3) 126 100 die (__('Cheatin’ uh?')); … … 139 113 default: 140 114 141 $standalone = 0;142 115 require_once ('admin-header.php'); 143 116 if ($user_level < 3) { -
trunk/wp-admin/edit-comments.php
r1746 r1818 1 1 <?php 2 require_once(' ../wp-includes/wp-l10n.php');2 require_once('admin.php'); 3 3 4 4 $title = __('Edit Comments'); -
trunk/wp-admin/edit-pages.php
r1753 r1818 1 1 <?php 2 require_once('../wp-includes/wp-l10n.php'); 3 2 require_once('admin.php'); 4 3 $title = __('Pages'); 5 4 $parent_file = 'edit.php'; -
trunk/wp-admin/edit.php
r1743 r1818 1 1 <?php 2 require_once(' ../wp-includes/wp-l10n.php');2 require_once('admin.php'); 3 3 4 4 $title = __('Posts'); -
trunk/wp-admin/link-add.php
r1551 r1818 1 1 <?php 2 require_once(' ../wp-includes/wp-l10n.php');2 require_once('admin.php'); 3 3 4 4 $title = 'Add Link'; … … 23 23 } 24 24 25 function add_magic_quotes($array) { 26 foreach ($array as $k => $v) { 27 if (is_array($v)) { 28 $array[$k] = add_magic_quotes($v); 29 } else { 30 $array[$k] = addslashes($v); 31 } 32 } 33 return $array; 34 } 35 if (!get_magic_quotes_gpc()) { 36 $_GET = add_magic_quotes($_GET); 37 $_POST = add_magic_quotes($_POST); 38 $_COOKIE = add_magic_quotes($_COOKIE); 39 } 40 41 $wpvarstoreset = array('action','standalone','cat_id', 'linkurl', 'name', 'image', 25 $wpvarstoreset = array('action', 'cat_id', 'linkurl', 'name', 'image', 42 26 'description', 'visible', 'target', 'category', 'link_id', 43 27 'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel', -
trunk/wp-admin/link-categories.php
r1599 r1818 2 2 // Links 3 3 // Copyright (C) 2002, 2003 Mike Little -- mike@zed1.com 4 require_once(' ../wp-includes/wp-l10n.php');4 require_once('admin.php'); 5 5 $title = __('Link Categories'); 6 6 $this_file='link-categories.php'; 7 7 $parent_file = 'link-manager.php'; 8 8 9 $wpvarstoreset = array('action', 'standalone','cat', 'auto_toggle');9 $wpvarstoreset = array('action', 'cat', 'auto_toggle'); 10 10 for ($i=0; $i<count($wpvarstoreset); $i += 1) { 11 11 $wpvar = $wpvarstoreset[$i]; … … 26 26 case 'addcat': 27 27 { 28 $standalone = 1;29 include_once('admin-header.php');30 31 28 if ($user_level < 5) 32 29 die (__("Cheatin' uh ?")); … … 83 80 case 'Delete': 84 81 { 85 $standalone = 1;86 include_once('admin-header.php');87 88 82 $cat_id = $_GET['cat_id']; 89 83 $cat_name=get_linkcatname($cat_id); … … 205 199 case "editedcat": 206 200 { 207 $standalone = 1;208 include_once("./admin-header.php");209 210 201 if ($user_level < 5) 211 202 die (__("Cheatin' uh ?")); … … 279 270 default: 280 271 { 281 $standalone=0; 282 include_once ("./admin-header.php"); 272 include_once ("admin-header.php"); 283 273 if ($user_level < 5) { 284 274 die(__("You have do not have sufficient permissions to edit the link categories for this blog. :)")); -
trunk/wp-admin/link-import.php
r1599 r1818 3 3 // Copyright (C) 2002 Mike Little -- mike@zed1.com 4 4 5 require_once('../wp-config.php'); 6 5 require_once('admin.php'); 7 6 $parent_file = 'link-manager.php'; 8 7 $title = __('Import Blogroll'); … … 16 15 case 0: 17 16 { 18 $standalone = 0;19 17 include_once('admin-header.php'); 20 18 if ($user_level < 5) … … 73 71 74 72 case 1: { 75 $standalone = 0;76 73 include_once('admin-header.php'); 77 74 if ($user_level < 5) -
trunk/wp-admin/link-manager.php
r1768 r1818 3 3 // Copyright (C) 2002, 2003 Mike Little -- mike@zed1.com 4 4 5 require_once(' ../wp-config.php');5 require_once('admin.php'); 6 6 7 7 $title = __('Manage Links'); … … 38 38 } 39 39 40 function add_magic_quotes($array) { 41 foreach ($array as $k => $v) { 42 if (is_array($v)) { 43 $array[$k] = add_magic_quotes($v); 44 } else { 45 $array[$k] = addslashes($v); 46 } 47 } 48 return $array; 49 } 50 if (!get_magic_quotes_gpc()) { 51 $_GET = add_magic_quotes($_GET); 52 $_POST = add_magic_quotes($_POST); 53 $_COOKIE = add_magic_quotes($_COOKIE); 54 } 55 56 $wpvarstoreset = array('action','standalone','cat_id', 'linkurl', 'name', 'image', 40 $wpvarstoreset = array('action','cat_id', 'linkurl', 'name', 'image', 57 41 'description', 'visible', 'target', 'category', 'link_id', 58 42 'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel', … … 84 68 case 'assign': 85 69 { 86 $standalone = 1;87 include_once('admin-header.php');88 89 70 check_admin_referer(); 90 71 … … 117 98 case 'visibility': 118 99 { 119 $standalone = 1;120 include_once('admin-header.php');121 122 100 check_admin_referer(); 123 101 … … 157 135 case 'move': 158 136 { 159 $standalone = 1;160 include_once('admin-header.php');161 162 137 check_admin_referer(); 163 138 … … 181 156 case 'Add': 182 157 { 183 $standalone = 1;184 include_once('admin-header.php');185 186 158 check_admin_referer(); 187 159 … … 230 202 } 231 203 $links_show_cat_id = $cat_id; 232 233 $standalone = 1;234 include_once('admin-header.php');235 204 236 205 check_admin_referer(); … … 277 246 case 'Delete': 278 247 { 279 $standalone = 1;280 include_once('admin-header.php');281 282 248 check_admin_referer(); 283 249 … … 304 270 case 'linkedit': 305 271 { 306 $standalone=0;307 272 $xfn = true; 308 273 include_once ('admin-header.php'); … … 570 535 setcookie('links_show_cat_id_' . COOKIEHASH, $links_show_cat_id, time()+600); 571 536 setcookie('links_show_order_' . COOKIEHASH, $links_show_order, time()+600); 572 $standalone=0;573 537 include_once ("./admin-header.php"); 574 538 if ($user_level < 5) { -
trunk/wp-admin/menu.php
r1810 r1818 1 2 <ul id="adminmenu">3 1 <?php 4 2 // This array constructs the admin menu bar. … … 50 48 } 51 49 52 $self = preg_replace('|^.*/wp-admin/|i', '', $_SERVER['PHP_SELF']);53 $self = preg_replace('|^.*/plugins/|i', '', $self);54 55 if (!isset($parent_file)) $parent_file = '';56 foreach ($menu as $item) {57 $class = '';58 59 // 0 = name, 1 = user_level, 2 = file60 if ((substr($self, -10) == substr($item[2], -10) && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file))) $class = ' class="current"';61 62 if ($user_level >= $item[1]) {63 if (64 ('upload.php' == $item[2] &&65 get_settings('use_fileupload') &&66 ($user_level >= get_settings('fileupload_minlevel'))67 ) || 'upload.php' != $item[2])68 echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/{$item[2]}'$class>{$item[0]}</a></li>";69 }70 }71 72 50 ?> 73 <li class="last"><a href="<?php echo get_settings('siteurl')74 ?>/wp-login.php?action=logout" title="<?php _e('Log out of this account') ?>"><?php printf(__('Logout (%s)'), $user_nickname) ?></a></li>75 </ul>76 77 <?php78 // Sub-menu79 if ( isset($submenu["$parent_file"]) ) :80 ?>81 <ul id="adminmenu2">82 <?php83 foreach ($submenu["$parent_file"] as $item) :84 if ($user_level < $item[1]) {85 continue;86 }87 88 if ( substr($self, -10) == substr($item[2], -10) ) $class = ' class="current"';89 else $class = '';90 echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/{$item[2]}'$class>{$item[0]}</a></li>";91 endforeach;92 ?>93 94 </ul>95 <?php endif; ?> -
trunk/wp-admin/moderation.php
r1744 r1818 1 1 <?php 2 require_once(' ../wp-includes/wp-l10n.php');2 require_once('admin.php'); 3 3 4 4 $title = __('Moderate comments'); 5 5 $parent_file = 'edit.php'; 6 7 function add_magic_quotes($array) {8 foreach ($array as $k => $v) {9 if (is_array($v)) {10 $array[$k] = add_magic_quotes($v);11 } else {12 $array[$k] = addslashes($v);13 }14 }15 return $array;16 }17 18 if (!get_magic_quotes_gpc()) {19 $_GET = add_magic_quotes($_GET);20 $_POST = add_magic_quotes($_POST);21 $_COOKIE = add_magic_quotes($_COOKIE);22 }23 6 24 7 $wpvarstoreset = array('action','item_ignored','item_deleted','item_approved'); … … 48 31 49 32 case 'update': 50 51 $standalone = 1;52 require_once('admin-header.php');53 33 54 34 if ($user_level < 3) { -
trunk/wp-admin/options-discussion.php
r1810 r1818 1 1 <?php 2 require_once(' ../wp-includes/wp-l10n.php');2 require_once('admin.php'); 3 3 4 4 $title = __('Discussion Options'); 5 include('options-head.php'); 5 $parent_file = 'options-general.php'; 6 7 include('admin-header.php'); 6 8 7 9 if ($action == 'retrospam') { -
trunk/wp-admin/options-general.php
r1810 r1818 1 1 <?php 2 require_once(' ../wp-includes/wp-l10n.php');2 require_once('admin.php'); 3 3 4 4 $title = __('General Options'); 5 $parent_file = 'options-general.php'; 5 6 6 include(' options-head.php');7 include('admin-header.php'); 7 8 ?> 8 9 -
trunk/wp-admin/options-head.php
r1810 r1818 1 1 <?php 2 3 $parent_file = 'options-general.php';4 5 function add_magic_quotes($array) {6 foreach ($array as $k => $v) {7 if (is_array($v)) {8 $array[$k] = add_magic_quotes($v);9 } else {10 $array[$k] = addslashes($v);11 }12 }13 return $array;14 }15 16 if (!get_magic_quotes_gpc()) {17 $_GET = add_magic_quotes($_GET);18 $_POST = add_magic_quotes($_POST);19 $_COOKIE = add_magic_quotes($_COOKIE);20 }21 2 22 3 $wpvarstoreset = array('action','standalone', 'option_group_id'); … … 35 16 } 36 17 } 37 38 $standalone = 0;39 include_once('admin-header.php');40 18 ?> 41 19 42 20 <br clear="all" /> 43 21 44 <?php if (isset($ updated)) : ?>22 <?php if (isset($_GET['updated'])) : ?> 45 23 <div class="updated"><p><strong><?php _e('Options saved.') ?></strong></p></div> 46 24 <?php endif; ?> -
trunk/wp-admin/options-misc.php
r1810 r1818 1 1 <?php 2 require_once(' ../wp-includes/wp-l10n.php');2 require_once('admin.php'); 3 3 4 4 $title = __('Miscellaneous Options'); 5 include('options-head.php'); 5 $parent_file = 'options-general.php'; 6 7 include('admin-header.php'); 8 6 9 ?> 7 10 -
trunk/wp-admin/options-permalink.php
r1811 r1818 1 1 <?php 2 require_once(' ../wp-includes/wp-l10n.php');2 require_once('admin.php'); 3 3 4 4 $title = __('Permalink Options'); 5 require('./options-head.php'); 5 $parent_file = 'options-general.php'; 6 7 include('admin-header.php'); 6 8 7 9 $home = get_settings('home'); -
trunk/wp-admin/options-reading.php
r1810 r1818 1 1 <?php 2 require_once(' ../wp-includes/wp-l10n.php');2 require_once('admin.php'); 3 3 4 4 $title = __('Reading Options'); 5 include('options-head.php'); 5 $parent_file = 'options-general.php'; 6 7 include('admin-header.php'); 6 8 ?> 7 9 -
trunk/wp-admin/options-writing.php
r1810 r1818 1 1 <?php 2 require_once(' ../wp-includes/wp-l10n.php');2 require_once('admin.php'); 3 3 4 4 $title = __('Writing Options'); 5 include('./options-head.php'); 5 $parent_file = 'options-general.php'; 6 7 include('admin-header.php'); 6 8 ?> 7 9 -
trunk/wp-admin/options.php
r1751 r1818 1 1 <?php 2 require_once(' ../wp-includes/wp-l10n.php');2 require_once('admin.php'); 3 3 4 4 $title = __('Options'); … … 6 6 $parent_file = 'options-general.php'; 7 7 8 function add_magic_quotes($array) { 9 foreach ($array as $k => $v) { 10 if (is_array($v)) { 11 $array[$k] = add_magic_quotes($v); 12 } else { 13 $array[$k] = addslashes($v); 14 } 15 } 16 return $array; 17 } 18 19 if (!get_magic_quotes_gpc()) { 20 $_GET = add_magic_quotes($_GET); 21 $_POST = add_magic_quotes($_POST); 22 $_COOKIE = add_magic_quotes($_COOKIE); 23 } 24 25 $wpvarstoreset = array('action','standalone'); 8 $wpvarstoreset = array('action'); 26 9 for ($i=0; $i<count($wpvarstoreset); $i += 1) { 27 10 $wpvar = $wpvarstoreset[$i]; … … 42 25 43 26 case 'update': 44 $standalone = 1;45 include_once('./admin-header.php');46 27 $any_changed = 0; 47 28 … … 92 73 93 74 default: 94 $standalone = 0; 95 include_once('./admin-header.php'); 96 if ($user_level <= 6) { 97 die(__("You have do not have sufficient permissions to edit the options for this blog.")); 98 } 99 ?> 100 101 <?php include('options-head.php'); ?> 75 include('admin-header.php'); ?> 102 76 103 77 <div class="wrap"> -
trunk/wp-admin/plugins.php
r1711 r1818 1 1 <?php 2 require_once('admin.php'); 2 3 3 4 if ( isset($_GET['action']) ) { 4 $standalone = 1;5 require_once('admin-header.php');6 7 5 check_admin_referer(); 8 6 … … 25 23 } 26 24 27 require_once('../wp-includes/wp-l10n.php');28 25 $title = __('Manage Plugins'); 29 26 require_once('admin-header.php'); 30 31 if ($user_level < 9) // Must be at least level 932 die (__('Sorry, you must be at least a level 8 user to modify plugins.'));33 27 34 28 // Clean up options -
trunk/wp-admin/post.php
r1813 r1818 1 1 <?php 2 require_once('../wp-includes/wp-l10n.php'); 3 4 function add_magic_quotes($array) { 5 foreach ($array as $k => $v) { 6 if (is_array($v)) { 7 $array[$k] = add_magic_quotes($v); 8 } else { 9 $array[$k] = addslashes($v); 10 } 11 } 12 return $array; 13 } 14 15 if (!get_magic_quotes_gpc()) { 16 $_GET = add_magic_quotes($_GET); 17 $_POST = add_magic_quotes($_POST); 18 $_COOKIE = add_magic_quotes($_COOKIE); 19 } 2 require_once('admin.php'); 20 3 21 4 $wpvarstoreset = array('action', 'safe_mode', 'withcomments', 'posts', 'poststart', 'postend', 'content', 'edited_post_title', 'comment_error', 'profile', 'trackback_url', 'excerpt', 'showcomments', 'commentstart', 'commentend', 'commentorder', 'enclosure_url' ); … … 38 21 switch($action) { 39 22 case 'post': 40 $standalone = 1;41 23 require_once('admin-header.php'); 42 24 … … 184 166 $title = __('Edit'); 185 167 186 $standalone = 0;187 168 require_once('admin-header.php'); 188 169 … … 237 218 case 'editpost': 238 219 // die(var_dump('<pre>', $_POST)); 239 $standalone = 1;240 require_once('./admin-header.php');241 242 220 if (!isset($blog_ID)) { 243 221 $blog_ID = 1; … … 399 377 400 378 case 'delete': 401 402 $standalone = 1;403 require_once('./admin-header.php');404 405 379 check_admin_referer(); 406 380 … … 429 403 case 'editcomment': 430 404 $title = __('Edit Comment'); 431 $standalone = 0;432 405 $parent_file = 'edit.php'; 433 406 require_once ('admin-header.php'); … … 452 425 case 'confirmdeletecomment': 453 426 454 $standalone = 0;455 427 require_once('./admin-header.php'); 456 428 … … 488 460 case 'deletecomment': 489 461 490 $standalone = 1;491 require_once('./admin-header.php');492 493 462 check_admin_referer(); 494 463 … … 521 490 case 'unapprovecomment': 522 491 523 $standalone = 1;524 492 require_once('./admin-header.php'); 525 493 … … 552 520 case 'mailapprovecomment': 553 521 554 $standalone = 1;555 require_once('./admin-header.php');556 557 522 $comment = (int) $_GET['comment']; 558 523 … … 574 539 575 540 case 'approvecomment': 576 577 $standalone = 1;578 require_once('./admin-header.php');579 541 580 542 $comment = $_GET['comment']; … … 606 568 607 569 case 'editedcomment': 608 609 $standalone = 1;610 require_once('./admin-header.php');611 570 612 571 $comment_ID = $_POST['comment_ID']; … … 654 613 655 614 default: 656 $standalone = 0;657 615 $title = __('Create New Post'); 658 616 require_once ('./admin-header.php'); -
trunk/wp-admin/profile.php
r1768 r1818 1 1 <?php 2 require_once(' ../wp-includes/wp-l10n.php');2 require_once('admin.php'); 3 3 4 4 $title = "Profile"; 5 5 $parent_file = 'profile.php'; 6 6 7 function add_magic_quotes($array) { 8 foreach ($array as $k => $v) { 9 if (is_array($v)) { 10 $array[$k] = add_magic_quotes($v); 11 } else { 12 $array[$k] = addslashes($v); 13 } 14 } 15 return $array; 16 } 17 18 if (!get_magic_quotes_gpc()) { 19 $_GET = add_magic_quotes($_GET); 20 $_POST = add_magic_quotes($_POST); 21 $_COOKIE = add_magic_quotes($_COOKIE); 22 } 23 24 $wpvarstoreset = array('action','standalone','redirect','profile','user'); 7 $wpvarstoreset = array('action','redirect','profile','user'); 25 8 for ($i=0; $i<count($wpvarstoreset); $i += 1) { 26 9 $wpvar = $wpvarstoreset[$i]; -
trunk/wp-admin/templates.php
r1703 r1818 1 1 <?php 2 require_once('../wp-includes/wp-l10n.php'); 3 2 require_once('admin.php'); 4 3 $title = __('Template & file editing'); 5 4 $parent_file = 'themes.php'; 6 7 function add_magic_quotes($array) {8 foreach ($array as $k => $v) {9 if (is_array($v)) {10 $array[$k] = add_magic_quotes($v);11 } else {12 $array[$k] = addslashes($v);13 }14 }15 return $array;16 }17 5 18 6 function validate_file($file) { … … 32 20 } 33 21 34 if (!get_magic_quotes_gpc()) { 35 $_GET = add_magic_quotes($_GET); 36 $_POST = add_magic_quotes($_POST); 37 $_COOKIE = add_magic_quotes($_COOKIE); 38 } 39 40 $wpvarstoreset = array('action','standalone','redirect','profile','error','warning','a','file'); 22 $wpvarstoreset = array('action','redirect','profile','error','warning','a','file'); 41 23 for ($i=0; $i<count($wpvarstoreset); $i += 1) { 42 24 $wpvar = $wpvarstoreset[$i]; … … 57 39 58 40 case 'update': 59 60 $standalone = 1;61 require_once('./admin-header.php');62 41 63 42 if ($user_level < 5) { -
trunk/wp-admin/theme-editor.php
r1703 r1818 1 1 <?php 2 require_once(' ../wp-includes/wp-l10n.php');2 require_once('admin.php'); 3 3 4 4 $title = __("Template & file editing"); 5 5 $parent_file = 'themes.php'; 6 7 function add_magic_quotes($array) {8 foreach ($array as $k => $v) {9 if (is_array($v)) {10 $array[$k] = add_magic_quotes($v);11 } else {12 $array[$k] = addslashes($v);13 }14 }15 return $array;16 }17 6 18 7 function validate_file($file) { … … 32 21 } 33 22 34 if (!get_magic_quotes_gpc()) { 35 $_GET = add_magic_quotes($_GET); 36 $_POST = add_magic_quotes($_POST); 37 $_COOKIE = add_magic_quotes($_COOKIE); 38 } 39 40 $wpvarstoreset = array('action','standalone','redirect','profile','error','warning','a','file', 'theme'); 23 $wpvarstoreset = array('action','redirect','profile','error','warning','a','file', 'theme'); 41 24 for ($i=0; $i<count($wpvarstoreset); $i += 1) { 42 25 $wpvar = $wpvarstoreset[$i]; … … 57 40 58 41 case 'update': 59 60 $standalone = 1;61 require_once("admin-header.php");62 42 63 43 if ($user_level < 5) { -
trunk/wp-admin/themes.php
r1755 r1818 1 1 <?php 2 require_once('admin.php'); 2 3 3 4 if ( isset($_GET['action']) ) { 4 $standalone = 1;5 require_once('admin-header.php');6 7 5 check_admin_referer(); 8 6 … … 22 20 } 23 21 24 require_once('../wp-includes/wp-l10n.php');25 22 $title = __('Manage Themes'); 26 23 $parent_file = 'themes.php'; 27 24 require_once('admin-header.php'); 28 29 if ($user_level < 9)30 die (__('Sorry, you must be at least a level 9 user to modify themes.'));31 25 ?> 32 33 26 <?php if ( ! validate_current_theme() ) : ?> 34 27 <div class="updated"><p><?php _e('The active theme is broken. Reverting to the default theme.'); ?></p></div> -
trunk/wp-admin/user-edit.php
r1520 r1818 1 1 <?php 2 require_once(' ../wp-includes/wp-l10n.php');2 require_once('admin.php'); 3 3 4 4 $title = __('Edit User'); 5 5 6 function add_magic_quotes($array) { 7 foreach ($array as $k => $v) { 8 if (is_array($v)) { 9 $array[$k] = add_magic_quotes($v); 10 } else { 11 $array[$k] = addslashes($v); 12 } 13 } 14 return $array; 15 } 16 17 if (!get_magic_quotes_gpc()) { 18 $_POST = add_magic_quotes($_POST); 19 } 20 21 $wpvarstoreset = array('action', 'standalone', 'redirect', 'profile', 'user_id'); 6 $wpvarstoreset = array('action', 'redirect', 'profile', 'user_id'); 22 7 for ($i=0; $i<count($wpvarstoreset); $i += 1) { 23 8 $wpvar = $wpvarstoreset[$i]; … … 84 69 case 'switchposts': 85 70 86 $standalone = 1;87 require_once('admin-header.php');88 89 71 check_admin_referer(); 90 72 … … 95 77 default: 96 78 97 $standalone = 0;98 79 include ('admin-header.php'); 99 80 -
trunk/wp-admin/users.php
r1733 r1818 1 1 <?php 2 require_once(' ../wp-includes/wp-l10n.php');2 require_once('admin.php'); 3 3 4 4 $title = __('Users'); … … 23 23 switch ($action) { 24 24 case 'adduser': 25 $standalone = 1;26 require_once('admin-header.php');27 28 25 check_admin_referer(); 29 26 … … 101 98 102 99 case 'promote': 103 104 $standalone = 1;105 require_once('admin-header.php');106 107 100 check_admin_referer(); 108 101 … … 135 128 136 129 case 'delete': 137 138 $standalone = 1;139 require_once('admin-header.php');140 130 141 131 check_admin_referer(); … … 177 167 default: 178 168 179 $standalone = 0;180 169 include ('admin-header.php'); 181 170 ?> -
trunk/wp-includes/functions.php
r1812 r1818 2236 2236 } 2237 2237 2238 function is_plugin_page() { 2239 global $plugin_page; 2240 2241 if (isset($plugin_page)) { 2242 return true; 2243 } 2244 2245 return false; 2246 } 2247 2238 2248 ?>
Note: See TracChangeset
for help on using the changeset viewer.