Easy Table - Version 1.1.4

Version Description

  • Added new parameter 'fixlinebreak' to optionally convert newline to <br /> if terminator is not \r or \n
Download this release

Release Info

Developer takien
Plugin Icon wp plugin Easy Table
Version 1.1.4
Comparing to
See all releases

Code changes from version 1.1.3 to 1.1.4

easy-table.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Easy Table
4
  Plugin URI: http://takien.com/
5
  Description: Create table in post, page, or widget in easy way.
6
  Author: Takien
7
- Version: 1.1.3
8
  Author URI: http://takien.com/
9
  */
10
 
@@ -55,7 +55,8 @@ var $settings = Array(
55
  'nl' => '~~',
56
  'csvfile' => false,
57
  'terminator' => '\n', /*row terminator, since 1.0*/
58
- 'limit' => 0 /*max row to be included to table, 0 = unlimited, since 1.0*/
 
59
  );
60
 
61
 
@@ -85,7 +86,7 @@ function __construct(){
85
  private function easy_table_base($return){
86
  $easy_table_base = Array(
87
  'name' => 'Easy Table',
88
- 'version' => '1.1.3',
89
  'plugin-domain' => 'easy-table'
90
  );
91
  return $easy_table_base[$return];
@@ -115,6 +116,7 @@ function easy_table_short_code($atts, $content="") {
115
  'style' => '', /*table inline style, since 1.0*/
116
  'colalign' => '', /*column align, ex: [table colalign="left|right|center"], @since 1.0*/
117
  'colwidth' => '', /*column width, ex: [table colwidth="100|200|300"], @since 1.0*/
 
118
  ), $atts);
119
  /**
120
  * because clean_pre is deprecated since WordPress 3.4, then replace it manually
@@ -321,9 +323,13 @@ ai head, text to shown in the table head row, default is No.
321
  $cell = $trim ? trim(str_replace('&nbsp;','',$cell)) : $cell;
322
 
323
  /*nl2br? only if terminator is not \n or \r*/
324
- if(( '\n' !== $terminator ) OR ( '\r' !== $terminator )) {
325
- $cell = nl2br($cell);
326
- }
 
 
 
 
327
  /*colalign
328
  @since 1.0
329
  */
@@ -838,6 +844,13 @@ settings_fields('easy_table_option_field');
838
  'type' => 'text',
839
  'value' => $this->option('escape'),
840
  'description' =>__('CSV escape (default is backslash)','easy-table'))
 
 
 
 
 
 
 
841
  ,Array(
842
  'name' => 'easy_table_plugin_option[csvfile]',
843
  'label' => __('Allow read CSV from file?','easy-table'),
4
  Plugin URI: http://takien.com/
5
  Description: Create table in post, page, or widget in easy way.
6
  Author: Takien
7
+ Version: 1.1.4
8
  Author URI: http://takien.com/
9
  */
10
 
55
  'nl' => '~~',
56
  'csvfile' => false,
57
  'terminator' => '\n', /*row terminator, since 1.0*/
58
+ 'limit' => 0, /*max row to be included to table, 0 = unlimited, since 1.0*/
59
+ 'fixlinebreak' => false
60
  );
61
 
62
 
86
  private function easy_table_base($return){
87
  $easy_table_base = Array(
88
  'name' => 'Easy Table',
89
+ 'version' => '1.1.4',
90
  'plugin-domain' => 'easy-table'
91
  );
92
  return $easy_table_base[$return];
116
  'style' => '', /*table inline style, since 1.0*/
117
  'colalign' => '', /*column align, ex: [table colalign="left|right|center"], @since 1.0*/
118
  'colwidth' => '', /*column width, ex: [table colwidth="100|200|300"], @since 1.0*/
119
+ 'fixlinebreak' => $this->option('fixlinebreak') /* fix linebreak on cell if terminator is not \n or \r @since 1.1.4 */
120
  ), $atts);
121
  /**
122
  * because clean_pre is deprecated since WordPress 3.4, then replace it manually
323
  $cell = $trim ? trim(str_replace('&nbsp;','',$cell)) : $cell;
324
 
325
  /*nl2br? only if terminator is not \n or \r*/
326
+ /* optionally, if $fixlinebreak is set. @since 1.1.4 */
327
+
328
+ if ( $fixlinebreak ) {
329
+ if(( '\n' !== $terminator ) OR ( '\r' !== $terminator )) {
330
+ $cell = nl2br($cell);
331
+ }
332
+ }
333
  /*colalign
334
  @since 1.0
335
  */
844
  'type' => 'text',
