action button update
This commit is contained in:
@ -18,7 +18,8 @@ class ActionButtonWidget extends Widget
|
||||
$label = $this->data['label'];
|
||||
$btn_type = $this->data['btn_type'];
|
||||
$url = $this->data['url'];
|
||||
$title = $this->data['title'] ?? '';
|
||||
|
||||
return $this->cgView->fetch('/action_button.php', ['label' => $label, 'btn_type' => $btn_type, 'url' => $url]);
|
||||
return $this->cgView->fetch('/action_button.php', ['label' => $label, 'btn_type' => $btn_type, 'url' => $url, 'title' => $title]);
|
||||
}
|
||||
}
|
26
kernel/widgets/IconBtn/IconBtnActivateWidget.php
Normal file
26
kernel/widgets/IconBtn/IconBtnActivateWidget.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace kernel\widgets\IconBtn;
|
||||
|
||||
use kernel\Widget;
|
||||
use kernel\widgets\ActionButtonWidget;
|
||||
|
||||
class IconBtnActivateWidget extends Widget
|
||||
{
|
||||
public static function create(array $data = []): IconBtnActivateWidget
|
||||
{
|
||||
return new static($data);
|
||||
}
|
||||
|
||||
public function run()
|
||||
{
|
||||
$url = $this->data['url'];
|
||||
|
||||
return ActionButtonWidget::create([
|
||||
'label' => "<i class='fa-regular fa-circle-check'></i>",
|
||||
'url' => $url,
|
||||
'btn_type' => "success",
|
||||
'title' => "Активировать"
|
||||
])->run();
|
||||
}
|
||||
}
|
26
kernel/widgets/IconBtn/IconBtnCreateWidget.php
Normal file
26
kernel/widgets/IconBtn/IconBtnCreateWidget.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace kernel\widgets\IconBtn;
|
||||
|
||||
use kernel\Widget;
|
||||
use kernel\widgets\ActionButtonWidget;
|
||||
|
||||
class IconBtnCreateWidget extends Widget
|
||||
{
|
||||
public static function create(array $data = []): IconBtnCreateWidget
|
||||
{
|
||||
return new static($data);
|
||||
}
|
||||
|
||||
public function run()
|
||||
{
|
||||
$url = $this->data['url'];
|
||||
|
||||
return ActionButtonWidget::create([
|
||||
'label' => "<i class='fa-regular fa-square-plus'></i>",
|
||||
'url' => $url,
|
||||
'btn_type' => "success",
|
||||
'title' => "Создать"
|
||||
])->run();
|
||||
}
|
||||
}
|
26
kernel/widgets/IconBtn/IconBtnDeactivateWidget.php
Normal file
26
kernel/widgets/IconBtn/IconBtnDeactivateWidget.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace kernel\widgets\IconBtn;
|
||||
|
||||
use kernel\Widget;
|
||||
use kernel\widgets\ActionButtonWidget;
|
||||
|
||||
class IconBtnDeactivateWidget extends Widget
|
||||
{
|
||||
public static function create(array $data = []): IconBtnDeactivateWidget
|
||||
{
|
||||
return new static($data);
|
||||
}
|
||||
|
||||
public function run()
|
||||
{
|
||||
$url = $this->data['url'];
|
||||
|
||||
return ActionButtonWidget::create([
|
||||
'label' => "<i class='fa-regular fa-circle-xmark'></i>",
|
||||
'url' => $url,
|
||||
'btn_type' => "warning",
|
||||
'title' => "Деактивировать"
|
||||
])->run();
|
||||
}
|
||||
}
|
26
kernel/widgets/IconBtn/IconBtnDeleteWidget.php
Normal file
26
kernel/widgets/IconBtn/IconBtnDeleteWidget.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace kernel\widgets\IconBtn;
|
||||
|
||||
use kernel\Widget;
|
||||
use kernel\widgets\ActionButtonWidget;
|
||||
|
||||
class IconBtnDeleteWidget extends Widget
|
||||
{
|
||||
public static function create(array $data = []): IconBtnDeleteWidget
|
||||
{
|
||||
return new static($data);
|
||||
}
|
||||
|
||||
public function run()
|
||||
{
|
||||
$url = $this->data['url'];
|
||||
|
||||
return ActionButtonWidget::create([
|
||||
'label' => "<i class='fa-regular fa-trash-can'></i>",
|
||||
'url' => $url,
|
||||
'btn_type' => "danger",
|
||||
'title' => "Удалить"
|
||||
])->run();
|
||||
}
|
||||
}
|
26
kernel/widgets/IconBtn/IconBtnEditWidget.php
Normal file
26
kernel/widgets/IconBtn/IconBtnEditWidget.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace kernel\widgets\IconBtn;
|
||||
|
||||
use kernel\Widget;
|
||||
use kernel\widgets\ActionButtonWidget;
|
||||
|
||||
class IconBtnEditWidget extends Widget
|
||||
{
|
||||
public static function create(array $data = []): IconBtnEditWidget
|
||||
{
|
||||
return new static($data);
|
||||
}
|
||||
|
||||
public function run()
|
||||
{
|
||||
$url = $this->data['url'];
|
||||
|
||||
return ActionButtonWidget::create([
|
||||
'label' => "<i class='fa-solid fa-pen'></i>",
|
||||
'url' => $url,
|
||||
'btn_type' => "success",
|
||||
'title' => "Редактировать"
|
||||
])->run();
|
||||
}
|
||||
}
|
26
kernel/widgets/IconBtn/IconBtnInstallWidget.php
Normal file
26
kernel/widgets/IconBtn/IconBtnInstallWidget.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace kernel\widgets\IconBtn;
|
||||
|
||||
use kernel\Widget;
|
||||
use kernel\widgets\ActionButtonWidget;
|
||||
|
||||
class IconBtnInstallWidget extends Widget
|
||||
{
|
||||
public static function create(array $data = []): IconBtnInstallWidget
|
||||
{
|
||||
return new static($data);
|
||||
}
|
||||
|
||||
public function run()
|
||||
{
|
||||
$url = $this->data['url'];
|
||||
|
||||
return ActionButtonWidget::create([
|
||||
'label' => "<i class='fa-solid fa-download'></i>",
|
||||
'url' => $url,
|
||||
'btn_type' => "success",
|
||||
'title' => "Установить"
|
||||
])->run();
|
||||
}
|
||||
}
|
26
kernel/widgets/IconBtn/IconBtnListWidget.php
Normal file
26
kernel/widgets/IconBtn/IconBtnListWidget.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace kernel\widgets\IconBtn;
|
||||
|
||||
use kernel\Widget;
|
||||
use kernel\widgets\ActionButtonWidget;
|
||||
|
||||
class IconBtnListWidget extends Widget
|
||||
{
|
||||
public static function create(array $data = []): IconBtnListWidget
|
||||
{
|
||||
return new static($data);
|
||||
}
|
||||
|
||||
public function run()
|
||||
{
|
||||
$url = $this->data['url'];
|
||||
|
||||
return ActionButtonWidget::create([
|
||||
'label' => "<i class='fa-regular fa-rectangle-list'></i>",
|
||||
'url' => $url,
|
||||
'btn_type' => "primary",
|
||||
'title' => "Список"
|
||||
])->run();
|
||||
}
|
||||
}
|
26
kernel/widgets/IconBtn/IconBtnUpdateWidget.php
Normal file
26
kernel/widgets/IconBtn/IconBtnUpdateWidget.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace kernel\widgets\IconBtn;
|
||||
|
||||
use kernel\Widget;
|
||||
use kernel\widgets\ActionButtonWidget;
|
||||
|
||||
class IconBtnUpdateWidget extends Widget
|
||||
{
|
||||
public static function create(array $data = []): IconBtnUpdateWidget
|
||||
{
|
||||
return new static($data);
|
||||
}
|
||||
|
||||
public function run()
|
||||
{
|
||||
$url = $this->data['url'];
|
||||
|
||||
return ActionButtonWidget::create([
|
||||
'label' => "<i class='fa-solid fa-cloud-arrow-down'></i>",
|
||||
'url' => $url,
|
||||
'btn_type' => "info",
|
||||
'title' => "Обновить"
|
||||
])->run();
|
||||
}
|
||||
}
|
27
kernel/widgets/IconBtn/IconBtnViewWidget.php
Normal file
27
kernel/widgets/IconBtn/IconBtnViewWidget.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace kernel\widgets\IconBtn;
|
||||
|
||||
use kernel\Widget;
|
||||
use kernel\widgets\ActionButtonWidget;
|
||||
|
||||
class IconBtnViewWidget extends Widget
|
||||
{
|
||||
public static function create(array $data = []): IconBtnViewWidget
|
||||
{
|
||||
return new static($data);
|
||||
}
|
||||
|
||||
public function run(): string
|
||||
{
|
||||
$url = $this->data['url'];
|
||||
|
||||
return ActionButtonWidget::create([
|
||||
'btn_type' => "primary",
|
||||
'label' => "<i class='fa-regular fa-eye'></i>",
|
||||
'url' => $url,
|
||||
'title' => "Просмотреть"
|
||||
])->run();
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user