author | Anthony Ly <anthonyly.com@gmail.com> |
Wed, 19 Dec 2012 17:46:52 -0800 | |
changeset 204 | 09a1c134465b |
parent 194 | 32102edaa81b |
permissions | -rw-r--r-- |
136 | 1 |
<?php |
2 |
/** |
|
3 |
* Media settings administration panel. |
|
4 |
* |
|
5 |
* @package WordPress |
|
6 |
* @subpackage Administration |
|
7 |
*/ |
|
8 |
||
9 |
/** WordPress Administration Bootstrap */ |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
10 |
require_once('./admin.php'); |
136 | 11 |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
12 |
if ( ! current_user_can( 'manage_options' ) ) |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
13 |
wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) ); |
136 | 14 |
|
15 |
$title = __('Media Settings'); |
|
16 |
$parent_file = 'options-general.php'; |
|
17 |
||
204
09a1c134465b
man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents:
194
diff
changeset
|
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>'; |
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
19 |
|
204
09a1c134465b
man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents:
194
diff
changeset
|
20 |
if ( ! is_multisite() && ( get_option('upload_url_path') || ( get_option('upload_path') != 'wp-content/uploads' && get_option('upload_path') ) ) ) { |
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
21 |
$media_options_help .= '<p>' . __('Uploading Files allows you to choose the folder and path for storing your uploaded files.') . '</p>'; |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
22 |
} |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
23 |
|
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
24 |
$media_options_help .= '<p>' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '</p>'; |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
25 |
|
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
26 |
get_current_screen()->add_help_tab( array( |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
27 |
'id' => 'overview', |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
28 |
'title' => __('Overview'), |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
29 |
'content' => $media_options_help, |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
30 |
) ); |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
31 |
|
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
32 |
get_current_screen()->set_help_sidebar( |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
33 |
'<p><strong>' . __('For more information:') . '</strong></p>' . |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
34 |
'<p>' . __('<a href="http://codex.wordpress.org/Settings_Media_Screen" target="_blank">Documentation on Media Settings</a>') . '</p>' . |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
35 |
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
36 |
); |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
37 |
|
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
38 |
include('./admin-header.php'); |
136 | 39 |
|
40 |
?> |
|
41 |
||
42 |
<div class="wrap"> |
|
43 |
<?php screen_icon(); ?> |
|
44 |
<h2><?php echo esc_html( $title ); ?></h2> |
|
45 |
||
46 |
<form action="options.php" method="post"> |
|
47 |
<?php settings_fields('media'); ?> |
|
48 |
||
49 |
<h3><?php _e('Image sizes') ?></h3> |
|
50 |
<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> |
|
51 |
||
52 |
<table class="form-table"> |
|
53 |
<tr valign="top"> |
|
54 |
<th scope="row"><?php _e('Thumbnail size') ?></th> |
|
55 |
<td> |
|
56 |
<label for="thumbnail_size_w"><?php _e('Width'); ?></label> |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
57 |
<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" /> |
136 | 58 |
<label for="thumbnail_size_h"><?php _e('Height'); ?></label> |
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
59 |
<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 /> |
136 | 60 |
<input name="thumbnail_crop" type="checkbox" id="thumbnail_crop" value="1" <?php checked('1', get_option('thumbnail_crop')); ?>/> |
61 |
<label for="thumbnail_crop"><?php _e('Crop thumbnail to exact dimensions (normally thumbnails are proportional)'); ?></label> |
|
62 |
</td> |
|
63 |
</tr> |
|
64 |
||
65 |
<tr valign="top"> |
|
66 |
<th scope="row"><?php _e('Medium size') ?></th> |
|
67 |
<td><fieldset><legend class="screen-reader-text"><span><?php _e('Medium size'); ?></span></legend> |
|
68 |
<label for="medium_size_w"><?php _e('Max Width'); ?></label> |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
69 |
<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" /> |
136 | 70 |
<label for="medium_size_h"><?php _e('Max Height'); ?></label> |
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
71 |
<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" /> |
136 | 72 |
</fieldset></td> |
73 |
</tr> |
|
74 |
||
75 |
<tr valign="top"> |
|
76 |
<th scope="row"><?php _e('Large size') ?></th> |
|
77 |
<td><fieldset><legend class="screen-reader-text"><span><?php _e('Large size'); ?></span></legend> |
|
78 |
<label for="large_size_w"><?php _e('Max Width'); ?></label> |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
79 |
<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" /> |
136 | 80 |
<label for="large_size_h"><?php _e('Max Height'); ?></label> |
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
81 |
<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" /> |
136 | 82 |
</fieldset></td> |
83 |
</tr> |
|
84 |
||
85 |
<?php do_settings_fields('media', 'default'); ?> |
|
86 |
</table> |
|
87 |
||
204
09a1c134465b
man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents:
194
diff
changeset
|
88 |
<?php if ( isset( $GLOBALS['wp_settings']['media']['embeds'] ) ) : ?> |
136 | 89 |
<h3><?php _e('Embeds') ?></h3> |
90 |
<table class="form-table"> |
|
204
09a1c134465b
man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents:
194
diff
changeset
|
91 |
<?php do_settings_fields( 'media', 'embeds' ); ?> |
136 | 92 |
</table> |
204
09a1c134465b
man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents:
194
diff
changeset
|
93 |
<?php endif; ?> |
136 | 94 |
|
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
95 |
<?php if ( !is_multisite() ) : ?> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
96 |
<h3><?php _e('Uploading Files'); ?></h3> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
97 |
<table class="form-table"> |
204
09a1c134465b
man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents:
194
diff
changeset
|
98 |
<?php |
09a1c134465b
man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents:
194
diff
changeset
|
99 |
// If upload_url_path is not the default (empty), and upload_path is not the default ('wp-content/uploads' or empty) |
09a1c134465b
man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents:
194
diff
changeset
|
100 |
if ( get_option('upload_url_path') || ( get_option('upload_path') != 'wp-content/uploads' && get_option('upload_path') ) ) : |
09a1c134465b
man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents:
194
diff
changeset
|
101 |
?> |
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
102 |
<tr valign="top"> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
103 |
<th scope="row"><label for="upload_path"><?php _e('Store uploads in this folder'); ?></label></th> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
104 |
<td><input name="upload_path" type="text" id="upload_path" value="<?php echo esc_attr(get_option('upload_path')); ?>" class="regular-text code" /> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
105 |
<p class="description"><?php _e('Default is <code>wp-content/uploads</code>'); ?></p> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
106 |
</td> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
107 |
</tr> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
108 |
|
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
109 |
<tr valign="top"> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
110 |
<th scope="row"><label for="upload_url_path"><?php _e('Full URL path to files'); ?></label></th> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
111 |
<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" /> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
112 |
<p class="description"><?php _e('Configuring this is optional. By default, it should be blank.'); ?></p> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
113 |
</td> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
114 |
</tr> |
204
09a1c134465b
man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents:
194
diff
changeset
|
115 |
<?php endif; ?> |
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
116 |
<tr> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
117 |
<th scope="row" colspan="2" class="th-full"> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
118 |
<label for="uploads_use_yearmonth_folders"> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
119 |
<input name="uploads_use_yearmonth_folders" type="checkbox" id="uploads_use_yearmonth_folders" value="1"<?php checked('1', get_option('uploads_use_yearmonth_folders')); ?> /> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
120 |
<?php _e('Organize my uploads into month- and year-based folders'); ?> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
121 |
</label> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
122 |
</th> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
123 |
</tr> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
124 |
|
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
125 |
<?php do_settings_fields('media', 'uploads'); ?> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
126 |
</table> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
127 |
<?php endif; ?> |
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
128 |
|
136 | 129 |
<?php do_settings_sections('media'); ?> |
130 |
||
194
32102edaa81b
MAJ wordpress et ajout de plugin
Anthony Ly <anthonyly.com@gmail.com>
parents:
136
diff
changeset
|
131 |
<?php submit_button(); ?> |
136 | 132 |
|
133 |
</form> |
|
134 |
||
135 |
</div> |
|
136 |
||
137 |
<?php include('./admin-footer.php'); ?> |