Changeset 2883285
- Timestamp:
- 03/20/2023 08:29:19 AM (3 years ago)
- Location:
- verge3d/trunk
- Files:
-
- 4 edited
-
app.php (modified) (8 diffs)
-
order.php (modified) (9 diffs)
-
readme.txt (modified) (1 diff)
-
verge3d.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
verge3d/trunk/app.php
r2825703 r2883285 54 54 'canvas_height' => V3D_DEFAULT_CANVAS_HEIGHT, 55 55 'allow_fullscreen' => 1, 56 'xr_spatial_tracking' => 1, 57 'loading' => 'auto', 56 58 ), 57 59 ); … … 73 75 $canvas_height = get_post_meta($app_id, 'canvas_height', true); 74 76 $allow_fullscreen = get_post_meta($app_id, 'allow_fullscreen', true); 77 $xr_spatial_tracking = get_post_meta($app_id, 'xr_spatial_tracking', true); 78 $loading = get_post_meta($app_id, 'loading', true); 75 79 $cover_att_id = get_post_meta($app_id, 'cover_attachment_id', true); 76 80 … … 124 128 <td> 125 129 <input type="checkbox" id="allow_fullscreen" name="allow_fullscreen" value="1" <?php checked($allow_fullscreen, 1) ?>> 130 </td> 131 </tr> 132 <tr class="form-field"> 133 <th scope="row"> 134 <label for="xr_spatial_tracking">Allow AR/VR</label> 135 </th> 136 <td> 137 <input type="checkbox" id="xr_spatial_tracking" name="xr_spatial_tracking" value="1" <?php checked($xr_spatial_tracking, 1) ?>> 138 </td> 139 </tr> 140 <tr class="form-field"> 141 <th scope="row"> 142 <label for="loading">Loading</label> 143 </th> 144 <td> 145 <select id="loading" name="loading"> 146 <option value="auto" <?= $loading == 'auto' ? 'selected' : '' ?>>Auto</option> 147 <option value="lazy" <?= $loading == 'lazy' ? 'selected' : '' ?>>Lazy</option> 148 <option value="eager" <?= $loading == 'eager' ? 'selected' : '' ?>>Eager</option> 149 </select> 126 150 </td> 127 151 </tr> … … 187 211 $canvas_height = (!empty($_POST['canvas_height'])) ? intval($_POST['canvas_height']) : ''; 188 212 $allow_fullscreen = !empty($_POST['allow_fullscreen']) ? 1 : 0; 213 $xr_spatial_tracking = !empty($_POST['xr_spatial_tracking']) ? 1 : 0; 214 $loading = !empty($_POST['loading']) ? $_POST['loading'] : 'auto'; 189 215 $cover_att_id = !empty($_POST['cover_attachment_id']) ? absint($_POST['cover_attachment_id']) : 0; 190 216 … … 197 223 'canvas_height' => $canvas_height, 198 224 'allow_fullscreen' => $allow_fullscreen, 225 'xr_spatial_tracking' => $xr_spatial_tracking, 226 'loading' => $loading, 199 227 'cover_attachment_id' => $cover_att_id, 200 228 ), … … 472 500 } 473 501 502 function v3d_iframe_allow_html($name, $value) { 503 if (!empty($value)) 504 return $name.';'; 505 else 506 return $name.' \'none\';'; 507 } 508 474 509 function v3d_gen_app_iframe_html($app_id, $wrap_to_figure=false) { 475 510 $url = v3d_get_app_url($app_id); … … 480 515 $canvas_height = get_post_meta($app_id, 'canvas_height', true); 481 516 $allow_fullscreen = get_post_meta($app_id, 'allow_fullscreen', true); 517 $xr_spatial_tracking = get_post_meta($app_id, 'xr_spatial_tracking', true); 518 $loading = get_post_meta($app_id, 'loading', true); 482 519 483 520 ob_start(); … … 487 524 width="<?php echo esc_attr($canvas_width) ?>" 488 525 height="<?php echo esc_attr($canvas_height) ?>" 489 <?= !empty($allow_fullscreen) ? 'allow="fullscreen"' : 'allow="fullscreen \'none\'"' ?>> 526 allow="<?= v3d_iframe_allow_html('fullscreen', $allow_fullscreen) ?> <?= v3d_iframe_allow_html('xr-spatial-tracking', $xr_spatial_tracking) ?>" 527 loading="<?= !empty($loading) ? esc_attr($loading) : 'auto' ?>"> 490 528 </iframe> 491 529 <?= $wrap_to_figure ? '</figure>' : ''; ?> -
verge3d/trunk/order.php
r2773896 r2883285 35 35 case 'createform': 36 36 $order = array(); 37 v3d_order_add_metaboxes($order, $order_id, $screen_id);37 v3d_order_add_metaboxes($order, -1, $screen_id); 38 38 v3d_display_order($order, -1); 39 39 break; … … 145 145 // Get order array by post ID 146 146 function v3d_get_order_by_id($order_id) { 147 if (empty($order_id) )147 if (empty($order_id) or $order_id < 0) 148 148 return null; 149 149 return update_order_compat(json_decode(get_post_field('post_content', $order_id), true)); … … 172 172 173 173 function calc_subtotal_price($order_items, $round_result=false) { 174 if (empty($order_items)) 175 return 0; 176 174 177 $subtotal_price = 0; 175 178 … … 185 188 186 189 function calc_discount($order, $round_result=false) { 190 if (empty($order)) 191 return 0; 192 187 193 $subtotal_price = calc_subtotal_price($order['items']); 188 194 $discount = $subtotal_price * $order['discount'] / 100; … … 195 201 196 202 function calc_tax($order, $round_result=false) { 203 if (empty($order)) 204 return 0; 205 197 206 $discounted_price = calc_subtotal_price($order['items']) - calc_discount($order); 198 207 $tax = $discounted_price * $order['tax'] / 100; … … 205 214 206 215 function calc_total_price($order, $round_result=false) { 216 if (empty($order)) 217 return 0; 218 207 219 $total_price = calc_subtotal_price($order['items']); 208 220 … … 237 249 $order = v3d_get_order_by_id($order_id); 238 250 $downloads = array(); 251 252 if (!$order) 253 return $downloads; 239 254 240 255 foreach ($order['items'] as $item) { … … 965 980 <tr> 966 981 <th scope="row">Subtotal:</th> 967 <td><?= v3d_price( calc_subtotal_price($order['items'], true)); ?></td>982 <td><?= v3d_price(!empty($order['items']) ? calc_subtotal_price($order['items'], true) : 0); ?></td> 968 983 </tr> 969 984 <tr> … … 1740 1755 return; 1741 1756 1742 $order_id = intval($_REQUEST['order']);1757 $order_id = !empty($_REQUEST['order']) ? intval($_REQUEST['order']) : -1; 1743 1758 1744 1759 wp_enqueue_script('v3d_admin', plugin_dir_url( __FILE__ ) . 'js/order.js'); -
verge3d/trunk/readme.txt
r2825703 r2883285 5 5 Tested up to: 6.0.1 6 6 Requires PHP: 7.0 7 Stable tag: 4. 2.07 Stable tag: 4.3.0 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
verge3d/trunk/verge3d.php
r2825703 r2883285 4 4 Plugin URI: https://www.soft8soft.com/verge3d 5 5 Description: Verge3D is the most artist-friendly toolkit for creating interactive web-based experiences. It can be used to create product configurators, 3D presentations, online stores, e-learning apps, 3D portfolios, browser games and more. 6 Version: 4. 2.06 Version: 4.3.0 7 7 Author: Soft8Soft LLC 8 8 Author URI: https://www.soft8soft.com
Note: See TracChangeset
for help on using the changeset viewer.