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,95 @@
<?php
namespace Olegnax\BannerSlider\Block\Adminhtml\Group;
use Magento\Backend\Block\Widget\Context;
use Magento\Backend\Block\Widget\Form\Container;
use Magento\Framework\Phrase;
use Magento\Framework\Registry;
class Edit extends Container
{
protected $_coreRegistry = null;
/**
* Edit constructor.
* @param Registry $registry
* @param Context $context
* @param array $data
*/
public function __construct(
Registry $registry,
Context $context,
array $data = []
) {
$this->_coreRegistry = $registry;
parent::__construct($context, $data);
}
/**
* @return Phrase|string
*/
public function getHeaderText()
{
$id = $this->_coreRegistry->registry('olegnax_bannerslider_group')->getId();
if ($id) {
return __("Edit Group '%1'", $this->escapeHtml($id));
} else {
return __('New Group');
}
}
/**
*
*/
protected function _construct()
{
$this->_blockGroup = 'Olegnax_BannerSlider';
$this->_controller = 'adminhtml_group';
parent::_construct();
if ($this->_isAllowedAction('Olegnax_BannerSlider::Group_New')
|| $this->_isAllowedAction('Olegnax_BannerSlider::Group_Edit')) {
$this->buttonList->remove('reset');
$this->buttonList->update('save', 'label', __('Save Group'));
$this->buttonList->add(
'saveandcontinue',
[
'label' => __('Save and Continue Edit'),
'class' => 'save',
'data_attribute' => [
'mage-init' => [
'button' => ['event' => 'saveAndContinueEdit', 'target' => '#edit_form'],
],
],
],
-100
);
$this->buttonList->update('delete', 'label', __('Delete Group'));
} else {
$this->buttonList->remove('save');
$this->buttonList->remove('delete');
}
}
/**
* @param $resourceId
* @return bool
*/
protected function _isAllowedAction($resourceId)
{
return $this->_authorization->isAllowed($resourceId);
}
/**
* @return string
*/
protected function _toHtml()
{
$this->_eventManager->dispatch(
'adminhtml_block_html_before',
['block' => $this]
);
return parent::_toHtml();
}
}
@@ -0,0 +1,50 @@
<?php
namespace Olegnax\BannerSlider\Block\Adminhtml\Group\Edit;
use Magento\Backend\Block\Template\Context;
use Magento\Backend\Block\Widget\Form\Generic;
use Magento\Framework\Data\FormFactory;
use Magento\Framework\Registry;
use Magento\Store\Model\System\Store;
class Form extends Generic {
protected $_systemStore;
public function __construct(
Context $context,
Registry $registry,
FormFactory $formFactory,
Store $systemStore,
array $data = [ ]
) {
$this->_systemStore = $systemStore;
parent::__construct( $context, $registry, $formFactory, $data );
}
protected function _construct() {
parent::_construct();
$this->setId( 'group_form' );
$this->setTitle( __( 'Group' ) );
}
protected function _prepareForm() {
$form = $this->_formFactory->create(
[
'data' => [
'id' => 'edit_form',
'action' => $this->getData( 'action' ),
'enctype'=>'multipart/form-data',
'method' => 'post',
]
]
);
$form->setUseContainer( true );
$this->setForm( $form );
return parent::_prepareForm();
}
}
@@ -0,0 +1,87 @@
<?php
namespace Olegnax\BannerSlider\Block\Adminhtml\Group\Edit\Tab;
use Magento\Backend\Block\Template\Context;
use Magento\Backend\Block\Widget\Form\Generic;
use Magento\Backend\Block\Widget\Tab\TabInterface;
use Magento\Framework\Data\FormFactory;
use Magento\Framework\Registry;
use Magento\Store\Model\System\Store;
class General extends Generic implements TabInterface {
/**
* @var Store
*/
protected $_systemStore;
public function __construct(
Store $systemStore,
Context $context,
Registry $registry,
FormFactory $formFactory,
array $data = []
) {
$this->_systemStore = $systemStore;
parent::__construct($context, $registry, $formFactory, $data);
}
protected function _prepareForm() {
$model = $this->_coreRegistry->registry('olegnax_bannerslider_group');
$form = $this->_formFactory->create();
$fieldset = $form->addFieldset(
'base_fieldset', ['legend' => __('General')]
);
if ($model->getId()) {
$fieldset->addField(
'group_id', 'hidden', ['name' => 'group_id']
);
}
$fieldset->addField('group_name', 'text', array(
'label' => __('Group name'),
'name' => 'group_name',
'required' => true
));
$fieldset->addField('identifier', 'text', array(
'label' => __('Identifier'),
'name' => 'identifier',
'required' => true
));
$fieldset->addField('slide_width', 'text', array(
'label' => __('Slide width'),
'name' => 'slide_width',
'required' => true
));
$fieldset->addField('slide_height', 'text', array(
'label' => __('Slide height'),
'name' => 'slide_height',
'required' => true
));
$data = $model->getData();
$form->setValues($data);
$this->setForm($form);
return parent::_prepareForm();
}
public function getTabLabel() {
return __('General');
}
public function getTabTitle() {
return __('General');
}
public function canShowTab() {
return true;
}
public function isHidden() {
return false;
}
}
@@ -0,0 +1,14 @@
<?php
namespace Olegnax\BannerSlider\Block\Adminhtml\Group\Edit;
class Tabs extends \Magento\Backend\Block\Widget\Tabs {
protected function _construct() {
parent::_construct();
$this->setId( 'group_edit_tabs' );
$this->setDestElementId( 'edit_form' );
$this->setTitle( __( 'Group' ) );
}
}