PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.4.4
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.4.4
4.0.8 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 All 149 releases
← All changes | classes/Visualizer/Render.php +46 -0 3.4.33.4.4 View file →
@@ -170,5 +170,51 @@
170 170 }
171 171 return false;
172 172 }
173 173
174 + /**
175 + * Gets the type of chart that is being rendered.
176 + *
177 + * This is useful if some type-specific functionality needs to be added.
178 + *
179 + * @since ?
180 + *
181 + * @access protected
182 + * @return string
183 + */
184 + protected function get_chart_type( $with_library = false ) {
185 + $lib_type = str_replace( 'Visualizer_Render_Sidebar_Type_', '', get_class( $this ) );
186 + if ( $with_library ) {
187 + return $lib_type;
188 + }
189 +
190 + $array = explode( '_', $lib_type );
191 + return end( $array );
192 + }
193 +
194 + /**
195 + * Determines if the type of chart can have a particular action.
196 + *
197 + * @since ?
198 + *
199 + * @access protected
200 + * @return bool
201 + */
202 + protected function can_chart_have_action( $action, $chart_id = null ) {
203 + $type = null;
204 + if ( ! $chart_id ) {
205 + $type = $this->get_chart_type( false );
206 + } else {
207 + $type = get_post_meta( $chart_id, Visualizer_Plugin::CF_CHART_TYPE, true );
208 + $type = ucwords( $type );
209 + }
210 +
211 + switch ( $action ) {
212 + case 'image':
213 + return ! in_array( $type, array( 'Gauge', 'Tabular', 'DataTable', 'Table' ), true );
214 + }
215 +
216 + return true;
217 + }
218 +
219 +
174 220 }