/** * The importer screen markup. * @access public * @since 1.0.0 * @return void */ public function importer_screen() { global $subscribe_and_connect; $key_transforms = Subscribe_And_Connect_Utils::get_wf_to_sc_key_transforms(); $settings = $subscribe_and_connect->get_settings(); // Prepare an array of keys to check for. $keys = array(); // Apply the key transforms detected. if (0 < count($key_transforms)) { $keys = array_merge($keys, array_values($key_transforms)); } // Add any networks to be checked. if (isset($settings['connect']['networks']) && 0 < count($settings['connect']['networks'])) { $prefix = 'woo_connect_'; if (isset($settings['connect']['networks']) && 0 < count($settings['connect']['networks'])) { foreach ($settings['connect']['networks'] as $k => $v) { if (!in_array($prefix . $k, $keys)) { if ('google_plus' == $k) { $k = 'googleplus'; } // A small caveat to match how the option looks in the WooFramework. $keys[] = $prefix . $k; } } } } $keys = Subscribe_And_Connect_Utils::filter_existing_keys($keys); ?> <div class="wrap"> <?php screen_icon(); ?> <h2><?php _e('Subscribe & Connect WooFramework Importer', 'subscribe-and-connect'); ?> </h2> <form action="" method="post"> <?php wp_nonce_field('subscribe-and-connect-importer', 'subscribe-and-connect-importer'); do_action('subscribe_and_connect_wf_importer_before'); if (0 >= count($keys)) { _e('No existing Subscribe & Connect data, from your WooThemes theme, was found. You\'re good to go!', 'subscribe-and-connect'); } else { $key_labels = Subscribe_And_Connect_Utils::get_wf_key_labels(); ?> <table class="wp-list-table widefat fixed" style="max-width: 500px;"> <tbody> <?php $counter = 0; foreach ($keys as $k => $v) { $counter++; $class = 'alternate'; if (0 == $counter % 2) { $class = ''; } $label = $k; if (isset($key_labels[$k]) && '' != $key_labels[$k]) { $label = $key_labels[$k]; } ?> <tr valign="top" class="<?php echo esc_attr($class); ?> "> <th scope="row" class="check-column"><input type="checkbox" value="<?php echo esc_attr($k); ?> " name="sc_fields_to_import[]" /></td> <td><?php echo esc_html($label) . '<br /><code><small>(' . esc_attr($k) . ')</small></code>'; ?> </td> <td><?php echo esc_html($v); ?> </td> </tr> <?php } ?> </tbody> <thead> <tr> <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><label class="screen-reader-text" for="cb-select-all-1">Select All</label><input id="cb-select-all-1" type="checkbox"></th> <th><?php _e('Title', 'subscribe-and-connect'); ?> </th> <th><?php _e('Stored Value', 'subscribe-and-connect'); ?> </th> </tr> </thead> </table> <?php submit_button(__('Import Settings', 'subscribe-and-connect')); } do_action('subscribe_and_connect_wf_importer_after'); ?> </form> </div><!--/.wrap--> <?php }