MicroFrameWork/kernel/modules/admin_themes/views/index.php

26 lines
654 B
PHP
Raw Normal View History

2024-09-03 16:29:44 +03:00
<?php
/**
* @var $json string
*/
use kernel\models\Option;
$table = new \Itguild\Tables\ListJsonTable($json);
$table->columns([
'preview' => function ($data) {
return "<img src='$data' width='200px'>";
}
]);
$table->addAction(function ($row, $url){
$path = $row['path'];
$active_admin_theme = Option::where("key", "active_admin_theme")->first();
2024-09-12 16:01:04 +03:00
$btn = "<a class='btn btn-primary' href='$url/activate/?p=$path' style='margin: 3px; width: 150px;' >Активировать</a>";
2024-09-03 16:29:44 +03:00
if ($path === $active_admin_theme->value){
$btn = "Активна";
}
return $btn;
});
$table->create();
$table->render();