PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 1.6.6
Visualizer – Tables & Charts Manager with Built-in AI Generator v1.6.6
4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 3.10.4 All 148 releases
visualizer / classes / Visualizer / Render / Page / Data.php

Data.php in Visualizer – Tables & Charts Manager with Built-in AI Generator 1.6.6, at classes/Visualizer/Render/Page/Data.php

151 lines 6.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // +----------------------------------------------------------------------+
4 // | Copyright 2013 Madpixels (email : visualizer@madpixels.net) |
5 // +----------------------------------------------------------------------+
6 // | This program is free software; you can redistribute it and/or modify |
7 // | it under the terms of the GNU General Public License, version 2, as |
8 // | published by the Free Software Foundation. |
9 // | |
10 // | This program is distributed in the hope that it will be useful, |
11 // | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 // | GNU General Public License for more details. |
14 // | |
15 // | You should have received a copy of the GNU General Public License |
16 // | along with this program; if not, write to the Free Software |
17 // | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, |
18 // | MA 02110-1301 USA |
19 // +----------------------------------------------------------------------+
20 // | Author: Eugene Manuilov <eugene@manuilov.org> |
21 // +----------------------------------------------------------------------+
22
23 /**
24 * Renders chart data setup page.
25 *
26 * @category Visualizer
27 * @package Render
28 * @subpackage Page
29 *
30 * @since 1.0.0
31 */
32 class Visualizer_Render_Page_Data extends Visualizer_Render_Page {
33
34 /**
35 * Renders page content.
36 *
37 * @since 1.0.0
38 *
39 * @access protected
40 */
41 protected function _renderContent() {
42 // Added by Ash/Upwork
43 if( defined( 'Visualizer_Pro' ) ){
44 global $Visualizer_Pro;
45 $Visualizer_Pro->_addEditor();
46 }
47 // Added by Ash/Upwork
48
49 echo '<div id="canvas">';
50 echo '<img src="', VISUALIZER_ABSURL, 'images/ajax-loader.gif" class="loader">';
51 echo '</div>';
52 }
53
54 /**
55 * Renders sidebar content.
56 *
57 * @since 1.0.0
58 *
59 * @access protected
60 */
61 protected function _renderSidebarContent() {
62 $upload_link = add_query_arg( array(
63 'action' => Visualizer_Plugin::ACTION_UPLOAD_DATA,
64 'nonce' => wp_create_nonce(),
65 'chart' => $this->chart->ID,
66 ), admin_url( 'admin-ajax.php' ) );
67
68 echo '<input type="button" name="back_button" class="return-settings-btn preview-btn hidden-setting" value="&laquo; Back">';
69 echo '<div class="initial-screen">';
70 echo '<iframe id="thehole" name="thehole"></iframe>';
71 echo '<p class="group-description">';
72 esc_html_e( "Select and upload your data CSV file here. The first row of the CSV file should contain the column headings. The second one should contain series type (string, number, boolean, date, datetime, timeofday).", Visualizer_Plugin::NAME );
73 echo '</p>';
74
75 echo '<p class="group-description">';
76 esc_html_e( 'If you are unsure about how to format your data CSV then please take a look at this sample:', Visualizer_Plugin::NAME );
77 echo ' <a href="', VISUALIZER_ABSURL, 'samples/', $this->type, '.csv" target="_blank">', $this->type, '.csv</a> ';
78 printf( esc_html__( 'or read how you can add Google spreadsheet in following %sarticle%s.', Visualizer_Plugin::NAME ), '<a href="https://github.com/madpixelslabs/visualizer/wiki/How-can-I-populate-data-from-Google-Spreadsheet%3F" target="_blank">', '</a>' );
79 echo '</p>';
80
81 echo '<div>';
82 echo '<form id="csv-form" action="', $upload_link, '" method="post" target="thehole" enctype="multipart/form-data">';
83 echo '<input type="hidden" id="remote-data" name="remote_data">';
84 echo '<div class="form-inline">';
85 echo '<div class="button button-primary file-wrapper computer-btn">';
86 echo '<input type="file" id="csv-file" class="file" name="local_data">';
87 esc_attr_e( 'From Computer', Visualizer_Plugin::NAME );
88 echo '</div>';
89
90 echo '<a id="remote-file" class="button from-web from-web-btn" href="javascript:;">', esc_html__( 'From Web', Visualizer_Plugin::NAME ), '</a>';
91 // Added by Ash/Upwork
92 if( defined( 'Visualizer_Pro' ) ){
93 global $Visualizer_Pro;
94 $Visualizer_Pro->_addFormElements();
95 }else{
96 // Added by Ash/Upwork
97 echo '<div class="just-on-pro"> </div>';
98 }
99 echo '</div>';
100 echo '</form>';
101
102 // added by Ash/Upwork
103 if( defined( 'Visualizer_Pro' ) ){
104 global $Visualizer_Pro;
105 $Visualizer_Pro->_addEditorElements();
106 }else{
107 ?>
108 <a href="<?php echo Visualizer_Plugin::PRO_TEASER_URL;?>" title="<?php echo Visualizer_Plugin::PRO_TEASER_TITLE;?>" class="check-pro-btn" target="_new">
109 <input type="button" class="button preview preview-btn" id="existing-chart-free" value="<?php esc_attr_e( 'Check PRO Version ', Visualizer_Plugin::NAME );?>">
110 </a>
111 <?php
112 }
113
114 echo'<input type="button" name="advanced_button" class="advanced-settings-btn preview-btn" value="'. __( 'Advanced', Visualizer_Plugin::NAME ).' &raquo;">';
115 // Added by Ash/Upwork
116
117 echo '</div>';
118 echo '</div>';
119
120 // changed by Ash/Upwork
121 echo '<div class= "second-screen hidden-setting">';
122 echo '<form id="settings-form" action="', add_query_arg( 'nonce', wp_create_nonce() ), '" method="post">';
123 echo $this->sidebar;
124 echo '</form>';
125 echo '</div>';
126 // changed by Ash/Upwork
127 }
128
129 /**
130 * Renders toolbar content.
131 *
132 * @since 1.0.0
133 *
134 * @access protected
135 */
136 protected function _renderToolbar() {
137 // changed by Ash/Upwork
138 echo '<div class="toolbar-div">';
139 echo '<a class="button button-large" href="', add_query_arg( 'tab', 'types' ), '">';
140 esc_html_e( 'Back', Visualizer_Plugin::NAME );
141 echo '</a>';
142 echo '</div>';
143 echo '<input type="submit" id="settings-button" class="button button-primary button-large push-right" value="', $this->button, '">';
144
145 echo '</div>';
146
147
148 }
149
150 }
151