From 8043cc773974c3fec8096caab2c317f22aefd3a8 Mon Sep 17 00:00:00 2001
From: Glen Whitney
Date: Mon, 8 Feb 2021 13:07:30 -0800
Subject: [PATCH] feat: add a pod_name parameter
---
tablepress-pods.php | 8 +++++---
view-exportpods.php | 37 +++++++++++--------------------------
2 files changed, 16 insertions(+), 29 deletions(-)
diff --git a/tablepress-pods.php b/tablepress-pods.php
index 6eef9fc..6b3e5ca 100644
--- a/tablepress-pods.php
+++ b/tablepress-pods.php
@@ -3,7 +3,7 @@
Plugin Name: TablePress Extension: Pods tables
Plugin URI: https://code.studioinfinity.org/glen/tablepress-pods
Description: Custom Extension for TablePress to incorporate Pods information in tables
-Version: 0.2.8
+Version: 0.2.9
Author: Glen Whitney
Author URI: http://studioinfinity.org/
*/
@@ -98,11 +98,13 @@ function playground_exportpods_data( $data, $act ) {
$data['export_ids'] = array();
}
$exporter = TablePress::load_class( 'TablePress_Export', 'class-export.php', 'classes' );
- $data['zip_support_available'] = $exporter->zip_support_available;
+ $data['zip_support_available'] = false;
$data['export_formats'] = $exporter->export_formats;
- $data['csv_delimiters'] = $exporter->csv_delimiters;
$data['export_format'] = ( ! empty( $_GET['export_format'] ) ) ? $_GET['export_format'] : false;
+ $data['csv_delimiters'] = $exporter->csv_delimiters;
$data['csv_delimiter'] = ( ! empty( $_GET['csv_delimiter'] ) ) ? $_GET['csv_delimiter'] : _x( ',', 'Default CSV delimiter in the translated language (";", ",", or "tab")', 'tablepress' );
+ $data['pod_names'] = pods_api()->load_pods();
+ $data['pod_name'] = ( ! empty( $_GET['pod_name'] ) ) ? $_GET['pod_name'] : false;
return $data;
}
diff --git a/view-exportpods.php b/view-exportpods.php
index 0672b6e..bd23164 100644
--- a/view-exportpods.php
+++ b/view-exportpods.php
@@ -35,7 +35,6 @@ class TablePress_ExportPods_View extends TablePress_View {
'error_export' => __( 'Error: The export failed.', 'tablepress' ),
'error_load_table' => __( 'Error: This table could not be loaded!', 'tablepress' ),
'error_table_corrupted' => __( 'Error: The internal data of this table is corrupted!', 'tablepress' ),
- 'error_create_zip_file' => __( 'Error: The ZIP file could not be created.', 'tablepress' ),
) );
$this->add_text_box( 'head', array( $this, 'textbox_head' ), 'normal' );
@@ -64,8 +63,7 @@ class TablePress_ExportPods_View extends TablePress_View {
-
-
+
@@ -104,12 +102,7 @@ class TablePress_ExportPods_View extends TablePress_View {
-
- ';
- }
- ?>
+
|
@@ -117,7 +110,6 @@ class TablePress_ExportPods_View extends TablePress_View {
$select_size = $data['tables_count'] + 1; // to show at least one empty row in the select
$select_size = max( $select_size, 3 );
$select_size = min( $select_size, 12 );
- $size_multiple = ( $data['zip_support_available'] ) ? " size=\"{$select_size}\" multiple=\"multiple\"" : '';
?>
- ' . __( 'You can select multiple tables by holding down the “Ctrl” key (Windows) or the “Command” key (Mac).', 'tablepress' ) . '';
- }
- ?>
|
@@ -170,18 +157,16 @@ class TablePress_ExportPods_View extends TablePress_View {
- : |
+ |
-
-
-
-
+
|