Changeset 8656 for trunk/wp-admin/custom-header.php
- Timestamp:
- 08/16/08 07:27:34 (3 months ago)
- Files:
-
- trunk/wp-admin/custom-header.php (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-admin/custom-header.php
r8618 r8656 1 1 <?php 2 2 /** 3 * The custom header image script. 4 * 5 * @package WordPress 6 * @subpackage Administration 7 */ 8 9 /** 10 * The custom header image class. 11 * 12 * @since unknown 13 * @package WordPress 14 * @subpackage Administration 15 */ 3 16 class Custom_Image_Header { 17 18 /** 19 * Callback for administration header. 20 * 21 * @var callback 22 * @since unknown 23 * @access private 24 */ 4 25 var $admin_header_callback; 5 26 27 /** 28 * PHP4 Constructor - Register administration header callback. 29 * 30 * @since unknown 31 * @param callback $admin_header_callback 32 * @return Custom_Image_Header 33 */ 6 34 function Custom_Image_Header($admin_header_callback) { 7 35 $this->admin_header_callback = $admin_header_callback; 8 36 } 9 37 38 /** 39 * Setup the hooks for the Custom Header admin page. 40 * 41 * @since unknown 42 */ 10 43 function init() { 11 44 $page = add_theme_page(__('Custom Image Header'), __('Custom Image Header'), 'edit_themes', 'custom-header', array(&$this, 'admin_page')); … … 17 50 } 18 51 52 /** 53 * Get the current step. 54 * 55 * @since unknown 56 * 57 * @return int Current step 58 */ 19 59 function step() { 20 $step = (int) @$_GET['step']; 60 if ( ! isset( $_GET['step'] ) ) 61 return 1; 62 63 $step = (int) $_GET['step']; 21 64 if ( $step < 1 || 3 < $step ) 22 65 $step = 1; 66 23 67 return $step; 24 68 } 25 69 70 /** 71 * Setup the enqueue for the JavaScript files. 72 * 73 * @since unknown 74 */ 26 75 function js_includes() { 27 76 $step = $this->step(); 77 28 78 if ( 1 == $step ) 29 79 wp_enqueue_script('colorpicker'); … … 32 82 } 33 83 84 /** 85 * Execute custom header modification. 86 * 87 * @since unknown 88 */ 34 89 function take_action() { 35 90 if ( isset( $_POST['textcolor'] ) ) { … … 49 104 } 50 105 106 /** 107 * Execute Javascript depending on step. 108 * 109 * @since unknown 110 */ 51 111 function js() { 52 112 $step = $this->step(); … … 57 117 } 58 118 119 /** 120 * Display Javascript based on Step 1. 121 * 122 * @since unknown 123 */ 59 124 function js_1() { ?> 60 125 <script type="text/javascript"> … … 130 195 } 131 196 197 /** 198 * Display Javascript based on Step 2. 199 * 200 * @since unknown 201 */ 132 202 function js_2() { ?> 133 203 <script type="text/javascript"> … … 174 244 } 175 245 246 /** 247 * Display first step of custom header image page. 248 * 249 * @since unknown 250 */ 176 251 function step_1() { 177 252 if ( $_GET['updated'] ) { ?> … … 227 302 } 228 303 304 /** 305 * Display second step of custom header image page. 306 * 307 * @since unknown 308 */ 229 309 function step_2() { 230 310 check_admin_referer('custom-header'); … … 299 379 } 300 380 381 /** 382 * Display third step of custom header image page. 383 * 384 * @since unknown 385 */ 301 386 function step_3() { 302 387 check_admin_referer('custom-header'); … … 340 425 } 341 426 427 /** 428 * Display last step of custom header image page. 429 * 430 * @since unknown 431 */ 342 432 function finished() { 343 433 ?> … … 351 441 } 352 442 443 /** 444 * Display the page based on the current step. 445 * 446 * @since unknown 447 */ 353 448 function admin_page() { 354 449 $step = $this->step();
