action btns

This commit is contained in:
2024-11-19 14:55:25 +03:00
parent 7a90980772
commit 6c2798c123
5 changed files with 53 additions and 51 deletions

View File

@ -4,6 +4,7 @@
*/
use kernel\models\Option;
use kernel\widgets\ActionButtonWidget;
$table = new \Itguild\Tables\ListJsonTable($json);
@ -15,7 +16,12 @@ $table->columns([
$table->addAction(function ($row, $url){
$path = $row['path'];
$active_admin_theme = \kernel\modules\option\service\OptionService::getItem('active_admin_theme');
$btn = "<a class='btn btn-primary' href='$url/activate/?p=$path' style='margin: 3px; width: 150px;' >Активировать</a>";
$btn = ActionButtonWidget::create([
'btn_type' => "primary",
'label' => "Активировать",
'url' => "$url/activate/?p=$path",
])->run();
if ($path === $active_admin_theme){
$btn = "Активна";
}