update, delete module from shop on local page

This commit is contained in:
2024-11-18 15:55:43 +03:00
parent faf0217b52
commit f4b0f006aa
6 changed files with 74 additions and 32 deletions

View File

@ -35,7 +35,7 @@ $table->addAction(function ($row, $url) use ($moduleService) {
} else {
$label = "Активировать";
$btn_type = "primary";
$btn_type = "success";
$btn = "<a class='btn btn-$btn_type' href='$url/activate/?slug=$slug' style='margin: 3px; width: 150px;' >$label</a>";
}
@ -47,10 +47,28 @@ $table->addAction(function ($row, $url) use ($moduleService) {
return "<a class='btn btn-primary' href='$url/view/?slug=$slug' style='margin: 3px; width: 150px;' >Просмотр</a>";
});
//$table->addAction(function ($row, $url) use ($moduleService) {
// $slug = $row['slug'];
// return "<a class='btn btn-primary' href='$url/update/?slug=$slug' style='margin: 3px; width: 150px;' >Обновить</a>";
//});
$table->addAction(function ($row, $url) use ($moduleService){
$slug = $row['slug'];
if (!$moduleService->isKernelModule($slug)){
if (!$moduleService->isLastVersion($slug)) {
$label = "Обновить";
$btn_type = "info";
return "<a class='btn btn-$btn_type' href='$url/update/?slug=$slug' style='margin: 3px; width: 150px;' >$label</a>";
}
}
return false;
});
$table->addAction(function ($row, $url) use ($moduleService){
$slug = $row['slug'];
if (!$moduleService->isKernelModule($slug)){
$label = "Удалить";
$btn_type = "danger";
return "<a class='btn btn-$btn_type' href='admin/module_shop_client/delete/?slug=$slug' style='margin: 3px; width: 150px;' >$label</a>";
}
return false;
});
$table->create();