wpDataTables Lite - Version 2.1.18

Version Description

  • Feature: Added new option "Page Orientation" for PDF export reports.
  • Feature: Added new option "Paper Size" for PDF export reports.
  • Other small bug fixes and stability improvements.
Download this release

Release Info

Developer wpDataTables
Plugin Icon 128x128 wpDataTables Lite
Version 2.1.18
Comparing to
See all releases

Code changes from version 2.1.17 to 2.1.18

assets/js/moment/locale/af.js CHANGED
@@ -1,73 +1,82 @@
1
  //! moment.js locale configuration
2
- //! locale : afrikaans (af)
3
  //! author : Werner Mollentze : https://github.com/wernerm
4
 
5
  ;(function (global, factory) {
6
  typeof exports === 'object' && typeof module !== 'undefined'
7
  && typeof require === 'function' ? factory(require('../moment')) :
8
- typeof define === 'function' && define.amd ? define(['moment'], factory) :
9
  factory(global.moment)
10
- }(this, function (moment) { 'use strict';
11
 
 
12
 
13
  var af = moment.defineLocale('af', {
14
- months : 'Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember'.split('_'),
15
- monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des'.split('_'),
16
- weekdays : 'Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag'.split('_'),
17
- weekdaysShort : 'Son_Maa_Din_Woe_Don_Vry_Sat'.split('_'),
18
- weekdaysMin : 'So_Ma_Di_Wo_Do_Vr_Sa'.split('_'),
 
 
 
 
19
  meridiemParse: /vm|nm/i,
20
- isPM : function (input) {
21
  return /^nm$/i.test(input);
22
  },
23
- meridiem : function (hours, minutes, isLower) {
24
  if (hours < 12) {
25
  return isLower ? 'vm' : 'VM';
26
  } else {
27
  return isLower ? 'nm' : 'NM';
28
  }
29
  },
30
- longDateFormat : {
31
- LT : 'HH:mm',
32
- LTS : 'HH:mm:ss',
33
- L : 'DD/MM/YYYY',
34
- LL : 'D MMMM YYYY',
35
- LLL : 'D MMMM YYYY HH:mm',
36
- LLLL : 'dddd, D MMMM YYYY HH:mm'
37
  },
38
- calendar : {
39
- sameDay : '[Vandag om] LT',
40
- nextDay : '[Môre om] LT',
41
- nextWeek : 'dddd [om] LT',
42
- lastDay : '[Gister om] LT',
43
- lastWeek : '[Laas] dddd [om] LT',
44
- sameElse : 'L'
45
  },
46
- relativeTime : {
47
- future : 'oor %s',
48
- past : '%s gelede',
49
- s : '\'n paar sekondes',
50
- m : '\'n minuut',
51
- mm : '%d minute',
52
- h : '\'n uur',
53
- hh : '%d ure',
54
- d : '\'n dag',
55
- dd : '%d dae',
56
- M : '\'n maand',
57
- MM : '%d maande',
58
- y : '\'n jaar',
59
- yy : '%d jaar'
 
60
  },
61
- ordinalParse: /\d{1,2}(ste|de)/,
62
- ordinal : function (number) {
63
- return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de'); // Thanks to Joris Röling : https://github.com/jjupiter
 
 
 
 
 
 
 
64
  },
65
- week : {
66
- dow : 1, // Maandag is die eerste dag van die week.
67
- doy : 4 // Die week wat die 4de Januarie bevat is die eerste week van die jaar.
68
- }
69
  });
70
 
71
  return af;
72
 
73
- }));
1
  //! moment.js locale configuration
2
+ //! locale : Afrikaans [af]
3
  //! author : Werner Mollentze : https://github.com/wernerm
4
 
