Add view classes for articles, banners, languages, menu, newsletter, containers, shop categories, clients, payment methods, products, and search

- Created Articles.php for rendering article views including full articles, miniature lists, and news sections.
- Added Banners.php for handling banner displays.
- Introduced Languages.php for rendering language options.
- Implemented Menu.php for dynamic menu rendering.
- Developed Newsletter.php for newsletter view rendering.
- Created Scontainers.php for rendering specific containers.
- Added ShopCategory.php for category descriptions and product listings.
- Introduced ShopClient.php for managing client-related views such as address editing and order history.
- Implemented ShopPaymentMethod.php for displaying payment methods in the basket.
- Created ShopProduct.php for generating product URLs.
- Added ShopSearch.php for rendering a simple search form.
- Added .htaccess file to enhance security by restricting access to sensitive files and directories.
This commit is contained in:
2026-02-21 23:00:15 +01:00
parent b51244c1d6
commit 3ecbe628dc
435 changed files with 44107 additions and 31270 deletions

View File

@@ -1,19 +1,43 @@
<?
$settings = is_array( $this -> settings ) ? $this -> settings : [];
$apilo_status = is_array( $this -> apilo_status ) ? $this -> apilo_status : [
'is_valid' => false,
'severity' => 'warning',
'message' => 'Brak statusu integracji.',
];
$status_class = 'alert-warning';
if ( isset( $apilo_status['severity'] ) && $apilo_status['severity'] == 'success' ) $status_class = 'alert-success';
if ( isset( $apilo_status['severity'] ) && $apilo_status['severity'] == 'danger' ) $status_class = 'alert-danger';
$status_message = trim( (string)($apilo_status['message'] ?? '') );
if ( $status_message == '' ) $status_message = 'Brak szczegolow statusu integracji.';
$platform_list_raw = isset( $settings['platform-list'] ) ? $settings['platform-list'] : '';
$platform_list = @unserialize( $platform_list_raw );
if ( !is_array( $platform_list ) ) $platform_list = [];
?>
<div class="panel panel-danger">
<div class="panel-heading">
<span class="panel-title">Ustawienia apilo.com</span>
</div>
<div class="panel-body">
<div class="alert <?= $status_class;?> mb15">
<b>Status integracji Apilo:</b> <?= $status_message;?>
</div>
<div class="row">
<div class="col-lg-6">
<div class="form-group mb10">
<label class="col-lg-3 control-label" for="inputDefault">Włącz synchronizację z apilo.com</label>
<label class="col-lg-3 control-label" for="inputDefault">Wlacz synchronizacje z apilo.com</label>
<div class="col-lg-9">
<div class="bs-component">
<div class="input-group">
<select class="form-control" id="enabled" name="enabled">
<option value="">--- wybierz ---</option>
<option value="0" <? if ( !$this -> settings['enabled'] ):?>selected<? endif;?>>nie</option>
<option value="1" <? if ( $this -> settings['enabled'] ):?>selected<? endif;?>>tak</option>
<option value="0" <? if ( !isset($settings['enabled']) || !$settings['enabled'] ):?>selected<? endif;?>>nie</option>
<option value="1" <? if ( isset($settings['enabled']) && $settings['enabled'] ):?>selected<? endif;?>>tak</option>
</select>
<span class="input-group-addon cursor" field-id="enabled">
<i class="fa fa-save"></i>
@@ -22,15 +46,16 @@
</div>
</div>
</div>
<div class="form-group mb10">
<label class="col-lg-3 control-label" for="inputDefault">Włącz synchronizację produktów</label>
<label class="col-lg-3 control-label" for="inputDefault">Wlacz synchronizacje produktow</label>
<div class="col-lg-9">
<div class="bs-component">
<div class="input-group">
<select class="form-control" id="sync_products" name="sync_products">
<option value="">--- wybierz ---</option>
<option value="0" <? if ( !$this -> settings['sync_products'] ):?>selected<? endif;?>>nie</option>
<option value="1" <? if ( $this -> settings['sync_products'] ):?>selected<? endif;?>>tak</option>
<option value="0" <? if ( !isset($settings['sync_products']) || !$settings['sync_products'] ):?>selected<? endif;?>>nie</option>
<option value="1" <? if ( isset($settings['sync_products']) && $settings['sync_products'] ):?>selected<? endif;?>>tak</option>
</select>
<span class="input-group-addon cursor" field-id="sync_products">
<i class="fa fa-save"></i>
@@ -39,15 +64,16 @@
</div>
</div>
</div>
<div class="form-group mb10">
<label class="col-lg-3 control-label" for="inputDefault">Włącz synchronizację zamówień</label>
<label class="col-lg-3 control-label" for="inputDefault">Wlacz synchronizacje zamowien</label>
<div class="col-lg-9">
<div class="bs-component">
<div class="input-group">
<select class="form-control" id="sync_orders" name="sync_orders">
<option value="">--- wybierz ---</option>
<option value="0" <? if ( !$this -> settings['sync_orders'] ):?>selected<? endif;?>>nie</option>
<option value="1" <? if ( $this -> settings['sync_orders'] ):?>selected<? endif;?>>tak</option>
<option value="0" <? if ( !isset($settings['sync_orders']) || !$settings['sync_orders'] ):?>selected<? endif;?>>nie</option>
<option value="1" <? if ( isset($settings['sync_orders']) && $settings['sync_orders'] ):?>selected<? endif;?>>tak</option>
</select>
<span class="input-group-addon cursor" field-id="sync_orders">
<i class="fa fa-save"></i>
@@ -56,12 +82,13 @@
</div>
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label" for="inputDefault">Data rozpoczęcia synchronizacji zamówień</label>
<label class="col-lg-3 control-label" for="inputDefault">Data rozpoczecia synchronizacji zamowien</label>
<div class="col-lg-9">
<div class="bs-component">
<div class="input-group">
<input class="form-control" type="text" id="sync_orders_date_start" name="sync_orders_date_start" placeholder="" value="<?= $this -> settings['sync_orders_date_start'];?>">
<input class="form-control" type="text" id="sync_orders_date_start" name="sync_orders_date_start" value="<?= isset($settings['sync_orders_date_start']) ? $settings['sync_orders_date_start'] : '';?>">
<span class="input-group-addon cursor" field-id="sync_orders_date_start">
<i class="fa fa-save"></i>
</span>
@@ -69,18 +96,20 @@
</div>
</div>
</div>
<div class="form-group mb10">
<label class="col-lg-3 control-label" for="inputDefault">Platforma</label>
<div class="col-lg-9">
<div class="bs-component">
<div class="input-group">
<?
$platform_list = unserialize( $this -> settings['platform-list'] );
?>
<select class="form-control" id="platform-id" name="platform-id">
<option value="">--- wybierz platformę ---</option>
<option value="">--- wybierz platforme ---</option>
<? foreach ( $platform_list as $platform ):?>
<option value="<?= $platform['id'];?>" <? if ( $this -> settings['platform-id'] == $platform['id'] ):?>selected<? endif;?>><?= $platform['name'];?> <?= $platform['description'];?></option>
<? if ( is_array($platform) && isset($platform['id']) ):?>
<option value="<?= $platform['id'];?>" <? if ( isset($settings['platform-id']) && $settings['platform-id'] == $platform['id'] ):?>selected<? endif;?>>
<?= isset($platform['name']) ? $platform['name'] : '';?> <?= isset($platform['description']) ? $platform['description'] : '';?>
</option>
<? endif;?>
<? endforeach;?>
</select>
<span class="input-group-addon cursor" field-id="platform-id">
@@ -90,12 +119,13 @@
</div>
</div>
</div>
<div class="form-group mb10">
<label class="col-lg-3 control-label" for="inputDefault">Client ID</label>
<div class="col-lg-9">
<div class="bs-component">
<div class="input-group">
<input class="form-control" type="text" id="client-id" name="client-id" placeholder="" value="<?= $this -> settings['client-id'];?>">
<input class="form-control" type="text" id="client-id" name="client-id" value="<?= isset($settings['client-id']) ? $settings['client-id'] : '';?>">
<span class="input-group-addon cursor" field-id="client-id">
<i class="fa fa-save"></i>
</span>
@@ -103,12 +133,13 @@
</div>
</div>
</div>
<div class="form-group mb10">
<label class="col-lg-3 control-label" for="inputDefault">Client Secret</label>
<div class="col-lg-9">
<div class="bs-component">
<div class="input-group">
<input class="form-control" type="text" id="client-secret" name="client-secret" placeholder="" value="<?= $this -> settings['client-secret'];?>">
<input class="form-control" type="text" id="client-secret" name="client-secret" value="<?= isset($settings['client-secret']) ? $settings['client-secret'] : '';?>">
<span class="input-group-addon cursor" field-id="client-secret">
<i class="fa fa-save"></i>
</span>
@@ -116,12 +147,13 @@
</div>
</div>
</div>
<div class="form-group mb10">
<label class="col-lg-3 control-label" for="inputDefault">ID cennika</label>
<div class="col-lg-9">
<div class="bs-component">
<div class="input-group">
<input class="form-control" type="text" id="pricelist_id" name="pricelist_id" placeholder="" value="<?= $this -> settings['pricelist_id'];?>">
<input class="form-control" type="text" id="pricelist_id" name="pricelist_id" value="<?= isset($settings['pricelist_id']) ? $settings['pricelist_id'] : '';?>">
<span class="input-group-addon cursor" field-id="pricelist_id">
<i class="fa fa-save"></i>
</span>
@@ -129,86 +161,89 @@
</div>
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label" for="inputDefault">Authorization Code</label>
<div class="col-lg-9">
<div class="bs-component">
<div class="input-group">
<input class="form-control" type="text" id="authorization-code" name="authorization-code" placeholder="" value="<?= $this -> settings['authorization-code'];?>" <? if ( $this -> settings['access-token'] ):?>readonly<? endif;?>>
<? if ( !$this -> settings['access-token'] ):?>
<span class="input-group-addon cursor" field-id="authorization-code">
<i class="fa fa-save"></i>
</span>
<? endif;?>
<input class="form-control" type="text" id="authorization-code" name="authorization-code" value="<?= isset($settings['authorization-code']) ? $settings['authorization-code'] : '';?>">
<span class="input-group-addon cursor" field-id="authorization-code">
<i class="fa fa-save"></i>
</span>
</div>
</div>
</div>
</div>
<? if ( $this -> settings['access-token'] ):?>
<? if ( !empty($settings['access-token']) ):?>
<div class="form-group">
<label class="col-lg-3 control-label" for="inputDefault">Access Token</label>
<div class="col-lg-9">
<div class="bs-component">
<div class="input-group">
<input class="form-control" type="text" id="access-token" name="access-token" placeholder="" value="<?= $this -> settings['access-token'];?>" readonly>
<input class="form-control" type="text" id="access-token" name="access-token" value="<?= $settings['access-token'];?>" readonly>
</div>
</div>
</div>
</div>
<? endif;?>
<? if ( $this -> settings['access-token-expire-at'] ):?>
<? if ( !empty($settings['access-token-expire-at']) ):?>
<div class="form-group">
<label class="col-lg-3 control-label" for="inputDefault">Access Token Expire At</label>
<div class="col-lg-9">
<div class="bs-component">
<div class="input-group">
<input class="form-control" type="text" id="access-token-expire-at" name="access-token-expire-at" placeholder="" value="<?= $this -> settings['access-token-expire-at'];?>" readonly>
<input class="form-control" type="text" id="access-token-expire-at" name="access-token-expire-at" value="<?= $settings['access-token-expire-at'];?>" readonly>
</div>
</div>
</div>
</div>
<? endif;?>
<? if ( $this -> settings['refresh-token'] ):?>
<? if ( !empty($settings['refresh-token']) ):?>
<div class="form-group">
<label class="col-lg-3 control-label" for="inputDefault">Refresh Token</label>
<div class="col-lg-9">
<div class="bs-component">
<div class="input-group">
<input class="form-control" type="text" id="refresh-token" name="refresh-token" placeholder="" value="<?= $this -> settings['refresh-token'];?>" readonly>
<input class="form-control" type="text" id="refresh-token" name="refresh-token" value="<?= $settings['refresh-token'];?>" readonly>
</div>
</div>
</div>
</div>
<? endif;?>
<? if ( $this -> settings['refresh-token-expire-at'] ):?>
<? if ( !empty($settings['refresh-token-expire-at']) ):?>
<div class="form-group">
<label class="col-lg-3 control-label" for="inputDefault">Refresh Token Expire At</label>
<div class="col-lg-9">
<div class="bs-component">
<div class="input-group">
<input class="form-control" type="text" id="refresh-token-expire-at" name="refresh-token-expire-at" placeholder="" value="<?= $this -> settings['refresh-token-expire-at'];?>" readonly>
<input class="form-control" type="text" id="refresh-token-expire-at" name="refresh-token-expire-at" value="<?= $settings['refresh-token-expire-at'];?>" readonly>
</div>
</div>
</div>
</div>
<? endif;?>
</div>
<div class="col-lg-6">
<? if ( !$this -> settings['access-token'] ):?>
<a href="#" class="btn btn-primary btn-block apilo-authorization">Autoryzuj się w apilo.com</a>
<? else:?>
<a href="/admin/integrations/get_payment_types_list/" class="btn btn-primary btn-block">Pobierz listę metod płatności</a>
<a href="/admin/integrations/get_carrier_account_list/" class="btn btn-primary btn-block">Pobierz listę kont przewoźników</a>
<a href="/admin/integrations/get_status_types_list/" class="btn btn-primary btn-block">Pobierz statusy zamówień</a>
<a href="/admin/integrations/get_platform_list/" class="btn btn-primary btn-block">Pobierz listę platform</a>
<? endif;?>
<a href="#" class="btn btn-primary btn-block apilo-authorization"><? if ( !empty($apilo_status['is_valid']) ):?>Ponow autoryzacje w apilo.com<? else:?>Autoryzuj sie w apilo.com<? endif;?></a>
<a href="/admin/integrations/get_payment_types_list/" class="btn btn-primary btn-block">Pobierz liste metod platnosci</a>
<a href="/admin/integrations/get_carrier_account_list/" class="btn btn-primary btn-block">Pobierz liste kont przewoznikow</a>
<a href="/admin/integrations/get_status_types_list/" class="btn btn-primary btn-block">Pobierz statusy zamowien</a>
<a href="/admin/integrations/get_platform_list/" class="btn btn-primary btn-block">Pobierz liste platform</a>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(function() {
$( 'body' ).on( 'click', '.apilo-authorization', function() {
$( 'body' ).on( 'click', '.apilo-authorization', function(e) {
e.preventDefault();
$.ajax({
url: '/admin/integrations/apilo_authorization/',
type: 'POST',
@@ -216,7 +251,12 @@
response = JSON.parse( response );
if ( response.status == 'ok' ) {
location.reload();
} else {
alert( response.msg || 'Autoryzacja nieudana.' );
}
},
error: function() {
alert('Nie udalo sie polaczyc z endpointem autoryzacji.');
}
});
});
@@ -238,10 +278,10 @@
$('#' + field_id).closest('.form-group').addClass('has-success');
setTimeout(function() {
$('#' + field_id).closest('.form-group').removeClass('has-success');
}, 5000);
}, 3000);
}
}
});
})
});
});
</script>
</script>