action button widget
This commit is contained in:
parent
f4b0f006aa
commit
202d265cab
@ -14,7 +14,7 @@
|
||||
|
||||
<link href="https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700,800,900" rel="stylesheet">
|
||||
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css">
|
||||
<link rel="stylesheet" href="<?= $resources ?>/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="<?= $resources ?>/css/style.css">
|
||||
</head>
|
||||
|
@ -122,8 +122,6 @@ class ModuleController extends AdminController
|
||||
$this->redirect("/admin/module_shop_client/update/?slug=" . $slug, 302);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$this->cgView->render("view.php", ['data' => $mod_info]);
|
||||
}
|
||||
|
||||
|
@ -34,9 +34,9 @@ $table->addAction(function ($row, $url) use ($moduleService) {
|
||||
$btn = "<a class='btn btn-$btn_type' href='$url/deactivate/?slug=$slug' style='margin: 3px; width: 150px;' >$label</a>";
|
||||
|
||||
} else {
|
||||
$label = "Активировать";
|
||||
$label = "<i class='fa-regular fa-circle-check'></i>";
|
||||
$btn_type = "success";
|
||||
$btn = "<a class='btn btn-$btn_type' href='$url/activate/?slug=$slug' style='margin: 3px; width: 150px;' >$label</a>";
|
||||
$btn = "<a class='btn btn-$btn_type' href='$url/activate/?slug=$slug' style='margin: 3px;' >$label</a>";
|
||||
}
|
||||
|
||||
return $btn;
|
||||
|
16
kernel/widgets/ActionButtonWidget.php
Normal file
16
kernel/widgets/ActionButtonWidget.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace kernel\widgets;
|
||||
|
||||
use kernel\Widget;
|
||||
|
||||
class ActionButtonWidget extends Widget
|
||||
{
|
||||
public function run(): void
|
||||
{
|
||||
$icon = $this->data['icon'];
|
||||
$btn = $this->data['btn'];
|
||||
$url = $this->data['url'];
|
||||
$this->cgView->render('/admin/action_button.php', ['icon' => $icon, 'btn' => $btn, 'url' => $url]);
|
||||
}
|
||||
}
|
9
views/widgets/admin/action_button.php
Normal file
9
views/widgets/admin/action_button.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* @var string $icon
|
||||
* @var string $btn
|
||||
* @var string $url
|
||||
*/
|
||||
?>
|
||||
|
||||
"<a class='btn btn-$btn_type' href='$url/deactivate/?slug=$slug' style='margin: 3px; width: 150px;' >$label</a>";
|
Loading…
Reference in New Issue
Block a user