null, 'autoLoad' => 1, 'hfov' => null, 'maxHfov' => null, 'minHfov' => null, 'showControls' => 1, 'customcontrol' => null, 'preview' => null, 'defaultscene' => null, 'scenefadeduration' => null, 'panodata' => array( 'scene-list' => array( array( 'scene-id' => null, 'scene-type' => 'equirectangular', 'hotspot-list' => array( array( 'hotspot-title' => null, 'hotspot-pitch' => null, 'hotspot-yaw' => null, 'hotspot-customclass' => null, 'hotspot-scene' => null, 'hotspot-url' => null, 'hotspot-content' => null, 'hotspot-hover' => null, 'hotspot-type' => 'info', 'hotspot-scene-list' => 'none', 'wpvr_url_open' => array( 0 => 'off' ) ), ), 'dscene' => 'off', 'scene-attachment-url' => null, ), ), ), 'previewtext' => 'Click To Load Panorama', ); return apply_filters( 'wpvr_extend_primary_meta_fields', $meta_fields ); } /** * Initialise Tab Navigation Items * @return array * @since 8.0.0 */ public static function get_navigation_fields() { $status = get_option('wpvr_edd_license_status', ''); $is_pro_active = (is_plugin_active('wpvr-pro/wpvr-pro.php') && 'valid' === $status); $fields = array( array( 'class' => 'scene', 'screen' => 'scene', 'href' => 'scenes', 'r_src' => 'admin/icon/scenes-regular.png', 'h_src' => 'admin/icon/scenes-hover.png', 'title' => __('Scenes','wpvr'), 'active' => 'active' ), array( 'class' => 'hotspot', 'screen' => 'hotspot', 'href' => 'scenes', 'r_src' => 'admin/icon/hotspot-regular.png', 'h_src' => 'admin/icon/hotspot-hover.png', 'title' => __('Hotspot','wpvr'), 'active' => '' ), array( 'class' => 'general', 'screen' => 'general', 'href' => 'general', 'r_src' => 'admin/icon/general-regular.png', 'h_src' => 'admin/icon/general-hover.png', 'title' => __('Settings','wpvr'), 'active' => '' ), array( 'class' => 'videos', 'screen' => 'video', 'href' => 'video', 'r_src' => 'admin/icon/video-regular.png', 'h_src' => 'admin/icon/video-hover.png', 'title' => __('Video','wpvr'), 'active' => '' ), ); if ( $is_pro_active ) { $fields = apply_filters( 'wpvr_extend_rex_pano_nav_menu', $fields ); // Compatibility fallback: older Pro versions may not extend nav fields. if ( ! self::has_navigation_field( $fields, 'floor-plan' ) ) { $fields[] = array( 'class' => 'floor-plan', 'screen' => 'floorPlan', 'href' => 'floorPlan', 'r_src' => 'admin/icon/map.svg', 'h_src' => 'admin/icon/map-hover.svg', 'title' => __('Floor Plan','wpvr'), 'active' => '' ); } if ( ! self::has_navigation_field( $fields, 'background-tour' ) ) { $fields[] = array( 'class' => 'background-tour', 'screen' => 'backgroundTour', 'href' => 'backgroundTour', 'r_src' => 'admin/icon/bg-tour-regular.png', 'h_src' => 'admin/icon/bg-tour-hover.png', 'title' => __('Background Tour','wpvr'), 'active' => '' ); } if ( ! self::has_navigation_field( $fields, 'streetview' ) ) { $fields[] = array( 'class' => 'streetview', 'screen' => 'streetview', 'href' => 'streetview', 'r_src' => 'admin/icon/street-view-regular.png', 'h_src' => 'admin/icon/street-view-hover.png', 'title' => __('Street View','wpvr'), 'active' => '' ); } } return $fields; } /** * Check if a navigation field exists by CSS class token. * * @param array $fields Navigation fields. * @param string $class Class token to search for. * * @return bool */ private static function has_navigation_field( $fields, $class ) { if ( ! is_array( $fields ) || '' === $class ) { return false; } foreach ( $fields as $field ) { if ( ! isset( $field['class'] ) ) { continue; } $classes = explode( ' ', (string) $field['class'] ); if ( in_array( $class, $classes, true ) ) { return true; } } return false; } /** * Initialise Basic Setting Left Field * @param mixed $preview * @param mixed $previewtext * @param mixed $autoload * @param mixed $control * * @return array * @since 8.0.0 */ public static function get_basic_setting_left_fields($postdata) { return array( 'preview-attachment-url' => array( 'class' => 'single-settings preview-setting', 'type' => 'preview_image', 'value' => $postdata['preview'], 'title' => __('Set a Tour Preview Image','wpvr'), 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Upload an image that will be shown as the preview before the tour starts.', 'wpvr'), 'url' => 'https://rextheme.com/docs/wpvr-add-a-preview-image-virtual-tour-wpvr/' ), ), 'previewtext' => array( 'class' => 'single-settings preview-img-message', 'type' => 'preview_image_msg', 'value' => $postdata['previewtext'], 'have_tooltip' => true, 'title' => __('Preview Image Message','wpvr'), 'tooltip_text' => array( 'text' => __('Add a custom message that appears alongside the tour preview image.', 'wpvr'), 'url' => '' ), ), 'autoload' => array( 'class' => 'single-settings autoload', 'type' => 'basic_setting_checkbox', 'title' => __('Tour Autoload','wpvr'), 'id' => 'wpvr_autoload', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Automatically start the tour when the page is loaded without displaying the preview image.', 'wpvr'), 'url' => 'https://rextheme.com/docs/wp-vr-exclusive-features-general-settings/#3-toc-title' ), 'checked' => $postdata['autoLoad'], ), ); } /** * Initialize fields render method * @param mixed $preview * @param mixed $previewtext * @param mixed $autoload * @param mixed $control * * @return void * @since 8.0.0 */ public static function render_basic_settings_left_fields($postdata) { $fields = self::get_basic_setting_left_fields($postdata); foreach($fields as $name => $val) { self::{ 'render_' . $val['type'] }( $name, $val ); } } /** * Initilize Basic Setting Right Fields * @param mixed $scene_fade_duration * @param mixed $postdata * * @return array * @since 8.0.0 */ public static function get_basic_setting_right_fields($postdata) { if(!isset($postdata['autoRotate'])){ $rotation = 0; }else{ $rotation = 1; } $basic_setting_right_fields = array( 'controls' => array( 'class' => 'single-settings controls', 'type' => 'basic_setting_checkbox', 'title' => __('Basic Control Buttons','wpvr'), 'id' => 'wpvr_controls', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Enable basic navigation buttons like play, pause, and reset for easier control of the tour.', 'wpvr'), 'url' => 'https://rextheme.com/docs/wp-vr-exclusive-features-general-settings/#4-toc-title' ), 'checked' => $postdata['showControls'], ), 'scene-fade-duration' => array( 'class' => 'single-settings scene-fade-duration', 'title' => __('Scene Fade Duration','wpvr'), 'type' => 'number_field', 'value' => $postdata['scenefadeduration'], 'placeholder' => null, 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Set the duration (in milliseconds) for the fade effect between scenes.', 'wpvr'), 'url' => 'https://rextheme.com/docs/wp-vr-exclusive-features-general-settings/#5-toc-title' ), ), 'autorotation' => array( 'class' => 'single-settings autoload has-children', 'title' => __('Auto Rotation','wpvr'), 'id' => 'wpvr_autorotation', 'type' => 'basic_setting_checkbox', 'checked' => $rotation, 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Enable automatic rotation of the tour for continuous movement without user interaction.', 'wpvr'), 'url' => 'https://rextheme.com/docs/wp-vr-exclusive-features-general-settings/#6-toc-title' ), ), ); if (defined('MEPR_VERSION') || is_plugin_active( 'restrict-content-pro/restrict-content-pro.php' )) { $post_id = isset($postdata['panoid']) ? str_replace("pano", "", $postdata['panoid']) : null; if(!empty($post_id)){ $membership_access = get_post_meta($post_id, '_wpvr_allowed_roles_levels', true); $basic_setting_right_fields['membership-access'] = array( 'class' =>'wpvr-membership-access', 'title' => __('Control Access','wpvr'), 'type' => 'membership_access_name_select', 'id' => 'wpvr_membership_access', 'package' => 'pro', 'value' => $membership_access ?? 'none', 'placeholder' => null, 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Restrict this tour to selected membership levels.', 'wpvr'), 'url' => '' ), ); } } return apply_filters( 'wpvr_extend_basic_setting_right_fields', $basic_setting_right_fields, $postdata ); } /** * Initilize Basic Setting Right Fields * @param mixed $scene_fade_duration * @param mixed $postdata * * @return array * @since 8.0.0 */ public static function get_basic_setting_generic_form_fields($postdata) { $status = get_option('wpvr_edd_license_status') === 'valid'; $is_disable = apply_filters('is_wpvr_pro_active', false); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound if(!isset($postdata['genericform'])){ $genericform = "off"; }else{ $genericform = $postdata['genericform']; } return $status ? array( 'genericform' => array( 'class' => 'single-settings genericform has-children', 'title' => __('Generic Form','wpvr'), 'id' => 'wpvr_generic_form', 'type' => 'generic_form_checkbox', 'checked' => $is_disable ? $genericform : 'off', 'is_disable' => $is_disable, 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Enable this to add a form to the tour for user interaction.', 'wpvr'), 'url' => '' ), ) ) : array(); } /** * Initilize Basic Setting Right Fields * @param mixed $scene_fade_duration * @param mixed $postdata * * @return array * @since 8.0.0 */ public static function get_basic_setting_call_to_action_fields($postdata) { $is_disable = apply_filters('is_wpvr_pro_active', false); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound $status = get_option('wpvr_edd_license_status') === 'valid'; if(!isset($postdata['calltoaction'])){ $calltoaction = "off"; }else{ $calltoaction = $postdata['calltoaction']; } return $status ? array( 'calltoaction' => array( 'class' => 'single-settings calltoaction has-children', 'title' => __('Call To Action ','wpvr'), 'id' => 'wpvr_cal_to_action_form', 'type' => 'call_to_form_checkbox', 'checked' => $is_disable ? $calltoaction : 'off', 'is_disable' => $is_disable, 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Add a call-to-action button that prompts users to take action during the tour.', 'wpvr'), 'url' => 'https://rextheme.com/docs/call-to-action-in-virtual-tour/' ), ) ) : array(); } /** * Initilize Basic Setting Right Fields * @param mixed $scene_fade_duration * @param mixed $postdata * * @return array * @since 8.0.0 */ public static function get_basic_setting_custom_css_fields($postdata) { $is_disable = apply_filters('is_wpvr_pro_active', false); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound $status = get_option('wpvr_edd_license_status') === 'valid'; if(!isset($postdata['customcss_enable'])){ $customcss_enable = "off"; }else{ $customcss_enable = $postdata['customcss_enable']; } return $status ? array( 'customcss' => array( 'class' => 'single-settings customcss-switcher has-children', 'title' => __('Custom CSS ','wpvr'), 'id' => 'wpvr_custom_css', 'type' => 'custom_css_form_checkbox', 'checked' => $is_disable ? $customcss_enable : 'off', 'is_disable' => $is_disable, 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Add your own custom CSS styles to further personalize the look and feel of the tour.', 'wpvr'), 'url' => '' ), ) ) : array(); } /** * Render Basic Setting Right Fields * @param mixed $scene_fade_duration * @param mixed $postdata * * @return void * @since 8.0.0 */ public static function render_basic_setting_generic_form_fields($postdata) { $fields = self::get_basic_setting_generic_form_fields($postdata); foreach($fields as $name => $val) { self::{ 'render_' . $val['type'] }( $name, $val ); } } /** * Render Basic Setting Right Fields * @param mixed $scene_fade_duration * @param mixed $postdata * * @return void * @since 8.0.0 */ public static function render_basic_setting_call_to_action_fields($postdata) { $fields = self::get_basic_setting_call_to_action_fields($postdata); foreach($fields as $name => $val) { self::{ 'render_' . $val['type'] }( $name, $val ); } } /** * Render Basic Setting Right Fields * @param mixed $scene_fade_duration * @param mixed $postdata * * @return void * @since 8.0.0 */ public static function render_basic_setting_custom_css_fields($postdata) { $fields = self::get_basic_setting_custom_css_fields($postdata); foreach($fields as $name => $val) { self::{ 'render_' . $val['type'] }( $name, $val ); } } /** * Render Basic Setting Right Fields * @param mixed $scene_fade_duration * @param mixed $postdata * * @return void * @since 8.0.0 */ public static function render_basic_setting_right_fields($postdata) { $fields = self::get_basic_setting_right_fields($postdata); foreach($fields as $name => $val) { if('basic_setting_checkbox_for_scene_animation' === $val['type']){ self::{ 'render_' . $val['type'] }( $name, $val, $postdata ); } else{ self::{ 'render_' . $val['type'] }( $name, $val ); } } } /** * Initialize Autorotation Data Wrapper Fields * @param mixed $autorotation * @param mixed $autorotationinactivedelay * @param mixed $autorotationstopdelay * * @return array * @since 8.0.0 */ public static function get_autorotation_data_wrapper_fields($postdata) { return array( 'auto-rotation' => array( 'class' => 'single-settings autorotationdata', 'title' => __('Rotation Speed and Direction','wpvr'), 'type' => 'number_field', 'value' => isset($postdata['autoRotate']) ? $postdata['autoRotate'] : -5, 'placeholder' => -5, 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Set the rotation speed, with positive values for anti-clockwise rotation and negative values for clockwise rotation.', 'wpvr'), 'url' => 'https://rextheme.com/docs/wp-vr-enable-auto-rotation-virtual-tour/' ), ), 'auto-rotation-inactive-delay' => array( 'class' => 'single-settings autorotationdata', 'title' => __('Resume Auto-rotation after','wpvr'), 'type' => 'number_field', 'value' => isset($postdata['autoRotateInactivityDelay']) ? $postdata['autoRotateInactivityDelay'] : null, 'placeholder' => 2000, 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Define the time (in milliseconds) after which auto-rotation will resume once the user clicks on the tour.', 'wpvr'), 'url' => 'https://rextheme.com/docs/wp-vr-enable-auto-rotation-virtual-tour/' ), ), 'auto-rotation-stop-delay' => array( 'class' => 'single-settings autorotationdata', 'title' => __('Stop Auto-rotation after','wpvr'), 'type' => 'number_field', 'value' => isset($postdata['autoRotateStopDelay']) ? $postdata['autoRotateStopDelay'] : null, 'placeholder' => 2000, 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Set the time (in milliseconds) after which the auto-rotation will stop automatically.', 'wpvr'), 'url' => 'https://rextheme.com/docs/wp-vr-enable-auto-rotation-virtual-tour/' ), ), ); } /** * Initialize Scene Animation Transition Data Wrapper Fields * @param mixed $sceneAnimationName * @param mixed $sceneAnimationTransitionDuration * @param mixed $sceneAnimationTransitionDelay * * @return array * @since 8.5.16 */ public static function get_scene_animation_transition_data_wrapper_fields($postdata) { return array( 'scene-animation-name' => array( 'class' => 'single-settings scene-animation-name', 'title' => __('Select Transition Style','wpvr'), 'type' => 'animation_name_select', 'id' => 'wpvr_scene_animation_name', 'package' => 'pro', 'value' => isset($postdata['sceneAnimationName']) ? $postdata['sceneAnimationName'] : 'none', 'placeholder' => null, 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('This will set the scene fade effect and execution time.', 'wpvr'), 'url' => '' ), ), 'scene-animation-transition-duration' => array( 'class' => 'single-settings autorotationdata scene-animation-transition-duration', 'title' => __('Scene Transition Duration (ms)','wpvr'), 'type' => 'number_field', 'id' => 'wpvr_scene_animation_transition_duration', 'package' => 'pro', 'value' => isset($postdata['sceneAnimationTransitionDuration']) ? $postdata['sceneAnimationTransitionDuration'] : '500', 'placeholder' => null, 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Set the duration for scene transition animations in milliseconds (default: 500 ms).', 'wpvr'), 'url' => '' ), ), 'scene-animation-transition-delay' => array( 'class' => 'single-settings autorotationdata scene-animation-transition-delay', 'title' => __('Add Animation Delay (ms)','wpvr'), 'type' => 'number_field', 'id' => 'wpvr_scene_animation_transition_delay', 'package' => 'pro', 'value' => isset($postdata['sceneAnimationTransitionDelay']) ? $postdata['sceneAnimationTransitionDelay'] : '0', 'placeholder' => null, 'have_tooltip' => true, 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Set the delay before the scene transition animation starts (default: 0 ms).', 'wpvr'), 'url' => '' ), ), ); } public static function get_generic_form_associate_fields($postdata) { return array( 'genericformshortcode' => array( 'class' => 'single-settings genericformshortcode', 'title' => __('Add Form Shortcode','wpvr'), 'type' => 'text_field', 'value' => isset($postdata['genericformshortcode']) ? $postdata['genericformshortcode'] : "", 'placeholder' => "", 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Insert the shortcode for the form you want to display in the tour.', 'wpvr'), 'url' => '' ), ), ); } public static function get_call_to_action_associate_fields($postdata) { return array( 'buttontext' => array( 'class' => 'single-settings buttontext', 'title' => __('Button Text','wpvr'), 'type' => 'text_field', 'value' => isset($postdata['buttontext']) ? $postdata['buttontext'] : "Click Here", 'placeholder' => "", 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Customize the text displayed on the call-to-action button.', 'wpvr'), 'url' => 'https://rextheme.com/docs/call-to-action-in-virtual-tour/' ), ),'buttonurl' => array( 'class' => 'single-settings buttonurl', 'title' => __('Button URL','wpvr'), 'type' => 'text_field', 'value' => isset($postdata['buttonurl']) ? $postdata['buttonurl'] : "", 'placeholder' => "Button URL", 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Set the link the call-to-action button will direct users to when clicked.', 'wpvr'), 'url' => 'https://rextheme.com/docs/call-to-action-in-virtual-tour/' ), ), 'button_configuration' => array( 'class' => 'single-settings button_configuration', 'title' => __('Button Style','wpvr'), 'name' => 'button_configuration_field', 'type' => 'button_configuration_field', 'value' => isset($postdata['button_configuration']) ? $postdata['button_configuration'] : array(), 'placeholder' => "", 'have_tooltip' => true, 'tooltip_text' => __('Print the forms shortcode you want to show.','wpvr'), ), ); } public static function get_custom_css_associate_fields($postdata) { return array( 'customcss' => array( 'class' => 'single-settings customcss', 'title' => __('Custom CSS','wpvr'), 'type' => 'text_area_field', 'code_mirror_id' => 'code-mirror-editor-custom-css', 'value' => isset($postdata['customcss']) ? $postdata['customcss'] : "", 'placeholder' => "", 'have_tooltip' => true, ) ); } /** * Render generic form associate fields * @param mixed $genericformshortcode * * @return void * @since 8.0.0 */ public static function render_generic_form_associate_fields($postdata) { $fields = self::get_generic_form_associate_fields($postdata); foreach($fields as $name => $val) { self::{ 'render_' . $val['type'] }( $name, $val ); } } /** * Render generic form associate fields * @param mixed $genericformshortcode * * @return void * @since 8.0.0 */ public static function render_call_to_action_associate_fields($postdata) { $fields = self::get_call_to_action_associate_fields($postdata); foreach($fields as $name => $val) { self::{ 'render_' . $val['type'] }( $name, $val ); } } /** * Render generic form associate fields * @param mixed $genericformshortcode * * @return void * @since 8.0.0 */ public static function render_custom_css_associate_fields($postdata) { $fields = self::get_custom_css_associate_fields($postdata); foreach($fields as $name => $val) { self::{ 'render_' . $val['type'] }( $name, $val ); } } /** * Render Autorotation Data Wrapper Fields * @param mixed $autorotation * @param mixed $autorotationinactivedelay * @param mixed $autorotationstopdelay * * @return void * @since 8.0.0 */ public static function render_autorotation_data_wrapper_fields($postdata) { $fields = self::get_autorotation_data_wrapper_fields($postdata); foreach($fields as $name => $val) { self::{ 'render_' . $val['type'] }( $name, $val ); } } /** * Render Scene Animation Transition Data Wrapper Fields * @param mixed $sceneAnimationName * @param mixed $sceneAnimationTransitionDuration * @param mixed $sceneAnimationTransitionDelay * * @return void * @since 8.5.16 */ public static function render_scene_animation_transition_data_wrapper_fields($postdata) { $fields = self::get_scene_animation_transition_data_wrapper_fields($postdata); foreach($fields as $name => $val) { self::{ 'render_' . $val['type'] }( $name, $val ); } } /** * Render Tab Navigation * @return void * @since 8.0.0 */ public static function render_pano_tab_nav($postdata) { $fields = self::get_navigation_fields(); ob_start(); ?> array( 'class' => 'single-settings compass', 'title' => __('Keyboard Movement Control','wpvr'), 'id' => 'wpvr_diskeyboard', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Use arrow keys or WASD keys to move through the virtual tour.', 'wpvr'), 'url' => 'https://rextheme.com/docs/wp-vr-limit-keyboard-controls-for-navigation-and-zoom/#0-toc-title' ), 'type' => 'checkbox' ), 'keyboardzoom' => array( 'class' => 'single-settings keyboard-zoom', 'title' => __('Keyboard Zoom Control','wpvr'), 'id' => 'wpvr_keyboardzoom', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Zoom in and out of the virtual tour using keyboard shortcuts.', 'wpvr'), 'url' => 'https://rextheme.com/docs/wp-vr-limit-keyboard-controls-for-navigation-and-zoom/#4-toc-title' ), 'type' => 'checkbox' ), 'draggable' => array( 'class' => 'single-settings has-children', 'title' => __('Mouse Drag Control','wpvr'), 'id' => 'wpvr_draggable', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Click and drag with your mouse to look around and navigate the virtual tour.', 'wpvr'), 'url' => 'https://rextheme.com/docs/wp-vr-limit-mouse-scroll-to-zoom-drag-to-move/#8-toc-title' ), 'type' => 'checkbox' ), 'mouseZoom' => array( 'class' => 'single-settings', 'title' => __('Mouse Zoom Control','wpvr'), 'id' => 'wpvr_mouseZoom', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Use your mouse wheel to zoom in and out smoothly within the virtual tour.', 'wpvr'), 'url' => 'https://rextheme.com/docs/wp-vr-limit-mouse-scroll-to-zoom-drag-to-move/#1-toc-title' ), 'type' => 'checkbox' ), 'gyro' => array( 'class' => 'single-settings gyro', 'title' => __('Gyroscope Control','wpvr'), 'id' => 'wpvr_gyro', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Move your mobile device to explore the tour using built-in motion sensors.', 'wpvr'), 'url' => 'https://rextheme.com/docs/wp-vr-gyroscope-support/' ), 'type' => 'checkbox' ), 'deviceorientationcontrol' => array( 'class' => 'single-settings orientation', 'title' => __('Auto Gyroscope Support','wpvr'), 'id' => 'wpvr_deviceorientationcontrol', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Automatically activate device orientation control if enabled, or manually trigger it with a button.', 'wpvr'), 'url' => 'https://rextheme.com/docs/wp-vr-gyroscope-support/' ), 'type' => 'checkbox' ), 'compass' => array( 'class' => 'single-settings compass', 'title' => __('Compass','wpvr'), 'id' => 'wpvr_compass', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Display a directional guide to keep track of your orientation while navigating the virtual tour.', 'wpvr'), 'url' => 'https://rextheme.com/docs/wp-vr-exclusive-features-general-settings/#11-toc-title' ), 'type' => 'checkbox' ), ); return $status ? apply_filters( 'modify_advanced_control_left_fields', $fields, $postdata ) : $fields; } /** * Initialise Advanced Settings Right Fields * @return array * @since 8.0.0 */ public static function get_advanced_settings_right_fields($postdata) { $status = get_option('wpvr_edd_license_status') === 'valid'; $fields = array( 'vrgallery' => array( 'class' => 'single-settings gallery', 'title' => __('Scene Gallery','wpvr'), 'id' => 'wpvr_vrgallery', 'type' => 'checkbox', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Show a gallery of all scenes, allowing users to easily navigate by clicking on thumbnails.', 'wpvr'), 'url' => 'https://rextheme.com/docs/wp-vr-scene-gallery/' ), ), 'vrgallery_title' => array( 'class' => 'single-settings', 'title' => __('Scene Titles on Gallery','wpvr'), 'id' => 'wpvr_vrgallery_title', 'type' => 'checkbox', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Display scene titles on each thumbnail in the Scene Gallery for better identification.', 'wpvr'), 'url' => 'https://rextheme.com/docs/wp-vr-scene-gallery/' ), ), 'vrscene_navigation' => array( 'class' => 'single-settings scene-navigation', 'title' => __('Scene Navigation Menu','wpvr'), 'id' => 'wpvr_scene_navigation', 'type' => 'checkbox', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Enable a menu to navigate through all scenes, allowing users to jump to a specific scene.', 'wpvr'), 'url' => '' ), ), 'bg_music' => array( 'class' => 'single-settings', 'title' => __('Tour Background Music','wpvr'), 'id' => 'wpvr_bg_music', 'type' => 'checkbox', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Add background music to your tour to enhance the user experience.', 'wpvr'), 'url' => 'https://rextheme.com/docs/wp-vr-add-background-music-virtual-tours/' ), ), 'explainerSwitch' => array( 'class' => 'single-settings company-info', 'title' => __('Enable explainer video','wpvr'), 'id' => 'wpvr_explainerSwitch', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Add an explainer video to the tour, providing additional context or details for users.', 'wpvr'), 'url' => 'https://rextheme.com/docs/set-explainer-videos-inside-virtual-tours/' ), 'type' => 'checkbox', ), 'globalzoom' => array( 'class' => 'single-settings', 'title' => __('Set Zoom Preferences','wpvr'), 'id' => 'wpvr_globalzoom', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Customize the zoom level for your tour, with options to adjust the view between 50 to 120 degrees.', 'wpvr'), 'url' => '' ), 'type' => 'checkbox', ), 'cpLogoSwitch' => array( 'class' => 'single-settings company-info', 'title' => __('Add Company Information','wpvr'), 'id' => 'wpvr_cpLogoSwitch', 'type' => 'checkbox', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Include your company logo and details within the tour to brand the experience.', 'wpvr'), 'url' => 'https://rextheme.com/docs/wp-vr-add-your-company-logo-virtual-tour/' ), ) ); return $status ? apply_filters( 'modify_advanced_control_right_fields', $fields, $postdata ) : $fields; } /** * Initialize Scene setting left fields * Panodata is empty * @return array * @since 8.0.0 */ public static function get_scene_left_fields_empty_panodata() { $status = get_option('wpvr_edd_license_status', '') === 'valid'; $fields = array( 'scene-type' => array( 'label_for' => 'scene-type', 'title' => __('Scene Type','wpvr'), 'input_class' => '', 'type' => 'text', 'value' => 'equirectangular', 'disabled' => 'disabled', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Choose the type of scene, such as Equirectangular or Cubemap.', 'wpvr'), 'url' => '' ), ), 'scene-attachment-url' => array( 'title' => __('Scene Upload','wpvr'), 'type' => 'upload', 'value' => '', 'display' => 'none', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Upload an image to be used as the scene media (video is not supported).', 'wpvr'), 'url' => 'https://rextheme.com/docs/wp-vr-add-a-scene-virtual-tour/' ), ), 'dscene' => array( 'class' => 'scene-setting dscene', 'title' => __('Set as Default','wpvr'), 'type' => 'select', 'select_class' => 'dscen', 'selected' => 'off', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Make this scene the first one that appears when the tour loads.', 'wpvr'), 'url' => 'https://rextheme.com/docs/wp-vr-add-a-scene-virtual-tour/' ), ), 'scene-id' => array( 'label_for' => 'scene-id', 'title' => __('Scene ID','wpvr'), 'input_class' => 'sceneid', 'type' => 'text', 'value' => '', 'disabled' => 'disabled', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Unique identifier for the scene, auto-generated if left empty.', 'wpvr'), 'url' => '' ), ) ); return $status && is_plugin_active('wpvr-pro/wpvr-pro.php') ? apply_filters( 'modify_scene_default_left_fields', $fields ) : $fields; } /** * Initilize Scene Settings left Fields * Panodata is not empty * @param mixed $dscene * @param mixed $scene_id * @param mixed $scene_photo * * @return array * @since 8.0.0 */ public static function get_scene_left_fields_with_panodata($pano_scene) { $status = get_option('wpvr_edd_license_status', '') === 'valid'; $fields = array( 'scene-type' => array( 'label_for' => 'scene-type', 'title' => __('Scene Type','wpvr'), 'input_class' => '', 'type' => 'text', 'value' => 'equirectangular', 'disabled' => 'disabled', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Choose the type of scene, such as Equirectangular or Cubemap.', 'wpvr'), 'url' => '' ), ), 'scene-attachment-url' => array( 'title' => __('Scene Upload','wpvr'), 'type' => 'upload', 'value' => $pano_scene['scene-attachment-url'], 'display' => 'block', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Upload an image to be used as the scene media (video is not supported).', 'wpvr'), 'url' => 'https://rextheme.com/docs/wp-vr-add-a-scene-virtual-tour/' ), ), 'dscene' => array( 'class' => 'scene-setting dscene', 'title' => __('Set as Default','wpvr'), 'type' => 'select', 'select_class' => 'dscen', 'selected' => $pano_scene['dscene'], 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Make this scene the first one that appears when the tour loads.', 'wpvr'), 'url' => 'https://rextheme.com/docs/wp-vr-add-a-scene-virtual-tour/' ), ), 'scene-id' => array( 'label_for' => 'scene-id', 'title' => __('Scene ID','wpvr'), 'input_class' => 'sceneid', 'type' => 'text', 'value' => $pano_scene['scene-id'], 'disabled' => 'disabled', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Unique identifier for the scene, auto-generated if left empty.', 'wpvr'), 'url' => '' ), ), ); return $status && is_plugin_active('wpvr-pro/wpvr-pro.php') ? apply_filters( 'modify_scene_left_fields', $fields, $pano_scene ) : $fields; } /** * Initialize Hotspot Settings Left Fields * @return array * * @since 8.0.0 */ public static function get_hotspot_left_fields($pano_hotspot) { $fields = array( 'hotspot-title' => array( 'title' => __('Hotspot ID','wpvr'), 'value' => $pano_hotspot['hotspot-title'], 'type' => 'text', 'input_class' => '', 'input_id' => 'hotspot-title', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('A unique identifier for the hotspot, auto-generated if left empty.', 'wpvr'), 'url' => '' ), ), 'hotspot-pitch' => array( 'title' => __('Pitch','wpvr'), 'value' => $pano_hotspot['hotspot-pitch'], 'type' => 'text', 'input_class' => 'hotspot-pitch', 'input_id' => '', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Set the pitch angle for the hotspot’s vertical position in the scene.', 'wpvr'), 'url' => '' ), ), 'hotspot-yaw' => array( 'title' => __('Yaw','wpvr'), 'value' => $pano_hotspot['hotspot-yaw'], 'type' => 'text', 'input_class' => 'hotspot-yaw', 'input_id' => '', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Set the yaw angle for the hotspot’s horizontal position in the scene.', 'wpvr'), 'url' => '' ), ), 'hotspot-customclass' => array( 'title' => __('Hotspot Custom Icon Class','wpvr'), 'value' => $pano_hotspot['hotspot-customclass'], 'type' => 'text', 'input_class' => '', 'input_id' => 'hotspot-customclass', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Add a custom CSS class for the hotspot icon.', 'wpvr'), 'url' => 'https://rextheme.com/docs/how-to-use-the-custom-icon-class/' ), ), ); return apply_filters( 'modify_hotspot_left_fields', $fields, $pano_hotspot ); } /** * Initialize Hotspot Setting Right Fields * @return array * * @since 8.0.0 */ public static function get_hotspot_right_fields() { $fields = array( 'hotspot-type' => array( 'title' => __('Hotspot-Type','wpvr'), 'type' => 'info_type_select', ), 'hotspot-url' => array( 'title' => __('URL','wpvr'), 'type' => 'info_url', 'value' => '', 'display' => 'block', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Provide a URL that the hotspot will link to when clicked.', 'wpvr'), 'url' => 'https://rextheme.com/docs/wp-vr-hotspots-to-show-information-images-videos/' ), ), 'wpvr_url_open' => array( 'title' => __('Open in same tab','wpvr'), 'type' => 'same_tab_checkbox', 'value' => 'off', 'display' => 'flex', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Choose whether the URL opens in the same tab or a new tab.', 'wpvr'), 'url' => 'https://rextheme.com/docs/wp-vr-hotspots-to-show-information-images-videos/' ), ), 'hotspot-content' => array( 'class' => 'hotspot-content', 'title' => __('On Click Content','wpvr'), 'type' => 'textarea', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Add custom content or actions that occur when the hotspot is clicked.', 'wpvr'), 'url' => 'https://rextheme.com/docs/wp-vr-hotspots-to-show-information-images-videos/' ), ), 'hotspot-hover' => array( 'class' => 'hotspot-hover', 'title' => __('On Hover Content','wpvr'), 'type' => 'textarea', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Add custom content or actions that appear when the user hovers over the hotspot.', 'wpvr'), 'url' => 'https://rextheme.com/docs/wp-vr-hotspots-to-show-information-images-videos/' ), ), 'hotspot-scene-list' => array( 'title' => __('Select Target Scene from List','wpvr'), 'type' => 'scene_select', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Choose the target scene for the hotspot to navigate to.', 'wpvr'), 'url' => 'https://rextheme.com/docs/wp-vr-set-default-scene-face/#3-toc-title' ), ), 'hotspot-scene' => array( 'title' => __('Target Scene ID','wpvr'), 'display' => 'none', 'input_class' => 'hotspotsceneinfodata', 'type' => 'disabled_text', 'value' => '', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Provide the unique ID of the target scene.', 'wpvr'), 'url' => 'https://rextheme.com/docs/wp-vr-set-default-scene-face/#3-toc-title' ), ) ); return apply_filters( 'modify_hotspot_right_fields', $fields ); } /** * Initialize Hotspot Setting Info Fields * * @param mixed $hotspot_type * @param mixed $hotspot_url * @param mixed $hotspot_content * @param mixed $hotspot_hover * * @return array * @since 8.0.0 */ public static function get_hotspot_setting_info_fields($pano_hotspot) { $fields = array( 'hotspot-type' => array( 'title' => __('Hotspot-Type','wpvr'), 'type' => 'info_type_select', ), 'hotspot-url' => array( 'title' => __('URL','wpvr'), 'type' => 'info_url', 'value' => $pano_hotspot['hotspot-url'], 'display' => 'block', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Provide a URL that the hotspot will link to when clicked.', 'wpvr'), 'url' => 'https://rextheme.com/docs/wp-vr-hotspots-to-show-information-images-videos/' ), ), 'wpvr_url_open' => array( 'title' => __('Open in same tab','wpvr'), 'type' => 'same_tab_checkbox', 'value' => isset($pano_hotspot['wpvr_url_open'][0]) ? $pano_hotspot['wpvr_url_open'][0] : 'off', 'display' => 'flex', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Choose whether the URL opens in the same tab or a new tab.', 'wpvr'), 'url' => 'https://rextheme.com/docs/wp-vr-hotspots-to-show-information-images-videos/' ), ), 'hotspot-content' => array( 'class' => 'hotspot-content', 'title' => __('On Click Content','wpvr'), 'type' => 'info_textarea', 'value' => $pano_hotspot['hotspot-content'], 'display' => 'block', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Add custom content or actions that occur when the hotspot is clicked.', 'wpvr'), 'url' => 'https://rextheme.com/docs/wp-vr-hotspots-to-show-information-images-videos/' ), ), 'hotspot-hover' => array( 'class' => 'hotspot-hover tip', 'title' => __('On Hover Content','wpvr'), 'type' => 'info_textarea', 'value' => $pano_hotspot['hotspot-hover'], 'display' => 'block', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Add custom content or actions that appear when the user hovers over the hotspot.', 'wpvr'), 'url' => 'https://rextheme.com/docs/wp-vr-hotspots-to-show-information-images-videos/' ), ), 'hotspot-scene-list' => array( 'title' => __('Select Target Scene from List','wpvr'), 'type' => 'scene_list', 'display' => 'none', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Choose the target scene for the hotspot to navigate to.', 'wpvr'), 'url' => 'https://rextheme.com/docs/wp-vr-set-default-scene-face/#3-toc-title' ), ), 'hotspot-scene' => array( 'title' => __('Target Scene ID','wpvr'), 'display' => 'none', 'input_class' => 'hotspotsceneinfodata', 'type' => 'disabled_text', 'value' => '', 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Provide the unique ID of the target scene.', 'wpvr'), 'url' => 'https://rextheme.com/docs/wp-vr-set-default-scene-face/#3-toc-title' ), ) ); return apply_filters( 'modify_hotspot_right_fields', $fields ); } /** * Initialize Hotspot Setting Info Fields * * @param mixed $hotspot_type * @param mixed $hotspot_url * @param mixed $hotspot_content * @param mixed $hotspot_hover * * @return array * @since 8.0.0 */ public static function get_hotspot_setting_wc_product_fields($pano_hotspot) { $fields = array( 'hotspot-type' => array( 'title' => __('Hotspot-Type','wpvr'), 'type' => 'wc_product_type', ), 'hotspot-product-id' => array( 'title' => __('Select your form','wpvr'), 'type' => 'wc_product_select', 'class' => 'wpvr-product-search', 'value' => $pano_hotspot ), 'hotspot-url' => array( 'title' => __('URL','wpvr'), 'type' => 'info_url', 'value' => $pano_hotspot['hotspot-url'], 'display' => 'none', ), 'wpvr_url_open' => array( 'title' => __('Open in same tab','wpvr'), 'type' => 'same_tab_checkbox', 'value' => isset($pano_hotspot['wpvr_url_open'][0]) ? $pano_hotspot['wpvr_url_open'][0] : 'off', 'display' => 'none', ), 'hotspot-content' => array( 'class' => 'hotspot-content', 'title' => __('On Click Content','wpvr'), 'type' => 'info_textarea', 'value' => $pano_hotspot['hotspot-content'], 'display' => 'none', ), 'hotspot-hover' => array( 'class' => 'hotspot-hover', 'title' => __('On Hover Content','wpvr'), 'type' => 'info_textarea', 'value' => $pano_hotspot['hotspot-hover'], 'display' => 'block', ), 'hotspot-scene-list' => array( 'title' => __('Select Target Scene from List','wpvr'), 'type' => 'scene_list', 'display' => 'none', ), 'hotspot-scene' => array( 'title' => __('Target Scene ID','wpvr'), 'display' => 'none', 'input_class' => 'hotspotsceneinfodata', 'type' => 'disabled_text', 'value' => '' ) ); return apply_filters( 'modify_hotspot_right_fields', $fields ); } /** * Initialize Hotspot Setting Fluent form field Fields * * @param mixed $hotspot_type * @param mixed $hotspot_url * @param mixed $hotspot_content * @param mixed $hotspot_hover * * @return array * @since 8.0.0 */ public static function get_hotspot_setting_fluent_form_fields($pano_hotspot) { $fields = array( 'hotspot-type' => array( 'title' => __('Hotspot-Type','wpvr'), 'type' => 'fluent_form_type', ), 'fluent-form-id' => array( 'title' => __('Select your form','wpvr'), 'type' => 'fluent_form_select', 'class' => 'wpvr-fluent-forms', 'value' => $pano_hotspot ), 'hotspot-url' => array( 'title' => __('URL','wpvr'), 'type' => 'info_url', 'value' => $pano_hotspot['hotspot-url'], 'display' => 'none', ), 'wpvr_url_open' => array( 'title' => __('Open in same tab','wpvr'), 'type' => 'same_tab_checkbox', 'value' => isset($pano_hotspot['wpvr_url_open'][0]) ? $pano_hotspot['wpvr_url_open'][0] : 'off', 'display' => 'none', ), 'hotspot-content' => array( 'class' => 'hotspot-content', 'title' => __('On Click Content','wpvr'), 'type' => 'info_textarea', 'value' => $pano_hotspot['hotspot-content'], 'display' => 'none', ), 'hotspot-hover' => array( 'class' => 'hotspot-hover', 'title' => __('On Hover Content','wpvr'), 'type' => 'info_textarea', 'value' => $pano_hotspot['hotspot-hover'], 'display' => 'block', ), 'hotspot-scene-list' => array( 'title' => __('Select Target Scene from List','wpvr'), 'type' => 'scene_list', 'display' => 'none', ), 'hotspot-scene' => array( 'title' => __('Target Scene ID','wpvr'), 'display' => 'none', 'input_class' => 'hotspotsceneinfodata', 'type' => 'disabled_text', 'value' => '' ) ); return apply_filters( 'modify_hotspot_right_fields', $fields ); } /** * Initializa Hotspot Setting Scene Fields * * @param mixed $hotspot_hover * @param mixed $hotspot_target_scene * * @return array * @since 8.0.0 */ public static function get_hotspot_setting_scene_fields($pano_hotspot) { $fields = array( 'hotspot-type' => array( 'title' => __('Hotspot-Type','wpvr'), 'type' => 'scene_type_select', ), 'hotspot-url' => array( 'title' => __('URL','wpvr'), 'type' => 'info_url', 'display' => 'none', 'value' => '', ), 'wpvr_url_open' => array( 'title' => __('Open in same tab','wpvr'), 'type' => 'same_tab_checkbox', 'value' => 'off', 'display' => 'none', ), 'hotspot-content' => array( 'class' => 'hotspot-content', 'title' => __('On Click Content','wpvr'), 'type' => 'scene_content', 'display' => 'none', ), 'hotspot-hover' => array( 'class' => 'hotspot-hover', 'title' => __('On Hover Content','wpvr'), 'type' => 'info_textarea', 'value' => $pano_hotspot['hotspot-hover'], 'display' => 'block', ), 'hotspot-scene-list' => array( 'title' => __('Select Target Scene from List','wpvr'), 'type' => 'scene_list', 'display' => 'block', ), 'hotspot-scene' => array( 'title' => __('Target Scene ID','wpvr'), 'display' => 'block', 'input_class' => 'hotspotsceneinfodata', 'type' => 'disabled_text', 'value' => $pano_hotspot['hotspot-scene'] ), ); return apply_filters( 'modify_hotspot_setting_scene_fields', $fields, $pano_hotspot ); } /** * Return general feature navigation meta fields * * @return array * @since 8.0.0 */ public static function get_general_navigation_meta_fields() { $status = get_option('wpvr_edd_license_status') === 'valid'; $fields = array( array( 'class' => 'gen-basic', 'active' => 'active', 'href' => 'gen-basic', 'isPro' => !$status || !is_plugin_active('wpvr-pro/wpvr-pro.php') ? true : false, 'regular_icon' => 'admin/icon/basic-settings-regular.svg', 'hover_icon' => 'admin/icon/basic-settings-hover.svg', 'title' => __('Basic Settings','wpvr') ), array( 'class' => 'gen-advanced', 'active' => '', 'href' => 'gen-advanced', 'isPro' => !$status || !is_plugin_active('wpvr-pro/wpvr-pro.php') ? true : false, 'regular_icon' => 'admin/icon/advance-control-regular.svg', 'hover_icon' => 'admin/icon/advance-control-hover.svg', 'title' => __('Advanced Controls','wpvr') ), ); return $status ? apply_filters( 'make_is_pro_false', $fields ) : $fields; } /** * Render inner navigation bar for General tab * * @return void * @since 8.0.0 */ public static function render_general_inner_navigation() { ob_start(); ?>
$val) { self::{ 'render_hotspot_' . $val['type'] . '_field' }( $name, $val ); } } /** * Render Hotspot Setting Right Fileds * @return void * * @since 8.0.0 */ public static function render_hotspot_setting_right_fields() { $fields = self::get_hotspot_right_fields(); foreach($fields as $name => $val) { self::{ 'render_hotspot_' . $val['type'] . '_field' }( $name, $val ); } } /** * Render Hotspot Setting When Hotspot-Type is Info * * @param mixed $hotspot_url * @param mixed $hotspot_content * @param mixed $hotspot_hover * * @return void * @since 8.0.0 */ public static function render_hotspot_setting_info_fields($pano_hotspot) { $fields = self::get_hotspot_setting_info_fields($pano_hotspot); foreach($fields as $name => $val) { self::{ 'render_hotspot_' . $val['type'] . '_field' }( $name, $val ); } } /** * Render Hotspot Setting When Hotspot-Type is fluent form * * @param mixed $hotspot_hover * @param mixed $hotspot_target_scene * * @return void * @since 8.0.0 */ public static function render_hotspot_setting_fluent_form_fields($pano_hotspot) { $fields = self::get_hotspot_setting_fluent_form_fields($pano_hotspot); foreach($fields as $name => $val) { self::{ 'render_hotspot_' . $val['type'] . '_field' }( $name, $val ); } } /** * Render Hotspot Setting When Hotspot-Type is Woocommerce Product * * @param mixed $hotspot_hover * @param mixed $hotspot_target_scene * * @return void * @since 8.0.0 */ public static function render_hotspot_setting_wc_product_fields($pano_hotspot) { $fields = self::get_hotspot_setting_wc_product_fields($pano_hotspot); foreach($fields as $name => $val) { self::{ 'render_hotspot_' . $val['type'] . '_field' }( $name, $val ); } } /** * Render Hotspot Setting When Hotspot-Type is Scene * * @param mixed $hotspot_hover * @param mixed $hotspot_target_scene * * @return void * @since 8.0.0 */ public static function render_hotspot_setting_scene_fields($pano_hotspot) { $fields = self::get_hotspot_setting_scene_fields($pano_hotspot); foreach($fields as $name => $val) { self::{ 'render_hotspot_' . $val['type'] . '_field' }( $name, $val ); } } /** * Render Scene Setting Left fields * When Panodata is Empty * @return void * @since 8.0.0 */ public static function render_scene_left_fields_empty_panodata() { $fields = self::get_scene_left_fields_empty_panodata(); foreach($fields as $name => $val) { self::{ 'render_scene_' . $val['type'] . '_field' }( $name, $val ); } } /** * Render Scene Setting Left Fields * When Panodata is not Empty * @param mixed $dscene * @param mixed $scene_id * @param mixed $scene_photo * * @return void * @since 8.0.0 */ public static function render_scene_left_fields_with_panodata($pano_scene) { $fields = self::get_scene_left_fields_with_panodata($pano_scene); foreach($fields as $name => $val) { self::{ 'render_scene_' . $val['type'] . '_field' }( $name, $val ); } } /** * Initialize fields render method * @return void * @since 8.0.0 */ public static function render_advanced_settings_left_fields($postdata) { $fields = self::get_advanced_settings_left_fields($postdata); foreach($fields as $name => $val) { if( 'advanced_setting_checkbox_for_mouse_dragg_control' === $val['type']){ self::{ 'render_' . $val['type'] . '_field' }( $name, $val, $postdata ); } else if('advanced_mouse_zoom_control' === $val['type']){ self::{ 'render_' . $val['type'] . '_field' }( $name, $val, $postdata ); }else if('advanced_gyro_control' === $val['type']){ self::{ 'render_' . $val['type'] . '_field' }( $name, $val, $postdata ); } else if('advanced_setting_scene_gallery' === $val['type']){ self::{ 'render_' . $val['type'] . '_field' }( $name, $val, $postdata ); } else if('pro_inner_scene_gallery_icon_size' === $val['type']){ self::{ 'render_' . $val['type'] . '_field' }( $name, $val, $postdata ); } else if($val['type'] === 'tour_layout_select'){ self::{ 'render_' . $val['type'] }( $name, $val ); } else{ self::{ 'render_' . $val['type'] . '_field' }( $name, $val ); } } } /** * Initialize fields render method * @return void * @since 8.0.0 */ public static function render_advanced_settings_right_fields($postdata) { $fields = self::get_advanced_settings_right_fields($postdata); $layout = (is_array($postdata) && isset($postdata['tourLayout']['layout'])) ? $postdata['tourLayout']['layout'] : ''; foreach($fields as $name => $val) { if(in_array($name, array('explainer','backToHome', 'panFullscreenControl'))){ self::{ 'render_' . $val['type'] . '_with_icon' }( $name, $val, $layout ); }else if('basic_setting_checkbox_for_scene_animation' === $val['type']){ self::{ 'render_' . $val['type'] }( $name, $val, $postdata ); } else if('advanced_setting_explainer_video' === $val['type']){ self::{ 'render_' . $val['type'] . '_field' }( $name, $val, $postdata ); } else if('advanced_setting_explainer_video' === $val['type']){ self::{ 'render_' . $val['type'] . '_field' }( $name, $val, $postdata ); } else if('advanced_setting_set_zoom_preference' === $val['type']){ self::{ 'render_' . $val['type'] . '_field' }( $name, $val, $postdata ); } else{ self::{ 'render_' . $val['type'] . '_field' }( $name, $val ); } } self::render_other_fields($postdata); } /** * Initilize Video Meta Fields * @param mixed $postdata * * @return array * @since 8.0.0 */ public static function get__video_setting_fields($postdata) { $vidurl = ''; if (isset($postdata['vidid'])) { $vidurl = $postdata['vidurl']; } $meta_fields = array( 'panovideo' => array( 'class' => 'single-settings videosetup', 'title' => __('Video Tour','wpvr'), 'type' => 'radio_button', 'lists' => array( array( 'input_class' => 'styled-radio video_off', 'input_id' => 'styled-radio', 'value' => 'off', 'checked' => isset($postdata['vidid']), 'label_value' => 'Off' ), array( 'input_class' => 'styled-radio video_on', 'input_id' => 'styled-radio-0', 'value' => 'on', 'checked' => isset($postdata['vidid']), 'label_value' => 'On' ) ), 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Enable or disable video mode using self-hosted, YouTube, or Vimeo.', 'wpvr'), 'url' => '' ), ), 'video-attachment-url' => array( 'class' => 'single-settings video-setting', 'title' => __('Upload or Add Link','wpvr'), 'placeholder' => __('Paste Youtube or Vimeo link or upload','wpvr'), 'input_class' => 'video-attachment-url', 'type' => 'video_text_input', 'value' => $vidurl, 'have_tooltip' => true, 'tooltip_text' => array( 'text' => __('Use a self-hosted file or paste a YouTube/Vimeo link.', 'wpvr'), 'url' => '' ), ) ); return apply_filters( 'extend_video_meta_fields', $meta_fields, $postdata, $vidurl ); } /** * Render Video Settings Meta Fields * @param mixed $postdata * * @return void * @since 8.0.0 */ public static function render_video_setting_meta_fields($postdata) { $fields = self::get__video_setting_fields($postdata); foreach($fields as $name => $val) { self::{ 'render_' . $val['type'] }( $name, $val ); } } /** * Render Scene Settings Select Field * @param mixed $name input name * @param mixed $val options * * @return void * @since 8.0.0 */ public static function render_scene_select_field($name, $val) { extract($val); ob_start(); ?>