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,50 @@
<?php
/**
* Plumrocket Inc.
*
* NOTICE OF LICENSE
*
* This source file is subject to the End-user License Agreement
* that is available through the world-wide-web at this URL:
* http://wiki.plumrocket.net/wiki/EULA
* If you are unable to obtain it through the world-wide-web, please
* send an email to support@plumrocket.com so we can send you a copy immediately.
*
* @package Plumrocket_CookieConsent
* @copyright Copyright (c) 2020 Plumrocket Inc. (http://www.plumrocket.com)
* @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
*/
declare(strict_types=1);
namespace Plumrocket\CookieConsent\Block\Adminhtml\Cookie\Category\Edit\Button;
/**
* @since 1.0.0
*/
class Back extends Generic
{
/**
* Get Button Data
*
* @return array
*/
public function getButtonData(): array
{
return [
'label' => __('Back'),
'on_click' => sprintf("location.href = '%s';", $this->getBackUrl()),
'class' => 'back',
'sort_order' => 10
];
}
/**
* Get URL for back
*
* @return string
*/
private function getBackUrl(): string
{
return $this->getUrl('*/*/');
}
}
@@ -0,0 +1,54 @@
<?php
/**
* Plumrocket Inc.
*
* NOTICE OF LICENSE
*
* This source file is subject to the End-user License Agreement
* that is available through the world-wide-web at this URL:
* http://wiki.plumrocket.net/wiki/EULA
* If you are unable to obtain it through the world-wide-web, please
* send an email to support@plumrocket.com so we can send you a copy immediately.
*
* @package Plumrocket_CookieConsent
* @copyright Copyright (c) 2020 Plumrocket Inc. (http://www.plumrocket.com)
* @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
*/
declare(strict_types=1);
namespace Plumrocket\CookieConsent\Block\Adminhtml\Cookie\Category\Edit\Button;
/**
* @since 1.0.0
*/
class Delete extends Generic
{
/**
* @inheritDoc
*/
public function getButtonData()
{
$data = [];
if ($this->getCategory()->getId()) {
$data = [
'label' => __('Delete'),
'class' => 'delete',
'on_click' => 'deleteConfirm(\'' . __('Are you sure you want to do this?')
. '\', \'' . $this->getDeleteUrl() . '\', {"data": {}})',
'sort_order' => 20,
];
}
return $data;
}
/**
* Get URL for delete
*
* @return string
*/
private function getDeleteUrl(): string
{
return $this->getUrl('*/*/delete', ['id' => $this->getCategory()->getId()]);
}
}
@@ -0,0 +1,86 @@
<?php
/**
* Plumrocket Inc.
*
* NOTICE OF LICENSE
*
* This source file is subject to the End-user License Agreement
* that is available through the world-wide-web at this URL:
* http://wiki.plumrocket.net/wiki/EULA
* If you are unable to obtain it through the world-wide-web, please
* send an email to support@plumrocket.com so we can send you a copy immediately.
*
* @package Plumrocket_CookieConsent
* @copyright Copyright (c) 2020 Plumrocket Inc. (http://www.plumrocket.com)
* @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
*/
declare(strict_types=1);
namespace Plumrocket\CookieConsent\Block\Adminhtml\Cookie\Category\Edit\Button;
use Magento\Framework\View\Element\UiComponent\Context;
use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;
use Plumrocket\CookieConsent\Api\Data\CategoryInterface;
use Plumrocket\CookieConsent\Ui\Locator\CategoryLocatorInterface;
/**
* @since 1.0.0
*/
class Generic implements ButtonProviderInterface
{
/**
* Url Builder
*
* @var Context
*/
protected $context;
/**
* @var \Plumrocket\CookieConsent\Ui\Locator\CategoryLocatorInterface
*/
private $categoryLocator;
/**
* Generic constructor
*
* @param Context $context
* @param \Plumrocket\CookieConsent\Ui\Locator\CategoryLocatorInterface $categoryLocator
*/
public function __construct(
Context $context,
CategoryLocatorInterface $categoryLocator
) {
$this->context = $context;
$this->categoryLocator = $categoryLocator;
}
/**
* Generate url by route and parameters
*
* @param string $route
* @param array $params
* @return string
*/
public function getUrl($route = '', $params = [])
{
return $this->context->getUrl($route, $params);
}
/**
* @return \Plumrocket\CookieConsent\Api\Data\CategoryInterface
* @throws \Magento\Framework\Exception\NotFoundException
*/
public function getCategory(): CategoryInterface
{
return $this->categoryLocator->getCategory();
}
/**
* @inheritdoc
*/
public function getButtonData()
{
return [];
}
}
@@ -0,0 +1,86 @@
<?php
/**
* Plumrocket Inc.
*
* NOTICE OF LICENSE
*
* This source file is subject to the End-user License Agreement
* that is available through the world-wide-web at this URL:
* http://wiki.plumrocket.net/wiki/EULA
* If you are unable to obtain it through the world-wide-web, please
* send an email to support@plumrocket.com so we can send you a copy immediately.
*
* @package Plumrocket_CookieConsent
* @copyright Copyright (c) 2020 Plumrocket Inc. (http://www.plumrocket.com)
* @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
*/
declare(strict_types=1);
namespace Plumrocket\CookieConsent\Block\Adminhtml\Cookie\Category\Edit\Button;
use Magento\Ui\Component\Control\Container;
/**
* @since 1.0.0
*/
class Save extends Generic
{
/**
* @inheritdoc
*/
public function getButtonData(): array
{
return [
'label' => __('Save'),
'class' => 'save primary',
'data_attribute' => [
'mage-init' => [
'buttonAdapter' => [
'actions' => [
[
'targetName' => 'pr_cookie_category_form.pr_cookie_category_form',
'actionName' => 'save',
'params' => [
false
]
]
]
]
]
],
'class_name' => Container::SPLIT_BUTTON,
'options' => $this->getOptions(),
];
}
/**
* Retrieve options
*
* @return array
*/
protected function getOptions(): array
{
$options[] = [
'id_hard' => 'save_and_close',
'label' => __('Save & Close'),
'data_attribute' => [
'mage-init' => [
'buttonAdapter' => [
'actions' => [
[
'targetName' => 'pr_cookie_category_form.pr_cookie_category_form',
'actionName' => 'save',
'params' => [
true
]
]
]
]
]
],
];
return $options;
}
}
@@ -0,0 +1,50 @@
<?php
/**
* Plumrocket Inc.
*
* NOTICE OF LICENSE
*
* This source file is subject to the End-user License Agreement
* that is available through the world-wide-web at this URL:
* http://wiki.plumrocket.net/wiki/EULA
* If you are unable to obtain it through the world-wide-web, please
* send an email to support@plumrocket.com so we can send you a copy immediately.
*
* @package Plumrocket_CookieConsent
* @copyright Copyright (c) 2020 Plumrocket Inc. (http://www.plumrocket.com)
* @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
*/
declare(strict_types=1);
namespace Plumrocket\CookieConsent\Block\Adminhtml\Cookie\Item\Edit\Button;
/**
* @since 1.0.0
*/
class Back extends Generic
{
/**
* Get Button Data
*
* @return array
*/
public function getButtonData(): array
{
return [
'label' => __('Back'),
'on_click' => sprintf("location.href = '%s';", $this->getBackUrl()),
'class' => 'back',
'sort_order' => 10
];
}
/**
* Get URL for back
*
* @return string
*/
private function getBackUrl(): string
{
return $this->getUrl('*/*/');
}
}
@@ -0,0 +1,54 @@
<?php
/**
* Plumrocket Inc.
*
* NOTICE OF LICENSE
*
* This source file is subject to the End-user License Agreement
* that is available through the world-wide-web at this URL:
* http://wiki.plumrocket.net/wiki/EULA
* If you are unable to obtain it through the world-wide-web, please
* send an email to support@plumrocket.com so we can send you a copy immediately.
*
* @package Plumrocket_CookieConsent
* @copyright Copyright (c) 2020 Plumrocket Inc. (http://www.plumrocket.com)
* @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
*/
declare(strict_types=1);
namespace Plumrocket\CookieConsent\Block\Adminhtml\Cookie\Item\Edit\Button;
/**
* @since 1.0.0
*/
class Delete extends Generic
{
/**
* @inheritDoc
*/
public function getButtonData()
{
$data = [];
if ($this->getCookie()->getId()) {
$data = [
'label' => __('Delete'),
'class' => 'delete',
'on_click' => 'deleteConfirm(\'' . __('Are you sure you want to do this?')
. '\', \'' . $this->getDeleteUrl() . '\', {"data": {}})',
'sort_order' => 20,
];
}
return $data;
}
/**
* Get URL for delete
*
* @return string
*/
private function getDeleteUrl(): string
{
return $this->getUrl('*/*/delete', ['id' => $this->getCookie()->getId()]);
}
}
@@ -0,0 +1,86 @@
<?php
/**
* Plumrocket Inc.
*
* NOTICE OF LICENSE
*
* This source file is subject to the End-user License Agreement
* that is available through the world-wide-web at this URL:
* http://wiki.plumrocket.net/wiki/EULA
* If you are unable to obtain it through the world-wide-web, please
* send an email to support@plumrocket.com so we can send you a copy immediately.
*
* @package Plumrocket_CookieConsent
* @copyright Copyright (c) 2020 Plumrocket Inc. (http://www.plumrocket.com)
* @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
*/
declare(strict_types=1);
namespace Plumrocket\CookieConsent\Block\Adminhtml\Cookie\Item\Edit\Button;
use Magento\Framework\View\Element\UiComponent\Context;
use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;
use Plumrocket\CookieConsent\Api\Data\CookieInterface;
use Plumrocket\CookieConsent\Ui\Locator\CookieLocatorInterface;
/**
* @since 1.0.0
*/
class Generic implements ButtonProviderInterface
{
/**W
* Url Builder
*
* @var Context
*/
protected $context;
/**
* @var \Plumrocket\CookieConsent\Ui\Locator\CookieLocatorInterface
*/
private $cookieLocator;
/**
* Generic constructor
*
* @param Context $context
* @param \Plumrocket\CookieConsent\Ui\Locator\CookieLocatorInterface $cookieLocator
*/
public function __construct(
Context $context,
CookieLocatorInterface $cookieLocator
) {
$this->context = $context;
$this->cookieLocator = $cookieLocator;
}
/**
* Generate url by route and parameters
*
* @param string $route
* @param array $params
* @return string
*/
public function getUrl($route = '', $params = [])
{
return $this->context->getUrl($route, $params);
}
/**
* @return \Plumrocket\CookieConsent\Api\Data\CookieInterface
* @throws \Magento\Framework\Exception\NotFoundException
*/
public function getCookie(): CookieInterface
{
return $this->cookieLocator->getCookie();
}
/**
* @inheritdoc
*/
public function getButtonData()
{
return [];
}
}
@@ -0,0 +1,86 @@
<?php
/**
* Plumrocket Inc.
*
* NOTICE OF LICENSE
*
* This source file is subject to the End-user License Agreement
* that is available through the world-wide-web at this URL:
* http://wiki.plumrocket.net/wiki/EULA
* If you are unable to obtain it through the world-wide-web, please
* send an email to support@plumrocket.com so we can send you a copy immediately.
*
* @package Plumrocket_CookieConsent
* @copyright Copyright (c) 2020 Plumrocket Inc. (http://www.plumrocket.com)
* @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
*/
declare(strict_types=1);
namespace Plumrocket\CookieConsent\Block\Adminhtml\Cookie\Item\Edit\Button;
use Magento\Ui\Component\Control\Container;
/**
* @since 1.0.0
*/
class Save extends Generic
{
/**
* @inheritdoc
*/
public function getButtonData(): array
{
return [
'label' => __('Save'),
'class' => 'save primary',
'data_attribute' => [
'mage-init' => [
'buttonAdapter' => [
'actions' => [
[
'targetName' => 'pr_cookie_item_form.pr_cookie_item_form',
'actionName' => 'save',
'params' => [
false
]
]
]
]
]
],
'class_name' => Container::SPLIT_BUTTON,
'options' => $this->getOptions(),
];
}
/**
* Retrieve options
*
* @return array
*/
protected function getOptions(): array
{
$options[] = [
'id_hard' => 'save_and_close',
'label' => __('Save & Close'),
'data_attribute' => [
'mage-init' => [
'buttonAdapter' => [
'actions' => [
[
'targetName' => 'pr_cookie_item_form.pr_cookie_item_form',
'actionName' => 'save',
'params' => [
true
]
]
]
]
]
],
];
return $options;
}
}