Changeset 10574 for trunk/wp-admin/install.php
- Timestamp:
- 02/15/2009 12:58:10 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/install.php
r9596 r10574 49 49 }//end function display_header(); 50 50 51 function display_setup_form( $error = null ) { 52 if ( ! is_null( $error ) ) { 53 ?> 54 <p><strong><?php _e('ERROR'); ?></strong>: <?php echo $error; ?></p> 55 <?php } ?> 56 <form id="setup" method="post" action="install.php?step=2"> 57 <table class="form-table"> 58 <tr> 59 <th scope="row"><label for="weblog_title"><?php _e('Blog Title'); ?></label></th> 60 <td><input name="weblog_title" type="text" id="weblog_title" size="25" value="<?php echo ( isset($_POST['weblog_title']) ? $_POST['weblog_title'] : '' ); ?>" /></td> 61 </tr> 62 <tr> 63 <th scope="row"><label for="admin_email"><?php _e('Your E-mail'); ?></label></th> 64 <td><input name="admin_email" type="text" id="admin_email" size="25" value="<?php echo ( isset($_POST['admin_email']) ? $_POST['admin_email'] : '' ); ?>" /><br /> 65 <?php _e('Double-check your email address before continuing.'); ?> 66 </tr> 67 <tr> 68 <td colspan="2"><label><input type="checkbox" name="blog_public" value="1"<?php if( isset($_POST) && ! empty($_POST) && isset( $_POST['blog_public'] ) ) : ?> checked="checked"<?php endif; ?> /> <?php _e('Allow my blog to appear in search engines like Google and Technorati.'); ?></label></td> 69 </tr> 70 </table> 71 <p class="step"><input type="submit" name="Submit" value="<?php _e('Install WordPress'); ?>" class="button" /></p> 72 </form> 73 <?php 74 } 75 51 76 // Let's check to make sure WP isn't already installed. 52 77 if ( is_blog_installed() ) {display_header(); die('<h1>'.__('Already Installed').'</h1><p>'.__('You appear to have already installed WordPress. To reinstall please clear your old database tables first.').'</p></body></html>');} … … 64 89 <p><?php _e("Please provide the following information. Don't worry, you can always change these settings later."); ?></p> 65 90 66 <form id="setup" method="post" action="install.php?step=2"> 67 <table class="form-table"> 68 <tr> 69 <th scope="row"><label for="weblog_title"><?php _e('Blog Title'); ?></label></th> 70 <td><input name="weblog_title" type="text" id="weblog_title" size="25" /></td> 71 </tr> 72 <tr> 73 <th scope="row"><label for="admin_email"><?php _e('Your E-mail'); ?></label></th> 74 <td><input name="admin_email" type="text" id="admin_email" size="25" /><br /> 75 <?php _e('Double-check your email address before continuing.'); ?> 76 </tr> 77 <tr> 78 <td colspan="2"><label><input type="checkbox" name="blog_public" value="1" checked="checked" /> <?php _e('Allow my blog to appear in search engines like Google and Technorati.'); ?></label></td> 79 </tr> 80 </table> 81 <p class="step"><input type="submit" name="Submit" value="<?php _e('Install WordPress'); ?>" class="button" /></p> 82 </form> 91 83 92 84 93 <?php 94 display_setup_form(); 85 95 break; 86 96 case 2: … … 94 104 $public = isset($_POST['blog_public']) ? (int) $_POST['blog_public'] : 0; 95 105 // check e-mail address 106 $error = false; 96 107 if (empty($admin_email)) { 97 108 // TODO: poka-yoke 98 die('<p>'.__("<strong>ERROR</strong>: you must provide an e-mail address.").'</p>'); 109 display_setup_form( __('you must provide an e-mail address.') ); 110 $error = true; 99 111 } else if (!is_email($admin_email)) { 100 112 // TODO: poka-yoke 101 die('<p>'.__('<strong>ERROR</strong>: that isn’t a valid e-mail address. E-mail addresses look like: <code>username@example.com</code>').'</p>'); 113 display_setup_form( __('that isn’t a valid e-mail address. E-mail addresses look like: <code>username@example.com</code>') ); 114 $error = true; 102 115 } 103 116 104 $wpdb->show_errors(); 105 $result = wp_install($weblog_title, 'admin', $admin_email, $public); 106 extract($result, EXTR_SKIP); 117 if ( $error === false ) { 118 $wpdb->show_errors(); 119 $result = wp_install($weblog_title, 'admin', $admin_email, $public); 120 extract($result, EXTR_SKIP); 107 121 ?> 108 122 … … 126 140 127 141 <?php 142 } 128 143 break; 129 144 }
Note: See TracChangeset
for help on using the changeset viewer.