$n ); // echo json_encode( $result ); // exit; // } if ( isset( $_REQUEST['action'] ) && ( $_REQUEST['action'] === self::REQUEST_IMPORT ) ) { if ( wp_verify_nonce( $_REQUEST[self::NONCE], self::NONCE_IMPORT_ACTION ) ) { Affiliates_Import_Process::import_affiliates( !empty( $_REQUEST['test'] ) ); } } } /** * Affiliates Import : admin section. */ public static function affiliates_admin_import() { if ( !current_user_can( AFFILIATES_ADMINISTER_OPTIONS ) ) { wp_die( esc_html__( 'Access denied.', 'affiliates-import' ) ); } $options = get_option( Affiliates_Import::PLUGIN_OPTIONS , array() ); if ( isset( $_POST['submit'] ) ) { if ( wp_verify_nonce( $_POST[self::NONCE], self::SET_ADMIN_OPTIONS ) ) { // currently nothing needed here } update_option( Affiliates_Import::PLUGIN_OPTIONS, $options ); } // css echo ''; echo '
'; echo '

'; esc_html_e( 'Import Affiliate Accounts', 'affiliates-import' ); echo '

'; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; echo '

'; echo ''; echo ' '; echo ''; echo ''; esc_html_e( 'File Format and Fields', 'affiliates-import' ); echo ''; echo ''; echo '

'; echo '

'; echo ''; echo '

'; echo '

'; echo ''; echo '

'; echo '

'; echo ''; echo '

'; echo '

'; echo ''; echo '

'; echo '

'; echo ''; echo '

'; echo '

'; echo ''; echo '

'; echo '

'; echo ''; echo '

'; echo '

'; echo wp_nonce_field( self::NONCE_IMPORT_ACTION, self::NONCE, true, false ); echo ''; echo '

'; printf( '', esc_attr( self::REQUEST_IMPORT ) ); echo '

'; echo __( 'An import can not be undone! When in doubt, run the import in small batches or on a test installation first.', 'affiliates-import' ); echo '

'; echo '

'; echo __( 'To import very large sets, several imports using the same file repeatedly can be done.', 'affiliates-import' ); echo ' '; echo __( 'In this case, enabling Suppress warnings is useful to avoid being alerted about existing entries.', 'affiliates-import' ); echo '

'; echo '
'; echo '
'; echo '
'; echo '
'; // .manage echo '
'; echo '

'; esc_html_e( 'File Format and Fields', 'affiliates-import' ); echo '

'; echo '
'; echo '
'; echo '

'; echo sprintf( __( 'Please also refer to the Documentation.', 'affiliates-import' ), esc_url( 'http://docs.itthinx.com/document/affiliates-import/' ) ); echo '

'; echo '

'; echo __( 'To import affiliates, use a plain text file with values separated by tabs.', 'affiliates-import' ); echo '

'; echo '

'; printf( __( 'These fields are defined in the Affiliates Registration settings and are recognized in the optional Column Declaration by their Field Name in the file to import.', 'affiliates-import' ), esc_url( add_query_arg( 'section', 'registration', admin_url( 'admin.php?page=affiliates-admin-settings' ) ) ) ); echo '

'; $fields = Affiliates_Import_Process::get_affiliates_registration_fields(); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; foreach( $fields as $name => $field ) { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; } echo '
'; echo esc_html__( 'Field Name', 'affiliates-import' ); echo ''; echo esc_html__( 'Field Label', 'affiliates-import' ); echo ''; echo esc_html__( 'Enabled', 'affiliates-import' ); echo ''; echo esc_html__( 'Required', 'affiliates-import' ); echo '
'; echo '' . esc_html( $name ) . ''; echo ''; echo esc_html( $field['label'] ); echo ''; echo ''; echo $field['enabled'] ? esc_html__( 'Yes', 'affiliates-import' ) : esc_html__( 'No', 'affiliates-import' ); echo ''; echo $field['required'] ? esc_html__( 'Yes', 'affiliates-import' ) : esc_html__( 'No', 'affiliates-import' ); echo '
'; echo '

'; _e( 'Without a Column Declaration, the entries in the imported file are expected to appear in the order as listed.', 'affiliates-import' ); echo ' '; _e( 'A different order can be indicated with an explicit Column Declaration, by starting a line with the @ symbol followed by one or more Field Names.', 'affiliates-import' ); echo '

'; echo '

'; echo ''; echo '

'; echo '
'; // .manage affiliates_footer(); } } Affiliates_Import_Admin::init();