Move media settings to options-media.php. see #7552

git-svn-id: http://svn.automattic.com/wordpress/trunk@8905 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-09-16 22:37:49 +00:00
parent 525e7a17b9
commit 7fb115c7dd
4 changed files with 137 additions and 92 deletions

View File

@ -64,9 +64,10 @@ $menu[20] = array(__('Settings'), '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(__('Privacy'), 'manage_options', 'options-privacy.php');
$submenu['options-general.php'][35] = array(__('Permalinks'), 'manage_options', 'options-permalink.php');
$submenu['options-general.php'][40] = array(__('Miscellaneous'), 'manage_options', 'options-misc.php');
$submenu['options-general.php'][30] = array(__('Media'), 'manage_options', 'options-media.php');
$submenu['options-general.php'][35] = array(__('Privacy'), 'manage_options', 'options-privacy.php');
$submenu['options-general.php'][40] = array(__('Permalinks'), 'manage_options', 'options-permalink.php');
$submenu['options-general.php'][45] = array(__('Miscellaneous'), 'manage_options', 'options-misc.php');
$menu[25] = array( __('Plugins'), 'activate_plugins', 'plugins.php' );
$submenu['plugins.php'][5] = array( __('Plugins'), 'activate_plugins', 'plugins.php' );

131
wp-admin/options-media.php Normal file
View File

@ -0,0 +1,131 @@
<?php
/**
* Miscellaneous settings administration panel.
*
* @package WordPress
* @subpackage Administration
*/
/** WordPress Administration Bootstrap */
require_once('admin.php');
$title = __('Miscellaneous Settings');
$parent_file = 'options-general.php';
include('admin-header.php');
?>
<div class="wrap">
<h2><?php _e('Media Settings') ?></h2>
<form action="options.php" method="post">
<p><?php _e('The setting below determines where images, documents, and other media files will be linked to when inserted into the body of a post.'); ?></p>
<table class="form-table">
<tr valign="top">
<th scope="row"><?php _e('Default media links') ?></th>
<td><fieldset><legend class="hidden"><?php _e('Default image links') ?></legend>
<?php
$link_types = array('none' => 'None', 'post' => 'Post URL', 'file' => 'File');
$default_link_type = get_option('image_default_link_type');
if ( empty($default_link_type) )
$default_link_type = 'file';
foreach ($link_types as $type => $name) { ?>
<input type="radio" name="image_default_link_type" id="image_default_link_type_<?php echo $type; ?>" value="<?php echo $type; ?>"<?php echo ($default_link_type == $type ? ' checked="checked"' : ''); ?> />
<label for="image_default_link_type_<?php echo $type; ?>"><?php _e($name); ?></label>
<?php
}
?>
</fieldset></td>
</tr>
</table>
<h3><?php _e('Image sizes') ?></h3>
<p><?php _e('The sizes listed below determine the maximum dimensions to use when inserting an image into the body of a post.'); ?></p>
<table class="form-table">
<tr valign="top">
<th scope="row"><?php _e('Thumbnail size') ?></th>
<td>
<label for="thumbnail_size_w"><?php _e('Width'); ?></label>
<input name="thumbnail_size_w" type="text" id="thumbnail_size_w" value="<?php form_option('thumbnail_size_w'); ?>" size="6" />
<label for="thumbnail_size_h"><?php _e('Height'); ?></label>
<input name="thumbnail_size_h" type="text" id="thumbnail_size_h" value="<?php form_option('thumbnail_size_h'); ?>" size="6" /><br />
<input name="thumbnail_crop" type="checkbox" id="thumbnail_crop" value="1" <?php checked('1', get_option('thumbnail_crop')); ?>/>
<label for="thumbnail_crop"><?php _e('Crop thumbnail to exact dimensions (normally thumbnails are proportional)'); ?></label>
</td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Medium size') ?></th>
<td><fieldset><legend class="hidden"><?php _e('Medium size') ?></legend>
<label for="medium_size_w"><?php _e('Max Width'); ?></label>
<input name="medium_size_w" type="text" id="medium_size_w" value="<?php form_option('medium_size_w'); ?>" size="6" />
<label for="medium_size_h"><?php _e('Max Height'); ?></label>
<input name="medium_size_h" type="text" id="medium_size_h" value="<?php form_option('medium_size_h'); ?>" size="6" />
</fieldset></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Large size') ?></th>
<td><fieldset><legend class="hidden"><?php _e('Large size') ?></legend>
<label for="large_size_w"><?php _e('Max Width'); ?></label>
<input name="large_size_w" type="text" id="large_size_w" value="<?php form_option('large_size_w'); ?>" size="6" />
<label for="large_size_h"><?php _e('Max Height'); ?></label>
<input name="large_size_h" type="text" id="large_size_h" value="<?php form_option('large_size_h'); ?>" size="6" />
</fieldset></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Default image size') ?></th>
<td><fieldset><legend class="hidden"><?php _e('Default image size') ?></legend>
<?php
$size_names = array('' => 'Auto', 'thumbnail' => 'Thumbnail', 'medium' => 'Medium', 'large' => 'Large', 'full' => 'Full size');
foreach ($size_names as $size => $name) { ?>
<input type="radio" name="image_default_size" id="image_default_size_<?php echo $size; ?>" value="<?php echo $size; ?>"<?php echo (get_option('image_default_size') == $size ? ' checked="checked"' : ''); ?> />
<label for="image_default_size_<?php echo $size; ?>"><?php _e($name); ?></label>
<?php
}
?>
</fieldset></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Default image alignment') ?></th>
<td><fieldset><legend class="hidden"><?php _e('Default image alignment') ?></legend>
<?php
$alignments = array('none' => 'None', 'left' => 'Left', 'center' => 'Center', 'right' => 'Right');
$default_align = get_option('image_default_align');
if ( empty($default_align) )
$default_align = 'none';
foreach ($alignments as $align => $name) { ?>
<input type="radio" name="image_default_align" id="image_default_align_<?php echo $align; ?>" value="<?php echo $align; ?>"<?php echo ($default_align == $align ? ' checked="checked"' : ''); ?> />
<label for="image_default_align_<?php echo $align; ?>"><?php _e($name); ?></label>
<?php
}
?>
</fieldset></td>
</tr>
<?php do_settings_fields('media', 'default'); ?>
</table>
<?php do_settings_sections('media'); ?>
<p class="submit">
<input type="hidden" name="action" value="update" />
<?php wp_nonce_field( 'media-options' ); ?>
<input type='hidden' name='option_page' value='media' />
<input type="hidden" name="page_options" value="thumbnail_size_w,thumbnail_size_h,thumbnail_crop,medium_size_w,medium_size_h,image_default_size,image_default_align,image_default_link_type,large_size_w,large_size_h" />
<input type="submit" name="Submit" value="<?php _e('Save Changes') ?>" />
</p>
</form>
</div>
<?php include('./admin-footer.php'); ?>

View File

@ -48,94 +48,6 @@ include('admin-header.php');
<?php do_settings_fields('misc', 'default'); ?>
</table>
<h3><?php _e('Image sizes') ?></h3>
<p><?php _e('The sizes listed below determine the maximum dimensions to use when inserting an image into the body of a post.'); ?></p>
<table class="form-table">
<tr valign="top">
<th scope="row"><?php _e('Thumbnail size') ?></th>
<td><fieldset><legend class="hidden"><?php _e('Thumbnail size') ?></legend>
<label for="thumbnail_size_w"><?php _e('Width'); ?></label>
<input name="thumbnail_size_w" type="text" id="thumbnail_size_w" value="<?php form_option('thumbnail_size_w'); ?>" size="6" />
<label for="thumbnail_size_h"><?php _e('Height'); ?></label>
<input name="thumbnail_size_h" type="text" id="thumbnail_size_h" value="<?php form_option('thumbnail_size_h'); ?>" size="6" /><br />
<input name="thumbnail_crop" type="checkbox" id="thumbnail_crop" value="1" <?php checked('1', get_option('thumbnail_crop')); ?>/>
<label for="thumbnail_crop"><?php _e('Crop thumbnail to exact dimensions (normally thumbnails are proportional)'); ?></label>
</fieldset></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Medium size') ?></th>
<td><fieldset><legend class="hidden"><?php _e('Medium size') ?></legend>
<label for="medium_size_w"><?php _e('Max Width'); ?></label>
<input name="medium_size_w" type="text" id="medium_size_w" value="<?php form_option('medium_size_w'); ?>" size="6" />
<label for="medium_size_h"><?php _e('Max Height'); ?></label>
<input name="medium_size_h" type="text" id="medium_size_h" value="<?php form_option('medium_size_h'); ?>" size="6" />
</fieldset></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Large size') ?></th>
<td><fieldset><legend class="hidden"><?php _e('Large size') ?></legend>
<label for="large_size_w"><?php _e('Max Width'); ?></label>
<input name="large_size_w" type="text" id="large_size_w" value="<?php form_option('large_size_w'); ?>" size="6" />
<label for="large_size_h"><?php _e('Max Height'); ?></label>
<input name="large_size_h" type="text" id="large_size_h" value="<?php form_option('large_size_h'); ?>" size="6" />
</fieldset></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Default image size') ?></th>
<td><fieldset><legend class="hidden"><?php _e('Default image size') ?></legend>
<?php
$size_names = array('' => 'Auto', 'thumbnail' => 'Thumbnail', 'medium' => 'Medium', 'large' => 'Large', 'full' => 'Full size');
foreach ($size_names as $size => $name) { ?>
<input type="radio" name="image_default_size" id="image_default_size_<?php echo $size; ?>" value="<?php echo $size; ?>"<?php checked(get_option('image_default_size'), $size); ?> />
<label for="image_default_size_<?php echo $size; ?>"><?php _e($name); ?></label>
<?php
}
?>
</fieldset></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Default image alignment') ?></th>
<td><fieldset><legend class="hidden"><?php _e('Default image alignment') ?></legend>
<?php
$alignments = array('none' => 'None', 'left' => 'Left', 'center' => 'Center', 'right' => 'Right');
$default_align = get_option('image_default_align');
if ( empty($default_align) )
$default_align = 'none';
foreach ($alignments as $align => $name) { ?>
<input type="radio" name="image_default_align" id="image_default_align_<?php echo $align; ?>" value="<?php echo $align; ?>"<?php checked($default_align, $align); ?> />
<label for="image_default_align_<?php echo $align; ?>"><?php _e($name); ?></label>
<?php
}
?>
</fieldset></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Default image links') ?></th>
<td><fieldset><legend class="hidden"><?php _e('Default image links') ?></legend>
<?php
$link_types = array('' => 'None', 'post' => 'Post URL', 'file' => 'File');
foreach ($link_types as $type => $name) { ?>
<input type="radio" name="image_default_link_type" id="image_default_link_type_<?php echo $type; ?>" value="<?php echo $type; ?>"<?php checked(get_option('image_default_link_type'), $type); ?> />
<label for="image_default_link_type_<?php echo $type; ?>"><?php _e($name); ?></label>
<?php
}
?>
</fieldset></td>
</tr>
<?php do_settings_fields('misc', 'images'); ?>
</table>
<table class="form-table">
<tr>

View File

@ -25,6 +25,7 @@ $whitelist_options = array(
'general' => array('blogname', 'blogdescription', 'admin_email', 'users_can_register', 'gmt_offset', 'date_format', 'time_format', 'start_of_week', 'comment_registration', 'default_role' ),
'discussion' => array( 'default_pingback_flag', 'default_ping_status', 'default_comment_status', 'comments_notify', 'moderation_notify', 'comment_moderation', 'require_name_email', 'comment_whitelist', 'comment_max_links', 'moderation_keys', 'blacklist_keys', 'show_avatars', 'avatar_rating', 'close_comments_for_old_posts', 'close_comments_days_old' ),
'misc' => array( 'hack_file', 'use_linksupdate', 'uploads_use_yearmonth_folders', 'upload_path', 'thumbnail_size_w', 'thumbnail_size_h', 'thumbnail_crop', 'medium_size_w', 'medium_size_h', 'image_default_size', 'image_default_align', 'image_default_link_type', 'large_size_w', 'large_size_h' ),
'media' => array( 'thumbnail_size_w', 'thumbnail_size_h', 'thumbnail_crop', 'medium_size_w', 'medium_size_h', 'large_size_w', 'large_size_h', 'image_default_size', 'image_default_align', 'image_default_link_type' ),
'privacy' => array( 'blog_public' ),
'reading' => array( 'posts_per_page', 'posts_per_rss', 'rss_use_excerpt', 'blog_charset', 'gzipcompression', 'show_on_front', 'page_on_front', 'page_for_posts' ),
'writing' => array( 'default_post_edit_rows', 'use_smilies', 'ping_sites', 'mailserver_url', 'mailserver_port', 'mailserver_login', 'mailserver_pass', 'default_category', 'default_email_category', 'use_balanceTags', 'default_link_category', 'enable_app', 'enable_xmlrpc' ),