Add backend site management for collective topics and topics
- Introduced new backend site management features including the ability to accept, unaccept, save, edit, and display topics and collective topics. - Added new views for editing and listing collective topics and topics. - Implemented necessary backend logic in the `BackendSites` and `factory\BackendSites` classes to handle CRUD operations for topics and collective topics. - Updated the layout to include links for accessing the new backend features based on user permissions.
This commit is contained in:
72
templates/backend_sites/topics.php
Normal file
72
templates/backend_sites/topics.php
Normal file
@@ -0,0 +1,72 @@
|
||||
<?php global $gdb;?>
|
||||
<div class="block-header">
|
||||
<h2>Lista <strong>tematów</strong></h2>
|
||||
</div>
|
||||
<?php
|
||||
$grid = new \grid( 'zaplecze_tematy' );
|
||||
$grid -> debug = true;
|
||||
$grid -> gdb_opt = $gdb;
|
||||
$grid -> order = [ 'column' => 'data_publikacji', 'type' => 'DESC' ];
|
||||
$grid -> search = [
|
||||
[ 'name' => 'zaakceptowany', 'db' => 'zaakceptowany', 'type' => 'select', 'replace' => [ 'array' => [ 0 => 'nie', 1 => 'tak' ] ] ],
|
||||
];
|
||||
$grid -> columns_view = [
|
||||
[
|
||||
'name' => 'Lp.',
|
||||
'th' => [ 'class' => 'g-lp', 'style' => 'width: 75px' ],
|
||||
'td' => [ 'class' => 'g-center' ],
|
||||
'autoincrement' => true
|
||||
], [
|
||||
'name' => 'Strona',
|
||||
'db' => 'strona'
|
||||
], [
|
||||
'name' => 'Kategoria',
|
||||
'db' => 'kategoria',
|
||||
], [
|
||||
'name' => 'Kategoria ID',
|
||||
'db' => 'kategoria_id',
|
||||
], [
|
||||
'name' => 'Link',
|
||||
'db' => 'link',
|
||||
], [
|
||||
'name' => 'Temat',
|
||||
'db' => 'temat',
|
||||
], [
|
||||
'name' => 'Data publikacji',
|
||||
'db' => 'data_publikacji',
|
||||
], [
|
||||
'name' => 'Opublikowany',
|
||||
'db' => 'opublikowany',
|
||||
'td' => [ 'class' => 'g-center' ],
|
||||
'th' => [ 'class' => 'g-center', 'style' => 'width: 150px;' ],
|
||||
'php' => 'echo ( (int)[opublikowany] == 1 ) ? "tak" : "<span class=\"text-danger\">nie</span>";',
|
||||
], [
|
||||
'name' => 'Zaakceptowany',
|
||||
'db' => 'zaakceptowany',
|
||||
'td' => [ 'class' => 'g-center' ],
|
||||
'th' => [ 'class' => 'g-center', 'style' => 'width: 150px;' ],
|
||||
'php' => 'echo ( (int)[zaakceptowany] == 1 ) ? "<a href=\"/backend_sites/topic_unaccept/id=[id]\">tak</a>" : "<a href=\"/backend_sites/topic_accept/id=[id]\" class=\"text-danger\">nie</a>";',
|
||||
], [
|
||||
'name' => 'Edytuj',
|
||||
'action' => [ 'type' => 'edit', 'url' => '/backend_sites/topic_edit/id=[id]' ],
|
||||
'th' => [ 'class' => 'g-center', 'style' => 'width: 70px;' ],
|
||||
'td' => [ 'class' => 'g-center' ]
|
||||
], [
|
||||
'name' => 'Usuń',
|
||||
'action' => [ 'type' => 'delete', 'url' => '/backend_sites/topic_delete/id=[id]' ],
|
||||
'th' => [ 'class' => 'g-center', 'style' => 'width: 70px;' ],
|
||||
'td' => [ 'class' => 'g-center' ]
|
||||
]
|
||||
];
|
||||
$grid -> buttons = [
|
||||
[
|
||||
'label' => 'Dodaj temat ogólny',
|
||||
'url' => '/backend_sites/topic_edit/',
|
||||
'icon' => 'fa-plus-circle',
|
||||
'class' => 'btn-success'
|
||||
]
|
||||
];
|
||||
$grid -> hide_columns = false;
|
||||
$grid -> limit = 10;
|
||||
echo $grid -> draw();
|
||||
?>
|
||||
Reference in New Issue
Block a user