5
  ;(function (global, factory) {
6
  typeof exports === 'object' && typeof module !== 'undefined'
7
  && typeof require === 'function' ? factory(require('../moment')) :
8
+ typeof define === 'function' && define.amd ? define(['../moment'], factory) :
9
  factory(global.moment)
10
+ }(this, (function (moment) { 'use strict';
11
 
12
+ //! moment.js locale configuration
13
 
14
  var af = moment.defineLocale('af', {
15
+ months: 'Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember'.split(
16
+ '_'
17
+ ),
18
+ monthsShort: 'Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des'.split('_'),
19
+ weekdays: 'Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag'.split(
20
+ '_'
21
+ ),
22
+ weekdaysShort: 'Son_Maa_Din_Woe_Don_Vry_Sat'.split('_'),
23
+ weekdaysMin: 'So_Ma_Di_Wo_Do_Vr_Sa'.split('_'),
24
  meridiemParse: /vm|nm/i,
25
+ isPM: function (input) {
26
  return /^nm$/i.test(input);
27
  },
28
+ meridiem: function (hours, minutes, isLower) {
29
  if (hours < 12) {
30
  return isLower ? 'vm' : 'VM';
31
  } else {
32
  return isLower ? 'nm' : 'NM';
33
  }
34
  },
35
+ longDateFormat: {
36
+ LT: 'HH:mm',
37
+ LTS: 'HH:mm:ss',
38
+ L: 'DD/MM/YYYY',
39
+ LL: 'D MMMM YYYY',
40
+ LLL: 'D MMMM YYYY HH:mm',
41
+ LLLL: 'dddd, D MMMM YYYY HH:mm',
42
  },
43
+ calendar: {
44
+ sameDay: '[Vandag om] LT',
45
+ nextDay: '[Môre om] LT',
46
+ nextWeek: 'dddd [om] LT',
47
+ lastDay: '[Gister om] LT',
48
+ lastWeek: '[Laas] dddd [om] LT',
49
+ sameElse: 'L',
50
  },
51
+ relativeTime: {
52
+ future: 'oor %s',
53
+ past: '%s gelede',
54
+ s: "'n paar sekondes",
55
+ ss: '%d sekondes',
56
+ m: "'n minuut",
57
+ mm: '%d minute',
58
+ h: "'n uur",
59
+ hh: '%d ure',
60
+ d: "'n dag",
61
+ dd: '%d dae',
62
+ M: "'n maand",
63
+ MM: '%d maande',
64
+ y: "'n jaar",
65
+ yy: '%d jaar',
66
  },
67
+ dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
68
+ ordinal: function (number) {
69
+ return (
70
+ number +
71
+ (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de')
72
+ ); // Thanks to Joris Röling : https://github.com/jjupiter
73
+ },
74
+ week: {
75
+ dow: 1, // Maandag is die eerste dag van die week.
76
+ doy: 4, // Die week wat die 4de Januarie bevat is die eerste week van die jaar.
77
  },
 
 
 
 
78
  });
79
 
80
  return af;
81
 
82
+ })));
assets/js/wpdatatables/admin/table-settings/main.js CHANGED
@@ -285,12 +285,37 @@
285
  for( var i in tableToolsSelection ){
286
  tableToolsConfig[tableToolsSelection[i]] = 1;
287
  }
 
 
 
 
 
 
 
 
 
 
 
288
  if ($(this).val() == null) {
289
  wpdatatable_config.setShowTableTools(0, []);
290
  }
291
  wpdatatable_config.setTableToolsConfig(tableToolsConfig);
292
  });
293
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
294
  /**
295
  * Set Placeholder VAR 1
296
  */
285
  for( var i in tableToolsSelection ){
286
  tableToolsConfig[tableToolsSelection[i]] = 1;
287
  }
288
+ // Show/hide PDF export options
289
+ if (tableToolsSelection.includes('pdf')) {
290
+ if( !$('div.pdf-export-options').is(":visible")){
291
+ $('div.pdf-export-options').animateFadeIn();
292
+ }
293
+ } else {
294
+ $('div.pdf-export-options').animateFadeOut();
295
+ wpdatatable_config.setPdfPaperSize('A4');
296
+ wpdatatable_config.setPdfPageOrientation('portrait');
297
+ }
298
+
299
  if ($(this).val() == null) {
300
  wpdatatable_config.setShowTableTools(0, []);
301
  }
