/**
  */
 public function outputPurgeDataContent()
 {
     $importTitle = __('Import', Postman::TEXT_DOMAIN);
     $exportTile = __('Export', Postman::TEXT_DOMAIN);
     $resetTitle = __('Reset Plugin', Postman::TEXT_DOMAIN);
     $options = $this->options;
     print '<div class="wrap">';
     PostmanViewController::outputChildPageHeader(sprintf('%s/%s/%s', $importTitle, $exportTile, $resetTitle));
     print '<section id="export_settings">';
     printf('<h3><span>%s<span></h3>', $exportTile);
     printf('<p><span>%s</span></p>', __('Copy this data into another instance of Postman to duplicate the configuration.', Postman::TEXT_DOMAIN));
     $data = '';
     if (!PostmanPreRequisitesCheck::checkZlibEncode()) {
         $extraDeleteButtonAttributes = sprintf('disabled="true"');
         $data = '';
     } else {
         $extraDeleteButtonAttributes = '';
         if (!$options->isNew()) {
             $data = $options->export();
         }
     }
     printf('<textarea cols="80" rows="5" readonly="true" name="settings" %s>%s</textarea>', $extraDeleteButtonAttributes, $data);
     print '</section>';
     print '<section id="import_settings">';
     printf('<h3><span>%s<span></h3>', $importTitle);
     print '<form method="POST" action="' . get_admin_url() . 'admin-post.php">';
     wp_nonce_field(PostmanAdminController::IMPORT_SETTINGS_SLUG);
     printf('<input type="hidden" name="action" value="%s" />', PostmanAdminController::IMPORT_SETTINGS_SLUG);
     print '<p>';
     printf('<span>%s</span>', __('Paste data from another instance of Postman here to duplicate the configuration.', Postman::TEXT_DOMAIN));
     if (PostmanTransportRegistry::getInstance()->getSelectedTransport()->isOAuthUsed(PostmanOptions::getInstance()->getAuthenticationType())) {
         $warning = __('Warning', Postman::TEXT_DOMAIN);
         $errorMessage = __('Using the same OAuth 2.0 Client ID and Client Secret from this site at the same time as another site will cause failures.', Postman::TEXT_DOMAIN);
         printf(' <span><b>%s</b>: %s</span>', $warning, $errorMessage);
     }
     print '</p>';
     printf('<textarea cols="80" rows="5" name="settings" %s></textarea>', $extraDeleteButtonAttributes);
     submit_button(__('Import', Postman::TEXT_DOMAIN), 'primary', 'import', true, $extraDeleteButtonAttributes);
     print '</form>';
     print '</section>';
     print '<section id="delete_settings">';
     printf('<h3><span>%s<span></h3>', $resetTitle);
     print '<form method="POST" action="' . get_admin_url() . 'admin-post.php">';
     wp_nonce_field(PostmanAdminController::PURGE_DATA_SLUG);
     printf('<input type="hidden" name="action" value="%s" />', PostmanAdminController::PURGE_DATA_SLUG);
     printf('<p><span>%s</span></p><p><span>%s</span></p>', __('This will purge all of Postman\'s settings, including account credentials and the email log.', Postman::TEXT_DOMAIN), __('Are you sure?', Postman::TEXT_DOMAIN));
     $extraDeleteButtonAttributes = 'style="background-color:red;color:white"';
     if ($this->options->isNew()) {
         $extraDeleteButtonAttributes .= ' disabled="true"';
     }
     submit_button($resetTitle, 'delete', 'submit', true, $extraDeleteButtonAttributes);
     print '</form>';
     print '</section>';
     print '</div>';
 }
 /**
  *
  * @param unknown $data        	
  */
 public function import($data)
 {
     if (PostmanPreRequisitesCheck::checkZlibEncode()) {
         $logger = new PostmanLogger(get_class($this));
         $logger->debug('Importing Settings');
         $base64 = $data;
         $logger->trace($base64);
         $gz = base64_decode($base64);
         $logger->trace($gz);
         $json = @gzuncompress($gz);
         $logger->trace($json);
         if (!empty($json)) {
             $data = json_decode($json, true);
             $logger->trace($data);
             // overwrite the current version with the version from the imported options
             // this way database upgrading can occur
             $postmanState = get_option('postman_state');
             $postmanState['version'] = $data['version'];
             $logger->trace(sprintf('Setting Postman version to %s', $postmanState['version']));
             assert($postmanState['version'] == $data['version']);
             update_option('postman_state', $postmanState);
             $this->options = $data;
             $logger->info('Imported data');
             $this->save();
             return true;
         } else {
             $logger->error('Could not import data - data error');
             return false;
         }
     }
 }