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

@ -41,7 +41,7 @@ $table->addAction(function ($row, $url) use ($moduleService){
}
else {
$label = "Установить";
$btn_type = "warning";
$btn_type = "success";
$btn = "<a class='btn btn-$btn_type' href='$url/install/?id=$id' style='margin: 3px; width: 150px;' >$label</a>";
}
@ -50,16 +50,15 @@ $table->addAction(function ($row, $url) use ($moduleService){
$table->addAction(function ($row, $url) use ($moduleService){
$slug = $row['slug'];
$id = $row['id'];
if ($moduleService->isInstall($slug)){
if (!$moduleService->isLastVersion($slug)) {
$label = "Обновить";
$btn_type = "danger";
return "<a class='btn btn-$btn_type' href='$url/update/?id=$id' style='margin: 3px; width: 150px;' >$label</a>";
$btn_type = "info";
return "<a class='btn btn-$btn_type' href='$url/update/?slug=$slug' style='margin: 3px; width: 150px;' >$label</a>";
}
}
return false;
return false;
});