From 36b8e07d52d5a7dadc711dacf1bd01a207f60b8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20B=C3=A9jean?= <nicolas@bejean.eu> Date: Sat, 9 May 2020 09:55:29 +0200 Subject: [PATCH] Corrections --- Block/Adminhtml/CategoryWidget.php | 6 ++-- .../CategoryWidget/Edit/DeleteButton.php | 2 +- .../CategoryWidget/Edit/GenericButton.php | 8 ++--- .../CategoryWidget/Widget/Chooser.php | 32 +++++++++---------- Block/Widget/CategoryWidgetNew.php | 2 +- Controller/Adminhtml/CategoryWidget/Edit.php | 8 ++--- Controller/Adminhtml/CategoryWidget/Index.php | 2 +- .../Adminhtml/CategoryWidget/InlineEdit.php | 4 +-- etc/adminhtml/system.xml | 2 +- .../categorywidget_categorywidget_form.xml | 2 +- 10 files changed, 34 insertions(+), 34 deletions(-) diff --git a/Block/Adminhtml/CategoryWidget.php b/Block/Adminhtml/CategoryWidget.php index d6c0ac0..5e7bd34 100755 --- a/Block/Adminhtml/CategoryWidget.php +++ b/Block/Adminhtml/CategoryWidget.php @@ -4,7 +4,7 @@ namespace NicolasBejean\CategoryWidget\Block\Adminhtml; use \Magento\Backend\Block\Widget\Grid\Container; /** - * Class Image Slider + * Class CategoryWidget * * @category PHP * @package NicolasBejean\CategoryWidget\Block\Adminhtml @@ -18,8 +18,8 @@ class CategoryWidget extends Container { $this->_blockGroup = 'NicolasBejean_CategoryWidget'; $this->_controller = 'adminhtml_categoryWidget'; - $this->_headerText = __('Image Slider'); - $this->_addButtonLabel = __('Create New Image Slider'); + $this->_headerText = __('Category Widget'); + $this->_addButtonLabel = __('Create New Category Widget'); parent::_construct(); } diff --git a/Block/Adminhtml/CategoryWidget/Edit/DeleteButton.php b/Block/Adminhtml/CategoryWidget/Edit/DeleteButton.php index ef177df..b596e4f 100755 --- a/Block/Adminhtml/CategoryWidget/Edit/DeleteButton.php +++ b/Block/Adminhtml/CategoryWidget/Edit/DeleteButton.php @@ -26,7 +26,7 @@ class DeleteButton extends GenericButton implements ButtonProviderInterface $data = []; if ($this->getCategoryWidgetId()) { $data = [ - 'label' => __('Delete Image Slider'), + 'label' => __('Delete Category Widget'), 'class' => 'delete', 'on_click' => 'deleteConfirm(\'' . __( 'Are you sure you want to do this?' diff --git a/Block/Adminhtml/CategoryWidget/Edit/GenericButton.php b/Block/Adminhtml/CategoryWidget/Edit/GenericButton.php index 43b8ba9..028034b 100755 --- a/Block/Adminhtml/CategoryWidget/Edit/GenericButton.php +++ b/Block/Adminhtml/CategoryWidget/Edit/GenericButton.php @@ -34,14 +34,14 @@ class GenericButton */ public function __construct( Context $context, - CategoryWidgetRepositoryInterface $categoryWidgetRepository + CategoryWidgetRepositoryInterface $categoryWidgetRepository ) { $this->context = $context; - $this->categoryWidgetRepository = $categoryWidgetRepository; + $this->categoryWidgetRepository = $categoryWidgetRepository; } /** - * Get Image Slider ID + * Get Category Widget ID * * @return int|null * @throws LocalizedException @@ -54,7 +54,7 @@ class GenericButton )->getId(); } catch (NoSuchEntityException $e) { } catch (LocalizedException $e) { - throw new LocalizedException(__('Image Slider with id "%1" does not exist.')); + throw new LocalizedException(__('Category Widget with id "%1" does not exist.')); } return null; } diff --git a/Block/Adminhtml/CategoryWidget/Widget/Chooser.php b/Block/Adminhtml/CategoryWidget/Widget/Chooser.php index b059e9e..367f6b8 100755 --- a/Block/Adminhtml/CategoryWidget/Widget/Chooser.php +++ b/Block/Adminhtml/CategoryWidget/Widget/Chooser.php @@ -12,7 +12,7 @@ use \Exception; use \Magento\Widget\Block\Adminhtml\Widget\Chooser as WidgetChooser; /** - * Class Chooser for Image Slider + * Class Chooser for Category Widget * * @category PHP * @package NicolasBejean\CategoryWidget\Block\Adminhtml\CategoryWidget\Widget @@ -33,27 +33,27 @@ class Chooser extends Extended protected $collectionFactory; /** - * @param Context $context - * @param Data $backendHelper + * @param Context $context + * @param Data $backendHelper * @param CategoryWidgetFactory $categoryWidgetFactory - * @param CollectionFactory $collectionFactory - * @param array $data + * @param CollectionFactory $collectionFactory + * @param array $data */ public function __construct( - Context $context, - Data $backendHelper, + Context $context, + Data $backendHelper, CategoryWidgetFactory $categoryWidgetFactory, - CollectionFactory $collectionFactory, + CollectionFactory $collectionFactory, array $data = [] ) { $this->categoryWidgetFactory = $categoryWidgetFactory; - $this->collectionFactory = $collectionFactory; + $this->collectionFactory = $collectionFactory; parent::__construct($context, $backendHelper, $data); } /** - * Image Slider construction, prepare grid params + * Category Widget construction, prepare grid params * * @return void */ @@ -122,7 +122,7 @@ class Chooser extends Extended '.setElementValue(categoryWidgetId); ' . $chooserJsObject . - '.setElementLabel(categoryWidgetName); + '.setElementLabel(categoryWidgetTitle); ' . $chooserJsObject . '.close(); @@ -132,7 +132,7 @@ class Chooser extends Extended } /** - * Prepare Image Slider collection + * Prepare Category Widget collection * * @return Extended */ @@ -156,13 +156,13 @@ class Chooser extends Extended ); $this->addColumn( - 'chooser_identifier', - ['header' => __('Identifier'), 'align' => 'left', 'index' => 'identifier'] + 'chooser_title', + ['header' => __('Title'), 'align' => 'left', 'index' => 'title'] ); $this->addColumn( - 'chooser_name', - ['header' => __('Name'), 'align' => 'left', 'index' => 'name'] + 'chooser_identifier', + ['header' => __('Identifier'), 'align' => 'left', 'index' => 'identifier'] ); $this->addColumn( diff --git a/Block/Widget/CategoryWidgetNew.php b/Block/Widget/CategoryWidgetNew.php index 8ebe1df..725d3a5 100755 --- a/Block/Widget/CategoryWidgetNew.php +++ b/Block/Widget/CategoryWidgetNew.php @@ -47,7 +47,7 @@ class CategoryWidgetNew extends Template implements BlockInterface protected $filterProvider; /** - * Image Slider factory + * Category Widget factory * * @var CategoryWidgetFactory */ diff --git a/Controller/Adminhtml/CategoryWidget/Edit.php b/Controller/Adminhtml/CategoryWidget/Edit.php index 1fcc685..b0b504b 100755 --- a/Controller/Adminhtml/CategoryWidget/Edit.php +++ b/Controller/Adminhtml/CategoryWidget/Edit.php @@ -71,11 +71,11 @@ class Edit extends CategoryWidget /** @var Page $resultPage */ $resultPage = $this->resultPageFactory->create(); $this->initPage($resultPage)->addBreadcrumb( - $id ? __('Edit Image Slider') : __('New Image Slider'), - $id ? __('Edit Image Slider') : __('New Image Slider') + $id ? __('Edit Category Widget') : __('New Category Widget'), + $id ? __('Edit Category Widget') : __('New Category Widget') ); - $resultPage->getConfig()->getTitle()->prepend(__('Image Slider')); - $resultPage->getConfig()->getTitle()->prepend($model->getId() ? $model->getName() . ' (' . $model->getIdentifier() . ')' : __('New Image Slider')); + $resultPage->getConfig()->getTitle()->prepend(__('Category Widget')); + $resultPage->getConfig()->getTitle()->prepend($model->getId() ? $model->getName() . ' (' . $model->getIdentifier() . ')' : __('New Category Widget')); return $resultPage; } } diff --git a/Controller/Adminhtml/CategoryWidget/Index.php b/Controller/Adminhtml/CategoryWidget/Index.php index 761ecab..bb11077 100755 --- a/Controller/Adminhtml/CategoryWidget/Index.php +++ b/Controller/Adminhtml/CategoryWidget/Index.php @@ -48,7 +48,7 @@ use \Magento\Framework\App\Request\DataPersistorInterface; { /** @var Page $resultPage */ $resultPage = $this->resultPageFactory->create(); - $this->initPage($resultPage)->getConfig()->getTitle()->prepend(__('Image Slider Manager')); + $this->initPage($resultPage)->getConfig()->getTitle()->prepend(__('Category Widget Manager')); $dataPersistor = $this->_objectManager->get(DataPersistorInterface::class); $dataPersistor->clear('nicolasbejean_categorywidget_item'); diff --git a/Controller/Adminhtml/CategoryWidget/InlineEdit.php b/Controller/Adminhtml/CategoryWidget/InlineEdit.php index 067a5e6..8f70bbc 100755 --- a/Controller/Adminhtml/CategoryWidget/InlineEdit.php +++ b/Controller/Adminhtml/CategoryWidget/InlineEdit.php @@ -95,7 +95,7 @@ class InlineEdit extends Action } /** - * Add Image Slider title to error message + * Add Category Widget title to error message * * @param CategoryWidgetInterface $categoryWidget * @param string $errorText @@ -103,6 +103,6 @@ class InlineEdit extends Action */ protected function getErrorWithImageId(CategoryWidgetInterface $categoryWidget, $errorText) { - return '[Image Slider ID: ' . $categoryWidget->getId() . '] ' . $errorText; + return '[Category Widget ID: ' . $categoryWidget->getId() . '] ' . $errorText; } } diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index 208c814..f48ccd1 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -3,7 +3,7 @@ <system> <section id="categorywidget" translate="label" sortOrder="15" showInDefault="1" showInWebsite="1" showInStore="1"> <class>separator-top</class> - <label>Image Slider Manager</label> + <label>Category Widget Manager</label> <tab>nicolasbejean</tab> <resource>NicolasBejean_CategoryWidget::global</resource> <group id="resize" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1"> diff --git a/view/adminhtml/ui_component/categorywidget_categorywidget_form.xml b/view/adminhtml/ui_component/categorywidget_categorywidget_form.xml index 8b53ef2..af8f072 100755 --- a/view/adminhtml/ui_component/categorywidget_categorywidget_form.xml +++ b/view/adminhtml/ui_component/categorywidget_categorywidget_form.xml @@ -61,7 +61,7 @@ </argument> <settings> <dataType>boolean</dataType> - <label translate="true">Enable Image Slider</label> + <label translate="true">Enable Category Widget</label> <dataScope>is_active</dataScope> </settings> <formElements> -- GitLab