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

106 lines 4.4 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 echo '<div id="canvas">';
43 echo '<img src="', VISUALIZER_ABSURL, 'images/ajax-loader.gif" class="loader">';
44 echo '</div>';
45 }
46
47 /**
48 * Renders sidebar content.
49 *
50 * @since 1.0.0
51 *
52 * @access protected
53 */
54 protected function _renderSidebarContent() {
55 $upload_link = add_query_arg( array(
56 'action' => Visualizer_Plugin::ACTION_UPLOAD_DATA,
57 'nonce' => Visualizer_Security::createNonce(),
58 'chart' => $this->chart->ID,
59 ), admin_url( 'admin-ajax.php' ) );
60
61 echo '<li class="group">';
62 echo '<h3 class="group-title">', esc_html__( 'Upload CSV File', Visualizer_Plugin::NAME ), '</h3>';
63 echo '<div class="group-content">';
64 echo '<iframe id="thehole" name="thehole"></iframe>';
65
66 echo '<p class="group-description">';
67 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 );
68 echo '</p>';
69
70 echo '<p class="group-description">';
71 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 );
72 echo ' <a href="', VISUALIZER_ABSURL, 'samples/', $this->type, '.csv" target="_blank">', $this->type, '.csv</a> ';
73 printf( esc_html__( 'or read how you can add Google spreadsheet in following %sarticle%s.', Visualizer_Plugin::NAME ), '<a href="http://visualizer.madpixels.net/knowledgebase/how-can-i-populate-data-from-google-spreadsheet/" target="_blank">', '</a>' );
74 echo '</p>';
75
76 echo '<div>';
77 echo '<form id="csv-form" action="', $upload_link, '" method="post" target="thehole" enctype="multipart/form-data">';
78 echo '<input type="hidden" id="remote-data" name="remote_data">';
79 echo '<div class="button button-primary file-wrapper">';
80 echo '<input type="file" id="csv-file" class="file" name="local_data">';
81 esc_attr_e( 'From Computer', Visualizer_Plugin::NAME );
82 echo '</div>';
83 echo '<a id="remote-file" class="button" href="javascript:;">', esc_html__( 'From Web', Visualizer_Plugin::NAME ), '</a>';
84 echo '</form>';
85 echo '</div>';
86 echo '</div>';
87 echo '</li>';
88 }
89
90 /**
91 * Renders toolbar content.
92 *
93 * @since 1.0.0
94 *
95 * @access protected
96 */
97 protected function _renderToolbar() {
98 echo '<a class="button button-large" href="', add_query_arg( 'tab', false ), '">';
99 esc_html_e( 'Back', Visualizer_Plugin::NAME );
100 echo '</a>';
101 echo '<a class="button button-large button-primary push-right" href="', add_query_arg( 'tab', 'settings' ), '">';
102 esc_html_e( 'Next', Visualizer_Plugin::NAME );
103 echo '</a>';
104 }
105
106 }