ms client update
This commit is contained in:
@ -4,6 +4,7 @@
|
||||
* @var int $module_count
|
||||
* @var int $page_number
|
||||
* @var int $per_page
|
||||
* @var \kernel\services\ModuleService $moduleService
|
||||
*/
|
||||
|
||||
use Itguild\Tables\ListJsonTable;
|
||||
@ -28,26 +29,25 @@ $info_to_table['data'] = $modules_info;
|
||||
|
||||
$table = new ListJsonTable(json_encode($info_to_table, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
|
||||
|
||||
|
||||
//$table->addAction(function ($row, $url) use ($moduleService){
|
||||
// $slug = $row['slug'];
|
||||
// if ($moduleService->isActive($slug)){
|
||||
// $label = "Деактивировать";
|
||||
// $btn_type = "warning";
|
||||
// $btn = "<a class='btn btn-$btn_type' href='$url/deactivate/?slug=$slug' style='margin: 3px; width: 150px;' >$label</a>";
|
||||
//
|
||||
// }
|
||||
// else {
|
||||
// $label = "Активировать";
|
||||
// $btn_type = "primary";
|
||||
// $btn = "<a class='btn btn-$btn_type' href='$url/activate/?slug=$slug' style='margin: 3px; width: 150px;' >$label</a>";
|
||||
// }
|
||||
//
|
||||
// return $btn;
|
||||
//});
|
||||
|
||||
$table->addAction(\kernel\IGTabel\action_column\ViewActionColumn::class);
|
||||
$table->addAction(\kernel\IGTabel\action_column\InstallActionColumn::class);
|
||||
|
||||
$table->addAction(function ($row, $url) use ($moduleService){
|
||||
$slug = $row['slug'];
|
||||
$id = $row['id'];
|
||||
if ($moduleService->isInstall($slug)){
|
||||
$label = "Удалить";
|
||||
$btn_type = "danger";
|
||||
$btn = "<a class='btn btn-$btn_type' href='$url/delete/?slug=$slug' style='margin: 3px; width: 150px;' >$label</a>";
|
||||
}
|
||||
else {
|
||||
$label = "Установить";
|
||||
$btn_type = "warning";
|
||||
$btn = "<a class='btn btn-$btn_type' href='$url/install/?id=$id' style='margin: 3px; width: 150px;' >$label</a>";
|
||||
}
|
||||
|
||||
return $btn;
|
||||
});
|
||||
|
||||
|
||||
$table->create();
|
||||
$table->render();
|
||||
|
Reference in New Issue
Block a user