ver 0.262 - pages module refactor and admin UX fixes

This commit is contained in:
2026-02-13 21:17:21 +01:00
parent 26ebf59849
commit 67705f1f56
44 changed files with 2235 additions and 1803 deletions

View File

@@ -21,15 +21,15 @@ ob_start();
<div id="settings-tabs">
<ul class="resp-tabs-list settings-tabs">
<li><i class="fa fa-file"></i>Opis</li>
<li><i class="fa fa-file"></i>Zakładki</li>
<li><i class="fa fa-file"></i>Zakładki</li>
<li><i class="fa fa-dollar"></i>Cena</li>
<li><i class="fa fa-home"></i>Magazyn</li>
<li><i class="fa fa-wrench"></i>Ustawienia</li>
<li><i class="fa fa-globe"></i>SEO</li>
<li><i class="fa fa-share-alt"></i>Wyświetlanie</li>
<li><i class="fa fa-share-alt"></i>Wyświetlanie</li>
<li><i class="fa fa-file-image-o"></i>Galeria</li>
<li><i class="fa fa-file-archive-o"></i>Załączniki</li>
<li><i class="fa fa-exchange"></i>Produkty powiązane</li>
<li><i class="fa fa-file-archive-o"></i>Załączniki</li>
<li><i class="fa fa-exchange"></i>Produkty powiÄ…zane</li>
<li><i class="fa fa-file-excel-o"></i>XML</li>
<li><i class="fa fa-file-o"></i>Dodatkowe pola</li>
<li><i class="fa fa-file-o"></i>GPSR</li>
@@ -40,7 +40,7 @@ ob_start();
<ul class="resp-tabs-list languages-main htabs">
<? if (is_array($this->languages)) : foreach ($this->languages as $lg) : ?>
<? if ($lg['status']) : ?>
<li><? if ($lg['id'] == \front\factory\Languages::default_language()) echo '<i class="fa fa-star fa-lg text-system" title="Język domyślny"></i> '; ?><?= $lg['name']; ?></a></li>
<li><? if ($lg['id'] == \front\factory\Languages::default_language()) echo '<i class="fa fa-star fa-lg text-system" title="Język domyślny"></i> '; ?><?= $lg['name']; ?></a></li>
<? endif; ?>
<?
endforeach;
@@ -52,7 +52,7 @@ ob_start();
<?
$languages = array();
$languages[''] = '---- wersja językowa ----';
$languages[''] = '---- wersja językowa ----';
if (is_array($this->languages))
foreach ($this->languages as $lg_tmp)
{
@@ -65,7 +65,7 @@ ob_start();
<?=
\Html::select(
array(
'label' => 'Wyświetlaj treść z wersji',
'label' => 'Wyświetlaj treść z wersji',
'name' => 'copy_from[' . $lg['id'] . ']',
'values' => $languages,
'value' => $this->product['languages'][$lg['id']]['copy_from'],
@@ -86,7 +86,7 @@ ob_start();
<?=
\Html::input(
array(
'label' => 'Komunikat gdy stan magazynowy równy 0',
'label' => 'Komunikat gdy stan magazynowy rĂłwny 0',
'name' => 'warehouse_message_zero[' . $lg['id'] . ']',
'id' => 'warehouse_message_zero_' . $lg['id'],
'value' => $this->product['languages'][$lg['id']]['warehouse_message_zero'],
@@ -97,7 +97,7 @@ ob_start();
<?=
\Html::input(
array(
'label' => 'Komunikat gdy stan magazynowy większy niż 0',
'label' => 'Komunikat gdy stan magazynowy większy niż 0',
'name' => 'warehouse_message_nonzero[' . $lg['id'] . ']',
'id' => 'warehouse_message_nonzero_' . $lg['id'],
'value' => $this->product['languages'][$lg['id']]['warehouse_message_nonzero'],
@@ -108,7 +108,7 @@ ob_start();
<?=
\Html::textarea(
array(
'label' => 'Krótki opis',
'label' => 'KrĂłtki opis',
'name' => 'short_description[' . $lg['id'] . ']',
'id' => 'short_description_' . $lg['id'],
'value' => $this->product['languages'][$lg['id']]['short_description'],
@@ -154,7 +154,7 @@ ob_start();
<ul class="resp-tabs-list languages-tabs htabs">
<? if (is_array($this->languages)) : foreach ($this->languages as $lg) : ?>
<? if ($lg['status']) : ?>
<li><? if ($lg['id'] == \front\factory\Languages::default_language()) echo '<i class="fa fa-star fa-lg text-system" title="Język domyślny"></i> '; ?><?= $lg['name']; ?></a></li>
<li><? if ($lg['id'] == \front\factory\Languages::default_language()) echo '<i class="fa fa-star fa-lg text-system" title="Język domyślny"></i> '; ?><?= $lg['name']; ?></a></li>
<? endif; ?>
<?
endforeach;
@@ -166,7 +166,7 @@ ob_start();
<?
$languages = array();
$languages[''] = '---- wersja językowa ----';
$languages[''] = '---- wersja językowa ----';
if (is_array($this->languages))
foreach ($this->languages as $lg_tmp)
{
@@ -179,7 +179,7 @@ ob_start();
<?=
\Html::input(
array(
'label' => 'Nazwa zakładki (1)',
'label' => 'Nazwa zakładki (1)',
'name' => 'tab_name_1[' . $lg['id'] . ']',
'id' => 'tab_name_1_' . $lg['id'],
'value' => $this->product['languages'][$lg['id']]['tab_name_1'],
@@ -190,7 +190,7 @@ ob_start();
<?=
\Html::textarea(
array(
'label' => 'Zawartość zakładki (1)',
'label' => 'Zawartość zakładki (1)',
'name' => 'tab_description_1[' . $lg['id'] . ']',
'id' => 'tab_description_1_' . $lg['id'],
'value' => $this->product['languages'][$lg['id']]['tab_description_1'],
@@ -201,7 +201,7 @@ ob_start();
<?=
\Html::input(
array(
'label' => 'Nazwa zakładki (2)',
'label' => 'Nazwa zakładki (2)',
'name' => 'tab_name_2[' . $lg['id'] . ']',
'id' => 'tab_name_2_' . $lg['id'],
'value' => $this->product['languages'][$lg['id']]['tab_name_2'],
@@ -212,7 +212,7 @@ ob_start();
<?=
\Html::textarea(
array(
'label' => 'Zawartość zakładki (2)',
'label' => 'Zawartość zakładki (2)',
'name' => 'tab_description_2[' . $lg['id'] . ']',
'id' => 'tab_description_2_' . $lg['id'],
'value' => $this->product['languages'][$lg['id']]['tab_description_2'],
@@ -305,7 +305,7 @@ ob_start();
?>
<?
$units[] = '--- wybierze jednostkę miary ---';
$units[] = '--- wybierze jednostkÄ™ miary ---';
foreach ($this->units as $unit)
$units[$unit['id']] = $unit['text'];
?>
@@ -317,7 +317,7 @@ ob_start();
'value' => $this->product['product_unit_id']
]); ?>
<?= \Html::input([
'label' => 'Waga/pojemność',
'label' => 'Waga/pojemność',
'name' => 'weight',
'id' => 'weight',
'class' => 'number-format',
@@ -336,14 +336,14 @@ ob_start();
?>
<?=
\Html::input_switch([
'label' => 'Pozwól zamawiać gdy stan 0',
'label' => 'Pozwól zamawiać gdy stan 0',
'name' => 'stock_0_buy',
'checked' => $this->product['stock_0_buy'] == 1 ? true : false
]);
?>
<?=
\Html::input([
'label' => 'Współczynnik WP',
'label' => 'Współczynnik WP',
'name' => 'wp',
'id' => 'wp',
'class' => 'number-format',
@@ -382,7 +382,7 @@ ob_start();
?>
<?=
\Html::input([
'label' => 'Nowość do dnia',
'label' => 'Nowość do dnia',
'name' => 'new_to_date',
'id' => 'new_to_date',
'class' => 'date',
@@ -390,19 +390,19 @@ ob_start();
]);
?>
<?= \Html::input_switch([
'label' => 'Wyświetlaj pole na dodatkową wiadomość',
'label' => 'Wyświetlaj pole na dodatkową wiadomość',
'name' => 'additional_message',
'checked' => $this->product['additional_message'] == 1 ? true : false
]);
?>
<?= \Html::input_switch([
'label' => 'Dodatkowa wiadomość jest wymagana',
'label' => 'Dodatkowa wiadomość jest wymagana',
'name' => 'additional_message_required',
'checked' => $this->product['additional_message_required'] == 1 ? true : false
]);
?>
<?= \Html::input([
'label' => 'Dodatkowa wiadomość (treść komunikatu)',
'label' => 'Dodatkowa wiadomość (treść komunikatu)',
'name' => 'additional_message_text',
'id' => 'additional_message_text',
'value' => $this->product['additional_message_text']
@@ -414,7 +414,7 @@ ob_start();
<ul class="resp-tabs-list languages-seo htabs">
<? if (is_array($this->languages)) : foreach ($this->languages as $lg) : ?>
<? if ($lg['status']) : ?>
<li><? if ($lg['id'] == \front\factory\Languages::default_language()) echo '<i class="fa fa-star fa-lg text-system" title="Język domyślny"></i> '; ?><?= $lg['name']; ?></li>
<li><? if ($lg['id'] == \front\factory\Languages::default_language()) echo '<i class="fa fa-star fa-lg text-system" title="Język domyślny"></i> '; ?><?= $lg['name']; ?></li>
<? endif; ?>
<?
endforeach;
@@ -481,7 +481,7 @@ ob_start();
</div>
<div>
<?
$layouts[''] = '---- szablon domyślny ----';
$layouts[''] = '---- szablon domyślny ----';
if (is_array($this->layouts)) : foreach ($this->layouts as $layout) :
$layouts[$layout['id']] = $layout['name'];
endforeach;
@@ -497,7 +497,7 @@ ob_start();
]);
?>
<div class="form-group row">
<label class="col-md-4 control-label">Wyświetlaj w:</label>
<label class="col-md-4 control-label">Wyświetlaj w:</label>
<div class="col-md-8">
<div class="menu_sortable">
<ol class="sortable" id="sortable">
@@ -580,7 +580,7 @@ ob_start();
</div>
<div>
<div class="form-group row">
<label class="col-lg-4 control-label">Wybierz zdefiniowany komplet produktów:</label>
<label class="col-lg-4 control-label">Wybierz zdefiniowany komplet produktĂłw:</label>
<div class="col-lg-8">
<select id="set" class="form-control" name="set">
<option value="">wybierz komplet...</option>
@@ -591,9 +591,9 @@ ob_start();
</div>
</div>
<div class="form-group row">
<label class="col-lg-4 control-label">Produkty powiązane:</label>
<label class="col-lg-4 control-label">Produkty powiÄ…zane:</label>
<div class="col-lg-8">
<select id="products_related" multiple name="products_related[]" placeholder="produkty powiązane">
<select id="products_related" multiple name="products_related[]" placeholder="produkty powiÄ…zane">
<option value="">wybierz produkt...</option>
<? foreach ($this->products as $key => $val) : ?>
<? if ($key != $this->product['id']) : ?>
@@ -622,7 +622,7 @@ ob_start();
<? if (is_array($this->languages)) : foreach ($this->languages as $lg) : ?>
<? if ($lg['status']) : ?>
<div id="xml_name_<?= $this->i; ?>_<?= $lg['id']; ?>" class="tab-pane <? if (!$z++) : ?>active<? endif; ?>">
<label class="col-lg-4 control-label">Nazwa produktu XML (150 znaków):</label>
<label class="col-lg-4 control-label">Nazwa produktu XML (150 znakĂłw):</label>
<div class="col-lg-8">
<input type="text" class="form-control" name="xml_name[<?= $lg['id']; ?>]" value="<?= $this->product['languages'][$lg['id']]['xml_name']; ?>">
</div>
@@ -700,7 +700,7 @@ ob_start();
</div>
<div class="form-group row">
<div class="col-sm-12 text-right">
<span class="input-group-addon btn btn-info" onclick="remove_custom_filed( $( this ) );">usuń</span>
<span class="input-group-addon btn btn-info" onclick="remove_custom_filed( $( this ) );">usuń</span>
</div>
</div>
</div>
@@ -724,7 +724,7 @@ ob_start();
<ul class="resp-tabs-list gpsr-seo htabs">
<? if ( is_array( $this -> languages ) ): foreach ( $this -> languages as $lg ):?>
<? if ($lg['status']) : ?>
<li><? if ($lg['id'] == \front\factory\Languages::default_language()) echo '<i class="fa fa-star fa-lg text-system" title="Język domyślny"></i> '; ?><?= $lg['name']; ?></li>
<li><? if ($lg['id'] == \front\factory\Languages::default_language()) echo '<i class="fa fa-star fa-lg text-system" title="Język domyślny"></i> '; ?><?= $lg['name']; ?></li>
<? endif; ?>
<? endforeach; endif; ?>
</ul>
@@ -733,7 +733,7 @@ ob_start();
<? if ( $lg['status'] ):?>
<div>
<?= \Html::textarea( [
'label' => 'Informacje o bezpieczeństwie ('.$lg['name'].')',
'label' => 'Informacje o bezpieczeństwie ('.$lg['name'].')',
'name' => 'security_information[' . $lg['id'] . ']',
'id' => 'security_information_' . $lg['id'],
'value' => $this->product['languages'][$lg['id']]['security_information']
@@ -776,7 +776,7 @@ $grid->actions = [
];
$grid->buttons = [
[
'label' => 'Podgląd',
'label' => 'PodglÄ…d',
'id' => 'product-preview',
'url' => '#',
'icon' => 'fa-search',
@@ -845,7 +845,7 @@ echo $grid->draw();
html += '</div>';
html += '<div class="form-group row">';
html += '<div class="col-sm-12 text-right">';
html += '<span class="input-group-addon btn btn-info" onclick="remove_custom_filed( $( this ) );">usuń</span>';
html += '<span class="input-group-addon btn btn-info" onclick="remove_custom_filed( $( this ) );">usuń</span>';
html += '</div>';
html += '</div>';
html += '</div>';
@@ -1138,8 +1138,8 @@ echo $grid->draw();
$(this).blur();
var file_id = $(this).attr('file_id');
$.prompt('Na pewno chcesz usunąć wybrany plik?', {
title: 'Potwierdź?',
$.prompt('Na pewno chcesz usunąć wybrany plik?', {
title: 'PotwierdĹş?',
submit: function(e, v, m, f) {
if (v === true) {
$.ajax({
@@ -1178,8 +1178,8 @@ echo $grid->draw();
$(this).blur();
var image_id = $(this).attr('image-id');
$.prompt('Na pewno chcesz usunąć wybrane zdjęcie?', {
title: 'Potwierdź?',
$.prompt('Na pewno chcesz usunąć wybrane zdjęcie?', {
title: 'PotwierdĹş?',
submit: function(e, v, m, f) {
if (v === true) {
$.ajax({
@@ -1316,9 +1316,8 @@ echo $grid->draw();
$.ajax({
type: 'POST',
cache: false,
url: '/admin/ajax.php',
url: '/admin/pages/generateSeoLink/',
data: {
a: 'generate_seo_link',
title: title,
article_id: article_id
},
@@ -1346,3 +1345,4 @@ echo $grid->draw();
<script>
CKEDITOR.dtd.$removeEmpty['span'] = false;
</script>