Changeset 197768
- Timestamp:
- 01/25/2010 03:46:55 AM (16 years ago)
- Location:
- shadows/trunk
- Files:
-
- 3 edited
-
options.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
-
shadows.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
shadows/trunk/options.php
r132095 r197768 2 2 3 3 function shadows_plugin_options() { 4 5 if( $_POST['action'] == 'update' ) { 6 $curl_shadow_height = preg_replace ('/[^0-9]*/', '', $_POST['curl_shadow_height'] ); # strip any non digits 7 $curl_shadow_height = $curl_shadow_height ? $curl_shadow_height : '10'; # default to 10 if empty 8 $curl_shadow_opacity = preg_replace ('/[^0-9]*/', '', $_POST['curl_shadow_opacity'] ); # strip any non digits 9 $curl_shadow_opacity = $curl_shadow_opacity ? $curl_shadow_opacity : '100'; # default to 100 if empty 10 $curl_shadow_height_unit = preg_replace ('/.*(px|em)$/i', '\\1', $_POST['curl_shadow_height'] ); # grab either px or em 11 $curl_shadow_height_unit = strtolower($curl_shadow_height_unit); 12 if (! ($curl_shadow_height_unit == 'px' || $curl_shadow_height_unit == 'em')) { 13 $curl_shadow_height_unit = 'px'; 14 } 15 16 update_option( 'curl_shadow_height', $curl_shadow_height . $curl_shadow_height_unit ); 17 update_option( 'curl_shadow_opacity', $curl_shadow_opacity ); 18 19 $flat_shadow_height = preg_replace ('/[^0-9]*/', '', $_POST['flat_shadow_height'] ); # strip any non digits 20 $flat_shadow_height = $flat_shadow_height ? $flat_shadow_height : '10'; # default to 10 if empty 21 $flat_shadow_opacity = preg_replace ('/[^0-9]*/', '', $_POST['flat_shadow_opacity'] ); # strip any non digits 22 $flat_shadow_opacity = $flat_shadow_opacity ? $flat_shadow_opacity : '100'; # default to 100 if empty 23 $flat_shadow_height_unit = preg_replace ('/.*(px|em)$/', '\\1', $_POST['flat_shadow_height'] ); # grab either px or em 24 $flat_shadow_height_unit = strtolower($flat_shadow_height_unit); 25 if (! ($flat_shadow_height_unit == 'px' || $flat_shadow_height_unit == 'em')) { 26 $flat_shadow_height_unit = 'px'; 27 } 28 29 update_option( 'flat_shadow_height', $flat_shadow_height . $flat_shadow_height_unit ); 30 update_option( 'flat_shadow_opacity', $flat_shadow_opacity ); 31 ?> 32 <div class="updated"><p><strong><?php _e('Options saved.', 'mt_trans_domain' ); ?></strong></p></div> 33 <?php 34 } 35 4 36 $curl_shadow_height = get_option('curl_shadow_height'); 5 37 $curl_shadow_height = $curl_shadow_height ? $curl_shadow_height : '10px'; 38 $curl_shadow_opacity = get_option('curl_shadow_opacity'); 39 $curl_shadow_opacity = $curl_shadow_opacity ? $curl_shadow_opacity : '100%'; 6 40 7 41 $flat_shadow_height = get_option('flat_shadow_height'); 8 42 $flat_shadow_height = $flat_shadow_height ? $flat_shadow_height : '10px'; 43 $flat_shadow_opacity = get_option('flat_shadow_opacity'); 44 $flat_shadow_opacity = $flat_shadow_opacity ? $flat_shadow_opacity : '100%'; 45 46 # opacities must be a number ONLY but are better displayed with a trailing % 47 $curl_shadow_opacity = preg_replace ('/[^0-9]*/', '', $curl_shadow_opacity) . '%'; 48 $flat_shadow_opacity = preg_replace ('/[^0-9]*/', '', $flat_shadow_opacity) . '%'; 49 9 50 ?> 10 51 <div class="wrap"> 11 52 <h2>Shadows Options</h2> 12 <form method="post" action=" options.php">53 <form method="post" action=""> 13 54 14 55 <?php wp_nonce_field('update-options'); ?> … … 16 57 <p>It is recommended that you leave the height of the shadows at the default of 10px for best results.</p> 17 58 18 <p>Heights must include units such as px or em.</p>59 <p>Heights can be specified in px or em. They will default to px if the units are unspecified or invalid.</p> 19 60 20 61 <table class="form-table"> 21 62 <tr valign="top"> 22 <th scope="row"> Curlshadow height</th>63 <th scope="row"><strong>Curl</strong> shadow height</th> 23 64 <td><input type="text" name="curl_shadow_height" value="<?php echo $curl_shadow_height; ?>" /></td> 24 65 </tr> 25 66 <tr valign="top"> 26 <th scope="row"> Curl shadow opacity<br/> (<strong>do not include %</strong>)</th>27 <td><input type="text" name="curl_shadow_opacity" value="<?php echo get_option('curl_shadow_opacity'); ?>" /></td>67 <th scope="row"><strong>Curl</strong> shadow opacity</th> 68 <td><input type="text" name="curl_shadow_opacity" value="<?php echo $curl_shadow_opacity; ?>" /></td> 28 69 </tr> 29 70 <tr valign="top"> 30 <th scope="row"> Flatshadow height</th>71 <th scope="row"><strong>Flat</strong> shadow height</th> 31 72 <td><input type="text" name="flat_shadow_height" value="<?php echo $flat_shadow_height; ?>" /></td> 32 73 </tr> 33 74 <tr valign="top"> 34 <th scope="row"> Flat shadow opacity<br/> (<strong>do not include %</strong>)</th>35 <td><input type="text" name="flat_shadow_opacity" value="<?php echo get_option('flat_shadow_opacity'); ?>" /></td>75 <th scope="row"><strong>Flat</strong> shadow opacity</th> 76 <td><input type="text" name="flat_shadow_opacity" value="<?php echo $flat_shadow_opacity; ?>" /></td> 36 77 </tr> 37 78 </table> … … 41 82 42 83 <p class="submit"> 43 <input type="submit" class="button-primary" value="<?php _e('Save Changes' )?>" />84 <input type="submit" class="button-primary" value="<?php _e('Save Changes', 'mt_trans_domain' ); ?>" /> 44 85 </p> 45 86 </form> -
shadows/trunk/readme.txt
r197287 r197768 5 5 Requires at least: 2.5 6 6 Tested up to: 2.9 7 Stable Tag: 0.3. 47 Stable Tag: 0.3.5 8 8 9 9 This is a plugin to add a range of shadow types to a range of objects. Currently supported are images, divs and blockquotes. … … 79 79 == Changelog == 80 80 81 = 0.3.5 = 82 * Improved handling and checking of units on options page 83 * Changed submit behaviour to be compatible with WPMU 84 81 85 = 0.3.4 = 82 86 * Added "overflow:hidden;" to avoid problems with other objects with clear's on them -
shadows/trunk/shadows.php
r197287 r197768 4 4 Plugin URI: http://deepport.net/computing/wordpress-shadows-plugin/ 5 5 Description: Adds a range of shadow types to images, divs and blockquotes 6 Version: 0.3. 46 Version: 0.3.5 7 7 Author: Andrew Radke 8 8 Author URI: http://deepport.net/
Note: See TracChangeset
for help on using the changeset viewer.