ltsecurityinc安防产品在线商城代码
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
<?php /**/
|
||||
|
||||
namespace Olegnax\MegaMenu\Model\Attribute;
|
||||
|
||||
use Magento\Eav\Model\Entity\Attribute\Source\AbstractSource;
|
||||
|
||||
class Alignhorizontal extends AbstractSource
|
||||
{
|
||||
/**
|
||||
* Retrieve option array
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getOptionArray()
|
||||
{
|
||||
$_options = [];
|
||||
foreach ($this->getAllOptions() as $option) {
|
||||
$_options[$option['value']] = $option['label'];
|
||||
}
|
||||
return $_options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve all options array
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAllOptions()
|
||||
{
|
||||
if ($this->_options === null) {
|
||||
$this->_options = [
|
||||
['label' => __('item-left'), 'value' => 'item-left'],
|
||||
['label' => __('item-right'), 'value' => 'item-right'],
|
||||
['label' => __('item-center'), 'value' => 'item-center'],
|
||||
['label' => __('menu-left'), 'value' => 'menu-left'],
|
||||
['label' => __('menu-right'), 'value' => 'menu-right'],
|
||||
['label' => __('menu-center'), 'value' => 'menu-center'],
|
||||
['label' => __('window-left'), 'value' => 'window-left'],
|
||||
['label' => __('window-right'), 'value' => 'window-right'],
|
||||
['label' => __('window-center'), 'value' => 'window-center'],
|
||||
['label' => __('container-left'), 'value' => 'container-left'],
|
||||
['label' => __('container-right'), 'value' => 'container-right'],
|
||||
['label' => __('container-center'), 'value' => 'container-center'],
|
||||
];
|
||||
}
|
||||
return $this->_options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a text for option value
|
||||
*
|
||||
* @param string|int $value
|
||||
* @return string|false
|
||||
*/
|
||||
public function getOptionText($value)
|
||||
{
|
||||
$options = $this->getAllOptions();
|
||||
foreach ($options as $option) {
|
||||
if ($option['value'] == $value) {
|
||||
return $option['label'];
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
<?php /**/
|
||||
|
||||
namespace Olegnax\MegaMenu\Model\Attribute;
|
||||
|
||||
use Magento\Eav\Model\Entity\Attribute\Source\AbstractSource;
|
||||
|
||||
class Alignvertical extends AbstractSource
|
||||
{
|
||||
/**
|
||||
* Retrieve option array
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getOptionArray()
|
||||
{
|
||||
$_options = [];
|
||||
foreach ($this->getAllOptions() as $option) {
|
||||
$_options[$option['value']] = $option['label'];
|
||||
}
|
||||
return $_options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve all options array
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAllOptions()
|
||||
{
|
||||
if ($this->_options === null) {
|
||||
$this->_options = [
|
||||
['label' => __('menu bottom'), 'value' => 'menu-bottom'],
|
||||
['label' => __('container bottom'), 'value' => 'container-bottom'],
|
||||
];
|
||||
}
|
||||
return $this->_options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a text for option value
|
||||
*
|
||||
* @param string|int $value
|
||||
* @return string|false
|
||||
*/
|
||||
public function getOptionText($value)
|
||||
{
|
||||
$options = $this->getAllOptions();
|
||||
foreach ($options as $option) {
|
||||
if ($option['value'] == $value) {
|
||||
return $option['label'];
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
<?php /**/
|
||||
|
||||
namespace Olegnax\MegaMenu\Model\Attribute;
|
||||
|
||||
use Magento\Eav\Model\Entity\Attribute\Source\AbstractSource;
|
||||
|
||||
class Animation extends AbstractSource
|
||||
{
|
||||
/**
|
||||
* Retrieve option array
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getOptionArray()
|
||||
{
|
||||
$_options = [];
|
||||
foreach ($this->getAllOptions() as $option) {
|
||||
$_options[$option['value']] = $option['label'];
|
||||
}
|
||||
return $_options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve all options array
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAllOptions()
|
||||
{
|
||||
if ($this->_options === null) {
|
||||
$this->_options = [
|
||||
['label' => __('toggle'), 'value' => 'toggle'],
|
||||
['label' => __('fade'), 'value' => 'fade'],
|
||||
['label' => __('emersion'), 'value' => 'emersion'],
|
||||
['label' => __('emersion vertical'), 'value' => 'emersion-vertical'],
|
||||
];
|
||||
}
|
||||
return $this->_options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a text for option value
|
||||
*
|
||||
* @param string|int $value
|
||||
* @return string|false
|
||||
*/
|
||||
public function getOptionText($value)
|
||||
{
|
||||
$options = $this->getAllOptions();
|
||||
foreach ($options as $option) {
|
||||
if ($option['value'] == $value) {
|
||||
return $option['label'];
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
<?php /**/
|
||||
|
||||
namespace Olegnax\MegaMenu\Model\Attribute;
|
||||
|
||||
use Magento\Eav\Model\Entity\Attribute\Source\AbstractSource;
|
||||
|
||||
class Columns extends AbstractSource
|
||||
{
|
||||
/**
|
||||
* Retrieve option array
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getOptionArray()
|
||||
{
|
||||
$_options = [];
|
||||
foreach ($this->getAllOptions() as $option) {
|
||||
$_options[$option['value']] = $option['label'];
|
||||
}
|
||||
return $_options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve all options array
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAllOptions()
|
||||
{
|
||||
if ($this->_options === null) {
|
||||
$this->_options = [
|
||||
['label' => __('1'), 'value' => 1],
|
||||
['label' => __('2'), 'value' => 2],
|
||||
['label' => __('3'), 'value' => 3],
|
||||
['label' => __('4'), 'value' => 4],
|
||||
['label' => __('5'), 'value' => 5],
|
||||
['label' => __('6'), 'value' => 6],
|
||||
];
|
||||
}
|
||||
return $this->_options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a text for option value
|
||||
*
|
||||
* @param string|int $value
|
||||
* @return string|false
|
||||
*/
|
||||
public function getOptionText($value)
|
||||
{
|
||||
$options = $this->getAllOptions();
|
||||
foreach ($options as $option) {
|
||||
if ($option['value'] == $value) {
|
||||
return $option['label'];
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php /**/
|
||||
|
||||
namespace Olegnax\MegaMenu\Model\Attribute;
|
||||
|
||||
use Magento\Eav\Model\Entity\Attribute\Source\AbstractSource;
|
||||
|
||||
class Columnsgrid extends AbstractSource
|
||||
{
|
||||
/**
|
||||
* Retrieve option array
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getOptionArray()
|
||||
{
|
||||
$_options = [];
|
||||
foreach ($this->getAllOptions() as $option) {
|
||||
$_options[$option['value']] = $option['label'];
|
||||
}
|
||||
return $_options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve all options array
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAllOptions()
|
||||
{
|
||||
if ($this->_options === null) {
|
||||
$this->_options = [
|
||||
['label' => __('Full Width'), 'value' => 12],
|
||||
['label' => __('One Half'), 'value' => 6],
|
||||
['label' => __('One Third'), 'value' => 4],
|
||||
['label' => __('One Fourth'), 'value' => 3],
|
||||
['label' => __('One Sixth'), 'value' => 2]
|
||||
];
|
||||
}
|
||||
return $this->_options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a text for option value
|
||||
*
|
||||
* @param string|int $value
|
||||
* @return string|false
|
||||
*/
|
||||
public function getOptionText($value)
|
||||
{
|
||||
$options = $this->getAllOptions();
|
||||
foreach ($options as $option) {
|
||||
if ($option['value'] == $value) {
|
||||
return $option['label'];
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
<?php /**/
|
||||
|
||||
namespace Olegnax\MegaMenu\Model\Attribute;
|
||||
|
||||
use Magento\Eav\Model\Entity\Attribute\Source\AbstractSource;
|
||||
|
||||
class Duration extends AbstractSource
|
||||
{
|
||||
/**
|
||||
* Retrieve option array
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getOptionArray()
|
||||
{
|
||||
$_options = [];
|
||||
foreach ($this->getAllOptions() as $option) {
|
||||
$_options[$option['value']] = $option['label'];
|
||||
}
|
||||
return $_options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve all options array
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAllOptions()
|
||||
{
|
||||
if ($this->_options === null) {
|
||||
$this->_options = [
|
||||
['label' => __('toggle'), 'value' => 'toggle'],
|
||||
['label' => __('fade'), 'value' => 'fade'],
|
||||
['label' => __('emersion'), 'value' => 'emersion'],
|
||||
['label' => __('emersion vertical'), 'value' => 'emersion-vertical'],
|
||||
];
|
||||
}
|
||||
return $this->_options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a text for option value
|
||||
*
|
||||
* @param string|int $value
|
||||
* @return string|false
|
||||
*/
|
||||
public function getOptionText($value)
|
||||
{
|
||||
$options = $this->getAllOptions();
|
||||
foreach ($options as $option) {
|
||||
if ($option['value'] == $value) {
|
||||
return $option['label'];
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
<?php /**/
|
||||
|
||||
namespace Olegnax\MegaMenu\Model\Attribute;
|
||||
|
||||
use Magento\Eav\Model\Entity\Attribute\Source\AbstractSource;
|
||||
|
||||
class Layout extends AbstractSource
|
||||
{
|
||||
/**
|
||||
* Retrieve option array
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getOptionArray()
|
||||
{
|
||||
$_options = [];
|
||||
foreach ($this->getAllOptions() as $option) {
|
||||
$_options[$option['value']] = $option['label'];
|
||||
}
|
||||
return $_options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve all options array
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAllOptions()
|
||||
{
|
||||
if ($this->_options === null) {
|
||||
$this->_options = [
|
||||
['label' => __('Top / Left, Categories, Right / Bottom'), 'value' => 1],
|
||||
['label' => __('Left / Top, Categories, Bottom / Right'), 'value' => 2],
|
||||
['label' => __('Left / Top, Categories / Right / Bottom'), 'value' => 3],
|
||||
['label' => __('Left / Top / Categories, Bottom / Right'), 'value' => 4],
|
||||
];
|
||||
}
|
||||
return $this->_options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a text for option value
|
||||
*
|
||||
* @param string|int $value
|
||||
* @return string|false
|
||||
*/
|
||||
public function getOptionText($value)
|
||||
{
|
||||
$options = $this->getAllOptions();
|
||||
foreach ($options as $option) {
|
||||
if ($option['value'] == $value) {
|
||||
return $option['label'];
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
<?php /**/
|
||||
|
||||
namespace Olegnax\MegaMenu\Model\Attribute;
|
||||
|
||||
use Magento\Eav\Model\Entity\Attribute\Source\AbstractSource;
|
||||
|
||||
class Menuwidth extends AbstractSource
|
||||
{
|
||||
/**
|
||||
* Retrieve option array
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getOptionArray()
|
||||
{
|
||||
$_options = [];
|
||||
foreach ($this->getAllOptions() as $option) {
|
||||
$_options[$option['value']] = $option['label'];
|
||||
}
|
||||
return $_options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve all options array
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAllOptions()
|
||||
{
|
||||
if ($this->_options === null) {
|
||||
$this->_options = [
|
||||
['label' => __('Default'), 'value' => 'default'],
|
||||
['label' => __('Custom Width'), 'value' => 'custom'],
|
||||
['label' => __('Column Max Width'), 'value' => 'column-max-width'],
|
||||
['label' => __('Container Width'), 'value' => 'container'],
|
||||
['label' => __('Full website Width'), 'value' => 'fullwidth']
|
||||
];
|
||||
}
|
||||
return $this->_options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a text for option value
|
||||
*
|
||||
* @param string|int $value
|
||||
* @return string|false
|
||||
*/
|
||||
public function getOptionText($value)
|
||||
{
|
||||
$options = $this->getAllOptions();
|
||||
foreach ($options as $option) {
|
||||
if ($option['value'] == $value) {
|
||||
return $option['label'];
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
<?php /**/
|
||||
|
||||
namespace Olegnax\MegaMenu\Model\Attribute;
|
||||
|
||||
use Magento\Eav\Model\Entity\Attribute\Source\AbstractSource;
|
||||
|
||||
class MmLvl2AlignVertical extends AbstractSource
|
||||
{
|
||||
/**
|
||||
* Retrieve option array
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getOptionArray()
|
||||
{
|
||||
$_options = [];
|
||||
foreach ($this->getAllOptions() as $option) {
|
||||
$_options[$option['value']] = $option['label'];
|
||||
}
|
||||
return $_options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve all options array
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAllOptions()
|
||||
{
|
||||
if ($this->_options === null) {
|
||||
$this->_options = [
|
||||
['label' => __('Default, Overlap Parent Drop'), 'value' => ''],
|
||||
['label' => __('Right, Relative to Link'), 'value' => 'right'],
|
||||
['label' => __('Parent Drop Top, without stretch'), 'value' => 'top'],
|
||||
['label' => __('Parent Drop Top, with Height Stretch'), 'value' => 'top-stretch'],
|
||||
];
|
||||
}
|
||||
return $this->_options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a text for option value
|
||||
*
|
||||
* @param string|int $value
|
||||
* @return string|false
|
||||
*/
|
||||
public function getOptionText($value)
|
||||
{
|
||||
$options = $this->getAllOptions();
|
||||
foreach ($options as $option) {
|
||||
if ($option['value'] == $value) {
|
||||
return $option['label'];
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Olegnax\MegaMenu\Model\Cache;
|
||||
|
||||
use Magento\Framework\App\Cache\Type\FrontendPool;
|
||||
use Magento\Framework\Cache\Frontend\Decorator\TagScope;
|
||||
|
||||
class MegaMenu extends TagScope
|
||||
{
|
||||
|
||||
const TYPE_IDENTIFIER = 'ox_megamenu';
|
||||
const CACHE_TAG = 'OXMEGAMENU';
|
||||
|
||||
/**
|
||||
* @param FrontendPool $cacheFrontendPool
|
||||
*/
|
||||
public function __construct(
|
||||
FrontendPool $cacheFrontendPool
|
||||
) {
|
||||
parent::__construct($cacheFrontendPool->get(self::TYPE_IDENTIFIER), self::CACHE_TAG);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
namespace Olegnax\MegaMenu\Model\Category;
|
||||
|
||||
/**
|
||||
* Class DataProvider
|
||||
*
|
||||
* @api
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
* @since 101.0.0
|
||||
*/
|
||||
class DataProvider extends \Magento\Catalog\Model\Category\DataProvider
|
||||
{
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @since 101.0.0
|
||||
*/
|
||||
protected function getFieldsMap()
|
||||
{
|
||||
$fields = parent::getFieldsMap();
|
||||
$fields['ox-menu'] = [
|
||||
'ox_title_text_color',
|
||||
'ox_title_bg_color',
|
||||
'ox_nav_custom_class',
|
||||
'ox_nav_custom_link_content',
|
||||
'ox_nav_custom_link',
|
||||
'ox_nav_custom_link_target',
|
||||
'ox_category_label',
|
||||
'ox_label_color',
|
||||
'ox_label_text_color',
|
||||
'ox_columns',
|
||||
'ox_nav_column_width',
|
||||
'ox_bg_image',
|
||||
'ox_data_tm_align_horizontal',
|
||||
'ox_nav_type',
|
||||
'ox_mm_lvl2_align_vertical',
|
||||
'ox_nav_subcategories',
|
||||
'ox_menu_width',
|
||||
'ox_cat_image',
|
||||
'ox_layout',
|
||||
'ox_nav_btm',
|
||||
'ox_nav_top',
|
||||
'ox_nav_left',
|
||||
'ox_nav_left_width',
|
||||
'ox_nav_right',
|
||||
'ox_nav_right_width',
|
||||
];
|
||||
return $fields;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user