mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
#1959 [cats] Toplu kategori silme
This commit is contained in:
parent
9a4e01ab58
commit
b4e4049fdb
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'categories_mass_delete_success' => 'Categories and related sub-categories has been deleted successfully!',
|
||||
];
|
||||
@ -1,6 +1,7 @@
|
||||
<?php namespace Visiosoft\CatsModule\Category\Table;
|
||||
|
||||
use Anomaly\Streams\Platform\Ui\Table\TableBuilder;
|
||||
use Visiosoft\CatsModule\Category\Table\Handler\Delete;
|
||||
|
||||
class CategoryTableBuilder extends TableBuilder
|
||||
{
|
||||
@ -68,6 +69,9 @@ class CategoryTableBuilder extends TableBuilder
|
||||
* @var array|string
|
||||
*/
|
||||
protected $actions = [
|
||||
'delete' => [
|
||||
'handler' => Delete::class
|
||||
]
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
@ -0,0 +1,26 @@
|
||||
<?php namespace Visiosoft\CatsModule\Category\Table\Handler;
|
||||
|
||||
use Anomaly\Streams\Platform\Ui\Table\Component\Action\ActionHandler;
|
||||
use Visiosoft\CatsModule\Category\Contract\CategoryRepositoryInterface;
|
||||
use Visiosoft\CatsModule\Category\Table\CategoryTableBuilder;
|
||||
|
||||
class Delete extends ActionHandler
|
||||
{
|
||||
public function handle(
|
||||
CategoryTableBuilder $builder, array $selected,
|
||||
CategoryRepositoryInterface $categoryRepository
|
||||
)
|
||||
{
|
||||
try {
|
||||
foreach ($selected as $id) {
|
||||
$categoryRepository->DeleteCategories($id);
|
||||
}
|
||||
|
||||
if ($selected) {
|
||||
$this->messages->success(trans('visiosoft.module.cats::message.categories_mass_delete_success'));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$this->messages->error($e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -769,8 +769,8 @@ pre code {
|
||||
.container-fluid {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
/*padding-left: 15px;*/
|
||||
/*padding-right: 15px;*/
|
||||
padding-left: 15px;
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
||||
.row {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user