ltsecurityinc安防产品在线商城代码
This commit is contained in:
Executable
+78
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
use Magento\Framework\Escaper;
|
||||
use Magento\Framework\View\Element\Template;
|
||||
use Magento\Search\Helper\Data;
|
||||
use Magento\Search\ViewModel\AdditionalSearchFormData;
|
||||
use Magento\Search\ViewModel\ConfigProvider;
|
||||
|
||||
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
|
||||
?>
|
||||
<?php
|
||||
/** @var $block Template */
|
||||
/** @var $helper Data */
|
||||
/** @var $escaper Escaper */
|
||||
|
||||
/** @var $configProvider ConfigProvider */
|
||||
$configProvider = $block->getData('configProvider');
|
||||
/** @var $versionManager AdditionalSearchFormData */
|
||||
$additionalSearchFormData = $block->getData('additionalSearchFormData');
|
||||
/** @var $helper Data */
|
||||
$helper = $configProvider->getSearchHelperData();
|
||||
$search_icon = '<img class="lts-header-icon lts-header-icon--search" src="'
|
||||
. $escaper->escapeUrl($block->getViewFileUrl('Magento_Theme::images/lts-header/header_search_icon.png'))
|
||||
. '" width="22" height="22" alt="" aria-hidden="true"/>';
|
||||
$placeholderText = $escaper->escapeHtml(__('Search'));
|
||||
?>
|
||||
<div class="header__item-search">
|
||||
<form class="form minisearch" id="search_mini_form_mobile" action="<?= $escaper->escapeUrl($helper->getResultUrl()) ?>" method="get">
|
||||
<?php if (!empty($queryParams = $additionalSearchFormData->getFormData())): ?>
|
||||
<?php foreach ($queryParams as $param): ?>
|
||||
<input type="hidden" name="<?= $escaper->escapeHtmlAttr($param['name']) ?>"
|
||||
value="<?= $escaper->escapeHtmlAttr($param['value']) ?>"/>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
<div class="field search">
|
||||
<div class="control">
|
||||
<input id="search"
|
||||
data-mage-init='{"Magento_Search/js/lts-search-autocomplete":{
|
||||
"formSelector":"#search_mini_form_mobile",
|
||||
"url":"<?= $escaper->escapeUrl($block->getUrl('lts_search/ajax/suggest')) ?>",
|
||||
"destinationSelector":"#search_autocomplete_mobile"}
|
||||
}'
|
||||
type="search"
|
||||
name="<?= $escaper->escapeHtmlAttr($helper->getQueryParamName()) ?>"
|
||||
value="<?= /* @noEscape */ $helper->getEscapedQueryText() ?>"
|
||||
placeholder="<?= $escaper->escapeHtmlAttr($placeholderText) ?>"
|
||||
class="input-text"
|
||||
maxlength="<?= $escaper->escapeHtmlAttr($helper->getMaxQueryLength()) ?>"
|
||||
role="combobox"
|
||||
aria-haspopup="false"
|
||||
aria-autocomplete="both"
|
||||
autocomplete="off"
|
||||
aria-expanded="false"/>
|
||||
<div id="search_autocomplete_mobile" class="search-autocomplete"></div>
|
||||
<div class="label">
|
||||
<div class="wrap">
|
||||
<label class="inner" for="search" data-role="minisearch-label"><?= $escaper->escapeHtml($placeholderText) ?></label>
|
||||
</div>
|
||||
</div>
|
||||
<?= $block->getChildHtml() ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button type="submit"
|
||||
title="<?= $escaper->escapeHtml(__('Search')) ?>"
|
||||
class="action search"
|
||||
aria-label="Search"
|
||||
>
|
||||
<?= $search_icon ?>
|
||||
<span><?= $escaper->escapeHtml(__('Search')) ?></span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
use Magento\Framework\Escaper;
|
||||
use Magento\Framework\View\Element\Template;
|
||||
use Magento\Search\Helper\Data;
|
||||
use Magento\Search\ViewModel\AdditionalSearchFormData;
|
||||
use Magento\Search\ViewModel\ConfigProvider;
|
||||
|
||||
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
|
||||
?>
|
||||
<?php
|
||||
/** @var $block Template */
|
||||
/** @var $helper Data */
|
||||
/** @var $escaper Escaper */
|
||||
|
||||
/** @var $configProvider ConfigProvider */
|
||||
$configProvider = $block->getData('configProvider');
|
||||
/** @var $versionManager AdditionalSearchFormData */
|
||||
$additionalSearchFormData = $block->getData('additionalSearchFormData');
|
||||
/** @var $helper Data */
|
||||
$helper = $configProvider->getSearchHelperData();
|
||||
$athlete_search_type = $this->helper('Olegnax\Athlete2\Helper\Helper')->getConfig('athlete2_settings/header/search_type');
|
||||
$search_icon = '<img class="lts-header-icon lts-header-icon--search" src="'
|
||||
. $escaper->escapeUrl($block->getViewFileUrl('Magento_Theme::images/lts-header/header_search_icon.png'))
|
||||
. '" width="22" height="22" alt="" aria-hidden="true"/>';
|
||||
$placeholderText = $escaper->escapeHtml(__('Search'));
|
||||
$input_classes = 'js-input-focus';
|
||||
if ($athlete_search_type == 'overlay') {
|
||||
$input_classes .= ' width-dynamic';
|
||||
}
|
||||
?>
|
||||
<div class="header__search-wrapper ox-move-item ox-move-item-search.slideout ox-move-search ox-move-sticky-search.slideout">
|
||||
<div class="ox-overlay-close-btn" aria-label="Close Modal"><span></span></div>
|
||||
<?php if ($athlete_search_type == 'overlay') { ?>
|
||||
<div class="logo__container">
|
||||
<?php echo $block->getLayout()->getBlock('logo')->toHtml(); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<form class="form minisearch" id="search_mini_form" action="<?= $escaper->escapeUrl($helper->getResultUrl()) ?>" method="get">
|
||||
<?php if (!empty($queryParams = $additionalSearchFormData->getFormData())): ?>
|
||||
<?php foreach ($queryParams as $param): ?>
|
||||
<input type="hidden" name="<?= $escaper->escapeHtmlAttr($param['name']) ?>"
|
||||
value="<?= $escaper->escapeHtmlAttr($param['value']) ?>"/>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
<div class="field search">
|
||||
<div class="control">
|
||||
<div class="flashing-cursor"></div>
|
||||
<input id="search"
|
||||
data-mage-init='{"Magento_Search/js/lts-search-autocomplete":{
|
||||
"formSelector":"#search_mini_form",
|
||||
"url":"<?= $escaper->escapeUrl($block->getUrl('lts_search/ajax/suggest')) ?>",
|
||||
"destinationSelector":"#search_autocomplete"}
|
||||
}'
|
||||
type="search"
|
||||
name="<?= $escaper->escapeHtmlAttr($helper->getQueryParamName()) ?>"
|
||||
value="<?= /* @noEscape */ $helper->getEscapedQueryText() ?>"
|
||||
placeholder="<?= $escaper->escapeHtmlAttr($placeholderText) ?>"
|
||||
class="input-text <?= $escaper->escapeHtmlAttr($input_classes) ?>"
|
||||
maxlength="<?= $escaper->escapeHtmlAttr($helper->getMaxQueryLength()) ?>"
|
||||
role="combobox"
|
||||
aria-haspopup="false"
|
||||
aria-autocomplete="both"
|
||||
autocomplete="off"
|
||||
aria-expanded="false"/>
|
||||
<div id="search_autocomplete" class="search-autocomplete"></div>
|
||||
<div class="label animated-text--masked">
|
||||
<div class="wrap">
|
||||
<label class="inner" for="search" data-role="minisearch-label"><?= $escaper->escapeHtml($placeholderText) ?></label>
|
||||
</div>
|
||||
</div>
|
||||
<?= $block->getChildHtml() ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button type="submit"
|
||||
title="<?= $escaper->escapeHtml(__('Go')) ?>"
|
||||
class="action search"
|
||||
aria-label="Search"
|
||||
>
|
||||
<?= $search_icon ?>
|
||||
<span><?= $escaper->escapeHtml(__('Go')) ?></span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
+144
@@ -0,0 +1,144 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
use Magento\Framework\Escaper;
|
||||
use Magento\Framework\View\Element\Template;
|
||||
use Magento\Search\Helper\Data;
|
||||
use Magento\Search\ViewModel\AdditionalSearchFormData;
|
||||
use Magento\Search\ViewModel\ConfigProvider;
|
||||
|
||||
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
|
||||
?>
|
||||
<?php
|
||||
/** @var $block Template */
|
||||
/** @var $helper Data */
|
||||
/** @var $escaper Escaper */
|
||||
|
||||
/** @var $configProvider ConfigProvider */
|
||||
$configProvider = $block->getData('configProvider');
|
||||
/** @var $versionManager AdditionalSearchFormData */
|
||||
$additionalSearchFormData = $block->getData('additionalSearchFormData');
|
||||
/** @var $helper Data */
|
||||
$helper = $configProvider->getSearchHelperData();
|
||||
$athlete_search_type = $this->helper('Olegnax\Athlete2\Helper\Helper')->getConfig('athlete2_settings/header/search_type');
|
||||
$athlete_header_layout = $this->helper('Olegnax\Athlete2\Helper\Helper')->getConfig('athlete2_settings/header/header_layout');
|
||||
$search_icon = '<img class="lts-header-icon lts-header-icon--search" src="'
|
||||
. $escaper->escapeUrl($block->getViewFileUrl('Magento_Theme::images/lts-header/header_search_icon.png'))
|
||||
. '" width="22" height="22" alt="" aria-hidden="true"/>';
|
||||
$placeholderText = __('Search');
|
||||
$input_classes = 'js-input-focus';
|
||||
$defaultModalClass = 'ox-dialog';
|
||||
$slideoutHtmlClass = 'ox-fixed';
|
||||
if ($athlete_search_type == 'overlay') {
|
||||
$input_classes .= ' width-dynamic';
|
||||
}
|
||||
?>
|
||||
<div class="block block-search header__item header__item-search block-search--type-<?= $escaper->escapeHtmlAttr($athlete_search_type) ?>">
|
||||
<div <?php if (in_array($athlete_search_type, ['slideout', 'overlay'])) : ?>data-move-mobile="search.slideout" data-move-sticky="search.slideout"<?php endif; ?> class="block block-content"<?php
|
||||
switch ($athlete_search_type) {
|
||||
case 'slideout':
|
||||
case 'overlay':
|
||||
?> data-role="OXmodal"
|
||||
data-mage-init='{"OXmodal":{
|
||||
"defaultModalClass": "<?= $defaultModalClass ?>",
|
||||
"triggerTarget":".action-search-slideout",
|
||||
"closeButtonTrigger": ".ox-overlay-close-btn",
|
||||
"overlayClass":"ox-slideout-shadow",
|
||||
"timeout": "1000",
|
||||
"closeOnEscape": true,
|
||||
"closeOnMouseLeave": false,
|
||||
"hoverOpen": false,
|
||||
"type": "<?= $escaper->escapeHtmlAttr($athlete_search_type) ?>",
|
||||
"positionSlideout":"top",
|
||||
"htmlClass":"<?= $slideoutHtmlClass ?>"
|
||||
}}'<?php
|
||||
break;
|
||||
}
|
||||
?>>
|
||||
<?php if ($athlete_header_layout != 'header_6') : ?>
|
||||
<div class="header__search-wrapper<?=
|
||||
!in_array($athlete_search_type, ['slideout', 'overlay']) ? ' ox-move-item ox-move-item-search.slideout' : '';
|
||||
?>">
|
||||
<div class="ox-overlay-close-btn" aria-label="Close Modal" ><span></span></div>
|
||||
<?php if ($athlete_search_type == 'overlay') {
|
||||
?>
|
||||
<div class="logo__container">
|
||||
<?php echo $block->getLayout()->getBlock('logo')->toHtml(); ?>
|
||||
</div>
|
||||
<?php
|
||||
} ?>
|
||||
<form class="form minisearch" id="search_mini_form" action="<?= $escaper->escapeUrl($helper->getResultUrl()) ?>" method="get">
|
||||
<?php if (!empty($queryParams = $additionalSearchFormData->getFormData())): ?>
|
||||
<?php foreach ($queryParams as $param): ?>
|
||||
<input type="hidden" name="<?= $escaper->escapeHtmlAttr($param['name']) ?>"
|
||||
value="<?= $escaper->escapeHtmlAttr($param['value']) ?>"/>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
<div class="search_form_wrap">
|
||||
<div class="field search">
|
||||
<div class="control">
|
||||
<div class="flashing-cursor"></div>
|
||||
<input id="search"
|
||||
data-mage-init='{"Magento_Search/js/lts-search-autocomplete":{
|
||||
"formSelector":"#search_mini_form",
|
||||
"url":"<?= $escaper->escapeUrl($block->getUrl('lts_search/ajax/suggest')) ?>",
|
||||
"destinationSelector":"#search_autocomplete"}
|
||||
}'
|
||||
type="search"
|
||||
name="<?= $escaper->escapeHtmlAttr($helper->getQueryParamName()) ?>"
|
||||
value="<?= /* @noEscape */ $helper->getEscapedQueryText() ?>"
|
||||
placeholder="<?= $escaper->escapeHtmlAttr($placeholderText) ?>"
|
||||
class="input-text <?= $escaper->escapeHtmlAttr($input_classes) ?>"
|
||||
maxlength="<?= $escaper->escapeHtmlAttr($helper->getMaxQueryLength()) ?>"
|
||||
role="combobox"
|
||||
aria-haspopup="false"
|
||||
aria-autocomplete="both"
|
||||
autocomplete="off"
|
||||
aria-expanded="false"/>
|
||||
<div id="search_autocomplete" class="search-autocomplete"></div>
|
||||
<div class="label animated-text--masked">
|
||||
<div class="wrap">
|
||||
<label class="inner" for="search" data-role="minisearch-label"><?= $escaper->escapeHtml($placeholderText) ?></label>
|
||||
</div>
|
||||
</div>
|
||||
<?= $block->getChildHtml() ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button type="submit"
|
||||
title="<?= $escaper->escapeHtml(__('Go')) ?>"
|
||||
class="action search"
|
||||
aria-label="Search"
|
||||
>
|
||||
<?= $search_icon ?>
|
||||
<span><?= $escaper->escapeHtml(__('Go')) ?></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php if (!in_array($athlete_search_type, ['slideout', 'overlay'])) : ?>
|
||||
<div class="block block-content block-content-slideout" data-move-mobile="search.slideout" data-move-sticky="search.slideout"
|
||||
style="display:none" data-role="OXmodal"
|
||||
data-mage-init='{"OXmodal":{
|
||||
"defaultModalClass": "<?= $defaultModalClass ?>",
|
||||
"triggerTarget":".action-search-slideout",
|
||||
"closeButtonTrigger": ".ox-overlay-close-btn",
|
||||
"overlayClass":"ox-slideout-shadow",
|
||||
"timeout": "1000",
|
||||
"closeOnEscape": true,
|
||||
"closeOnMouseLeave": false,
|
||||
"hoverOpen": false,
|
||||
"type": "slideout",
|
||||
"positionSlideout":"top",
|
||||
"htmlClass":"<?= $slideoutHtmlClass ?>"
|
||||
}}'>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<a class="button action-search-slideout"><?= $search_icon ?></a>
|
||||
</div>
|
||||
Reference in New Issue
Block a user