"Название", "author" => "Автор", "version" => "Версия", "description" => "Описание" ]; $meta['params'] = ["class" => "table table-bordered"]; $meta['perPage'] = $per_page; $meta['baseUrl'] = "/admin/module"; $meta['currentPage'] = $page_number; $meta['total'] = $module_count; $info_to_table['meta'] = $meta; $info_to_table['data'] = $modules_info; $table = new \Itguild\Tables\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 = "$label"; } else { $label = ""; $btn_type = "success"; $btn = "$label"; } return $btn; }); $table->addAction(function ($row, $url) use ($moduleService) { $slug = $row['slug']; return "Просмотр"; }); $table->addAction(function ($row, $url) use ($moduleService){ $slug = $row['slug']; if (!$moduleService->isKernelModule($slug)){ if (!$moduleService->isLastVersion($slug)) { $label = "Обновить"; $btn_type = "info"; return "$label"; } } return false; }); $table->addAction(function ($row) use ($moduleService){ $slug = $row['slug']; if (!$moduleService->isKernelModule($slug)){ $label = "Удалить"; $btn_type = "danger"; return "$label"; } return false; }); $table->create(); if ($moduleService->isActive('module_shop_client')) { \kernel\widgets\ModuleTabsWidget::create()->run(); } $table->render();