File: /www/wwwroot/www.scdc-marine.com/wp-content/themes/heku-cms/HekuClass/View/Single.php
<?php
namespace Heku\HekuClass\View;
/**
* @package Heku\HekuClass\View
* @subpackage Classes/Single
* @author Heku Daleconan <http://www.daleconan.com>
* @copyright Copyright (c) 2022-2023, Heku Daleconan
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
*/
class Single {
/**
* 类实现单例模式,类的独生子女
*/
private static $instance;
/**
* 依赖注入的接口 Instance 方法
* 目标是 保证 init() 初始化方法 只执行一次
*
* @return self 唯一实例化的本类
*/
public static function instance() {
if ( ! isset( self::$instance ) ) {
self::$instance = new self;
self::$instance->init();
}
return self::$instance;
}
private function init() {
// add_action('single_bar_line',array($this,'single_bar_html'),10);
// // 产品单页面,产品轮播图片,视频,和右侧 产品属性,型号,宣传语等 信息排版
// add_action('heku_single_content',array($this,'product_img_row_html'), 10);
// add_action('heku_single_sidebar',array($this,'product_sidebar_html'), 10);
// add_action('heku_footer_inline_js',array($this,'footer_inline_js_html'), 10);
}
// public static function top_single_script(){
// wp_enqueue_script( 'heku-viewer', HEKU_THEME_URI . '/Assets/js/viewer.min.js' );
// $custom_inline_script = '// 网站导航条自动悬浮设置 #heku_top_menu
// window.addEventListener("DOMContentLoaded", function () {
// var galley = document.getElementById("viewer");
// var viewer = new Viewer(galley, {
// url: "data-original",
// toolbar:{
// oneToOne: false,
// play: false,
// prev: function() {
// viewer.prev(true);
// },
// next: function() {
// viewer.next(true);
// },
// },
// title:false,
// });
// var single_info_content = document.getElementById("single_info_content");
// var viewer = new Viewer(single_info_content, {
// url: "src",
// toolbar:{
// oneToOne: false,
// play: false,
// prev: function() {
// viewer.prev(true);
// },
// next: function() {
// viewer.next(true);
// },
// },
// title:false,
// });
// });';
// wp_add_inline_script( 'heku-viewer', $custom_inline_script );
// }
// public static function top_banner_css(){
// wp_dequeue_style( 'global-styles' );
// wp_dequeue_style('wp-block-library');
// $custom_inline_style = '
// ';
// $top_width = '440px';
// $custom_inline_style .='
// li.depth-0.heku-menu-type2:hover > .sub-menu{height:' . $top_width . ';}
// ';
// wp_add_inline_style( 'custom-style', $custom_inline_style );
// }
// public function footer_inline_js_html(){
// //wp_print_scripts('heku-viewer');
// }
}