29 lines
771 B
PHP
29 lines
771 B
PHP
|
<?php
|
||
|
/**
|
||
|
* @var $json string
|
||
|
*/
|
||
|
|
||
|
use app\helpers\Debug;
|
||
|
use Itguild\EloquentTable\EloquentDataProvider;
|
||
|
use Itguild\EloquentTable\ListEloquentTable;
|
||
|
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();
|
||
|
$btn = "<a class='btn btn-primary' href='$url/activate/?p=$path' style='margin: 3px; width: 150px;' >Активировать</a>";;
|
||
|
if ($path === $active_admin_theme->value){
|
||
|
$btn = "Активна";
|
||
|
}
|
||
|
|
||
|
return $btn;
|
||
|
});
|
||
|
$table->create();
|
||
|
$table->render();
|