|
// +----------------------------------------------------------------------+
/**
* Renders visualizer library page.
*
* @category Visualizer
* @package Render
*
* @since 1.0.0
*/
class Visualizer_Render_Library extends Visualizer_Render {
/**
* Renders library page.
*
* @since 1.0.0
*
* @access protected
*/
protected function _toHTML() {
echo '
';
echo '
';
printf( esc_html__( '%s option is disabled in your php.ini config. Please, enable it by change its value to 1. This option increases the speed of remote CSV uploading.', 'visualizer' ), 'allow_url_fopen' );
echo '
';
echo '
';
}
}
/**
* Renders library content.
*
* @since 1.0.0
*
* @access private
*/
private function _renderLibrary() {
// Added by Ash/Upwork
$filterBy = null;
if ( isset( $_GET['s'] ) && strlen( $_GET['s'] ) > 0 ) {
$filterBy = filter_input( INPUT_GET, 's', FILTER_SANITIZE_STRING );
}
// Added by Ash/Upwork
echo $this->custom_css;
echo '';
if ( ! empty( $this->charts ) ) {
echo '
';
$count = 0;
foreach ( $this->charts as $placeholder_id => $chart ) {
$this->_renderChartBox( $placeholder_id, $chart['id'] );
// show the sidebar after the first 3 charts.
if ( $count++ === 2 ) {
$this->_renderSidebar();
}
}
// show the sidebar if there are less than 3 charts.
if ( $count < 3 ) {
$this->_renderSidebar();
}
echo '
';
} else {
echo '
';
echo '
';
echo '
';
echo '
', esc_html__( 'No charts found', 'visualizer' ), '
';
echo '
';
echo '';
echo '
';
$this->_renderSidebar();
echo '
';
}
echo '
';
if ( is_array( $this->pagination ) ) {
echo '