845
  'value' => $this->option('escape'),
846
  'description' =>__('CSV escape (default is backslash)','easy-table'))
847
+ ,Array(
848
+ 'name' => 'easy_table_plugin_option[fixlinebreak]',
849
+ 'label' => __('Fix linebreak','easy-table'),
850
+ 'type' => 'checkbox',
851
+ 'value' => 1,
852
+ 'description' => __('If terminator is not default (linebreak), you may encounter some issue with linebreak inside cell, try to check or uncheck this to resolve','easy-table'),
853
+ 'attr' => $this->option('fixlinebreak') ? 'checked="checked"' : '')
854
  ,Array(
855
  'name' => 'easy_table_plugin_option[csvfile]',
856
  'label' => __('Allow read CSV from file?','easy-table'),
languages/easy-table-id_ID.mo CHANGED
Binary file
languages/easy-table-id_ID.po CHANGED
@@ -1,10 +1,10 @@
1
  msgid ""
2
  msgstr ""
3
- "Project-Id-Version: easy-table 1.1.3\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: 2013-05-13 04:14+0700\n"
6
- "PO-Revision-Date: 2013-08-12 11:50+0700\n"
7
- "Last-Translator: takien <imissuaja@yahoo.com>\n"
8
  "Language-Team: takien.com <contact@takien.com>\n"
9
  "Language: id_ID\n"
10
  "MIME-Version: 1.0\n"
1
  msgid ""
2
  msgstr ""
3
+ "Project-Id-Version: easy-table 1.1.4\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: 2013-05-13 04:14+0700\n"
6
+ "PO-Revision-Date: 2013-08-12 12:36+0700\n"
7
+ "Last-Translator: takien <contact@takien.com>\n"
8
  "Language-Team: takien.com <contact@takien.com>\n"
9
  "Language: id_ID\n"
10
  "MIME-Version: 1.0\n"
languages/english.mo CHANGED
Binary file
languages/english.po CHANGED
@@ -1,10 +1,10 @@
1
  msgid ""
2
  msgstr ""
3
- "Project-Id-Version: easy-table 1.1.3\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: 2013-05-13 04:13+0700\n"
6
- "PO-Revision-Date: 2013-08-12 11:50+0700\n"
7
- "Last-Translator: takien <imissuaja@yahoo.com>\n"
8
  "Language-Team: takien.com <contact@takien.com>\n"
9
  "Language: en_US\n"
10
  "MIME-Version: 1.0\n"
1
  msgid ""
2
  msgstr ""
3
+ "Project-Id-Version: easy-table 1.1.4\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: 2013-05-13 04:13+0700\n"
6
+ "PO-Revision-Date: 2013-08-12 12:36+0700\n"
7
+ "Last-Translator: takien <contact@takien.com>\n"
8
  "Language-Team: takien.com <contact@takien.com>\n"
9
  "Language: en_US\n"
10
  "MIME-Version: 1.0\n"
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://takien.com/donate
4
  Tags: table,csv,csv-to-table,post,excel,csv file,widget,tablesorter
5
  Requires at least: 3.0
6
  Tested up to: 3.6
7
- Stable tag: 1.1.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -47,7 +47,7 @@ Year,Make,Model,Length
47
  2000,Mercury,Cougar,2.38
48
  [/table]`
49
 
50
- Valid with value : auto, any number followed by % or px.
51
  If width not set, it will use default width value ( can be changed via Plugin option )
52
 
53
  * Table with colspan and other attribute in some cells
@@ -225,6 +225,9 @@ No
225
 
226
  == Changelog ==
227
 
 
 
 
228
  = 1.1.3 =
229
  * Added: now you can use 'auto' for table width
230
  * Table width now use inline style ( internally, not affected to the plugin usage )
4
  Tags: table,csv,csv-to-table,post,excel,csv file,widget,tablesorter
5
  Requires at least: 3.0
6
  Tested up to: 3.6
7
+ Stable tag: 1.1.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
47
  2000,Mercury,Cougar,2.38
48
  [/table]`
49
 
50
+ Valid width value : auto, any number followed by % or px.
51
  If width not set, it will use default width value ( can be changed via Plugin option )
52
 
53
  * Table with colspan and other attribute in some cells
225
 
226
  == Changelog ==
227
 
228
+ = 1.1.4 =
229
+ * Added new parameter 'fixlinebreak' to optionally convert newline to &lt;br /&gt; if terminator is not \r or \n
230
+
231
  = 1.1.3 =
232
  * Added: now you can use 'auto' for table width
233
  * Table width now use inline style ( internally, not affected to the plugin usage )