feat: Add 'wygeneruj_temat' parameter to topic_save method and update related templates for enhanced topic management

This commit is contained in:
2025-05-17 23:54:47 +02:00
parent cce4ac8410
commit e0fcbabacf
5 changed files with 24 additions and 8 deletions

View File

@@ -37,6 +37,13 @@ ob_start();
'value' => $this -> topic['temat'],
'inline' => true
] );?>
<?= \Html::input_switch( [
'label' => 'Wygeneruj temat',
'name' => 'wygeneruj_temat',
'id' => 'wygeneruj_temat',
'checked' => $this -> topic['wygeneruj_temat'] == 1 ? true : false,
'inline' => true
] );?>
<?= \Html::input( [
'label' => 'Data publikacji',
'name' => 'data_publikacji',
@@ -65,7 +72,7 @@ $grid = new \gridEdit;
$grid -> id = 'client-edit';
$grid -> gdb_opt = $gdb;
$grid -> include_plugins = true;
$grid -> title = 'Edycja <strong>tematu zbiorowego</strong>';
$grid -> title = 'Edycja <strong>tematu</strong>';
$grid -> fields = [
[
'db' => 'id',

View File

@@ -28,9 +28,16 @@ $grid -> columns_view = [
], [
'name' => 'Link',
'db' => 'link',
'cut' => 50,
], [
'name' => 'Temat',
'db' => 'temat',
], [
'name' => 'Wygeneruj temat',
'db' => 'wygeneruj_temat',
'td' => [ 'class' => 'g-center' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 150px;' ],
'php' => 'echo ( (int)[wygeneruj_temat] == 1 ) ? "tak" : "<span class=\"text-danger\">nie</span>";',
], [
'name' => 'Data publikacji',
'db' => 'data_publikacji',
@@ -60,7 +67,7 @@ $grid -> columns_view = [
];
$grid -> buttons = [
[
'label' => 'Dodaj temat ogólny',
'label' => 'Dodaj temat',
'url' => '/backend_sites/topic_edit/',
'icon' => 'fa-plus-circle',
'class' => 'btn-success'