302
  wpdatatable_config.setTableToolsConfig(tableToolsConfig);
303
  });
304
 
305
+ /**
306
+ * Set PDF export paper size
307
+ */
308
+ $('#wdt-pdf-paper-size').change(function (e) {
309
+ wpdatatable_config.setPdfPaperSize($(this).val());
310
+ });
311
+
312
+ /**
313
+ * Set PDF export page orientation
314
+ */
315
+ $('#wdt-pdf-page-orientation').change(function (e) {
316
+ wpdatatable_config.setPdfPageOrientation($(this).val());
317
+ });
318
+
319
  /**
320
  * Set Placeholder VAR 1
321
  */
assets/js/wpdatatables/admin/table-settings/table_config_object.js CHANGED
@@ -50,6 +50,8 @@ var wpdatatable_config = {
50
  dataTable: null,
51
  datatable_config: null,
52
  tabletools_config: {print: 1, copy: 1, excel: 1, csv: 1, pdf: 0},
 
 
53
  showTableToolsIncludeHTML: 0,
54
  columns: [],
55
  columns_by_headers: {},
@@ -221,11 +223,20 @@ var wpdatatable_config = {
221
  wpdatatable_config.setTableToolsConfig({print: 1, copy: 1, excel: 1, csv: 1, pdf: 0}) :
222
  wpdatatable_config.setTableToolsConfig(table_tools);
223
  wpdatatable_config.setTableToolsIncludeHTML(0);
 
 
 
 
 
 
224
  } else {
225
  jQuery('.wdt-table-settings .table-tools-settings-block').addClass('hidden');
226
- wpdatatable_config.setTableToolsConfig({})
227
  jQuery('.wdt-table-settings .table-tools-include-html-block').addClass('hidden');
 
 
228
  wpdatatable_config.setTableToolsIncludeHTML(0);
 
 
229
  }
230
  jQuery('#wdt-table-tools').prop('checked', show_tabletools);
231
  },
@@ -659,6 +670,24 @@ var wpdatatable_config = {
659
  jQuery('#wdt-table-tools-config').val(tabletoolsConfigVal).selectpicker('refresh');
660
  }
661
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
662
  /**
663
  * Set the VAR 1 placeholder value
664
  */
@@ -829,6 +858,8 @@ var wpdatatable_config = {
829
  wpdatatable_config.setSorting(parseInt(tableJSON.sorting));
830
  wpdatatable_config.setShowTableTools(parseInt(tableJSON.tools), tableJSON.tabletools_config);
831
  wpdatatable_config.setTableToolsIncludeHTML( parseInt( tableJSON.showTableToolsIncludeHTML ) );
 
 
832
  wpdatatable_config.setWordWrap(tableJSON.word_wrap);
833
  wpdatatable_config.setPlaceholderVar1(tableJSON.var1);
834
  wpdatatable_config.setPlaceholderVar2(tableJSON.var2);
50
  dataTable: null,
51
  datatable_config: null,
52
  tabletools_config: {print: 1, copy: 1, excel: 1, csv: 1, pdf: 0},
53
+ pdfPaperSize: 'A4',
54
+ pdfPageOrientation: 'portrait',
55
  showTableToolsIncludeHTML: 0,
56
  columns: [],
57
  columns_by_headers: {},
223
  wpdatatable_config.setTableToolsConfig({print: 1, copy: 1, excel: 1, csv: 1, pdf: 0}) :
224
  wpdatatable_config.setTableToolsConfig(table_tools);
225
  wpdatatable_config.setTableToolsIncludeHTML(0);
226
+ // Show/hide PDF export options
227
+ if (typeof wpdatatable_config.tabletools_config.pdf !== "undefined" && wpdatatable_config.tabletools_config.pdf == 1) {
228
+ jQuery('div.pdf-export-options').animateFadeIn();
229
+ } else {
230
+ jQuery('div.pdf-export-options').animateFadeOut();
231
+ }
232
  } else {
233
  jQuery('.wdt-table-settings .table-tools-settings-block').addClass('hidden');
 
234
  jQuery('.wdt-table-settings .table-tools-include-html-block').addClass('hidden');
235
+ jQuery('div.pdf-export-options').animateFadeOut();
236
+ wpdatatable_config.setTableToolsConfig({})
237
  wpdatatable_config.setTableToolsIncludeHTML(0);
238
+ wpdatatable_config.setPdfPaperSize('A4')
239
+ wpdatatable_config.setPdfPageOrientation('portrait')
240
  }
