diff --git a/src/Model/Menu/Source/Menu.php b/src/Model/Menu/Source/Menu.php deleted file mode 100644 index 05c8f16..0000000 --- a/src/Model/Menu/Source/Menu.php +++ /dev/null @@ -1,64 +0,0 @@ - - * @copyright Copyright (c) 2015 Scandiweb, Ltd (http://scandiweb.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ - -namespace ScandiPWA\Customization\Model\Menu\Source; - -use Magento\Eav\Model\Entity\Attribute\Source\AbstractSource; -use ScandiPWA\MenuOrganizer\Api\Data\MenuInterface; -use ScandiPWA\MenuOrganizer\Model\ResourceModel\Menu\CollectionFactory; - -class Menu extends AbstractSource -{ - /** - * @var CollectionFactory - */ - protected $collectionFactory; - - /** - * Menu constructor. - * @param CollectionFactory $collectionFactory - */ - public function __construct( - CollectionFactory $collectionFactory - ) { - $this->collectionFactory = $collectionFactory; - } - - /** - * Retrieve All options - * - * @return array - */ - public function getAllOptions() - { - if (!$this->_options) { - $menus = $this->collectionFactory - ->create() - ->addFieldToFilter(MenuInterface::IS_ACTIVE, ['eq' => 1]) - ->load() - ->getItems(); - - /** @var MenuInterface $menu */ - foreach ($menus as $menu) { - $this->_options[] = [ - 'value' => $menu->getIdentifier(), - 'label' => $menu->getTitle() - ]; - } - - if (is_array($this->_options)) { - array_unshift($this->_options, ['value' => '', 'label' => __('Please select a menu.')]); - } else { - $this->_options = ['value' => '', 'label' => __('No menus to select.')]; - } - } - - return $this->_options; - } -} diff --git a/src/etc/adminhtml/system/content.xml b/src/etc/adminhtml/system/content.xml index 00fb2ec..ef609f8 100644 --- a/src/etc/adminhtml/system/content.xml +++ b/src/etc/adminhtml/system/content.xml @@ -62,14 +62,7 @@ - - - - - Please select a menu you would like to display - ScandiPWA\Customization\Model\Menu\Source\Menu - - +