PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 1.7.0
Visualizer – Tables & Charts Manager with Built-in AI Generator v1.7.0
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.7.0, at classes/Visualizer/Render/Page/Data.php

147 lines 5.7 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 * Renders chart data setup page.
24 *
25 * @category Visualizer
26 * @package Render
27 * @subpackage Page
28 *
29 * @since 1.0.0
30 */
31 class Visualizer_Render_Page_Data extends Visualizer_Render_Page {
32
33 /**
34 * Renders page content.
35 *
36 * @since 1.0.0
37 *
38 * @access protected
39 */
40 protected function _renderContent() {
41 // Added by Ash/Upwork
42 if ( defined( 'Visualizer_Pro' ) ) {
43 global $Visualizer_Pro;
44 $Visualizer_Pro->_addEditor();
45 }
46 // Added by Ash/Upwork
47 echo '<div id="canvas">';
48 echo '<img src="', VISUALIZER_ABSURL, 'images/ajax-loader.gif" class="loader">';
49 echo '</div>';
50 }
51
52 /**
53 * Renders sidebar content.
54 *
55 * @since 1.0.0
56 *
57 * @access protected
58 */
59 protected function _renderSidebarContent() {
60 $upload_link = add_query_arg( array(
61 'action' => Visualizer_Plugin::ACTION_UPLOAD_DATA,
62 'nonce' => wp_create_nonce(),
63 'chart' => $this->chart->ID,
64 ), admin_url( 'admin-ajax.php' ) );
65
66 echo '<input type="button" name="back_button" class="return-settings-btn preview-btn hidden-setting" value="&laquo; Back">';
67 echo '<div class="initial-screen">';
68 echo '<iframe id="thehole" name="thehole"></iframe>';
69 echo '<p class="group-description">';
70 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' );
71 echo '</p>';
72
73 echo '<p class="group-description">';
74 esc_html_e( 'If you are unsure about how to format your data CSV then please take a look at this sample:', 'visualizer' );
75 echo ' <a href="', VISUALIZER_ABSURL, 'samples/', $this->type, '.csv" target="_blank">', $this->type, '.csv</a> ';
76 printf( esc_html__( 'or read how you can add Google spreadsheet in following %1$sarticle%1$s.', 'visualizer' ), '<a href="https://github.com/madpixelslabs/visualizer/wiki/How-can-I-populate-data-from-Google-Spreadsheet%3F" target="_blank">', '</a>' );
77 echo '</p>';
78
79 echo '<div>';
80 echo '<form id="csv-form" action="', $upload_link, '" method="post" target="thehole" enctype="multipart/form-data">';
81 echo '<input type="hidden" id="remote-data" name="remote_data">';
82 echo '<div class="form-inline">';
83 echo '<div class="button button-primary file-wrapper computer-btn">';
84 echo '<input type="file" id="csv-file" class="file" name="local_data">';
85 esc_attr_e( 'From Computer', 'visualizer' );
86 echo '</div>';
87
88 echo '<a id="remote-file" class="button from-web from-web-btn" href="javascript:;">', esc_html__( 'From Web', 'visualizer' ), '</a>';
89 // Added by Ash/Upwork
90 if ( defined( 'Visualizer_Pro' ) ) {
91 global $Visualizer_Pro;
92 $Visualizer_Pro->_addFormElements();
93 } else {
94 // Added by Ash/Upwork
95 echo '<div class="just-on-pro"> </div>';
96 }
97 echo '</div>';
98 echo '</form>';
99
100 // added by Ash/Upwork
101 if ( defined( 'Visualizer_Pro' ) ) {
102 global $Visualizer_Pro;
103 $Visualizer_Pro->_addEditorElements();
104 } else {
105 ?>
106 <a href="<?php echo Visualizer_Plugin::PRO_TEASER_URL;?>" title="<?php echo Visualizer_Plugin::PRO_TEASER_TITLE;?>" class="check-pro-btn" target="_new">
107 <input type="button" class="button preview preview-btn" id="existing-chart-free" value="<?php esc_attr_e( 'Check PRO Version ', 'visualizer' );?>">
108 </a>
109 <?php
110 }
111
112 echo'<input type="button" name="advanced_button" class="advanced-settings-btn preview-btn" value="' . __( 'Advanced', 'visualizer' ) . ' &raquo;">';
113 // Added by Ash/Upwork
114 echo '</div>';
115 echo '</div>';
116
117 // changed by Ash/Upwork
118 echo '<div class= "second-screen hidden-setting">';
119 echo '<form id="settings-form" action="', add_query_arg( 'nonce', wp_create_nonce() ), '" method="post">';
120 echo $this->sidebar;
121 echo '</form>';
122 echo '</div>';
123 // changed by Ash/Upwork
124 }
125
126 /**
127 * Renders toolbar content.
128 *
129 * @since 1.0.0
130 *
131 * @access protected
132 */
133 protected function _renderToolbar() {
134 // changed by Ash/Upwork
135 echo '<div class="toolbar-div">';
136 echo '<a class="button button-large" href="', add_query_arg( 'tab', 'types' ), '">';
137 esc_html_e( 'Back', 'visualizer' );
138 echo '</a>';
139 echo '</div>';
140 echo '<input type="submit" id="settings-button" class="button button-primary button-large push-right" value="', $this->button, '">';
141
142 echo '</div>';
143
144 }
145
146 }
147