ltsecurityinc安防产品在线商城代码

This commit is contained in:
2026-09-14 17:47:10 +08:00
parent 57d8444c15
commit 6a3c9c5bd8
14539 changed files with 1775310 additions and 0 deletions
@@ -0,0 +1,126 @@
<?php
/** @var Exporter $block */
use Olegnax\Athlete2\Block\Adminhtml\Import\Exporter;
$options = $block->getConfig();
$blocks = $block->getBlocks();
$pages = $block->getPages();
$bannerSliders = $block->getBannerSlider();
$carousels = $block->getCarousel();
?>
<form method="POST" action="<?= $block->actionExport(); ?>">
<div class="options-wrap">
<h2 class="title">Options</h2>
<input id="options_all" class="option option-all" type="checkbox" name="config_all" value=""> <label for="options_all"><?= __( 'Select All' ) ?></label>
<ul class="options" style="padding-left: 30px;">
<?php foreach ( $options as $section => $value1 ) { ?>
<li>
<input id="options_<?= $section ?>" class="option option-section" type="checkbox" name="config[]" value="<?= $section ?>"> <label for="options_<?= $section ?>"><?= $section ?></label>
<?php if ( is_array( $value1 ) ) { ?>
<ul style="padding-left: 30px;">
<?php foreach ( $value1 as $group => $value2 ) { ?>
<li>
<input id="options_<?= $section ?>_<?= $group ?>" class="option option-group" type="checkbox" name="config[]" value="<?= implode( '/', [ $section, $group ] ) ?>"> <label for="options_<?= $section ?>_<?= $group ?>"><?= $group ?></label>
</li>
<?php } ?>
</ul>
<?php } ?>
</li>
<?php } ?>
</ul>
</div>
<div class="blocks-wrap">
<h2 class="title">Blocks</h2>
<input id="block_all" class="block block-all" type="checkbox" name="block_all" value=""> <label for="block_all"><?= __( 'Select All' ) ?></label>
<ul class="blocks" style="padding-left: 30px;">
<?php foreach ( $blocks as $identifier => $title ) { ?>
<li><input id="block_<?= $identifier ?>" class="block option-block" type="checkbox" name="blocks[]" value="<?= $identifier ?>"> <label for="block_<?= $identifier ?>"><?= $title ?></label></li>
<?php } ?>
</ul>
</div>
<div class="pages-wrap">
<h2 class="title">Pages</h2>
<input id="pages_all" class="page page-all" type="checkbox" name="page_all" value=""> <label for="pages_all"><?= __( 'Select All' ) ?></label>
<ul class="pages" style="padding-left: 30px;">
<?php foreach ( $pages as $identifier => $title ) { ?>
<li><input id="pages_<?= $identifier ?>" class="page option-page" type="checkbox" name="pages[]" value="<?= $identifier ?>"> <label for="pages_<?= $identifier ?>"><?= $title ?></label></li>
<?php } ?>
</ul>
</div>
<?php if ( !empty( $bannerSliders ) ) : ?>
<div class="bannersliders-wrap">
<h2 class="title">Banner Sliders</h2>
<input id="bannersliders_all" class="bannerslider bannerslider-all" type="checkbox" name="bannersliders_all" value=""> <label for="bannersliders_all"><?= __( 'Select All' ) ?></label>
<ul class="pages" style="padding-left: 30px;">
<?php foreach ( $bannerSliders as $identifier => $title ) { ?>
<li><input id="bannersliders_<?= $identifier ?>" class="bannerslider option-bannerslider" type="checkbox" name="bannersliders[]" value="<?= $identifier ?>"> <label for="bannersliders_<?= $identifier ?>"><?= $title ?></label></li>
<?php } ?>
</ul>
</div>
<?php endif; ?>
<?php if ( !empty( $carousels ) ) : ?>
<div class="bannersliders-wrap">
<h2 class="title">Carousel Sliders</h2>
<input id="carouselsliders_all" class="carousel carousel-all" type="checkbox" name="carousels_all" value=""> <label for="carousels_all"><?= __( 'Select All' ) ?></label>
<ul class="pages" style="padding-left: 30px;">
<?php foreach ( $carousels as $identifier => $title ) { ?>
<li><input id="carousels_<?= $identifier ?>" class="carousel option-carousel" type="checkbox" name="carousels[]" value="<?= $identifier ?>"> <label
for="carousels_<?= $identifier ?>"><?= $title ?></label></li>
<?php } ?>
</ul>
</div>
<?php endif; ?>
<button type="submit"><?= __( 'Save' ) ?></button>
<input name="form_key" type="hidden" value="<?= $block->getFormKey() ?>" />
</form>
<script>
require( [
'jquery',
], function ( $ ) {
'use strict';
// options
$( '.options .option' ).on( 'change', function ( e ) {
var $this = $( this ),
$li = $this.closest( 'li' ).eq( 0 ),
$submenu = $li.children( 'ul' ),
checked = $this.is( ':checked' ),
value = $this.attr( 'value' ),
child = $( 'input[name^=config][value^="' + $( this ).attr( 'value' ) + '/"]' );
$submenu.toggle( !checked );
child.prop( 'disabled', checked );
if ( checked ) {
child.prop( 'checked', true ).trigger( 'change' );
} else {
var parent_val = $( this ).attr( 'value' ).split( '/' );
parent_val.pop();
parent_val = parent_val.join( '/' );
$( 'input[name^=config][value="' + parent_val + '"]' ).prop( 'checked', false );
$( '.option.option-all' ).prop( 'checked', false );
}
} );
$( '.option.option-all' ).on( 'change', function ( e ) {
if ( $( this ).is( ':checked' ) ) {
$( '.option.option-section' ).prop( 'checked', true ).trigger( 'change' );
}
} );
// blocks
$( '.block.block-all' ).on( 'change', function ( e ) {
$( '.block.option-block' ).prop( 'checked', $( this ).is( ':checked' ) ).trigger( 'change' );
} );
// pages
$( '.page.page-all' ).on( 'change', function ( e ) {
$( '.page.option-page' ).prop( 'checked', $( this ).is( ':checked' ) ).trigger( 'change' );
} );
// bannerslider
$( '.bannerslider.bannerslider-all' ).on( 'change', function ( e ) {
$( '.bannerslider.option-bannerslider' ).prop( 'checked', $( this ).is( ':checked' ) ).trigger( 'change' );
} );
// carousel
$( '.carousel.carousel-all' ).on( 'change', function ( e ) {
$( '.carousel.option-carousel' ).prop( 'checked', $( this ).is( ':checked' ) ).trigger( 'change' );
} );
} );
</script>
@@ -0,0 +1,109 @@
<?php
/** @var Index $block */
use Olegnax\Athlete2\Block\Adminhtml\Import\Index;
$demos = $block->getDemo();
?>
<div class="ox-admin__import">
<?php foreach ( $demos as $demoId => $demo ) : ?>
<div class="ox-admin-import__block" id="demo-<?= $block->getDemoId( $demoId ) ?>">
<img src="<?= $block->getDemoImage( $demoId ) ?>">
<span class="ox-admin-import__name"><?= $demo[ 'name' ] ?></span>
<a href="#" class="ox-admin__button action-primary ox-admin-modal__action ox-admin-import__button"><?= __( 'Import' ); ?></a>
<div class="ox-admin__modal">
<div class="ox-admin-modal__inner">
<div class="ox-overlay-close-btn action-primary"><span></span></div>
<h2><?= __( 'Choose what to Import:' ); ?></h2>
<table>
<tbody>
<?php if ( in_array( 'content', $demo[ 'variations' ] ) ) : ?>
<tr>
<td>
<h3><?= __( 'Pages and CMS Blocks' ); ?></h3>
<p>
<label class="ox-checkbox" for="<?=$block->escapeHtmlAttr($demoId) ?>_not_replace"><input type="checkbox" class="import-not-replace" id="<?=$block->escapeHtmlAttr($demoId)
?>_not_replace"
name="<?=$block->escapeHtmlAttr($demoId) ?>_not_replace"> <?= __('Add items, do not replace'); ?></label>
</p>
<p class="attention"><?= __( 'Attention! This will override your existing Static blocks and CMS Pages with the same Identifiers.' ); ?></p>
</td>
<td>
<a href="<?= $block->actionImport( $demoId, 'content' ) ?>" class="ox-admin__button action-primary ox-admin__button-replace"><?= __( 'Import' ); ?></a>
<a href="<?= $block->actionImport( $demoId, 'content' ) ?>notreplace/1" class="ox-admin__button action-primary ox-admin__button-not-replace" style="display: none"><?= __(
'Import'
);
?></a>
</td>
</tr>
<?php endif; ?>
<?php if ( in_array( 'bannerslider', $demo[ 'variations' ] ) ) : ?>
<tr>
<td><h3><?= __( 'Banner Slider & Carousel' ); ?></h3></td>
<td><a href="<?= $block->actionImport( $demoId, 'bannerslider' ) ?>" class="ox-admin__button action-primary"><?= __( 'Import' ); ?></a></td>
</tr>
<?php endif; ?>
<?php if ( in_array( 'settings', $demo[ 'variations' ] ) ) : ?>
<tr>
<td><h3><?= __( 'Theme Settings' ); ?></h3></td>
<td><a href="<?= $block->actionImport( $demoId, 'settings' ) ?>" class="ox-admin__button action-primary"><?= __( 'Import' ); ?></a></td>
</tr>
<?php endif; ?>
<?php if ( in_array( 'blog', $demo[ 'variations' ] ) ) : ?>
<tr>
<td><h3><?= __( 'Blog Settings' ); ?></h3><p class="small">Requires Magefan Blog module to be installed.</p></td>
<td><a href="<?= $block->actionImport( $demoId, 'blog' ) ?>" class="ox-admin__button action-primary"><?= __( 'Import' ); ?></a></td>
</tr>
<?php endif; ?>
<?php if ( in_array( 'popup', $demo[ 'variations' ] ) ) : ?>
<tr>
<td><h3><?= __( 'Newsletter Popup Settings *' ); ?></h3><p class="small">Requires Olegnax Newsletter module to be installed.</p></td>
<td><a href="<?= $block->actionImport( $demoId, 'popup' ) ?>" class="ox-admin__button action-primary"><?= __( 'Import' ); ?></a></td>
</tr>
<?php endif; ?>
<?php if ( in_array( 'hotspots', $demo[ 'variations' ] ) ) : ?>
<tr>
<td><h3><?= __( 'Hotspots' ); ?></h3><p class="small">Sample page and cms blocks with hotspot content.</p></td>
<td><a href="<?= $block->actionImport( $demoId, 'hotspots' ) ?>" class="ox-admin__button action-primary"><?= __( 'Import' ); ?></a></td>
</tr>
<?php endif; ?>
<?php if ( in_array( 'googlemap', $demo[ 'variations' ] ) ) : ?>
<tr>
<td><h3><?= __( 'Google Map Module Settings *' ); ?></h3><p class="small">Requires Olegnax Google map module to be installed.</p></td>
<td><a href="<?= $block->actionImport( $demoId, 'googlemap' ) ?>" class="ox-admin__button action-primary"><?= __( 'Import' ); ?></a></td>
</tr>
<?php endif; ?>
<tr>
<td colspan="2"><p style="text-align: left;"><?= __( '* Options are optional and already present in Theme Settings import. Use them in case you already have website setup and don\'t want to lose existing settings but only import new or specific options.' ); ?></p></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
<script>
require( [
'jquery',
], function ( $ ) {
'use strict';
$( 'body' ).on( 'click', '.ox-admin-import__button', function ( e ) {
e.preventDefault();
$( this ).next( '.ox-admin__modal' ).addClass( 'opened' );
} );
$( 'body' ).on( 'click', '.ox-overlay-close-btn', function ( e ) {
e.preventDefault();
$( this ).closest( '.ox-admin__modal' ).removeClass( 'opened' );
} );
$( 'body' ).on( 'change', '.import-not-replace', function ( e ) {
var $this = $(this),
parent = $this.closest('tr').eq(0),
isChecked = $this.is(':checked');
parent.find('p.attention, .ox-admin__button-replace').toggle(!isChecked);
parent.find('.ox-admin__button-not-replace').toggle(isChecked);
});
} );
</script>