$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 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 esc_html__( 'Field Name', 'affiliates-import' ); echo ' | '; echo ''; echo esc_html__( 'Field Label', 'affiliates-import' ); echo ' | '; echo ''; echo esc_html__( 'Enabled', 'affiliates-import' ); echo ' | '; echo ''; echo esc_html__( 'Required', 'affiliates-import' ); echo ' | '; echo '
|---|---|---|---|
';
echo '' . esc_html( $name ) . '';
echo ' | ';
echo ''; echo esc_html( $field['label'] ); echo ' | '; echo ''; echo ''; echo $field['enabled'] ? esc_html__( 'Yes', 'affiliates-import' ) : esc_html__( 'No', 'affiliates-import' ); echo ' | '; 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 '