web/wp-admin/options-media.php
changeset 194 32102edaa81b
parent 136 bde1974c263b
child 204 09a1c134465b
equal deleted inserted replaced
193:2f6f6f7551ca 194:32102edaa81b
     5  * @package WordPress
     5  * @package WordPress
     6  * @subpackage Administration
     6  * @subpackage Administration
     7  */
     7  */
     8 
     8 
     9 /** WordPress Administration Bootstrap */
     9 /** WordPress Administration Bootstrap */
    10 require_once('admin.php');
    10 require_once('./admin.php');
    11 
    11 
    12 if ( ! current_user_can('manage_options') )
    12 if ( ! current_user_can( 'manage_options' ) )
    13 	wp_die(__('You do not have sufficient permissions to manage options for this blog.'));
    13 	wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) );
    14 
    14 
    15 $title = __('Media Settings');
    15 $title = __('Media Settings');
    16 $parent_file = 'options-general.php';
    16 $parent_file = 'options-general.php';
    17 
    17 
    18 include('admin-header.php');
    18 $media_options_help = '<p>' . __('You can set maximum sizes for images inserted into your written content; you can also insert an image as Full Size.') . '</p>' .
       
    19 	'<p>' . __('The Embed option allows you embed a video, image, or other media content into your content automatically by typing the URL (of the web page where the file lives) on its own line when you create your content.');
       
    20 
       
    21 if ( ! empty( $content_width ) )
       
    22 	$media_options_help .= ' ' . __( 'If you do not set the maximum embed size, it will be automatically sized to fit into your content area.' );
       
    23 
       
    24 $media_options_help .= '</p>';
       
    25 
       
    26 if ( ! is_multisite() ) {
       
    27 	$media_options_help .= '<p>' . __('Uploading Files allows you to choose the folder and path for storing your uploaded files.') . '</p>';
       
    28 }
       
    29 
       
    30 $media_options_help .= '<p>' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '</p>';
       
    31 
       
    32 get_current_screen()->add_help_tab( array(
       
    33 	'id'      => 'overview',
       
    34 	'title'   => __('Overview'),
       
    35 	'content' => $media_options_help,
       
    36 ) );
       
    37 
       
    38 get_current_screen()->set_help_sidebar(
       
    39 	'<p><strong>' . __('For more information:') . '</strong></p>' .
       
    40 	'<p>' . __('<a href="http://codex.wordpress.org/Settings_Media_Screen" target="_blank">Documentation on Media Settings</a>') . '</p>' .
       
    41 	'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
       
    42 );
       
    43 
       
    44 include('./admin-header.php');
    19 
    45 
    20 ?>
    46 ?>
    21 
    47 
    22 <div class="wrap">
    48 <div class="wrap">
    23 <?php screen_icon(); ?>
    49 <?php screen_icon(); ?>
    32 <table class="form-table">
    58 <table class="form-table">
    33 <tr valign="top">
    59 <tr valign="top">
    34 <th scope="row"><?php _e('Thumbnail size') ?></th>
    60 <th scope="row"><?php _e('Thumbnail size') ?></th>
    35 <td>
    61 <td>
    36 <label for="thumbnail_size_w"><?php _e('Width'); ?></label>
    62 <label for="thumbnail_size_w"><?php _e('Width'); ?></label>
    37 <input name="thumbnail_size_w" type="text" id="thumbnail_size_w" value="<?php form_option('thumbnail_size_w'); ?>" class="small-text" />
    63 <input name="thumbnail_size_w" type="number" step="1" min="0" id="thumbnail_size_w" value="<?php form_option('thumbnail_size_w'); ?>" class="small-text" />
    38 <label for="thumbnail_size_h"><?php _e('Height'); ?></label>
    64 <label for="thumbnail_size_h"><?php _e('Height'); ?></label>
    39 <input name="thumbnail_size_h" type="text" id="thumbnail_size_h" value="<?php form_option('thumbnail_size_h'); ?>" class="small-text" /><br />
    65 <input name="thumbnail_size_h" type="number" step="1" min="0" id="thumbnail_size_h" value="<?php form_option('thumbnail_size_h'); ?>" class="small-text" /><br />
    40 <input name="thumbnail_crop" type="checkbox" id="thumbnail_crop" value="1" <?php checked('1', get_option('thumbnail_crop')); ?>/>
    66 <input name="thumbnail_crop" type="checkbox" id="thumbnail_crop" value="1" <?php checked('1', get_option('thumbnail_crop')); ?>/>
    41 <label for="thumbnail_crop"><?php _e('Crop thumbnail to exact dimensions (normally thumbnails are proportional)'); ?></label>
    67 <label for="thumbnail_crop"><?php _e('Crop thumbnail to exact dimensions (normally thumbnails are proportional)'); ?></label>
    42 </td>
    68 </td>
    43 </tr>
    69 </tr>
    44 
    70 
    45 <tr valign="top">
    71 <tr valign="top">
    46 <th scope="row"><?php _e('Medium size') ?></th>
    72 <th scope="row"><?php _e('Medium size') ?></th>
    47 <td><fieldset><legend class="screen-reader-text"><span><?php _e('Medium size'); ?></span></legend>
    73 <td><fieldset><legend class="screen-reader-text"><span><?php _e('Medium size'); ?></span></legend>
    48 <label for="medium_size_w"><?php _e('Max Width'); ?></label>
    74 <label for="medium_size_w"><?php _e('Max Width'); ?></label>
    49 <input name="medium_size_w" type="text" id="medium_size_w" value="<?php form_option('medium_size_w'); ?>" class="small-text" />
    75 <input name="medium_size_w" type="number" step="1" min="0" id="medium_size_w" value="<?php form_option('medium_size_w'); ?>" class="small-text" />
    50 <label for="medium_size_h"><?php _e('Max Height'); ?></label>
    76 <label for="medium_size_h"><?php _e('Max Height'); ?></label>
    51 <input name="medium_size_h" type="text" id="medium_size_h" value="<?php form_option('medium_size_h'); ?>" class="small-text" />
    77 <input name="medium_size_h" type="number" step="1" min="0" id="medium_size_h" value="<?php form_option('medium_size_h'); ?>" class="small-text" />
    52 </fieldset></td>
    78 </fieldset></td>
    53 </tr>
    79 </tr>
    54 
    80 
    55 <tr valign="top">
    81 <tr valign="top">
    56 <th scope="row"><?php _e('Large size') ?></th>
    82 <th scope="row"><?php _e('Large size') ?></th>
    57 <td><fieldset><legend class="screen-reader-text"><span><?php _e('Large size'); ?></span></legend>
    83 <td><fieldset><legend class="screen-reader-text"><span><?php _e('Large size'); ?></span></legend>
    58 <label for="large_size_w"><?php _e('Max Width'); ?></label>
    84 <label for="large_size_w"><?php _e('Max Width'); ?></label>
    59 <input name="large_size_w" type="text" id="large_size_w" value="<?php form_option('large_size_w'); ?>" class="small-text" />
    85 <input name="large_size_w" type="number" step="1" min="0" id="large_size_w" value="<?php form_option('large_size_w'); ?>" class="small-text" />
    60 <label for="large_size_h"><?php _e('Max Height'); ?></label>
    86 <label for="large_size_h"><?php _e('Max Height'); ?></label>
    61 <input name="large_size_h" type="text" id="large_size_h" value="<?php form_option('large_size_h'); ?>" class="small-text" />
    87 <input name="large_size_h" type="number" step="1" min="0" id="large_size_h" value="<?php form_option('large_size_h'); ?>" class="small-text" />
    62 </fieldset></td>
    88 </fieldset></td>
    63 </tr>
    89 </tr>
    64 
    90 
    65 <?php do_settings_fields('media', 'default'); ?>
    91 <?php do_settings_fields('media', 'default'); ?>
    66 </table>
    92 </table>
    69 
    95 
    70 <table class="form-table">
    96 <table class="form-table">
    71 
    97 
    72 <tr valign="top">
    98 <tr valign="top">
    73 <th scope="row"><?php _e('Auto-embeds'); ?></th>
    99 <th scope="row"><?php _e('Auto-embeds'); ?></th>
    74 <td><fieldset><legend class="screen-reader-text"><span><?php _e('Attempt to automatically embed all plain text URLs'); ?></span></legend>
   100 <td><fieldset><legend class="screen-reader-text"><span><?php _e('When possible, embed the media content from a URL directly onto the page. For example: links to Flickr and YouTube.'); ?></span></legend>
    75 <label for="embed_autourls"><input name="embed_autourls" type="checkbox" id="embed_autourls" value="1" <?php checked( '1', get_option('embed_autourls') ); ?>/> <?php _e('Attempt to automatically embed all plain text URLs'); ?></label>
   101 <label for="embed_autourls"><input name="embed_autourls" type="checkbox" id="embed_autourls" value="1" <?php checked( '1', get_option('embed_autourls') ); ?>/> <?php _e('When possible, embed the media content from a URL directly onto the page. For example: links to Flickr and YouTube.'); ?></label>
    76 </fieldset></td>
   102 </fieldset></td>
    77 </tr>
   103 </tr>
    78 
   104 
    79 <tr valign="top">
   105 <tr valign="top">
    80 <th scope="row"><?php _e('Maximum embed size') ?></th>
   106 <th scope="row"><?php _e('Maximum embed size') ?></th>
    81 <td>
   107 <td>
    82 <label for="embed_size_w"><?php _e('Width'); ?></label>
   108 <label for="embed_size_w"><?php _e('Width'); ?></label>
    83 <input name="embed_size_w" type="text" id="embed_size_w" value="<?php form_option('embed_size_w'); ?>" class="small-text" />
   109 <input name="embed_size_w" type="number" step="1" min="0" id="embed_size_w" value="<?php form_option('embed_size_w'); ?>" class="small-text" />
    84 <label for="embed_size_h"><?php _e('Height'); ?></label>
   110 <label for="embed_size_h"><?php _e('Height'); ?></label>
    85 <input name="embed_size_h" type="text" id="embed_size_h" value="<?php form_option('embed_size_h'); ?>" class="small-text" />
   111 <input name="embed_size_h" type="number" step="1" min="0" id="embed_size_h" value="<?php form_option('embed_size_h'); ?>" class="small-text" />
    86 <?php if ( !empty($content_width) ) echo '<br />' . __("If the width value is left blank, embeds will default to the max width of your theme."); ?>
   112 <?php if ( ! empty( $content_width ) )
       
   113 	echo '<p class="description">' . __( 'If the width value is left blank, embeds will default to the max width of your theme.' ) . '</p>';
       
   114 ?>
    87 </td>
   115 </td>
    88 </tr>
   116 </tr>
    89 
   117 
    90 <?php do_settings_fields('media', 'embeds'); ?>
   118 <?php do_settings_fields('media', 'embeds'); ?>
    91 </table>
   119 </table>
    92 
   120 
       
   121 <?php if ( !is_multisite() ) : ?>
       
   122 <h3><?php _e('Uploading Files'); ?></h3>
       
   123 <table class="form-table">
       
   124 <tr valign="top">
       
   125 <th scope="row"><label for="upload_path"><?php _e('Store uploads in this folder'); ?></label></th>
       
   126 <td><input name="upload_path" type="text" id="upload_path" value="<?php echo esc_attr(get_option('upload_path')); ?>" class="regular-text code" />
       
   127 <p class="description"><?php _e('Default is <code>wp-content/uploads</code>'); ?></p>
       
   128 </td>
       
   129 </tr>
       
   130 
       
   131 <tr valign="top">
       
   132 <th scope="row"><label for="upload_url_path"><?php _e('Full URL path to files'); ?></label></th>
       
   133 <td><input name="upload_url_path" type="text" id="upload_url_path" value="<?php echo esc_attr( get_option('upload_url_path')); ?>" class="regular-text code" />
       
   134 <p class="description"><?php _e('Configuring this is optional. By default, it should be blank.'); ?></p>
       
   135 </td>
       
   136 </tr>
       
   137 
       
   138 <tr>
       
   139 <th scope="row" colspan="2" class="th-full">
       
   140 <label for="uploads_use_yearmonth_folders">
       
   141 <input name="uploads_use_yearmonth_folders" type="checkbox" id="uploads_use_yearmonth_folders" value="1"<?php checked('1', get_option('uploads_use_yearmonth_folders')); ?> />
       
   142 <?php _e('Organize my uploads into month- and year-based folders'); ?>
       
   143 </label>
       
   144 </th>
       
   145 </tr>
       
   146 
       
   147 <?php do_settings_fields('media', 'uploads'); ?>
       
   148 </table>
       
   149 <?php endif; ?>
       
   150 
    93 <?php do_settings_sections('media'); ?>
   151 <?php do_settings_sections('media'); ?>
    94 
   152 
    95 <p class="submit">
   153 <?php submit_button(); ?>
    96 	<input type="submit" name="Submit" class="button-primary" value="<?php esc_attr_e('Save Changes') ?>" />
       
    97 </p>
       
    98 
   154 
    99 </form>
   155 </form>
   100 
   156 
   101 </div>
   157 </div>
   102 
   158