Make WordPress Core

Ticket #12620: livejournal.php.patch

File livejournal.php.patch, 5.1 KB (added by briancolinger, 15 years ago)
  • Sites/wordpress-trunk/wp-admin/import/livejournal.php

     
    184184                        <input type="hidden" name="step" value="<?php echo esc_attr( get_option( 'ljapi_step' ) ) ?>" />
    185185                        <p><?php _e( 'It looks like you attempted to import your LiveJournal posts previously and got interrupted.' ) ?></p>
    186186                        <p class="submit">
    187                                 <input type="submit" class="button-primary" value="<?php esc_attr_e( 'Continue previous import' ) ?>" />
     187                                <input type="submit" class="button" value="<?php esc_attr_e( 'Continue previous import' ) ?>" />
    188188                        </p>
    189189                        <p class="submitbox"><a href="<?php echo esc_url($_SERVER['PHP_SELF'] . '?import=livejournal&amp;step=-1&amp;_wpnonce=' . wp_create_nonce( 'lj-api-import' ) . '&amp;_wp_http_referer=' . esc_attr( $_SERVER['REQUEST_URI'] )) ?>" class="deletion submitdelete"><?php _e( 'Cancel &amp; start a new import' ) ?></a></p>
    190190                        <p>
     
    223223                        <p><?php _e( "<strong>WARNING:</strong> This can take a really long time if you have a lot of entries in your LiveJournal, or a lot of comments. Ideally, you should only start this process if you can leave your computer alone while it finishes the import." ) ?></p>
    224224
    225225                        <p class="submit">
    226                                 <input type="submit" class="button-primary" value="<?php esc_attr_e( 'Connect to LiveJournal and Import' ) ?>" />
     226                                <input type="submit" class="button" value="<?php esc_attr_e( 'Connect to LiveJournal and Import' ) ?>" />
    227227                        </p>
    228228
    229229                        <p><?php _e( '<strong>NOTE:</strong> If the import process is interrupted for <em>any</em> reason, come back to this page and it will continue from where it stopped automatically.' ) ?></p>
     
    762762        // Check form inputs and start importing posts
    763763        function step1() {
    764764                global $verified;
     765
     766                do_action( 'import_start' );
     767
    765768                set_time_limit( 0 );
    766769                update_option( 'ljapi_step', 1 );
    767770                if ( !$this->ixr ) $this->ixr = new IXR_Client( $this->ixr_url, false, 80, 30 );
     
    821824                        <form action="admin.php?import=livejournal" method="post" id="ljapi-auto-repost">
    822825                        <?php wp_nonce_field( 'lj-api-import' ) ?>
    823826                        <input type="hidden" name="step" id="step" value="1" />
    824                         <p><input type="submit" class="button-primary" value="<?php esc_attr_e( 'Import the next batch' ) ?>" /> <span id="auto-message"></span></p>
     827                        <p><input type="submit" class="button" value="<?php esc_attr_e( 'Import the next batch' ) ?>" /> <span id="auto-message"></span></p>
    825828                        </form>
    826829                        <?php $this->auto_ajax( 'ljapi-auto-repost', 'auto-message', 0 ); ?>
    827830                <?php
     
    835838
    836839        // Download comments to local XML
    837840        function step2() {
     841                do_action( 'import_start' );
     842
    838843                set_time_limit( 0 );
    839844                update_option( 'ljapi_step', 2 );
    840845                $this->username = get_option( 'ljapi_username' );
     
    871876                        <p><strong><?php printf( __( 'Imported comment batch %d of <strong>approximately</strong> %d' ), get_option( 'ljapi_comment_batch' ), $batch ) ?></strong></p>
    872877                        <?php wp_nonce_field( 'lj-api-import' ) ?>
    873878                        <input type="hidden" name="step" id="step" value="2" />
    874                         <p><input type="submit" class="button-primary" value="<?php esc_attr_e( 'Import the next batch' ) ?>" /> <span id="auto-message"></span></p>
     879                        <p><input type="submit" class="button" value="<?php esc_attr_e( 'Import the next batch' ) ?>" /> <span id="auto-message"></span></p>
    875880                        </form>
    876881                        <?php $this->auto_ajax( 'ljapi-auto-repost', 'auto-message', 0 ); ?>
    877882                <?php
     
    886891        // Re-thread comments already in the DB
    887892        function step3() {
    888893                global $wpdb;
     894
     895                do_action( 'import_start' );
     896
    889897                set_time_limit( 0 );
    890898                update_option( 'ljapi_step', 3 );
    891899
     
    947955                $str .= wp_nonce_field( 'lj-api-import', '_wpnonce', true, false );
    948956                $str .= wp_referer_field( false );
    949957                $str .= '<input type="hidden" name="step" id="step" value="' . esc_attr($next_step) . '" />';
    950                 $str .= '<p><input type="submit" class="button-primary" value="' . esc_attr( $label ) . '" /> <span id="auto-message"></span></p>';
     958                $str .= '<p><input type="submit" class="button" value="' . esc_attr( $label ) . '" /> <span id="auto-message"></span></p>';
    951959                $str .= '</form>';
    952960
    953961                return $str;
     
    10001008                                                str = '<?php _e( "Processing next batch." ) ?> <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" id="processing" align="top" />';
    10011009                                                jQuery( '#<?php echo $msg ?>' ).html( str );
    10021010                                                jQuery('#ljapi-status').load(ajaxurl, {'action':'lj-importer',
     1011                                                                                                                                'import':'livejournal',
    10031012                                                                                                                                'step':jQuery('#step').val(),
    10041013                                                                                                                                '_wpnonce':'<?php echo wp_create_nonce( 'lj-api-import' ) ?>',
    10051014                                                                                                                                '_wp_http_referer':'<?php echo $_SERVER['REQUEST_URI'] ?>'});
     
    10421051                $wpdb->update( $wpdb->comments,
    10431052                                                array( 'comment_karma' => 0, 'comment_agent' => 'WP LJ Importer', 'comment_type' => '' ),
    10441053                                                array( 'comment_type' => 'livejournal' ) );
     1054
     1055                do_action( 'import_end' );
    10451056        }
    10461057
    10471058        function LJ_API_Import() {