diff --git a/Block/Adminhtml/Banner.php b/Block/Adminhtml/Banner.php index a171f63..8daffa9 100644 --- a/Block/Adminhtml/Banner.php +++ b/Block/Adminhtml/Banner.php @@ -36,9 +36,9 @@ class Banner extends Container */ protected function _construct() { - $this->_controller = 'adminhtml_banner'; - $this->_blockGroup = 'Mageplaza_BannerSlider'; - $this->_headerText = __('Banners'); + $this->_controller = 'adminhtml_banner'; + $this->_blockGroup = 'Mageplaza_BannerSlider'; + $this->_headerText = __('Banners'); $this->_addButtonLabel = __('Create New Banner'); parent::_construct(); diff --git a/Block/Adminhtml/Banner/Edit.php b/Block/Adminhtml/Banner/Edit.php index 18a6692..b4f4a57 100644 --- a/Block/Adminhtml/Banner/Edit.php +++ b/Block/Adminhtml/Banner/Edit.php @@ -63,7 +63,7 @@ public function __construct( */ protected function _construct() { - $this->_objectId = 'banner_id'; + $this->_objectId = 'banner_id'; $this->_blockGroup = 'Mageplaza_BannerSlider'; $this->_controller = 'adminhtml_banner'; parent::_construct(); @@ -71,12 +71,12 @@ protected function _construct() $this->buttonList->add( 'save-and-continue', [ - 'label' => __('Save and Continue Edit'), - 'class' => 'save', + 'label' => __('Save and Continue Edit'), + 'class' => 'save', 'data_attribute' => [ 'mage-init' => [ 'button' => [ - 'event' => 'saveAndContinueEdit', + 'event' => 'saveAndContinueEdit', 'target' => '#edit_form' ] ] diff --git a/Block/Adminhtml/Banner/Edit/Form.php b/Block/Adminhtml/Banner/Edit/Form.php index b36bf13..cde31e9 100644 --- a/Block/Adminhtml/Banner/Edit/Form.php +++ b/Block/Adminhtml/Banner/Edit/Form.php @@ -75,9 +75,9 @@ protected function _prepareForm() $form = $this->_formFactory->create( [ 'data' => [ - 'id' => 'edit_form', - 'action' => $this->getUrl('*/*/save', ['id' => $this->getRequest()->getParam('id')]), - 'method' => 'post', + 'id' => 'edit_form', + 'action' => $this->getUrl('*/*/save', ['id' => $this->getRequest()->getParam('id')]), + 'method' => 'post', 'enctype' => 'multipart/form-data' ] ] diff --git a/Block/Adminhtml/Banner/Edit/Tab/Banner.php b/Block/Adminhtml/Banner/Edit/Tab/Banner.php index 8448cac..330240b 100644 --- a/Block/Adminhtml/Banner/Edit/Tab/Banner.php +++ b/Block/Adminhtml/Banner/Edit/Tab/Banner.php @@ -115,13 +115,13 @@ public function __construct( WysiwygConfig $wysiwygConfig, array $data = [] ) { - $this->typeOptions = $typeOptions; - $this->template = $template; - $this->statusOptions = $statusOptions; - $this->imageHelper = $imageHelper; - $this->_fieldFactory = $fieldFactory; + $this->typeOptions = $typeOptions; + $this->template = $template; + $this->statusOptions = $statusOptions; + $this->imageHelper = $imageHelper; + $this->_fieldFactory = $fieldFactory; $this->_objectConverter = $objectConverter; - $this->_wysiwygConfig = $wysiwygConfig; + $this->_wysiwygConfig = $wysiwygConfig; parent::__construct($context, $registry, $formFactory, $data); } @@ -174,12 +174,12 @@ protected function _prepareForm() { /** @var \Mageplaza\BannerSlider\Model\Banner $banner */ $banner = $this->_coreRegistry->registry('mpbannerslider_banner'); - $form = $this->_formFactory->create(); + $form = $this->_formFactory->create(); $form->setHtmlIdPrefix('banner_'); $form->setFieldNameSuffix('banner'); $fieldset = $form->addFieldset('base_fieldset', [ 'legend' => __('Banner Information'), - 'class' => 'fieldset-wide' + 'class' => 'fieldset-wide' ]); if ($banner->getId()) { @@ -191,89 +191,89 @@ protected function _prepareForm() } $fieldset->addField('name', 'text', [ - 'name' => 'name', - 'label' => __('Name'), - 'title' => __('Name'), + 'name' => 'name', + 'label' => __('Name'), + 'title' => __('Name'), 'required' => true, ]); $fieldset->addField('status', 'select', [ - 'name' => 'status', - 'label' => __('Status'), - 'title' => __('Status'), + 'name' => 'status', + 'label' => __('Status'), + 'title' => __('Status'), 'values' => $this->statusOptions->toOptionArray(), ]); $typeBanner = $fieldset->addField('type', 'select', [ - 'name' => 'type', - 'label' => __('Type'), - 'title' => __('Type'), + 'name' => 'type', + 'label' => __('Type'), + 'title' => __('Type'), 'values' => $this->typeOptions->toOptionArray(), ]); $uploadBanner = $fieldset->addField('image', BannerImage::class, [ - 'name' => 'image', + 'name' => 'image', 'label' => __('Upload Image'), 'title' => __('Upload Image'), - 'path' => $this->imageHelper->getBaseMediaPath(HelperImage::TEMPLATE_MEDIA_TYPE_BANNER) + 'path' => $this->imageHelper->getBaseMediaPath(HelperImage::TEMPLATE_MEDIA_TYPE_BANNER) ]); $titleBanner = $fieldset->addField('title', 'text', [ - 'name' => 'title', + 'name' => 'title', 'label' => __('Banner title'), 'title' => __('Banner title'), ]); $urlBanner = $fieldset->addField('url_banner', 'text', [ - 'name' => 'url_banner', + 'name' => 'url_banner', 'label' => __('Url'), 'title' => __('Url'), ]); $newTab = $fieldset->addField('newtab', 'select', [ - 'name' => 'newtab', - 'label' => __('Open new tab after click'), - 'title' => __('Open new tab after click'), + 'name' => 'newtab', + 'label' => __('Open new tab after click'), + 'title' => __('Open new tab after click'), 'values' => $this->statusOptions->toOptionArray(), - 'note' => __('Automatically open new tab after clicking on the banner') + 'note' => __('Automatically open new tab after clicking on the banner') ]); if (!$banner->getId()) { $defaultImage = array_values(Data::jsonDecode($this->template->getImageUrls()))[0]; $demoTemplate = $fieldset->addField('default_template', 'select', [ - 'name' => 'default_template', - 'label' => __('Demo template'), - 'title' => __('Demo template'), + 'name' => 'default_template', + 'label' => __('Demo template'), + 'title' => __('Demo template'), 'values' => $this->template->toOptionArray(), - 'note' => '' + 'note' => '' ]); $insertVariableButton = $this->getLayout()->createBlock(Button::class, '', [ 'data' => [ - 'type' => 'button', + 'type' => 'button', 'label' => __('Load Template'), ] ]); - $insertButton = $fieldset->addField('load_template', 'note', [ - 'text' => $insertVariableButton->toHtml(), + $insertButton = $fieldset->addField('load_template', 'note', [ + 'text' => $insertVariableButton->toHtml(), 'label' => '' ]); } $content = $fieldset->addField('content', 'editor', [ - 'name' => 'content', + 'name' => 'content', 'required' => false, - 'config' => $this->_wysiwygConfig->getConfig([ - 'hidden' => true, - 'add_variables' => false, - 'add_widgets' => false, + 'config' => $this->_wysiwygConfig->getConfig([ + 'hidden' => true, + 'add_variables' => false, + 'add_widgets' => false, 'add_directives' => true ]) ]); $fieldset->addField('sliders_ids', Slider::class, [ - 'name' => 'sliders_ids', + 'name' => 'sliders_ids', 'label' => __('Sliders'), 'title' => __('Sliders'), ]); diff --git a/Block/Adminhtml/Banner/Edit/Tab/Render/Image.php b/Block/Adminhtml/Banner/Edit/Tab/Render/Image.php index 3791a88..ab9d13c 100644 --- a/Block/Adminhtml/Banner/Edit/Tab/Render/Image.php +++ b/Block/Adminhtml/Banner/Edit/Tab/Render/Image.php @@ -86,7 +86,7 @@ public function getElementHtml() { $html = ''; - if ((string) $this->getValue()) { + if ((string)$this->getValue()) { $url = $this->_getUrl(); if (!preg_match("/^http\:\/\/|https\:\/\//", $url)) { diff --git a/Block/Adminhtml/Banner/Edit/Tab/Render/Slider.php b/Block/Adminhtml/Banner/Edit/Tab/Render/Slider.php index d75c1c8..2af2215 100644 --- a/Block/Adminhtml/Banner/Edit/Tab/Render/Slider.php +++ b/Block/Adminhtml/Banner/Edit/Tab/Render/Slider.php @@ -67,7 +67,7 @@ public function __construct( array $data = [] ) { $this->collectionFactory = $collectionFactory; - $this->authorization = $authorization; + $this->authorization = $authorization; parent::__construct($factoryElement, $factoryCollection, $escaper, $data); } @@ -141,10 +141,10 @@ public function getSliderCollection() $collection = $this->collectionFactory->create(); $sliderById = []; foreach ($collection as $slider) { - $sliderId = $slider->getId(); - $sliderById[$sliderId]['value'] = $sliderId; + $sliderId = $slider->getId(); + $sliderById[$sliderId]['value'] = $sliderId; $sliderById[$sliderId]['is_active'] = 1; - $sliderById[$sliderId]['label'] = $slider->getName(); + $sliderById[$sliderId]['label'] = $slider->getName(); } return $sliderById; diff --git a/Block/Adminhtml/Config/Field/Responsive.php b/Block/Adminhtml/Config/Field/Responsive.php index f0e851e..7d32416 100644 --- a/Block/Adminhtml/Config/Field/Responsive.php +++ b/Block/Adminhtml/Config/Field/Responsive.php @@ -43,7 +43,7 @@ protected function _prepareToRender() ['label' => __('Number of items'), 'renderer' => false, 'class' => 'required-entry validate-digits'] ); - $this->_addAfter = false; + $this->_addAfter = false; $this->_addButtonLabel = __('Add'); } } diff --git a/Block/Adminhtml/Slider.php b/Block/Adminhtml/Slider.php index 236cfa1..8a01499 100644 --- a/Block/Adminhtml/Slider.php +++ b/Block/Adminhtml/Slider.php @@ -36,9 +36,9 @@ class Slider extends Container */ protected function _construct() { - $this->_controller = 'adminhtml_slider'; - $this->_blockGroup = 'Mageplaza_BannerSlider'; - $this->_headerText = __('Sliders'); + $this->_controller = 'adminhtml_slider'; + $this->_blockGroup = 'Mageplaza_BannerSlider'; + $this->_headerText = __('Sliders'); $this->_addButtonLabel = __('Create New Slider'); parent::_construct(); diff --git a/Block/Adminhtml/Slider/Edit.php b/Block/Adminhtml/Slider/Edit.php index e50357c..4011c9a 100644 --- a/Block/Adminhtml/Slider/Edit.php +++ b/Block/Adminhtml/Slider/Edit.php @@ -63,7 +63,7 @@ public function __construct( */ protected function _construct() { - $this->_objectId = 'slider_id'; + $this->_objectId = 'slider_id'; $this->_blockGroup = 'Mageplaza_BannerSlider'; $this->_controller = 'adminhtml_slider'; parent::_construct(); @@ -71,12 +71,12 @@ protected function _construct() $this->buttonList->add( 'save-and-continue', [ - 'label' => __('Save and Continue Edit'), - 'class' => 'save', + 'label' => __('Save and Continue Edit'), + 'class' => 'save', 'data_attribute' => [ 'mage-init' => [ 'button' => [ - 'event' => 'saveAndContinueEdit', + 'event' => 'saveAndContinueEdit', 'target' => '#edit_form' ] ] diff --git a/Block/Adminhtml/Slider/Edit/Form.php b/Block/Adminhtml/Slider/Edit/Form.php index 81baba0..fbfe6ab 100644 --- a/Block/Adminhtml/Slider/Edit/Form.php +++ b/Block/Adminhtml/Slider/Edit/Form.php @@ -40,9 +40,9 @@ protected function _prepareForm() $form = $this->_formFactory->create( [ 'data' => [ - 'id' => 'edit_form', - 'action' => $this->getUrl('*/*/save', ['id' => $this->getRequest()->getParam('id')]), - 'method' => 'post', + 'id' => 'edit_form', + 'action' => $this->getUrl('*/*/save', ['id' => $this->getRequest()->getParam('id')]), + 'method' => 'post', 'enctype' => 'multipart/form-data' ] ] diff --git a/Block/Adminhtml/Slider/Edit/Tab/Banner.php b/Block/Adminhtml/Slider/Edit/Tab/Banner.php index bd561c8..3682c96 100644 --- a/Block/Adminhtml/Slider/Edit/Tab/Banner.php +++ b/Block/Adminhtml/Slider/Edit/Tab/Banner.php @@ -82,8 +82,8 @@ public function __construct( array $data = [] ) { $this->bannerCollectionFactory = $bannerCollectionFactory; - $this->coreRegistry = $coreRegistry; - $this->bannerFactory = $bannerFactory; + $this->coreRegistry = $coreRegistry; + $this->bannerFactory = $bannerFactory; parent::__construct($context, $backendHelper, $data); } @@ -142,60 +142,60 @@ protected function _prepareColumns() { $this->addColumn('in_banners', [ 'header_css_class' => 'a-center', - 'type' => 'checkbox', - 'name' => 'in_banner', - 'values' => $this->_getSelectedBanners(), - 'align' => 'center', - 'index' => 'banner_id' + 'type' => 'checkbox', + 'name' => 'in_banner', + 'values' => $this->_getSelectedBanners(), + 'align' => 'center', + 'index' => 'banner_id' ]); $this->addColumn('banner_id', [ - 'header' => __('ID'), - 'sortable' => true, - 'index' => 'banner_id', - 'type' => 'number', + 'header' => __('ID'), + 'sortable' => true, + 'index' => 'banner_id', + 'type' => 'number', 'header_css_class' => 'col-id', 'column_css_class' => 'col-id' ]); $this->addColumn('image', [ - 'header' => __('Image'), - 'index' => 'image', + 'header' => __('Image'), + 'index' => 'image', 'header_css_class' => 'col-image', 'column_css_class' => 'col-image', - 'sortable' => false, - 'renderer' => GridImage::class + 'sortable' => false, + 'renderer' => GridImage::class ]); $this->addColumn('name', [ - 'header' => __('Name'), - 'index' => 'name', + 'header' => __('Name'), + 'index' => 'name', 'header_css_class' => 'col-name', 'column_css_class' => 'col-name' ]); $this->addColumn('type', [ - 'header' => __('Type'), - 'index' => 'type', + 'header' => __('Type'), + 'index' => 'type', 'header_css_class' => 'col-type', 'column_css_class' => 'col-type', - 'renderer' => Type::class + 'renderer' => Type::class ]); $this->addColumn('status', [ - 'header' => __('Status'), - 'index' => 'status', + 'header' => __('Status'), + 'index' => 'status', 'header_css_class' => 'col-status', 'column_css_class' => 'col-status', - 'renderer' => Status::class + 'renderer' => Status::class ]); $this->addColumn('position', [ - 'header' => __('Position'), - 'name' => 'position', - 'type' => 'number', + 'header' => __('Position'), + 'name' => 'position', + 'type' => 'number', 'validate_class' => 'validate-number validate-zero-or-greater validate-digits', - 'index' => 'position', - 'editable' => true, + 'index' => 'position', + 'editable' => true, ]); return $this; diff --git a/Block/Adminhtml/Slider/Edit/Tab/Design.php b/Block/Adminhtml/Slider/Edit/Tab/Design.php index 4de3413..29f9950 100644 --- a/Block/Adminhtml/Slider/Edit/Tab/Design.php +++ b/Block/Adminhtml/Slider/Edit/Tab/Design.php @@ -67,7 +67,7 @@ public function __construct( array $data = [] ) { $this->_effect = $effect; - $this->_yesno = $yesno; + $this->_yesno = $yesno; parent::__construct($context, $registry, $formFactory, $data); } @@ -85,79 +85,79 @@ protected function _prepareForm() $form->setFieldNameSuffix('slider'); $fieldset = $form->addFieldset('base_fieldset', [ 'legend' => __('Design'), - 'class' => 'fieldset-wide' + 'class' => 'fieldset-wide' ]); $fieldset->addField('effect', 'select', [ - 'name' => 'effect', - 'label' => __('Animation Effect'), - 'title' => __('Animation Effect'), + 'name' => 'effect', + 'label' => __('Animation Effect'), + 'title' => __('Animation Effect'), 'values' => $this->_effect->toOptionArray() ]); - $design = $fieldset->addField('design', 'select', [ - 'name' => 'design', - 'label' => __('Manually Design'), - 'title' => __('Manually Design'), + $design = $fieldset->addField('design', 'select', [ + 'name' => 'design', + 'label' => __('Manually Design'), + 'title' => __('Manually Design'), 'options' => [ '0' => __('Use Config'), '1' => __('Yes') ] ]); - $responsive = $fieldset->addField('is_responsive', 'select', [ - 'name' => 'is_responsive', - 'label' => __('Is Responsive'), - 'title' => __('Is Responsive'), + $responsive = $fieldset->addField('is_responsive', 'select', [ + 'name' => 'is_responsive', + 'label' => __('Is Responsive'), + 'title' => __('Is Responsive'), 'values' => $this->_yesno->toOptionArray() ]); $responsiveItem = $fieldset->addField('responsive_items', Responsive::class, [ - 'name' => 'responsive_items', + 'name' => 'responsive_items', 'label' => __('Max Items Slider'), 'title' => __('Max Items Slider'), ]); - $autoWidth = $fieldset->addField('autoWidth', 'select', [ - 'name' => 'autoWidth', - 'label' => __('Auto Width'), - 'title' => __('Auto Width'), + $autoWidth = $fieldset->addField('autoWidth', 'select', [ + 'name' => 'autoWidth', + 'label' => __('Auto Width'), + 'title' => __('Auto Width'), 'values' => $this->_yesno->toOptionArray() ]); - $autoHeight = $fieldset->addField('autoHeight', 'select', [ - 'name' => 'autoHeight', - 'label' => __('Auto Height'), - 'title' => __('Auto Height'), + $autoHeight = $fieldset->addField('autoHeight', 'select', [ + 'name' => 'autoHeight', + 'label' => __('Auto Height'), + 'title' => __('Auto Height'), 'values' => $this->_yesno->toOptionArray() ]); - $loop = $fieldset->addField('loop', 'select', [ - 'name' => 'loop', - 'label' => __('Infinity Loop'), - 'title' => __('Infinity Loop'), + $loop = $fieldset->addField('loop', 'select', [ + 'name' => 'loop', + 'label' => __('Infinity Loop'), + 'title' => __('Infinity Loop'), 'values' => $this->_yesno->toOptionArray() ]); - $nav = $fieldset->addField('nav', 'select', [ - 'name' => 'nav', - 'label' => __('Show Next/Prev Buttons'), - 'title' => __('Show Next/Prev Buttons'), + $nav = $fieldset->addField('nav', 'select', [ + 'name' => 'nav', + 'label' => __('Show Next/Prev Buttons'), + 'title' => __('Show Next/Prev Buttons'), 'values' => $this->_yesno->toOptionArray() ]); - $dots = $fieldset->addField('dots', 'select', [ - 'name' => 'dots', - 'label' => __('Show Dots Navigation'), - 'title' => __('Show Dots Navigation'), + $dots = $fieldset->addField('dots', 'select', [ + 'name' => 'dots', + 'label' => __('Show Dots Navigation'), + 'title' => __('Show Dots Navigation'), 'values' => $this->_yesno->toOptionArray() ]); - $lazyload = $fieldset->addField('lazyLoad', 'select', [ - 'name' => 'lazyLoad', - 'label' => __('Lazy Loading Images'), - 'title' => __('Lazy Loading Images'), + $lazyload = $fieldset->addField('lazyLoad', 'select', [ + 'name' => 'lazyLoad', + 'label' => __('Lazy Loading Images'), + 'title' => __('Lazy Loading Images'), 'values' => $this->_yesno->toOptionArray() ]); - $autoplay = $fieldset->addField('autoplay', 'select', [ - 'name' => 'autoplay', - 'label' => __('Autoplay'), - 'title' => __('Autoplay'), + $autoplay = $fieldset->addField('autoplay', 'select', [ + 'name' => 'autoplay', + 'label' => __('Autoplay'), + 'title' => __('Autoplay'), 'values' => $this->_yesno->toOptionArray() ]); - $timeout = $fieldset->addField('autoplayTimeout', 'text', [ - 'name' => 'autoplayTimeout', + $timeout = $fieldset->addField('autoplayTimeout', 'text', [ + 'name' => 'autoplayTimeout', 'label' => __('Autoplay Time-Out'), 'title' => __('Autoplay Time-Out') ]); diff --git a/Block/Adminhtml/Slider/Edit/Tab/Renderer/Snippet.php b/Block/Adminhtml/Slider/Edit/Tab/Renderer/Snippet.php index 06354fe..1b5ff88 100644 --- a/Block/Adminhtml/Slider/Edit/Tab/Renderer/Snippet.php +++ b/Block/Adminhtml/Slider/Edit/Tab/Renderer/Snippet.php @@ -35,17 +35,17 @@ class Snippet extends AbstractElement public function getElementHtml() { $sliderId = $this->getSliderId() ?? 1; - $html = '
'; + $html = ' '; return $html; } diff --git a/Block/Adminhtml/Slider/Edit/Tab/Slider.php b/Block/Adminhtml/Slider/Edit/Tab/Slider.php index 3ca6822..d90c35d 100644 --- a/Block/Adminhtml/Slider/Edit/Tab/Slider.php +++ b/Block/Adminhtml/Slider/Edit/Tab/Slider.php @@ -102,12 +102,12 @@ public function __construct( Store $systemStore, array $data = [] ) { - $this->statusOptions = $statusOptions; - $this->_location = $location; - $this->_groupRepository = $groupRepository; + $this->statusOptions = $statusOptions; + $this->_location = $location; + $this->_groupRepository = $groupRepository; $this->_searchCriteriaBuilder = $searchCriteriaBuilder; - $this->_objectConverter = $objectConverter; - $this->_systemStore = $systemStore; + $this->_objectConverter = $objectConverter; + $this->_systemStore = $systemStore; parent::__construct($context, $registry, $formFactory, $data); } @@ -120,28 +120,28 @@ protected function _prepareForm() { /** @var \Mageplaza\BannerSlider\Model\Slider $slider */ $slider = $this->_coreRegistry->registry('mpbannerslider_slider'); - $form = $this->_formFactory->create(); + $form = $this->_formFactory->create(); $form->setHtmlIdPrefix('slider_'); $form->setFieldNameSuffix('slider'); $fieldset = $form->addFieldset('base_fieldset', [ 'legend' => __('Slider Information'), - 'class' => 'fieldset-wide' + 'class' => 'fieldset-wide' ]); if ($slider->getId()) { $fieldset->addField('slider_id', 'hidden', ['name' => 'slider_id']); } $fieldset->addField('name', 'text', [ - 'name' => 'name', - 'label' => __('Name'), - 'title' => __('Name'), + 'name' => 'name', + 'label' => __('Name'), + 'title' => __('Name'), 'required' => true, ]); $fieldset->addField('status', 'select', [ - 'name' => 'status', - 'label' => __('Status'), - 'title' => __('Status'), + 'name' => 'status', + 'label' => __('Status'), + 'title' => __('Status'), 'values' => array_merge(['' => ''], $this->statusOptions->toOptionArray()), ]); @@ -150,73 +150,73 @@ protected function _prepareForm() } if ($this->_storeManager->isSingleStoreMode()) { $fieldset->addField('store_ids', 'hidden', [ - 'name' => 'store_ids', + 'name' => 'store_ids', 'value' => $this->_storeManager->getStore()->getId() ]); } else { /** @var RendererInterface $rendererBlock */ $rendererBlock = $this->getLayout()->createBlock(Element::class); $fieldset->addField('store_ids', 'multiselect', [ - 'name' => 'store_ids', - 'label' => __('Store Views'), - 'title' => __('Store Views'), + 'name' => 'store_ids', + 'label' => __('Store Views'), + 'title' => __('Store Views'), 'required' => true, - 'values' => $this->_systemStore->getStoreValuesForForm(false, true) + 'values' => $this->_systemStore->getStoreValuesForForm(false, true) ])->setRenderer($rendererBlock); } $customerGroups = $this->_groupRepository->getList($this->_searchCriteriaBuilder->create())->getItems(); $fieldset->addField('customer_group_ids', 'multiselect', [ - 'name' => 'customer_group_ids[]', - 'label' => __('Customer Groups'), - 'title' => __('Customer Groups'), + 'name' => 'customer_group_ids[]', + 'label' => __('Customer Groups'), + 'title' => __('Customer Groups'), 'required' => true, - 'values' => $this->_objectConverter->toOptionArray($customerGroups, 'id', 'code'), - 'note' => __('Select customer group(s) to display the slider to') + 'values' => $this->_objectConverter->toOptionArray($customerGroups, 'id', 'code'), + 'note' => __('Select customer group(s) to display the slider to') ]); $fieldset->addField('location', 'multiselect', [ - 'name' => 'location', - 'label' => __('Position'), - 'title' => __('Position'), - 'values' => $this->_location->toOptionArray(), - 'note' => __('Select the position to display block.'), + 'name' => 'location', + 'label' => __('Position'), + 'title' => __('Position'), + 'values' => $this->_location->toOptionArray(), + 'note' => __('Select the position to display block.'), 'required' => true, ]); $fieldset->addField('from_date', 'date', [ - 'name' => 'from_date', - 'label' => __('Display from'), - 'title' => __('Display from'), - 'date_format' => 'M/d/yyyy', + 'name' => 'from_date', + 'label' => __('Display from'), + 'title' => __('Display from'), + 'date_format' => 'M/d/yyyy', 'input_format' => DateTime::DATE_INTERNAL_FORMAT, - 'timezone' => false + 'timezone' => false ]); $fieldset->addField('to_date', 'date', [ - 'name' => 'to_date', - 'label' => __('Display to'), - 'title' => __('Display to'), - 'date_format' => 'M/d/yyyy', + 'name' => 'to_date', + 'label' => __('Display to'), + 'title' => __('Display to'), + 'date_format' => 'M/d/yyyy', 'input_format' => DateTime::DATE_INTERNAL_FORMAT, - 'timezone' => false + 'timezone' => false ]); $fieldset->addField('priority', 'text', [ - 'name' => 'priority', + 'name' => 'priority', 'label' => __('Priority'), 'class' => 'validate-digits', - 'note' => __('Enter a number to set priority for the slider. A lower number represents a higher priority.') + 'note' => __('Enter a number to set priority for the slider. A lower number represents a higher priority.') ]); $subfieldset = $form->addFieldset('sub_fieldset', [ 'legend' => __('Another way to add sliders to your page'), - 'class' => 'fieldset-wide' + 'class' => 'fieldset-wide' ]); $subfieldset->addField('snippet', Snippet::class, [ - 'name' => 'snippet', - 'label' => __('How to use'), - 'title' => __('How to use'), + 'name' => 'snippet', + 'label' => __('How to use'), + 'title' => __('How to use'), 'slider_id' => $slider->getId(), ]); diff --git a/Block/Slider.php b/Block/Slider.php index a06e413..5e46212 100644 --- a/Block/Slider.php +++ b/Block/Slider.php @@ -79,11 +79,11 @@ public function __construct( FilterProvider $filterProvider, array $data = [] ) { - $this->helperData = $helperData; + $this->helperData = $helperData; $this->customerRepository = $customerRepository; - $this->store = $context->getStoreManager(); - $this->_date = $dateTime; - $this->filterProvider = $filterProvider; + $this->store = $context->getStoreManager(); + $this->_date = $dateTime; + $this->filterProvider = $filterProvider; parent::__construct($context, $data); } @@ -142,4 +142,13 @@ public function getBannerOptions() { return $this->helperData->getBannerOptions($this->getSlider()); } + + + /** + * @return array|mixed + */ + public function isLazyLoad() + { + return $this->helperData->getModuleConfig('mpbannerslider_design/lazyLoad'); + } } diff --git a/Block/Widget.php b/Block/Widget.php index 595680a..fbcae07 100644 --- a/Block/Widget.php +++ b/Block/Widget.php @@ -43,7 +43,7 @@ public function getBannerCollection() } $sliderCollection = $this->helperData->getActiveSliders(); - $slider = $sliderCollection->addFieldToFilter('slider_id', $sliderId)->getFirstItem(); + $slider = $sliderCollection->addFieldToFilter('slider_id', $sliderId)->getFirstItem(); $this->setSlider($slider); return parent::getBannerCollection(); diff --git a/Controller/Adminhtml/Banner.php b/Controller/Adminhtml/Banner.php index 31bbf9f..9c1fc06 100644 --- a/Controller/Adminhtml/Banner.php +++ b/Controller/Adminhtml/Banner.php @@ -66,7 +66,7 @@ public function __construct( Context $context ) { $this->bannerFactory = $bannerFactory; - $this->coreRegistry = $coreRegistry; + $this->coreRegistry = $coreRegistry; parent::__construct($context); } @@ -78,7 +78,7 @@ public function __construct( */ protected function initBanner() { - $bannerId = (int) $this->getRequest()->getParam('banner_id'); + $bannerId = (int)$this->getRequest()->getParam('banner_id'); /** @var \Mageplaza\BannerSlider\Model\Banner $banner */ $banner = $this->bannerFactory->create(); if ($bannerId) { diff --git a/Controller/Adminhtml/Banner/Edit.php b/Controller/Adminhtml/Banner/Edit.php index 8b014c0..8912a34 100644 --- a/Controller/Adminhtml/Banner/Edit.php +++ b/Controller/Adminhtml/Banner/Edit.php @@ -82,7 +82,7 @@ public function execute() 'mpbannerslider/*/edit', [ 'banner_id' => $banner->getId(), - '_current' => true + '_current' => true ] ); diff --git a/Controller/Adminhtml/Banner/InlineEdit.php b/Controller/Adminhtml/Banner/InlineEdit.php index a6824f3..51e0dfb 100644 --- a/Controller/Adminhtml/Banner/InlineEdit.php +++ b/Controller/Adminhtml/Banner/InlineEdit.php @@ -63,7 +63,7 @@ public function __construct( BannerFactory $bannerFactory, Context $context ) { - $this->jsonFactory = $jsonFactory; + $this->jsonFactory = $jsonFactory; $this->bannerFactory = $bannerFactory; parent::__construct($context); @@ -76,13 +76,13 @@ public function execute() { /** @var Json $resultJson */ $resultJson = $this->jsonFactory->create(); - $error = false; - $messages = []; - $postItems = $this->getRequest()->getParam('items', []); + $error = false; + $messages = []; + $postItems = $this->getRequest()->getParam('items', []); if (!(!empty($postItems) && $this->getRequest()->getParam('isAjax'))) { return $resultJson->setData([ 'messages' => [__('Please correct the data sent.')], - 'error' => true, + 'error' => true, ]); } foreach (array_keys($postItems) as $bannerId) { @@ -94,19 +94,19 @@ public function execute() $banner->save(); } catch (RuntimeException $e) { $messages[] = $this->getErrorWithBannerId($banner, $e->getMessage()); - $error = true; + $error = true; } catch (Exception $e) { $messages[] = $this->getErrorWithBannerId( $banner, __('Something went wrong while saving the Banner.') ); - $error = true; + $error = true; } } return $resultJson->setData([ 'messages' => $messages, - 'error' => $error + 'error' => $error ]); } diff --git a/Controller/Adminhtml/Banner/MassDelete.php b/Controller/Adminhtml/Banner/MassDelete.php index 8845e15..199fdf9 100644 --- a/Controller/Adminhtml/Banner/MassDelete.php +++ b/Controller/Adminhtml/Banner/MassDelete.php @@ -65,7 +65,7 @@ public function __construct( CollectionFactory $collectionFactory, Context $context ) { - $this->filter = $filter; + $this->filter = $filter; $this->collectionFactory = $collectionFactory; parent::__construct($context); diff --git a/Controller/Adminhtml/Banner/MassStatus.php b/Controller/Adminhtml/Banner/MassStatus.php index 2434032..8c769e7 100644 --- a/Controller/Adminhtml/Banner/MassStatus.php +++ b/Controller/Adminhtml/Banner/MassStatus.php @@ -64,7 +64,7 @@ public function __construct( Filter $filter, CollectionFactory $collectionFactory ) { - $this->filter = $filter; + $this->filter = $filter; $this->collectionFactory = $collectionFactory; parent::__construct($context); @@ -76,8 +76,8 @@ public function __construct( */ public function execute() { - $collection = $this->filter->getCollection($this->collectionFactory->create()); - $status = (int) $this->getRequest()->getParam('status'); + $collection = $this->filter->getCollection($this->collectionFactory->create()); + $status = (int)$this->getRequest()->getParam('status'); $bannerUpdated = 0; foreach ($collection as $banner) { try { diff --git a/Controller/Adminhtml/Banner/Save.php b/Controller/Adminhtml/Banner/Save.php index 564d7e1..a1f5f79 100644 --- a/Controller/Adminhtml/Banner/Save.php +++ b/Controller/Adminhtml/Banner/Save.php @@ -71,7 +71,7 @@ public function __construct( Context $context ) { $this->imageHelper = $imageHelper; - $this->jsHelper = $jsHelper; + $this->jsHelper = $jsHelper; parent::__construct($bannerFactory, $registry, $context); } @@ -84,7 +84,7 @@ public function execute() $resultRedirect = $this->resultRedirectFactory->create(); if ($this->getRequest()->getPost('banner')) { - $data = $this->getRequest()->getPost('banner'); + $data = $this->getRequest()->getPost('banner'); $banner = $this->initBanner(); if ($data['type'] === Type::IMAGE) { $this->imageHelper->uploadImage($data, 'image', Image::TEMPLATE_MEDIA_TYPE_BANNER, $banner->getImage()); @@ -104,7 +104,7 @@ public function execute() $this->_eventManager->dispatch( 'mpbannerslider_banner_prepare_save', [ - 'banner' => $banner, + 'banner' => $banner, 'request' => $this->getRequest() ] ); @@ -117,7 +117,7 @@ public function execute() 'mpbannerslider/*/edit', [ 'banner_id' => $banner->getId(), - '_current' => true + '_current' => true ] ); @@ -137,7 +137,7 @@ public function execute() 'mpbannerslider/*/edit', [ 'banner_id' => $banner->getId(), - '_current' => true + '_current' => true ] ); diff --git a/Controller/Adminhtml/Slider.php b/Controller/Adminhtml/Slider.php index 7bdf501..373897b 100644 --- a/Controller/Adminhtml/Slider.php +++ b/Controller/Adminhtml/Slider.php @@ -59,7 +59,7 @@ public function __construct( Context $context ) { $this->sliderFactory = $sliderFactory; - $this->coreRegistry = $coreRegistry; + $this->coreRegistry = $coreRegistry; parent::__construct($context); } @@ -71,7 +71,7 @@ public function __construct( */ protected function initSlider() { - $sliderId = (int) $this->getRequest()->getParam('slider_id'); + $sliderId = (int)$this->getRequest()->getParam('slider_id'); /** @var \Mageplaza\BannerSlider\Model\Slider $slider */ $slider = $this->sliderFactory->create(); if ($sliderId) { diff --git a/Controller/Adminhtml/Slider/Edit.php b/Controller/Adminhtml/Slider/Edit.php index 7d41c75..e0db0e9 100644 --- a/Controller/Adminhtml/Slider/Edit.php +++ b/Controller/Adminhtml/Slider/Edit.php @@ -83,7 +83,7 @@ public function execute() 'mpbannerslider/*/edit', [ 'slider_id' => $slider->getId(), - '_current' => true + '_current' => true ] ); diff --git a/Controller/Adminhtml/Slider/InlineEdit.php b/Controller/Adminhtml/Slider/InlineEdit.php index 7a70522..7be7f84 100644 --- a/Controller/Adminhtml/Slider/InlineEdit.php +++ b/Controller/Adminhtml/Slider/InlineEdit.php @@ -63,7 +63,7 @@ public function __construct( SliderFactory $sliderFactory, Context $context ) { - $this->jsonFactory = $jsonFactory; + $this->jsonFactory = $jsonFactory; $this->sliderFactory = $sliderFactory; parent::__construct($context); @@ -76,13 +76,13 @@ public function execute() { /** @var Json $resultJson */ $resultJson = $this->jsonFactory->create(); - $error = false; - $messages = []; - $postItems = $this->getRequest()->getParam('items', []); + $error = false; + $messages = []; + $postItems = $this->getRequest()->getParam('items', []); if (!(!empty($postItems) && $this->getRequest()->getParam('isAjax'))) { return $resultJson->setData([ 'messages' => [__('Please correct the data sent.')], - 'error' => true, + 'error' => true, ]); } foreach (array_keys($postItems) as $sliderId) { @@ -94,19 +94,19 @@ public function execute() $slider->save(); } catch (RuntimeException $e) { $messages[] = $this->getErrorWithSliderId($slider, $e->getMessage()); - $error = true; + $error = true; } catch (Exception $e) { $messages[] = $this->getErrorWithSliderId( $slider, __('Something went wrong while saving the Banner.') ); - $error = true; + $error = true; } } return $resultJson->setData([ 'messages' => $messages, - 'error' => $error + 'error' => $error ]); } diff --git a/Controller/Adminhtml/Slider/MassDelete.php b/Controller/Adminhtml/Slider/MassDelete.php index f98386d..0e1a76d 100644 --- a/Controller/Adminhtml/Slider/MassDelete.php +++ b/Controller/Adminhtml/Slider/MassDelete.php @@ -65,7 +65,7 @@ public function __construct( CollectionFactory $collectionFactory, Context $context ) { - $this->filter = $filter; + $this->filter = $filter; $this->collectionFactory = $collectionFactory; parent::__construct($context); diff --git a/Controller/Adminhtml/Slider/MassStatus.php b/Controller/Adminhtml/Slider/MassStatus.php index 4bd36f6..95ad8ea 100644 --- a/Controller/Adminhtml/Slider/MassStatus.php +++ b/Controller/Adminhtml/Slider/MassStatus.php @@ -64,7 +64,7 @@ public function __construct( Filter $filter, CollectionFactory $collectionFactory ) { - $this->filter = $filter; + $this->filter = $filter; $this->collectionFactory = $collectionFactory; parent::__construct($context); @@ -76,8 +76,8 @@ public function __construct( */ public function execute() { - $collection = $this->filter->getCollection($this->collectionFactory->create()); - $status = (int) $this->getRequest()->getParam('status'); + $collection = $this->filter->getCollection($this->collectionFactory->create()); + $status = (int)$this->getRequest()->getParam('status'); $sliderUpdated = 0; foreach ($collection as $slider) { try { diff --git a/Controller/Adminhtml/Slider/Save.php b/Controller/Adminhtml/Slider/Save.php index 96e5025..a209aca 100644 --- a/Controller/Adminhtml/Slider/Save.php +++ b/Controller/Adminhtml/Slider/Save.php @@ -79,8 +79,8 @@ public function __construct( Date $dateFilter, DataPersistorInterface $dataPersistor ) { - $this->jsHelper = $jsHelper; - $this->_dateFilter = $dateFilter; + $this->jsHelper = $jsHelper; + $this->_dateFilter = $dateFilter; $this->dataPersistor = $dataPersistor; parent::__construct($sliderFactory, $registry, $context); @@ -94,17 +94,17 @@ public function execute() $resultRedirect = $this->resultRedirectFactory->create(); if ($this->getRequest()->getPost('slider')) { - $data = $this->_filterData($this->getRequest()->getPost('slider')); + $data = $this->_filterData($this->getRequest()->getPost('slider')); $slider = $this->initSlider(); $fromDate = $toDate = null; if (isset($data['from_date']) && isset($data['to_date'])) { $fromDate = $data['from_date']; - $toDate = $data['to_date']; + $toDate = $data['to_date']; } if ($fromDate && $toDate) { $fromDate = new DateTime($fromDate); - $toDate = new DateTime($toDate); + $toDate = new DateTime($toDate); if ($fromDate > $toDate) { $this->messageManager->addErrorMessage(__('End Date must follow Start Date.')); @@ -125,7 +125,7 @@ public function execute() $this->_eventManager->dispatch( 'mpbannerslider_slider_prepare_save', [ - 'slider' => $slider, + 'slider' => $slider, 'request' => $this->getRequest() ] ); @@ -134,13 +134,12 @@ public function execute() $slider->save(); $this->messageManager->addSuccess(__('The Slider has been saved.')); $this->_session->setMageplazaBannerSliderSliderData(false); - $this->dataPersistor->set('mpbannerslider_slider', $data); if ($this->getRequest()->getParam('back')) { $resultRedirect->setPath( 'mpbannerslider/*/edit', [ 'slider_id' => $slider->getId(), - '_current' => true + '_current' => true ] ); @@ -160,7 +159,7 @@ public function execute() 'mpbannerslider/*/edit', [ 'slider_id' => $slider->getId(), - '_current' => true + '_current' => true ] ); @@ -182,7 +181,7 @@ public function execute() protected function _filterData($data) { $inputFilter = new Zend_Filter_Input(['from_date' => $this->_dateFilter,], [], $data); - $data = $inputFilter->getUnescaped(); + $data = $inputFilter->getUnescaped(); if (isset($data['responsive_items'])) { unset($data['responsive_items']['__empty']); diff --git a/Helper/Data.php b/Helper/Data.php index cd52333..813a1d2 100644 --- a/Helper/Data.php +++ b/Helper/Data.php @@ -83,8 +83,8 @@ public function __construct( StoreManagerInterface $storeManager, ObjectManagerInterface $objectManager ) { - $this->date = $date; - $this->httpContext = $httpContext; + $this->date = $date; + $this->httpContext = $httpContext; $this->bannerFactory = $bannerFactory; $this->sliderFactory = $sliderFactory; @@ -104,9 +104,9 @@ public function getBannerOptions($slider) $config = $this->getModuleConfig('mpbannerslider_design'); } - $defaultOpt = $this->getDefaultConfig($config); + $defaultOpt = $this->getDefaultConfig($config); $responsiveOpt = $this->getResponsiveConfig($slider); - $effectOpt = $this->getEffectConfig($slider); + $effectOpt = $this->getEffectConfig($slider); $sliderOptions = array_merge($defaultOpt, $responsiveOpt, $effectOpt); @@ -126,7 +126,7 @@ public function getDefaultConfig($configs) $key, ['autoWidth', 'autoHeight', 'loop', 'nav', 'dots', 'lazyLoad', 'autoplay', 'autoplayTimeout'] )) { - $basicConfig[$key] = (int) $value; + $basicConfig[$key] = (int)$value; } } @@ -141,7 +141,7 @@ public function getDefaultConfig($configs) public function getResponsiveConfig($slider = null) { $defaultResponsive = $this->getModuleConfig('mpbannerslider_design/responsive'); - $sliderResponsive = $slider->getIsResponsive(); + $sliderResponsive = $slider->getIsResponsive(); if ((!$defaultResponsive && !$sliderResponsive) || (!$sliderResponsive && $slider->getDesign())) { return ['items' => 1]; @@ -159,8 +159,8 @@ public function getResponsiveConfig($slider = null) $result = []; foreach ($responsiveItems as $config) { - $size = $config['size'] ?: 0; - $items = $config['items'] ?: 0; + $size = $config['size'] ?: 0; + $items = $config['items'] ?: 0; $result[$size] = ['items' => $items]; } diff --git a/Helper/Image.php b/Helper/Image.php index 053ffe9..eac1b61 100644 --- a/Helper/Image.php +++ b/Helper/Image.php @@ -29,7 +29,7 @@ */ class Image extends Media { - const TEMPLATE_MEDIA_PATH = 'mageplaza/bannerslider'; + const TEMPLATE_MEDIA_PATH = 'mageplaza/bannerslider'; const TEMPLATE_MEDIA_TYPE_BANNER = 'banner/image'; const TEMPLATE_MEDIA_TYPE_SLIDER = 'slider/image'; } diff --git a/Model/Banner.php b/Model/Banner.php index 93a262a..64df456 100644 --- a/Model/Banner.php +++ b/Model/Banner.php @@ -119,7 +119,7 @@ public function __construct( array $data = [] ) { $this->sliderCollectionFactory = $sliderCollectionFactory; - $this->imageModel = $configImage; + $this->imageModel = $configImage; parent::__construct($context, $registry, $resource, $resourceCollection, $data); } @@ -195,6 +195,6 @@ public function getSliderIds() $this->setData('slider_ids', $ids); } - return (array) $this->getData('slider_ids'); + return (array)$this->getData('slider_ids'); } } diff --git a/Model/Config/Source/Effect.php b/Model/Config/Source/Effect.php index c61aa91..21eac5a 100644 --- a/Model/Config/Source/Effect.php +++ b/Model/Config/Source/Effect.php @@ -29,15 +29,15 @@ */ class Effect implements ArrayInterface { - const SLIDER = 'slider'; - const FADE_OUT = 'fadeOut'; - const ROTATE_OUT = 'rotateOut'; - const FLIP_OUT = 'flipOutX'; - const ROLL_OUT = 'rollOut'; - const ZOOM_OUT = 'zoomOut'; - const SLIDER_OUT_LEFT = 'slideOutLeft'; + const SLIDER = 'slider'; + const FADE_OUT = 'fadeOut'; + const ROTATE_OUT = 'rotateOut'; + const FLIP_OUT = 'flipOutX'; + const ROLL_OUT = 'rollOut'; + const ZOOM_OUT = 'zoomOut'; + const SLIDER_OUT_LEFT = 'slideOutLeft'; const SLIDER_OUT_RIGHT = 'slideOutRight'; - const LIGHT_SPEED_OUT = 'lightSpeedOut'; + const LIGHT_SPEED_OUT = 'lightSpeedOut'; /** * to option array diff --git a/Model/Config/Source/Location.php b/Model/Config/Source/Location.php index 364e482..3bf9244 100644 --- a/Model/Config/Source/Location.php +++ b/Model/Config/Source/Location.php @@ -29,25 +29,25 @@ */ class Location implements ArrayInterface { - const ALLPAGE_CONTENT_TOP = 'allpage.content-top'; - const ALLPAGE_CONTENT_BOTTOM = 'allpage.content-bottom'; - const ALLPAGE_PAGE_TOP = 'allpage.page-top'; - const ALLPAGE_PAGE_BOTTOM = 'allpage.footer-container'; - const HOMEPAGE_CONTENT_TOP = 'cms_index_index.content-top'; + const ALLPAGE_CONTENT_TOP = 'allpage.content-top'; + const ALLPAGE_CONTENT_BOTTOM = 'allpage.content-bottom'; + const ALLPAGE_PAGE_TOP = 'allpage.page-top'; + const ALLPAGE_PAGE_BOTTOM = 'allpage.footer-container'; + const HOMEPAGE_CONTENT_TOP = 'cms_index_index.content-top'; const HOMEPAGE_CONTENT_BOTTOM = 'cms_index_index.content-bottom'; - const HOMEPAGE_PAGE_TOP = 'cms_index_index.page-top'; - const HOMEPAGE_PAGE_BOTTOM = 'cms_index_index.footer-container'; - const CATEGORY_CONTENT_TOP = 'catalog_category_view.content-top'; + const HOMEPAGE_PAGE_TOP = 'cms_index_index.page-top'; + const HOMEPAGE_PAGE_BOTTOM = 'cms_index_index.footer-container'; + const CATEGORY_CONTENT_TOP = 'catalog_category_view.content-top'; const CATEGORY_CONTENT_BOTTOM = 'catalog_category_view.content-bottom'; - const CATEGORY_PAGE_TOP = 'catalog_category_view.page-top'; - const CATEGORY_PAGE_BOTTOM = 'catalog_category_view.footer-container'; - const CATEGORY_SIDEBAR_TOP = 'catalog_category_view.sidebar-top'; + const CATEGORY_PAGE_TOP = 'catalog_category_view.page-top'; + const CATEGORY_PAGE_BOTTOM = 'catalog_category_view.footer-container'; + const CATEGORY_SIDEBAR_TOP = 'catalog_category_view.sidebar-top'; const CATEGORY_SIDEBAR_BOTTOM = 'catalog_category_view.sidebar-bottom'; - const PRODUCT_CONTENT_TOP = 'catalog_product_view.content-top'; - const PRODUCT_CONTENT_BOTTOM = 'catalog_product_view.content-bottom'; - const PRODUCT_PAGE_TOP = 'catalog_product_view.page-top'; - const PRODUCT_PAGE_BOTTOM = 'catalog_product_view.footer-container'; - const USING_SNIPPET_CODE = 'custom.snippet-code'; + const PRODUCT_CONTENT_TOP = 'catalog_product_view.content-top'; + const PRODUCT_CONTENT_BOTTOM = 'catalog_product_view.content-bottom'; + const PRODUCT_PAGE_TOP = 'catalog_product_view.page-top'; + const PRODUCT_PAGE_BOTTOM = 'catalog_product_view.footer-container'; + const USING_SNIPPET_CODE = 'custom.snippet-code'; /** * Return array of options as value-label pairs diff --git a/Model/Config/Source/SlidersWidget.php b/Model/Config/Source/SlidersWidget.php index 6f7e59b..c5de2b1 100644 --- a/Model/Config/Source/SlidersWidget.php +++ b/Model/Config/Source/SlidersWidget.php @@ -67,7 +67,7 @@ public function toOptionArray() protected function toArray() { $options = []; - $rules = $this->collectionFactory->create() + $rules = $this->collectionFactory->create() ->addActiveFilter() ->addFieldToFilter('location', ['finset' => Location::USING_SNIPPET_CODE]); diff --git a/Model/Config/Source/Template.php b/Model/Config/Source/Template.php index 3c58b6a..5f879da 100644 --- a/Model/Config/Source/Template.php +++ b/Model/Config/Source/Template.php @@ -90,7 +90,7 @@ public function toOptionArray() */ public function getTemplateHtml() { - $imgTmp = '