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
+59
View File
@@ -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;
}
}