Removing personal options, putting on profile page. Fixes #1557

git-svn-id: http://svn.automattic.com/wordpress/trunk@3112 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
matt 2005-11-16 23:32:38 +00:00
parent 4eb19bcf5e
commit d0aa219739
13 changed files with 32 additions and 70 deletions

View File

@ -1276,7 +1276,7 @@ function add_submenu_page($parent, $page_title, $menu_title, $access_level, $fil
}
function add_options_page($page_title, $menu_title, $access_level, $file, $function = '') {
return add_submenu_page('options-personal.php', $page_title, $menu_title, $access_level, $file, $function);
return add_submenu_page('options-general.php', $page_title, $menu_title, $access_level, $file, $function);
}
function add_management_page($page_title, $menu_title, $access_level, $file, $function = '') {

View File

@ -260,7 +260,7 @@ function ajaxNewCat() {
<?php
require(ABSPATH . '/wp-admin/menu-header.php');
if ( $parent_file == 'options-personal.php' ) {
if ( $parent_file == 'options-general.php' ) {
require(ABSPATH . '/wp-admin/options-head.php');
}
?>

View File

@ -14,7 +14,7 @@ if ( current_user_can('edit_users') )
$menu[35] = array(__('Users'), 'read', 'profile.php');
else
$menu[35] = array(__('Profile'), 'read', 'profile.php');
$menu[40] = array(__('Options'), 'read', 'options-personal.php');
$menu[40] = array(__('Options'), 'read', 'options-general.php');
$menu[45] = array(__('Import'), 'import', 'import.php');
if ( get_option('use_fileupload') )
@ -39,13 +39,12 @@ $submenu['link-manager.php'][20] = array(__('Import Links'), 'manage_links', 'li
$submenu['profile.php'][5] = array(__('Your Profile'), 'read', 'profile.php');
$submenu['profile.php'][10] = array(__('Authors &amp; Users'), 'edit_users', 'users.php');
$submenu['options-personal.php'][5] = array(__('Personal'), 'read', 'options-personal.php');
$submenu['options-personal.php'][10] = array(__('General'), 'manage_options', 'options-general.php');
$submenu['options-personal.php'][15] = array(__('Writing'), 'manage_options', 'options-writing.php');
$submenu['options-personal.php'][20] = array(__('Reading'), 'manage_options', 'options-reading.php');
$submenu['options-personal.php'][25] = array(__('Discussion'), 'manage_options', 'options-discussion.php');
$submenu['options-personal.php'][30] = array(__('Permalinks'), 'manage_options', 'options-permalink.php');
$submenu['options-personal.php'][35] = array(__('Miscellaneous'), 'manage_options', 'options-misc.php');
$submenu['options-general.php'][10] = array(__('General'), 'manage_options', 'options-general.php');
$submenu['options-general.php'][15] = array(__('Writing'), 'manage_options', 'options-writing.php');
$submenu['options-general.php'][20] = array(__('Reading'), 'manage_options', 'options-reading.php');
$submenu['options-general.php'][25] = array(__('Discussion'), 'manage_options', 'options-discussion.php');
$submenu['options-general.php'][30] = array(__('Permalinks'), 'manage_options', 'options-permalink.php');
$submenu['options-general.php'][35] = array(__('Miscellaneous'), 'manage_options', 'options-misc.php');
$submenu['plugins.php'][5] = array(__('Plugins'), 'activate_plugins', 'plugins.php');
$submenu['plugins.php'][10] = array(__('Plugin Editor'), 'edit_plugins', 'plugin-editor.php');

View File

@ -2,7 +2,7 @@
require_once('admin.php');
$title = __('Discussion Options');
$parent_file = 'options-personal.php';
$parent_file = 'options-general.php';
include('admin-header.php');

View File

@ -2,7 +2,7 @@
require_once('admin.php');
$title = __('General Options');
$parent_file = 'options-personal.php';
$parent_file = 'options-general.php';
include('admin-header.php');
?>

View File

@ -2,7 +2,7 @@
require_once('admin.php');
$title = __('Miscellaneous Options');
$parent_file = 'options-personal.php';
$parent_file = 'options-general.php';
include('admin-header.php');

View File

@ -2,7 +2,7 @@
require_once('admin.php');
$title = __('Permalink Options');
$parent_file = 'options-personal.php';
$parent_file = 'options-general.php';
function add_js() {
?>

View File

@ -1,18 +0,0 @@
<?php
require_once('admin.php');
check_admin_referer();
if ( isset( $_POST['action'] ) ) {
if ( !isset( $_POST['rich_editing'] ) )
$_POST['rich_editing'] = 'false';
update_user_option( $current_user->id, 'rich_editing', $wpdb->escape($_POST['rich_editing']), true );
do_action('personal_options_update');
$goback = add_query_arg('updated', 'true', $_SERVER['HTTP_REFERER']);
$goback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $goback);
wp_redirect($goback);
}
?>

View File

@ -1,36 +0,0 @@
<?php
require_once('admin.php');
$title = __('Personal Options');
$parent_file = 'options-personal.php';
include('admin-header.php');
?>
<div class="wrap">
<h2><?php _e('Personal Options') ?></h2>
<form id="personal-options" method="post" action="options-personal-update.php">
<fieldset>
<p><?php _e('Personal options are just for you, they don&#8217;t affect other users on blog.'); ?><input type="hidden" name="action" value="update" />
<input type="hidden" name="page_options" value="rich_editing<?php do_action('personal_option_list'); ?>" /></p>
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
<tr valign="top">
<th width="33%" scope="row"><?php _e('Editing:') ?></th>
<td><label for="rich_editing">
<input name="rich_editing" type="checkbox" id="rich_editing" value="true" <?php checked('true', get_user_option('rich_editing')); ?> />
<?php _e('Use the visual rich editor when writing') ?></label></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('More:') ?></th>
<td>We should really figure out what else to put here.</td>
</tr>
<?php do_action('personal_options_table'); ?>
</table>
</fieldset>
<p class="submit">
<input type="submit" name="Submit" value="<?php _e('Update Personal Options') ?> &raquo;" />
</p>
</form>
</div>
<?php include('admin-footer.php'); ?>

View File

@ -2,7 +2,7 @@
require_once('admin.php');
$title = __('Reading Options');
$parent_file = 'options-personal.php';
$parent_file = 'options-general.php';
include('admin-header.php');
?>

View File

@ -2,7 +2,7 @@
require_once('admin.php');
$title = __('Writing Options');
$parent_file = 'options-personal.php';
$parent_file = 'options-general.php';
include('admin-header.php');
?>

View File

@ -4,6 +4,9 @@ require_once('admin.php');
check_admin_referer();
if ( !$_POST )
die( __('No post?') );
$errors = edit_user($user_ID);
if (count($errors) != 0) {
@ -13,6 +16,12 @@ if (count($errors) != 0) {
exit;
}
if ( !isset( $_POST['rich_editing'] ) )
$_POST['rich_editing'] = 'false';
update_user_option( $current_user->id, 'rich_editing', $_POST['rich_editing'], true );
do_action('personal_options_update');
if ( 'profile' == $_POST['from'] )
$to = 'profile.php?updated=true';
else

View File

@ -105,6 +105,14 @@ if ( $show_password_fields ) :
<?php do_action('show_user_profile'); ?>
<br clear="all" />
<h3><?php _e('Personal Options'); ?></h3>
<p><label for="rich_editing"><input name="rich_editing" type="checkbox" id="rich_editing" value="true" <?php checked('true', get_user_option('rich_editing')); ?> />
<?php _e('Use the visual rich editor when writing') ?></label></p>
<?php do_action('profile_personal_options'); ?>
<table width="99%" border="0" cellspacing="2" cellpadding="3" class="editform">
<?php
if(count($profileuser->caps) > count($profileuser->roles)):