241
  jQuery('#wdt-table-tools').prop('checked', show_tabletools);
242
  },
670
  jQuery('#wdt-table-tools-config').val(tabletoolsConfigVal).selectpicker('refresh');
671
  }
672
  },
673
+ /**
674
+ * Set paper size for PDF export
675
+ */
676
+ setPdfPaperSize: function ( pdfPaperSize ) {
677
+ wpdatatable_config.pdfPaperSize = pdfPaperSize;
678
+ jQuery( '#wdt-pdf-paper-size' )
679
+ .val( pdfPaperSize )
680
+ .selectpicker( 'refresh' );
681
+ },
682
+ /**
683
+ * Set page orientation for PDF export
684
+ */
685
+ setPdfPageOrientation: function ( pdfPageOrientation ) {
686
+ wpdatatable_config.pdfPageOrientation = pdfPageOrientation;
687
+ jQuery( '#wdt-pdf-page-orientation' )
688
+ .val( pdfPageOrientation )
689
+ .selectpicker( 'refresh' );
690
+ },
691
  /**
692
  * Set the VAR 1 placeholder value
693
  */
858
  wpdatatable_config.setSorting(parseInt(tableJSON.sorting));
859
  wpdatatable_config.setShowTableTools(parseInt(tableJSON.tools), tableJSON.tabletools_config);
860
  wpdatatable_config.setTableToolsIncludeHTML( parseInt( tableJSON.showTableToolsIncludeHTML ) );
861
+ wpdatatable_config.setPdfPaperSize( tableJSON.pdfPaperSize);
862
+ wpdatatable_config.setPdfPageOrientation( tableJSON.pdfPageOrientation);
863
  wpdatatable_config.setWordWrap(tableJSON.word_wrap);
864
  wpdatatable_config.setPlaceholderVar1(tableJSON.var1);
865
  wpdatatable_config.setPlaceholderVar2(tableJSON.var2);
config/config.inc.php CHANGED
@@ -9,7 +9,7 @@ defined('ABSPATH') or die("Cannot access pages directly.");
9
 
10
  // Current version
11
 
12
- define('WDT_CURRENT_VERSION', '2.1.17');
13
 
