function fpd_admin_display_version_info() { echo '<div class="fpd-header-right"><a href="http://support.fancyproductdesigner.com" target="_blank" class="button-primary">' . __('Support Center', 'radykal') . '</a><p class="description">'; if (false === ($fpd_version = get_transient('fpd_version'))) { $version_str = fpd_admin_get_file_content("http://assets.radykal.de/fpd/version.json"); if ($version_str !== false) { $json = json_decode($version_str, true); $current_version = $json['version']; set_transient('fpd_version', $current_version, HOUR_IN_SECONDS); } } else { $current_version = $fpd_version; delete_transient('fpd_version'); } if (Fancy_Product_Designer::VERSION < $current_version) { _e('You are not using the <a href="http://fancyproductdesigner.com/woocommerce-plugin/documentation/changelog/" target="_blank">latest version</a> of Fancy Product Designer. Please go to your <a href="http://codecanyon.net/downloads" target="_blank">downloads tab on codecanyon</a> and download it again. Read also the <a href="http://fancyproductdesigner.com/woocommerce-plugin/documentation/upgrading/" target="_blank">upgrading documentation</a> how to install a new version.', 'radykal'); } echo '</p></div>'; }
<div class="fpd-modal-wrapper" id="fpd-modal-load-demo"> <div class="fpd-modal-dialog"> <a href="#" class="fpd-close-modal">×</a> <h3><?php _e('Load an example demo', 'radykal'); ?> </h3> <div class="fpd-modal-content"> <ul> <?php //load demos in a list $demo_url = 'http://assets.fancyproductdesigner.com/fpd-demos.json'; $json = fpd_admin_get_file_content($demo_url); $json = json_decode($json); foreach ($json as $key => $value) { echo '<li><a href="' . $value . '" class="button-primary">' . __('Load', 'radykal') . '</a>' . $key . '</li>'; } ?> </ul> </div> </div> </div>
public function export_product() { if (!isset($_GET['id'])) { exit; } check_ajax_referer('fpd_ajax_nonce', '_ajax_nonce'); $id = $_GET['id']; $fp = new Fancy_Product($id); $views = $fp->get_views(); header('Content-Type: text/csv; charset=utf-8'); header('Content-Disposition: attachment; filename=fancy_product_' . $id . '.json'); $output = '{'; foreach ($views as $view) { $output .= '"' . $view->ID . '": {'; $output .= '"title": "' . $view->title . '",'; $elements = unserialize($view->elements); for ($i = 0; $i < sizeof($elements); $i++) { $source = $elements[$i]['source']; if ($elements[$i]['type'] == 'image' && base64_encode(base64_decode($source, true)) !== $source) { $image_content = base64_encode(fpd_admin_get_file_content($source)); if ($image_content !== false) { $image_type = explode(".", basename($source), 2); $image_type = $image_type[1]; $elements[$i]['source'] = $image_type . ',' . $image_content; } } } $output .= '"elements": ' . stripslashes(json_encode($elements)) . ','; $output .= '"thumbnail_name": "' . basename($view->thumbnail) . '",'; $thumbnail_content = base64_encode(fpd_admin_get_file_content(stripslashes($view->thumbnail))); $output .= '"thumbnail": "' . ($thumbnail_content === false ? stripslashes($view->thumbnail) : $thumbnail_content) . '"},'; } $output = rtrim($output, ","); $output .= '}'; echo $output; die; }