first commit

This commit is contained in:
2024-10-23 12:55:46 +02:00
commit 85c92aa932
8453 changed files with 1186172 additions and 0 deletions

View File

@@ -0,0 +1,101 @@
<?
global $db;
ob_start();
?>
<?
if ( $this -> language['id'] )
{
echo \Html::input(
array(
'type' => 'hidden',
'name' => 'id',
'value' => $this -> language['id']
)
);
echo \Html::input(
array(
'type' => 'hidden',
'name' => 'o',
'value' => $this -> language['o']
)
);
echo \Html::input(
array(
'label' => 'Język',
'type' => 'text',
'class' => 'require',
'name' => 'name',
'value' => $this -> language['name']
)
);
}
else
{
echo \Html::input(
array(
'type' => 'hidden',
'name' => 'o',
'value' => $this -> order + 1
)
);
echo \Html::input(
array(
'label' => 'Język',
'type' => 'text',
'class' => 'require',
'name' => 'name'
)
);
echo \Html::input(
array(
'label' => 'ID (2 znaki)',
'class' => 'require',
'type' => 'text',
'name' => 'id'
)
);
}
?>
<?= \Html::input_switch(
array(
'label' => 'Aktywny',
'name' => 'status',
'checked' => $this -> language['status'] == 1 ? true : false
)
);?>
<?= \Html::input_switch(
array(
'label' => 'Domyślny',
'name' => 'start',
'checked' => $this -> language['start'] == 1 ? true : false
)
);?>
<?
$out = ob_get_clean();
$grid = new \gridEdit;
$grid -> id = 'language-edit';
$grid -> gdb_opt = $gdb;
$grid -> include_plugins = true;
$grid -> title = 'Edycja języka';
$grid -> external_code = $out;
$grid -> actions = [
'save' => [ 'url' => '/admin/languages/language_save/', 'back_url' => '/admin/languages/view_list/' ],
'cancel' => [ 'url' => '/admin/languages/view_list/' ]
];
$grid -> persist_edit = true;
$grid -> id_param = 'id';
echo $grid -> draw();
?>
<script type="text/javascript">
$( function()
{
disable_menu();
$( 'input[type="text"].date' ).datetimepicker({
format: "YYYY-MM-DD",
pickTime: false
});
});
</script>

View File

@@ -0,0 +1,58 @@
<?php
global $gdb;
$grid = new \grid( 'pp_langs' );
$grid -> gdb_opt = $gdb;
$grid -> order = [ 'column' => 'o', 'type' => 'ASC' ];
$grid -> search = [
[ 'name' => 'Język', 'db' => 'name', 'type' => 'text' ],
[ 'name' => 'Aktywny', 'db' => 'status', 'type' => 'select', 'replace' => [ 'array' => [ 0 => 'nie', 1 => 'tak' ] ] ],
[ 'name' => 'Domyślny', 'db' => 'start', 'type' => 'select', 'replace' => [ 'array' => [ 0 => 'nie', 1 => 'tak' ] ] ]
];
$grid -> columns_view = [
[
'name' => 'Lp.',
'th' => [ 'class' => 'g-lp' ],
'td' => [ 'class' => 'g-center' ],
'autoincrement' => true
],
[
'name' => 'Domyślny',
'db' => 'start',
'th' => [ 'class' => 'g-center', 'style' => 'width: 150px;' ],
'td' => [ 'class' => 'g-center' ],
'php' => 'if ( [start] ) echo "<span class=\'text-system\'>tak</span>"; else echo "nie";'
],
[
'name' => 'Aktywny',
'db' => 'status',
'replace' => [ 'array' => [ 0 => '<span style="color: #FF0000;">nie</span>', 1 => 'tak' ] ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 150px;' ],
'td' => [ 'class' => 'g-center' ]
],
[
'name' => 'Język',
'db' => 'name'
],
[
'name' => 'Edytuj',
'action' => [ 'type' => 'edit', 'url' => '/admin/languages/language_edit/id=[id]' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 70px;' ],
'td' => [ 'class' => 'g-center' ]
],
[
'name' => 'Usuń',
'action' => [ 'type' => 'delete', 'url' => '/admin/languages/language_delete/id=[id]' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 70px;' ],
'td' => [ 'class' => 'g-center' ]
]
];
$grid -> buttons = [
[
'label' => 'Dodaj język',
'url' => '/admin/languages/language_edit/',
'icon' => 'fa-plus-circle',
'class' => 'btn-success'
]
];
echo $grid -> draw();

View File

@@ -0,0 +1,60 @@
<?
global $db;
ob_start();
?>
<?
echo \Html::input(
array(
'type' => 'text',
'label' => 'Tekst',
'name' => 'text',
'class' => 'require',
'value' => $this -> translation['text']
)
);
if ( is_array( $this -> languages ) ): foreach ( $this -> languages as $language ):
echo \Html::input(
array(
'type' => 'text',
'label' => $language['name'],
'name' => $language['id'],
'value' => $this -> translation[$language['id']]
) );
endforeach;
endif;
$out = ob_get_clean();
$grid = new \gridEdit;
$grid -> id = 'translation-edit';
$grid -> gdb_opt = $gdb;
$grid -> include_plugins = true;
$grid -> title = 'Edycja tłumaczenia';
$grid -> fields = [
[
'db' => 'id',
'type' => 'hidden',
'value' => $this -> translation['id']
]
];
$grid -> external_code = $out;
$grid -> actions = [
'save' => [ 'url' => '/admin/languages/translation_save/', 'back_url' => '/admin/languages/translation_list/' ],
'cancel' => [ 'url' => '/admin/languages/translation_list/' ]
];
$grid -> persist_edit = true;
$grid -> id_param = 'id';
echo $grid -> draw();
?>
<script type="text/javascript">
$(function ()
{
disable_menu();
$('input[type="text"].date').datetimepicker({
format: "YYYY-MM-DD",
pickTime: false
});
});
</script>

View File

@@ -0,0 +1,44 @@
<?php
global $gdb;
$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();