14
  /**
15
  * Regular Expressions
9
 
10
  // Current version
11
 
12
+ define('WDT_CURRENT_VERSION', '2.1.18');
13
 
14
  /**
15
  * Regular Expressions
readme.txt CHANGED
@@ -6,7 +6,7 @@ Tags: table, table builder, data tables, tables, charts, simple table, tables fr
6
  Requires at least: 4.0
7
  Tested up to: 5.8
8
  Requires PHP: 5.6
9
- Stable tag: 2.1.17
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -237,6 +237,11 @@ This can be changed from the “Number format” drop-down menu in the wpDataTab
237
 
238
  == Changelog ==
239
 
 
 
 
 
 
240
  = 2.1.17 =
241
 
242
  * Bugfix: Removed unnecessary CSS.
6
  Requires at least: 4.0
7
  Tested up to: 5.8
8
  Requires PHP: 5.6
9
+ Stable tag: 2.1.18
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
237
 
238
  == Changelog ==
239
 
240
+ = 2.1.18 =
241
+ * Feature: Added new option "Page Orientation" for PDF export reports.
242
+ * Feature: Added new option "Paper Size" for PDF export reports.
243
+ * Other small bug fixes and stability improvements.
244
+
245
  = 2.1.17 =
246
 
247
  * Bugfix: Removed unnecessary CSS.
source/class.wdtconfigcontroller.php CHANGED
@@ -164,6 +164,9 @@ class WDTConfigController {
164
  $table->cellPadding = (isset($advancedSettings->cellPadding)) ? $advancedSettings->cellPadding : 10;
165
  $table->verticalScroll = (isset($advancedSettings->verticalScroll)) ? $advancedSettings->verticalScroll : 0;
166
  $table->verticalScrollHeight = (isset($advancedSettings->verticalScrollHeight)) ? $advancedSettings->verticalScrollHeight : 0;
 
 
 
167
 
168
 
169
  $table = self::sanitizeTableConfig($table);
@@ -284,7 +287,9 @@ class WDTConfigController {
284
  'stripeTable' => $table->stripeTable,
285
  'cellPadding' => $table->cellPadding,
286
  'verticalScroll' => $table->verticalScroll,
287
- 'verticalScrollHeight' => $table->verticalScrollHeight
 
 
288
  )
289
  )
290
  );
@@ -357,6 +362,8 @@ class WDTConfigController {
357
  $table->clearFilters = (int)$table->clearFilters;
358
  $table->display_length = (int)$table->display_length;
359
  $table->showRowsPerPage = (int)$table->showRowsPerPage;
 
 
360
  $table->userid_column_id = $table->userid_column_id != null ?
361
  (int)$table->userid_column_id : null;
362
 
@@ -935,6 +942,8 @@ class WDTConfigController {
935
  );
936
  $table->columns = array();
937
  $table->content = '';
 
 
938
 
939
  return $table;
940
  }
164
  $table->cellPadding = (isset($advancedSettings->cellPadding)) ? $advancedSettings->cellPadding : 10;
165
  $table->verticalScroll = (isset($advancedSettings->verticalScroll)) ? $advancedSettings->verticalScroll : 0;
166
  $table->verticalScrollHeight = (isset($advancedSettings->verticalScrollHeight)) ? $advancedSettings->verticalScrollHeight : 0;
167
+ $table->pdfPaperSize = isset($advancedSettings->pdfPaperSize) ? $advancedSettings->pdfPaperSize : 'A4';
168
+ $table->pdfPageOrientation = isset($advancedSettings->pdfPageOrientation) ? $advancedSettings->pdfPageOrientation : 'portrait';
169
+
170
 
171
 
172
  $table = self::sanitizeTableConfig($table);
287
  'stripeTable' => $table->stripeTable,
288
  'cellPadding' => $table->cellPadding,
289
  'verticalScroll' => $table->verticalScroll,
290
+ 'verticalScrollHeight' => $table->verticalScrollHeight,
291
+ 'pdfPaperSize' => $table->pdfPaperSize,
292
+ 'pdfPageOrientation' => $table->pdfPageOrientation
293
  )
294
  )
295
  );
362
  $table->clearFilters = (int)$table->clearFilters;
363
  $table->display_length = (int)$table->display_length;
364
  $table->showRowsPerPage = (int)$table->showRowsPerPage;
365
+ $table->pdfPaperSize = sanitize_text_field($table->pdfPaperSize);
366
+ $table->pdfPageOrientation = sanitize_text_field($table->pdfPageOrientation);
367
  $table->userid_column_id = $table->userid_column_id != null ?
368
  (int)$table->userid_column_id : null;
369
 
942
  );
943
  $table->columns = array();
944
  $table->content = '';
945
+ $table->pdfPaperSize = 'A4';
946
+ $table->pdfPageOrientation = 'portrait';
947
 
948
  return $table;
949
  }
source/class.wpdatatable.php CHANGED
@@ -87,6 +87,8 @@ class WPDataTable
87
  private $_aggregateFuncsRes = array();
88
  private $_ajaxReturn = false;
89
  private $_clearFilters = false;
 
 
90
  public static $allowedTableTypes = array('xls', 'csv', 'manual', 'mysql', 'json', 'google_spreadsheet', 'xml', 'serialized', 'simple');
91
 
92
  /**
@@ -776,9 +778,40 @@ class WPDataTable
776
  $this->_showRowsPerPage = (bool)$showRowsPerPage;
777
  }
778
 
779
- public function __construct()
 
 
 
780
  {
 
 
781
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
782
  if (self::$wdt_internal_idcount == 0) {
783
  $this->_firstOnPage = true;
784
  }
@@ -1957,6 +1990,8 @@ class WPDataTable
1957
  isset($advancedSettings->paginationAlign) ? $this->setPaginationAlign($advancedSettings->paginationAlign) : $this->setPaginationAlign('right');
1958
  isset($advancedSettings->paginationLayout) ? $this->setPaginationLayout($advancedSettings->paginationLayout) : $this->setPaginationLayout('full_numbers');
1959
  isset($advancedSettings->showTableToolsIncludeHTML) ? $this->setTableToolsIncludeHTML($advancedSettings->showTableToolsIncludeHTML) : $this->setTableToolsIncludeHTML(false);
 
 
1960
  } else {
1961
  $this->setInfoBlock(true);
1962
  $this->setGlobalSearch(true);
@@ -1971,6 +2006,8 @@ class WPDataTable
1971
  $this->setPaginationAlign('right');
1972
  $this->setPaginationLayout('full_numbers');
1973
  $this->setTableToolsIncludeHTML(false);
 
 
1974
  }
1975
 
1976
  if (!empty($columnData['columnOrder'])) {
@@ -2170,6 +2207,8 @@ class WPDataTable
2170
  $currentSkin = get_option('wdtBaseSkin');
2171
  $skinsWithNewTableToolsButtons = ['aqua', 'purple', 'dark'];
2172
  $tableToolsIncludeHTML = !$this->getTableToolsIncludeHTML();
 
 
2173
 
2174
  if ($this->TTEnabled()) {
2175
  (!isset($obj->dataTableParams->buttons)) ? $obj->dataTableParams->buttons = array() : '';
@@ -2239,7 +2278,9 @@ class WPDataTable
2239
  array(
2240
  'extend' => 'pdfHtml5',
2241
  'exportOptions' => array('columns' => ':visible'),
2242
- 'orientation' => 'portrait',
 
 
2243
  'title' => $wdtExportFileName,
2244
  'text' => __('PDF', 'wpdatatables')
2245
  );
@@ -2262,7 +2303,6 @@ class WPDataTable
2262
  'extend' => 'colvis',
2263
  'className' => 'DTTT_button DTTT_button_colvis',
2264
  'text' => __('Columns', 'wpdatatables')
2265
-
2266
  );
2267
  }
2268
  if (!empty($this->_tableToolsConfig['print'])) {
@@ -2324,7 +2364,8 @@ class WPDataTable
2324
  'extend' => 'pdfHtml5',
2325
  'exportOptions' => array('columns' => ':visible'),
2326
  'className' => 'DTTT_button DTTT_button_pdf',
2327
- 'orientation' => 'portrait',
 
2328
  'title' => $wdtExportFileName,
2329
  'text' => __('PDF', 'wpdatatables')
2330
  );
87
  private $_aggregateFuncsRes = array();
88
  private $_ajaxReturn = false;
89
  private $_clearFilters = false;
90
+ private $_pdfPaperSize = 'A4';
91
+ private $_pdfPageOrientation = 'portrait';
92
  public static $allowedTableTypes = array('xls', 'csv', 'manual', 'mysql', 'json', 'google_spreadsheet', 'xml', 'serialized', 'simple');
93
 
94
  /**
778
  $this->_showRowsPerPage = (bool)$showRowsPerPage;
779
  }
780
 
781
+ /**
782
+ * @return string
783
+ */
784
+ public function getPdfPaperSize()
785
  {
786
+ return $this->_pdfPaperSize;
787
+ }
788
 
