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

137 lines 5.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // +----------------------------------------------------------------------+
3 // | Copyright 2013 Madpixels (email : visualizer@madpixels.net) |
4 // +----------------------------------------------------------------------+
5 // | This program is free software; you can redistribute it and/or modify |
6 // | it under the terms of the GNU General Public License, version 2, as |
7 // | published by the Free Software Foundation. |
8 // | |
9 // | This program is distributed in the hope that it will be useful, |
10 // | but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 // | GNU General Public License for more details. |
13 // | |
14 // | You should have received a copy of the GNU General Public License |
15 // | along with this program; if not, write to the Free Software |
16 // | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, |
17 // | MA 02110-1301 USA |
18 // +----------------------------------------------------------------------+
19 // | Author: Eugene Manuilov <eugene@manuilov.org> |
20 // +----------------------------------------------------------------------+
21 /**
22 * Renders chart data setup page.
23 *
24 * @category Visualizer
25 * @package Render
26 * @subpackage Page
27 *
28 * @since 1.0.0
29 */
30 class Visualizer_Render_Page_Data extends Visualizer_Render_Page {
31
32 /**
33 * Renders page content.
34 *
35 * @since 1.0.0
36 *
37 * @access protected
38 */
39 protected function _renderContent() {
40 // Added by Ash/Upwork
41 if ( Visualizer_Module::can_show_feature( 'simple-editor' ) ) {
42 Visualizer_Render_Layout::show( 'simple-editor-screen', $this->chart->ID );
43 }
44
45 if ( Visualizer_Module::is_pro() ) {
46 do_action( 'visualizer_add_editor_etc', $this->chart->ID );
47
48 if ( Visualizer_Module::is_pro() && Visualizer_Module::is_pro_older_than( '1.9.0' ) ) {
49 global $Visualizer_Pro;
50 $Visualizer_Pro->_addEditor( $this->chart->ID );
51 if ( method_exists( $Visualizer_Pro, '_addFilterWizard' ) ) {
52 $Visualizer_Pro->_addFilterWizard( $this->chart->ID );
53 }
54 }
55 }
56
57 $this->add_additional_content();
58
59 // Added by Ash/Upwork
60 echo '<div id="canvas">';
61 echo '<img src="', VISUALIZER_ABSURL, 'images/ajax-loader.gif" class="loader">';
62 echo '</div>';
63 echo $this->custom_css;
64 }
65
66 /**
67 * Renders sidebar content.
68 *
69 * @since 1.0.0
70 *
71 * @access protected
72 */
73 protected function _renderSidebarContent() {
74 ?>
75 <div id="viz-tabs">
76 <ul>
77 <li><a href="#viz-tab-basic-content" id="viz-tab-basic"><?php _e( 'Source', 'visualizer' ); ?></a></li>
78 <li><a href="#viz-tab-advanced-content" id="viz-tab-advanced"><?php _e( 'Settings', 'visualizer' ); ?></a></li>
79 <li><a href="#viz-tab-help-content" id="viz-tab-help"><?php _e( 'Help', 'visualizer' ); ?></a></li>
80 </ul>
81 <div id="viz-tab-basic-content"><?php Visualizer_Render_Layout::show( 'tab-basic', $this->chart->ID ); ?></div>
82 <div id="viz-tab-advanced-content"><?php Visualizer_Render_Layout::show( 'tab-advanced', $this->chart->ID, $this->sidebar ); ?></div>
83 <div id="viz-tab-help-content"><?php Visualizer_Render_Layout::show( 'tab-help', $this->chart->ID ); ?></div>
84 </div>
85
86 <li class="viz-group bottom-fixed" id="vz-chart-copyright">
87 Hate it? Love it? <a href="https://wordpress.org/support/plugin/visualizer/reviews/#new-post" target="_blank">Rate it!</a>
88 <br/>
89 Visualizer &copy;
90 <?php
91 // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date, WordPress.DateTime.CurrentTimeTimestamp.Requested
92 echo date( 'Y', current_time( 'timestamp' ) );
93 ?>
94 </li>
95 <?php
96 }
97
98 /**
99 * Renders toolbar content.
100 *
101 * @since 1.0.0
102 *
103 * @access protected
104 */
105 protected function _renderToolbar() {
106 // don't show back button at all.
107 // NOTE: We can't be selective on the post_status here because when a new chart reaches the settings screen, its status changes to publish.
108 if ( ! VISUALIZER_SKIP_CHART_TYPE_PAGE ) {
109 echo '<div class="toolbar-div">';
110 echo '<a class="button button-large" href="', add_query_arg( 'tab', 'types' ), '">';
111 esc_html_e( 'Back', 'visualizer' );
112 echo '</a>';
113 echo '</div>';
114 }
115 echo '<input type="submit" id="settings-button" class="button button-primary button-large push-right" value="', $this->button, '">';
116 if ( isset( $this->cancel_button ) ) {
117 echo '<input type="submit" id="cancel-button" class="button button-secondary button-large push-right" value="', $this->cancel_button, '">';
118 }
119 }
120
121 /**
122 * Renders the additional content.
123 *
124 * @access private
125 */
126 private function add_additional_content() {
127 $source = strtolower( get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_SOURCE, true ) );
128 $query = '';
129 if ( 'visualizer_source_query' === $source ) {
130 $query = get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_DB_QUERY, true );
131 }
132 Visualizer_Render_Layout::show( 'db-query', $query, $this->chart->ID );
133 Visualizer_Render_Layout::show( 'json-screen', $this->chart->ID );
134 }
135
136 }
137