| @@ -205,9 +205,57 @@ | ||
| 205 | 205 | <input type="button" id="viz-lib-reset" class="viz-filter button button-secondary" value="' . __( 'Clear Filters', 'visualizer' ) . '"> |
| 206 | 206 | </form> |
| 207 | 207 | </div>'; |
| 208 | 208 | } |
| 209 | + /** | |
| 210 | + * Renders pro charts blocker. | |
| 211 | + * | |
| 212 | + * @access private | |
| 213 | + */ | |
| 214 | + private function _renderProPopupBlocker() { | |
| 215 | + if ( Visualizer_Module::is_pro() ) { | |
| 216 | + return; | |
| 217 | + } | |
| 218 | + $license = get_option( 'visualizer_pro_license_data', 'free' ); | |
| 219 | + $license_key = ''; | |
| 220 | + $download_id = ''; | |
| 221 | + if ( ! empty( $license ) && is_object( $license ) ) { | |
| 222 | + $license_key = $license->key; | |
| 223 | + $download_id = $license->download_id; | |
| 224 | + } | |
| 225 | + $admin_license_url = admin_url( 'options-general.php#visualizer_pro_license' ); | |
| 226 | + $renew_license_url = tsdk_utmify( Visualizer_Plugin::STORE_URL . '?edd_license_key=' . $license_key . '&download_id=' . $download_id, 'visualizer_license_block' ); | |
| 227 | + echo ' | |
| 228 | + <div class="vizualizer-renew-notice-overlay" id="overlay-visualizer"></div> | |
| 229 | + <div class="vizualizer-renew-notice-popup"> | |
| 230 | + <h1 class="vizualizer-renew-notice-heading">Alert!</h1> | |
| 231 | + <p class="vizualizer-renew-notice-message">' . esc_html__( 'In order to edit premium charts, benefit from updates and support for Visualizer Premium plugin, please renew your license code or activate it.', 'visualizer' ) . '</p> | |
| 232 | + <div class="vizualizer-renew-notice-buttons-container"> | |
| 233 | + <a href="' . esc_url( $renew_license_url) . '" target="_blank"> | |
| 234 | + <button class="vizualizer-renew-notice-button vizualizer-renew-notice-renew-button"> | |
| 235 | + <span class="dashicons dashicons-cart"></span>' . esc_html__( 'Renew License', 'visualizer' ) . ' | |
| 236 | + </button> | |
| 237 | + </a> | |
| 238 | + <a href="' . esc_url( $admin_license_url ) . '"> | |
| 239 | + <button class="vizualizer-renew-notice-button vizualizer-renew-notice-activate-button"> | |
| 240 | + <span class="dashicons dashicons-unlock"></span> ' . esc_html__( 'Activate License', 'visualizer' ) . ' | |
| 241 | + </button> | |
| 242 | + </a> | |
| 243 | + <button class="vizualizer-renew-notice-button vizualizer-renew-notice-close-icon" aria-label="Close" onclick="closePopup()"> | |
| 244 | + <i class="dashicons dashicons-no"></i> | |
| 245 | + </button> | |
| 246 | + </div> | |
| 247 | + </div> | |
| 248 | + <script> | |
| 249 | + function closePopup() { | |
| 250 | + var overlay = document.getElementById("overlay-visualizer"); | |
| 251 | + var popup = document.querySelector(".vizualizer-renew-notice-popup"); | |
| 252 | + overlay.style.display = "none"; | |
| 253 | + popup.style.display = "none"; | |
| 254 | + } | |
| 255 | + </script>'; | |
| 209 | 256 | |
| 257 | + } | |
| 210 | 258 | /** |
| 211 | 259 | * Renders library content. |
| 212 | 260 | * |
| 213 | 261 | * @since 1.0.0 |
| @@ -214,12 +262,16 @@ | ||
| 214 | 262 | * |
| 215 | 263 | * @access private |
| 216 | 264 | */ |
| 217 | 265 | private function _renderLibrary() { |
| 266 | + | |
| 218 | 267 | // Added by Ash/Upwork |
| 219 | 268 | $filterBy = ! empty( $_GET['s'] ) ? sanitize_text_field( wp_unslash( $_GET['s'] ) ) : null; // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 220 | 269 | // Added by Ash/Upwork |
| 221 | 270 | echo $this->custom_css; |
| 271 | + | |
| 272 | + $this->_renderProPopupBlocker(); | |
| 273 | + | |
| 222 | 274 | echo '<div id="visualizer-types" class="visualizer-clearfix">'; |
| 223 | 275 | echo '<svg xmlns="http://www.w3.org/2000/svg" style="display: none;"><symbol id="list-icon" fill="currentColor"><path d="M8 0C3.58 0 0 3.58 0 8C0 12.42 3.58 16 8 16C12.42 16 16 12.42 16 8C16 3.58 12.42 0 8 0ZM7.385 12.66H6.045L2.805 8.12L4.146 6.87L6.715 9.27L11.856 3.339L13.196 4.279L7.385 12.66Z"/></symbol></svg>'; |
| 224 | 276 | $this->getDisplayForm(); |
| 225 | 277 | echo '</div>'; |