789
+ /**
790
+ * @param string $pdfPaperSize
791
+ */
792
+ public function setPdfPaperSize($pdfPaperSize)
793
+ {
794
+ $this->_pdfPaperSize = $pdfPaperSize;
795
+ }
796
+
797
+ /**
798
+ * @return string
799
+ */
800
+ public function getPdfPageOrientation()
801
+ {
802
+ return $this->_pdfPageOrientation;
803
+ }
804
+
805
+ /**
806
+ * @param string $pdfPageOrientation
807
+ */
808
+ public function setPdfPageOrientation($pdfPageOrientation)
809
+ {
810
+ $this->_pdfPageOrientation = $pdfPageOrientation;
811
+ }
812
+
813
+ public function __construct()
814
+ {
815
  if (self::$wdt_internal_idcount == 0) {
816
  $this->_firstOnPage = true;
817
  }
1990
  isset($advancedSettings->paginationAlign) ? $this->setPaginationAlign($advancedSettings->paginationAlign) : $this->setPaginationAlign('right');
1991
  isset($advancedSettings->paginationLayout) ? $this->setPaginationLayout($advancedSettings->paginationLayout) : $this->setPaginationLayout('full_numbers');
1992
  isset($advancedSettings->showTableToolsIncludeHTML) ? $this->setTableToolsIncludeHTML($advancedSettings->showTableToolsIncludeHTML) : $this->setTableToolsIncludeHTML(false);
1993
+ isset($advancedSettings->pdfPaperSize) ? $this->setPdfPaperSize($advancedSettings->pdfPaperSize) : $this->setPdfPaperSize('A4');
1994
+ isset($advancedSettings->pdfPageOrientation) ? $this->setPdfPageOrientation($advancedSettings->pdfPageOrientation) : $this->setPdfPageOrientation('portrait');
1995
  } else {
1996
  $this->setInfoBlock(true);
1997
  $this->setGlobalSearch(true);
2006
  $this->setPaginationAlign('right');
2007
  $this->setPaginationLayout('full_numbers');
2008
  $this->setTableToolsIncludeHTML(false);
2009
+ $this->setPdfPaperSize('A4');
2010
+ $this->setPdfPageOrientation('portrait');
2011
  }
