refactor languages module to domain/controller and release 0.254 update package

This commit is contained in:
2026-02-12 22:10:37 +01:00
parent 2ecc4fd9be
commit a02f718a41
22 changed files with 1190 additions and 490 deletions

View File

@@ -1,44 +1,2 @@
<?php
global $gdb;
<?= \Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>
$grid = new \grid( 'pp_langs_translations' );
$grid -> gdb_opt = $gdb;
$grid -> order = [ 'column' => 'text', 'type' => 'ASC' ];
$grid -> search = [
[ 'name' => 'Tekst', 'db' => 'text', 'type' => 'text' ]
];
$grid -> columns_view = [
[
'name' => 'Lp.',
'th' => [ 'class' => 'g-lp' ],
'td' => [ 'class' => 'g-center' ],
'autoincrement' => true
],
[
'name' => 'Tekst',
'db' => 'text',
'php' => 'echo "<a href=\'/admin/languages/translation_edit/id=[id]\'>[text]</a>";',
'sort' => true
],
[
'name' => 'Edytuj',
'action' => [ 'type' => 'edit', 'url' => '/admin/languages/translation_edit/id=[id]' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 70px;' ],
'td' => [ 'class' => 'g-center' ]
],
[
'name' => 'Usuń',
'action' => [ 'type' => 'delete', 'url' => '/admin/languages/translation_delete/id=[id]' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 70px;' ],
'td' => [ 'class' => 'g-center' ]
]
];
$grid -> buttons = [
[
'label' => 'Dodaj tłumaczenie',
'url' => '/admin/languages/translation_edit/',
'icon' => 'fa-plus-circle',
'class' => 'btn-success'
]
];
echo $grid -> draw();