WordPress/wp-admin/options-media.php
ryan bd78058d90 Use settings_fields()
git-svn-id: http://svn.automattic.com/wordpress/trunk@9954 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-11-28 21:57:58 +00:00

131 lines
5.2 KiB
PHP

<?php
/**
* Media settings administration panel.
*
* @package WordPress
* @subpackage Administration
*/
/** WordPress Administration Bootstrap */
require_once('admin.php');
$title = __('Media Settings');
$parent_file = 'options-general.php';
include('admin-header.php');
?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php echo wp_specialchars( $title ); ?></h2>
<form action="options.php" method="post">
<?php settings_fields('media'); ?>
<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 echo $name; ?></label>
<?php
}
?>
</fieldset></td>
</tr>
</table>
<h3><?php _e('Image sizes') ?></h3>
<p><?php _e('The sizes listed below determine the maximum dimensions in pixels 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'); ?>" class="small-text" />
<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'); ?>" class="small-text" /><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'); ?>" class="small-text" />
<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'); ?>" class="small-text" />
</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'); ?>" class="small-text" />
<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'); ?>" class="small-text" />
</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 echo $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="submit" name="Submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
</p>
</form>
</div>
<?php include('./admin-footer.php'); ?>