2012
 
2013
  if (!empty($columnData['columnOrder'])) {
2207
  $currentSkin = get_option('wdtBaseSkin');
2208
  $skinsWithNewTableToolsButtons = ['aqua', 'purple', 'dark'];
2209
  $tableToolsIncludeHTML = !$this->getTableToolsIncludeHTML();
2210
+ $pdfPaperSize = $this->getPdfPaperSize();
2211
+ $pdfPageOrientation = $this->getPdfPageOrientation();
2212
 
2213
  if ($this->TTEnabled()) {
2214
  (!isset($obj->dataTableParams->buttons)) ? $obj->dataTableParams->buttons = array() : '';
2278
  array(
2279
  'extend' => 'pdfHtml5',
2280
  'exportOptions' => array('columns' => ':visible'),
2281
+ 'className' => 'DTTT_button DTTT_button_pdf',
2282
+ 'orientation' => $pdfPageOrientation,
2283
+ 'pageSize' => $pdfPaperSize,
2284
  'title' => $wdtExportFileName,
2285
  'text' => __('PDF', 'wpdatatables')
2286
  );
2303
  'extend' => 'colvis',
2304
  'className' => 'DTTT_button DTTT_button_colvis',
2305
  'text' => __('Columns', 'wpdatatables')
 
2306
  );
2307
  }
