admin themes
This commit is contained in:
29
kernel/modules/admin_themes/views/index.php
Normal file
29
kernel/modules/admin_themes/views/index.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?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();
|
Reference in New Issue
Block a user