function cs_export_options() { header('Content-Type: plain/text'); header('Content-disposition: attachment; filename=backup-options-' . gmdate('d-m-Y') . '.txt'); header('Content-Transfer-Encoding: binary'); header('Pragma: no-cache'); header('Expires: 0'); echo cs_encode_string(get_option(CS_OPTION)); die; }
public function output() { echo $this->element_before(); echo '<textarea name="' . $this->unique . '[import]"' . $this->element_class() . $this->element_attributes() . '></textarea>'; submit_button(__('Import a Backup', CS_TEXTDOMAIN), 'primary cs-import-backup', 'backup', false); echo '<small>( ' . __('copy-paste your backup string here', CS_TEXTDOMAIN) . ' )</small>'; echo '<hr />'; echo '<textarea name="_nonce"' . $this->element_class() . $this->element_attributes() . ' disabled="disabled">' . cs_encode_string(get_option($this->unique)) . '</textarea>'; echo '<a href="' . admin_url('admin-ajax.php?action=cs-export-options') . '" class="button button-primary" target="_blank">' . __('Export and Download Backup', CS_TEXTDOMAIN) . '</a>'; echo '<small>-( ' . __('or', CS_TEXTDOMAIN) . ' )-</small>'; submit_button(__('!!! Reset All Options !!!', CS_TEXTDOMAIN), 'cs-warning-primary cs-reset-confirm', $this->unique . '[resetall]', false); echo '<small class="cs-text-warning">' . __('Please be sure for reset all of framework options.', CS_TEXTDOMAIN) . '</small>'; echo $this->element_after(); }
public function output() { echo $this->element_before(); echo '<textarea name="' . $this->unique . '[import]"' . $this->element_class() . $this->element_attributes() . '></textarea>'; submit_button(__('导入', 'cs-framework'), 'primary cs-import-backup', 'backup', false); echo '<small>( ' . __('请粘贴你的备份字符串', 'cs-framework') . ' )</small>'; echo '<hr />'; echo '<textarea name="_nonce"' . $this->element_class() . $this->element_attributes() . ' disabled="disabled">' . cs_encode_string(get_option($this->unique)) . '</textarea>'; echo '<a href="' . admin_url('admin-ajax.php?action=cs-export-options') . '" class="button button-primary" target="_blank">' . __('导出', 'cs-framework') . '</a>'; echo '<small>-( ' . __('或', 'cs-framework') . ' )-</small>'; submit_button(__('重设所有选项', 'cs-framework'), 'cs-warning-primary cs-reset-confirm', $this->unique . '[resetall]', false); echo '<small class="cs-text-warning">' . __('Please be sure for reset all of framework options.', 'cs-framework') . '</small>'; echo $this->element_after(); }