2308
  if (!empty($this->_tableToolsConfig['print'])) {
2364
  'extend' => 'pdfHtml5',
2365
  'exportOptions' => array('columns' => ':visible'),
2366
  'className' => 'DTTT_button DTTT_button_pdf',
2367
+ 'orientation' => $pdfPageOrientation,
2368
+ 'pageSize' => $pdfPaperSize,
2369
  'title' => $wdtExportFileName,
2370
  'text' => __('PDF', 'wpdatatables')
2371
  );
templates/admin/table-settings/table_settings_block.inc.php CHANGED
@@ -1082,6 +1082,44 @@
1082
  </div>
1083
  <!-- /.row -->
1084
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1085
  </div>
1086
  <!-- /Table tools settings -->
1087
 
1082
  </div>
1083
  <!-- /.row -->
1084
 
1085
+ <!-- .row -->
1086
+ <div class="row pdf-export-options hidden">
1087
+ <div class="col-sm-4 m-b-16">
1088
+ <h4 class="c-title-color m-b-2">
1089
+ <?php _e('PDF Paper Size', 'wpdatatables'); ?>
1090
+ <i class=" wpdt-icon-info-circle-thin" data-toggle="tooltip" data-placement="right"
1091
+ title=" <?php _e('Choose between different paper sizes for the created PDF.', 'wpdatatables'); ?>"></i>
1092
+ </h4>
1093
+ <div class="select">
1094
+ <select class="form-control selectpicker"
1095
+ id="wdt-pdf-paper-size">
1096
+ <option value="A3"><?php _e('A3', 'wpdatatables'); ?></option>
1097
+ <option value="A4" selected><?php _e('A4', 'wpdatatables'); ?></option>
1098
+ <option value="A5"><?php _e('A5', 'wpdatatables'); ?></option>
1099
+ <option value="LEGAL"><?php _e('Legal', 'wpdatatables'); ?></option>
1100
+ <option value="LETTER"><?php _e('Letter', 'wpdatatables'); ?></option>
1101
+ <option value="TABLOID"><?php _e('Tabloid', 'wpdatatables'); ?></option>
1102
+ </select>
1103
+ </div>
1104
+ </div>
1105
+
1106
+ <div class="col-sm-4 m-b-16">
1107
+ <h4 class="c-title-color m-b-2">
1108
+ <?php _e('Page orientation', 'wpdatatables'); ?>
1109
+ <i class=" wpdt-icon-info-circle-thin" data-toggle="tooltip" data-placement="right"
1110
+ title=" <?php _e('Choose a paper orientation for the created PDF.', 'wpdatatables'); ?>"></i>
1111
+ </h4>
1112
+ <div class="select">
1113
+ <select class="form-control selectpicker"
1114
+ id="wdt-pdf-page-orientation">
1115
+ <option value="portrait" selected><?php _e('Portrait', 'wpdatatables'); ?></option>
1116
+ <option value="landscape"><?php _e('Landscape', 'wpdatatables'); ?></option>
1117
+ </select>
1118
+ </div>
1119
+ </div>
1120
+ </div>
1121
+ <!-- /.row -->
1122
+
1123
  </div>
1124
  <!-- /Table tools settings -->
1125
 
wpdatatables.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: wpDataTables - Tables & Table Charts
4
  Plugin URI: https://wpdatatables.com
5
  Description: Create responsive, sortable tables & charts from Excel, CSV or PHP. Add tables & charts to any post in minutes with DataTables.
6
- Version: 2.1.17
7
  Author: TMS-Plugins
8
  Author URI: https://tms-outsource.com
9
  Text Domain: wpdatatables
3
  Plugin Name: wpDataTables - Tables & Table Charts
4
  Plugin URI: https://wpdatatables.com
5
  Description: Create responsive, sortable tables & charts from Excel, CSV or PHP. Add tables & charts to any post in minutes with DataTables.
6
+ Version: 2.1.18
7
  Author: TMS-Plugins
8
  Author URI: https://tms-outsource.com
9
  Text Domain: wpdatatables