2024-09-03 16:29:44 +03:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @var $json string
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
$table = new \Itguild\Tables\ListJsonTable($json);
|
|
|
|
$table->columns([
|
|
|
|
'preview' => function ($data) {
|
|
|
|
return "<img src='$data' width='200px'>";
|
|
|
|
}
|
|
|
|
]);
|
|
|
|
$table->addAction(function ($row, $url){
|
2024-09-24 17:22:09 +03:00
|
|
|
$active_admin_theme = \kernel\modules\option\service\OptionService::getItem('active_admin_theme');
|
2024-11-19 14:55:25 +03:00
|
|
|
|
2024-11-20 12:45:02 +03:00
|
|
|
if ($row['path'] === $active_admin_theme){
|
|
|
|
return "Активна";
|
|
|
|
} else {
|
|
|
|
$url = "$url/activate/?p=" . $row['path'];
|
2024-09-03 16:29:44 +03:00
|
|
|
|
2024-11-20 12:45:02 +03:00
|
|
|
return \kernel\widgets\IconBtn\IconBtnActivateWidget::create(['url' => $url])->run();
|
|
|
|
}
|
2024-09-03 16:29:44 +03:00
|
|
|
});
|
|
|
|
$table->create();
|
|
|
|
$table->render();
|