@@ -215,9 +215,10 @@ public function setJsonData() {
215
215
$ chart = get_post ( $ chart_id );
216
216
217
217
$ source = new Visualizer_Source_Json ( $ params );
218
+ update_post_meta ( $ chart ->ID , Visualizer_Plugin::CF_EDITABLE_TABLE , true );
218
219
$ source ->fetchFromEditableTable ();
219
220
220
- $ content = $ source ->getData ();
221
+ $ content = $ source ->getData ( get_post_meta ( $ chart -> ID , Visualizer_Plugin:: CF_EDITABLE_TABLE , true ) );
221
222
$ chart ->post_content = $ content ;
222
223
wp_update_post ( $ chart ->to_array () );
223
224
update_post_meta ( $ chart ->ID , Visualizer_Plugin::CF_SERIES , $ source ->getSeries () );
@@ -266,7 +267,7 @@ public function setJsonData() {
266
267
267
268
$ render = new Visualizer_Render_Page_Update ();
268
269
$ render ->id = $ chart ->ID ;
269
- $ render ->data = json_encode ( $ source ->getRawData () );
270
+ $ render ->data = json_encode ( $ source ->getRawData ( get_post_meta ( $ chart_id , Visualizer_Plugin:: CF_EDITABLE_TABLE , true ) ) );
270
271
$ render ->series = json_encode ( $ source ->getSeries () );
271
272
$ render ->render ();
272
273
@@ -498,7 +499,7 @@ public function renderChartPages() {
498
499
'post_title ' => 'Visualization ' ,
499
500
'post_author ' => get_current_user_id (),
500
501
'post_status ' => 'auto-draft ' ,
501
- 'post_content ' => $ source ->getData (),
502
+ 'post_content ' => $ source ->getData ( get_post_meta ( $ chart_id , Visualizer_Plugin:: CF_EDITABLE_TABLE , true ) ),
502
503
)
503
504
);
504
505
if ( $ chart_id && ! is_wp_error ( $ chart_id ) ) {
@@ -851,7 +852,7 @@ private function _handleTypesPage() {
851
852
if ( filter_var ( get_post_meta ( $ this ->_chart ->ID , Visualizer_Plugin::CF_DEFAULT_DATA , true ), FILTER_VALIDATE_BOOLEAN ) ) {
852
853
$ source = new Visualizer_Source_Csv ( VISUALIZER_ABSPATH . DIRECTORY_SEPARATOR . 'samples ' . DIRECTORY_SEPARATOR . $ type . '.csv ' );
853
854
$ source ->fetch ();
854
- $ this ->_chart ->post_content = $ source ->getData ();
855
+ $ this ->_chart ->post_content = $ source ->getData ( get_post_meta ( $ this -> _chart -> ID , Visualizer_Plugin:: CF_EDITABLE_TABLE , true ) );
855
856
wp_update_post ( $ this ->_chart ->to_array () );
856
857
update_post_meta ( $ this ->_chart ->ID , Visualizer_Plugin::CF_SERIES , $ source ->getSeries () );
857
858
}
@@ -1087,7 +1088,7 @@ public function uploadData() {
1087
1088
1088
1089
if ( $ source ) {
1089
1090
if ( $ source ->fetch () ) {
1090
- $ content = $ source ->getData ();
1091
+ $ content = $ source ->getData ( get_post_meta ( $ chart_id , Visualizer_Plugin:: CF_EDITABLE_TABLE , true ) );
1091
1092
$ populate = true ;
1092
1093
if ( is_string ( $ content ) && is_array ( unserialize ( $ content ) ) ) {
1093
1094
$ json = unserialize ( $ content );
@@ -1114,7 +1115,7 @@ public function uploadData() {
1114
1115
$ settings = get_post_meta ( $ chart ->ID , Visualizer_Plugin::CF_SETTINGS , true );
1115
1116
1116
1117
$ render ->id = $ chart ->ID ;
1117
- $ render ->data = json_encode ( $ source ->getRawData () );
1118
+ $ render ->data = json_encode ( $ source ->getRawData ( get_post_meta ( $ chart -> ID , Visualizer_Plugin:: CF_EDITABLE_TABLE , true ) ) );
1118
1119
$ render ->series = json_encode ( $ source ->getSeries () );
1119
1120
$ render ->settings = json_encode ( $ settings );
1120
1121
} else {
@@ -1349,10 +1350,10 @@ public function saveQuery() {
1349
1350
wp_update_post (
1350
1351
array (
1351
1352
'ID ' => $ chart_id ,
1352
- 'post_content ' => $ source ->getData (),
1353
+ 'post_content ' => $ source ->getData ( get_post_meta ( $ chart_id , Visualizer_Plugin:: CF_EDITABLE_TABLE , true ) ),
1353
1354
)
1354
1355
);
1355
- $ render ->data = json_encode ( $ source ->getRawData () );
1356
+ $ render ->data = json_encode ( $ source ->getRawData ( get_post_meta ( $ chart_id , Visualizer_Plugin:: CF_EDITABLE_TABLE , true ) ) );
1356
1357
$ render ->series = json_encode ( $ source ->getSeries () );
1357
1358
$ render ->id = $ chart_id ;
1358
1359
} else {
0 commit comments