Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit 36b8e07d authored by Nicolas's avatar Nicolas
Browse files

Corrections

parent feb65ace
No related branches found
No related tags found
No related merge requests found
......@@ -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();
}
......
......@@ -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?'
......
......@@ -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;
}
......
......@@ -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(
......
......@@ -47,7 +47,7 @@ class CategoryWidgetNew extends Template implements BlockInterface
protected $filterProvider;
/**
* Image Slider factory
* Category Widget factory
*
* @var CategoryWidgetFactory
*/
......
......@@ -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;
}
}
......@@ -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');
......
......@@ -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;
}
}
......@@ -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">
......
......@@ -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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment