Plugin Directory

Changeset 2883285


Ignore:
Timestamp:
03/20/2023 08:29:19 AM (3 years ago)
Author:
soft8soft
Message:

Verge3D 4.3.0 release

Location:
verge3d/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • verge3d/trunk/app.php

    r2825703 r2883285  
    5454                'canvas_height' => V3D_DEFAULT_CANVAS_HEIGHT,
    5555                'allow_fullscreen' => 1,
     56                'xr_spatial_tracking' => 1,
     57                'loading' => 'auto',
    5658            ),
    5759        );
     
    7375        $canvas_height = get_post_meta($app_id, 'canvas_height', true);
    7476        $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);
    7579        $cover_att_id = get_post_meta($app_id, 'cover_attachment_id', true);
    7680
     
    124128                  <td>
    125129                    <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>
    126150                  </td>
    127151                </tr>
     
    187211            $canvas_height = (!empty($_POST['canvas_height'])) ? intval($_POST['canvas_height']) : '';
    188212            $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';
    189215            $cover_att_id = !empty($_POST['cover_attachment_id']) ? absint($_POST['cover_attachment_id']) : 0;
    190216
     
    197223                        'canvas_height' => $canvas_height,
    198224                        'allow_fullscreen' => $allow_fullscreen,
     225                        'xr_spatial_tracking' => $xr_spatial_tracking,
     226                        'loading' => $loading,
    199227                        'cover_attachment_id' => $cover_att_id,
    200228                    ),
     
    472500}
    473501
     502function v3d_iframe_allow_html($name, $value) {
     503    if (!empty($value))
     504        return $name.';';
     505    else
     506        return $name.' \'none\';';
     507}
     508
    474509function v3d_gen_app_iframe_html($app_id, $wrap_to_figure=false) {
    475510    $url = v3d_get_app_url($app_id);
     
    480515    $canvas_height = get_post_meta($app_id, 'canvas_height', true);
    481516    $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);
    482519
    483520    ob_start();
     
    487524        width="<?php echo esc_attr($canvas_width) ?>"
    488525        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' ?>">
    490528      </iframe>
    491529    <?= $wrap_to_figure ? '</figure>' : ''; ?>
  • verge3d/trunk/order.php

    r2773896 r2883285  
    3535    case 'createform':
    3636        $order = array();
    37         v3d_order_add_metaboxes($order, $order_id, $screen_id);
     37        v3d_order_add_metaboxes($order, -1, $screen_id);
    3838        v3d_display_order($order, -1);
    3939        break;
     
    145145// Get order array by post ID
    146146function v3d_get_order_by_id($order_id) {
    147     if (empty($order_id))
     147    if (empty($order_id) or $order_id < 0)
    148148        return null;
    149149    return update_order_compat(json_decode(get_post_field('post_content', $order_id), true));
     
    172172
    173173function calc_subtotal_price($order_items, $round_result=false) {
     174    if (empty($order_items))
     175        return 0;
     176
    174177    $subtotal_price = 0;
    175178
     
    185188
    186189function calc_discount($order, $round_result=false) {
     190    if (empty($order))
     191        return 0;
     192
    187193    $subtotal_price = calc_subtotal_price($order['items']);
    188194    $discount = $subtotal_price * $order['discount'] / 100;
     
    195201
    196202function calc_tax($order, $round_result=false) {
     203    if (empty($order))
     204        return 0;
     205
    197206    $discounted_price = calc_subtotal_price($order['items']) - calc_discount($order);
    198207    $tax = $discounted_price * $order['tax'] / 100;
     
    205214
    206215function calc_total_price($order, $round_result=false) {
     216    if (empty($order))
     217        return 0;
     218
    207219    $total_price = calc_subtotal_price($order['items']);
    208220
     
    237249    $order = v3d_get_order_by_id($order_id);
    238250    $downloads = array();
     251
     252    if (!$order)
     253        return $downloads;
    239254
    240255    foreach ($order['items'] as $item) {
     
    965980        <tr>
    966981          <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>
    968983        </tr>
    969984        <tr>
     
    17401755        return;
    17411756
    1742     $order_id = intval($_REQUEST['order']);
     1757    $order_id = !empty($_REQUEST['order']) ? intval($_REQUEST['order']) : -1;
    17431758
    17441759    wp_enqueue_script('v3d_admin', plugin_dir_url( __FILE__ ) . 'js/order.js');
  • verge3d/trunk/readme.txt

    r2825703 r2883285  
    55Tested up to: 6.0.1
    66Requires PHP: 7.0
    7 Stable tag: 4.2.0
     7Stable tag: 4.3.0
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • verge3d/trunk/verge3d.php

    r2825703 r2883285  
    44Plugin URI: https://www.soft8soft.com/verge3d
    55Description: 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.0
     6Version: 4.3.0
    77Author: Soft8Soft LLC
    88Author URI: https://www.soft8soft.com
Note: See TracChangeset for help on using the changeset viewer.