Make WordPress Core

Ticket #12186: background-ui-tweaks.patch

File background-ui-tweaks.patch, 5.9 KB (added by TECannon, 15 years ago)

refines the ui (see #12699)

  • wp-admin/custom-background.php

     
    139139<div class="wrap" id="custom-background">
    140140<?php screen_icon(); ?>
    141141<h2><?php _e('Custom Background'); ?></h2>
     142
     143
    142144<?php if ( !empty($this->updated) ) { ?>
    143145<div id="message" class="updated">
    144146<p><?php printf(__('Background updated. <a href="%s">Visit your site</a> to see how it looks.'), home_url()); ?></p>
    145147</div>
    146148<?php } ?>
    147 <p><?php _e('This is your current background.'); ?></p>
     149
     150
     151
     152
    148153<?php
    149154        if ( $this->admin_image_div_callback ) {
    150155                call_user_func($this->admin_image_div_callback);
    151156        } else {
    152157?>
    153158
     159<!-- Start Background Image -->
     160<h3><?php _e('Background Image'); ?></h3>
     161<table class="form-table">
     162<tbody>
     163<tr valign="top">
     164<th scope="row"><?php _e('Current Image'); ?></th>
     165<td>
    154166<style type="text/css">
    155167#custom-background-image {
    156168        background-color: #<?php echo get_background_color()?>;
     
    170182<br class="clear" />
    171183</div>
    172184<?php } ?>
    173 <h3><?php _e('Change Display Options') ?></h3>
     185</td>
     186</tr>
     187
     188
     189<?php if ( get_background_image() ) : ?>
     190<tr valign="top">
     191<th scope="row"><?php _e('Remove Image'); ?></th>
     192<td><p><?php _e('This will remove the background image. You will not be able to restore any customizations.') ?></p>
    174193<form method="post" action="">
    175 <table>
    176 <thead>
    177 <tr>
    178 <th scope="col"><?php _e( 'Position' ); ?></th>
    179 <th scope="col"><?php _e( 'Repeat' ); ?></th>
    180 <th scope="col"><?php _e( 'Attachment' ); ?></th>
    181 <th scope="col"><?php _e( 'Color' ); ?></th>
     194<?php wp_nonce_field('custom-background'); ?>
     195<input type="submit" class="button" name="remove-background" value="<?php esc_attr_e('Remove Background'); ?>" />
     196</form>
     197</td>
    182198</tr>
     199<?php endif; ?>
    183200
     201
     202<tr valign="top">
     203<th scope="row"><?php _e('Upload Image'); ?></th>
     204<td><form enctype="multipart/form-data" id="uploadForm" method="POST" action="">
     205<label for="upload"><?php _e('Choose an image from your computer:'); ?></label><br /><input type="file" id="upload" name="import" />
     206<input type="hidden" name="action" value="save" />
     207<?php wp_nonce_field('custom-background') ?>
     208<p class="submit">
     209<input type="submit" value="<?php esc_attr_e('Upload'); ?>" />
     210</p>
     211</form>
     212</td>
     213</tbody>
     214</table>
     215
     216
     217<h3><?php _e('Display Options') ?></h3>
     218<form method="post" action="">
     219<table class="form-table">
    184220<tbody>
    185 <tr>
    186 <td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Position' ); ?></span></legend>
     221
     222<tr valign="top">
     223<th scope="row"><?php _e( 'Background Color' ); ?></th>
     224<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Color' ); ?></span></legend>
     225<input type="text" name="background-color" id="background-color" value="#<?php echo esc_attr(get_background_color()) ?>" />
     226<input type="button" class="button" value="<?php esc_attr_e('Select a Color'); ?>" id="pickcolor" />
     227
     228<div id="colorPickerDiv" style="z-index: 100; background:#eee; border:1px solid #ccc; position:absolute; display:none;"></div>
     229</fieldset></td>
     230</tr>
     231
     232<tr valign="top">
     233<th scope="row"><?php _e( 'Background Position' ); ?></th>
     234<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Position' ); ?></span></legend>
    187235<label>
    188236<input name="background-position" type="radio" value="left" <?php checked('left', get_theme_mod('background_position', 'left')); ?> />
    189237<?php _e('Left') ?>
     
    197245<?php _e('Right') ?>
    198246</label>
    199247</fieldset></td>
     248</tr>
    200249
     250<tr valign="top">
     251<th scope="row"><?php _e( 'Repeat' ); ?></th>
    201252<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Repeat' ); ?></span></legend>
    202253<label>
    203254<select name="background-repeat">
     
    208259</select>
    209260</label>
    210261</fieldset></td>
     262</tr>
    211263
     264<tr valign="top">
     265<th scope="row"><?php _e( 'Attachment' ); ?></th>
    212266<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Attachment' ); ?></span></legend>
    213267<label>
    214268<input name="background-attachment" type="radio" value="scroll" <?php checked('scroll', get_theme_mod('background_attachment', 'fixed')); ?> />
     
    219273<?php _e('Fixed') ?>
    220274</label>
    221275</fieldset></td>
     276</tr>
    222277
    223 <td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Color' ); ?></span></legend>
    224 <input type="text" name="background-color" id="background-color" value="#<?php echo esc_attr(get_background_color()) ?>" />
    225 <input type="button" class="button" value="<?php esc_attr_e('Select a Color'); ?>" id="pickcolor" />
    226 
    227 <div id="colorPickerDiv" style="z-index: 100; background:#eee; border:1px solid #ccc; position:absolute; display:none;"></div>
    228 </fieldset></td>
    229 </tr>
    230278</tbody>
    231279</table>
    232280
    233281<?php wp_nonce_field('custom-background'); ?>
    234 <p class="submit"><input type="submit" class="button" name="save-background-options" value="<?php esc_attr_e('Save Changes'); ?>" /></p>
     282<p class="submit"><input type="submit" class="button-primary" name="save-background-options" value="<?php esc_attr_e('Save Changes'); ?>" /></p>
    235283</form>
    236284
    237 <h3><?php _e('Upload New Background Image'); ?></h3>
    238 <form enctype="multipart/form-data" id="uploadForm" method="POST" action="">
    239 <label for="upload"><?php _e('Choose an image from your computer:'); ?></label><br /><input type="file" id="upload" name="import" />
    240 <input type="hidden" name="action" value="save" />
    241 <?php wp_nonce_field('custom-background') ?>
    242 <p class="submit">
    243 <input type="submit" value="<?php esc_attr_e('Upload'); ?>" />
    244 </p>
    245 </form>
    246 
    247 <?php if ( get_background_image() ) : ?>
    248 <h3><?php _e('Remove Background Image'); ?></h3>
    249 <p><?php _e('This will remove the background image. You will not be able to restore any customizations.') ?></p>
    250 <form method="post" action="">
    251 <?php wp_nonce_field('custom-background'); ?>
    252 <input type="submit" class="button" name="remove-background" value="<?php esc_attr_e('Remove Background'); ?>" />
    253 </form>
    254 <?php endif; ?>
    255 
    256285</div>
    257286<?php
    258287        }