first commit

This commit is contained in:
2025-03-12 17:06:23 +01:00
commit 2241f7131f
13185 changed files with 1692479 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
<?php if ($app_product_attribute_variant->isPictureType() && $app_product_attribute_variant->getPicturePath()): ?>
<p><img src="<?php echo $app_product_attribute_variant->getPicturePath() ?>" alt="" style="max-height: 50px" /></p>
<?php endif; ?>
<?php echo input_file_tag('app_product_attribute_variant[picture]', array('disabled' => $app_product_attribute_variant->isColorType())); ?>

View File

@@ -0,0 +1,9 @@
<?php
$color = $app_product_attribute_variant->isPictureType() ? '' : $app_product_attribute_variant->getColor();
if (null === $color)
{
$color = 'ffffff';
}
echo st_colorpicker_input_tag('app_product_attribute_variant[color]', $color, array('disabled' => $app_product_attribute_variant->isPictureType()));

View File

@@ -0,0 +1,23 @@
<?php echo select_tag('app_product_attribute_variant[color_type]', options_for_select(appProductAttributeVariant::getTypes(), $app_product_attribute_variant->getType() ? $app_product_attribute_variant->getType() : $related_object->getType())) ?>
<script type="text/javascript">
//<![CDATA[
jQuery(function($) {
$('#app_product_attribute_variant_color_type').change(function() {
var option = this.options[this.selectedIndex];
var color = $('#app_product_attribute_variant_color');
var picture = $('#app_product_attribute_variant_picture');
if (option.value == 'C') {
color.removeAttr('disabled');
if (!color.val()) {
color.val('ffffff');
}
picture.attr('disabled', true);
} else {
color.attr('disabled', true);
picture.removeAttr('disabled');
}
});
});
//]]>
</script>

View File

@@ -0,0 +1,10 @@
<?php
/**
* @var sfWebRequest $sf_request
*/
if ($sf_request->getParameter('category_id') && !$filters)
{
$empty_message = 'Wybrana kategoria nie ma przypisanych atrybutów produktów';
}
include st_admin_get_template_path(__FILE__);

View File

@@ -0,0 +1,26 @@
<div class="header" style="margin-bottom: 15px">
<div class="menu categories">
<ul>
<li class="expandable">
<span>
<img src="<?php echo get_app_icon('stCategory') ?>" alt="<?php echo __('Kategorie', null, 'stBackendMain') ?>">
<span><?php echo __('Kategorie', null, 'stBackendMain') ?></span>
</span>
<?php st_include_component('stCategory', 'tree', array(
'url' => st_url_for('@appProductAttributesPlugin'),
'selected' => $forward_parameters['category_id']
)) ?>
</li>
</ul>
<script type="text/javascript">
jQuery(function($) {
$(".show").click(function() {
$(this).next().next().toggleClass('open');
});
});
</script>
<div class="clr"></div>
</div>
</div>

View File

@@ -0,0 +1,10 @@
<?php
/**
* @var appProductAttributeVariant $app_product_attribute_variant
*/
?>
<?php if ($app_product_attribute_variant->isPictureType() && $app_product_attribute_variant->getPicturePath()): ?>
<p><img src="<?php echo $app_product_attribute_variant->getPicturePath() ?>" alt="" style="max-height: 50px" /></p>
<?php endif; ?>
<?php echo input_file_tag('app_product_attribute_variant[picture]', array('disabled' => $app_product_attribute_variant->isColorType())); ?>

View File

@@ -0,0 +1,5 @@
<?php if ($type == 'edit'): ?>
<?php echo select_tag('app_product_attribute[type]', options_for_select(appProductAttributeHelper::getTypes(), $app_product_attribute->getType()), array('disabled' => !$app_product_attribute->isNew())) ?>
<?php else: ?>
<?php echo appProductAttributeHelper::getLabelByType($app_product_attribute->getType()) ?>
<?php endif ?>

View File

@@ -0,0 +1,10 @@
<?php $url = stAdminGeneratorHelper::generateModelUrl($app_product_attribute_variant, 'appProductAttributeBackend', 'variantEdit', $forward_parameters, false) ?>
<?php if ($app_product_attribute_variant->getType() == 'C'): ?>
<a class="app_product_attribute_variant_preview" href="<?php echo $url ?>" style="background-color: #<?php echo $app_product_attribute_variant->getColor() ?>"></a>
<a href="<?php echo $url ?>"><?php echo $app_product_attribute_variant->getName() ?></a>
<?php elseif ($app_product_attribute_variant->getType() == 'P'): ?>
<a class="app_product_attribute_variant_preview" href="<?php echo $url ?>" style="background-image: url('<?php echo $app_product_attribute_variant->getPicturePath() ?>')"></a>
<a href="<?php echo $url ?>"><?php echo $app_product_attribute_variant->getName() ?></a>
<?php else: ?>
<a href="<?php echo $url ?>"><?php echo $app_product_attribute_variant->getValue() ?></a>
<?php endif ?>

View File

@@ -0,0 +1,41 @@
<?php use_helper('stAdminGenerator', 'appProductAttribute') ?>
<?php st_include_partial('stProduct/header', array(
'related_object' => $product,
'title' => __('Atrybuty'),
'culture' => $product->getCulture(),
'forward_parameters' => $forward_parameters,
)) ?>
<?php st_include_partial('stProduct/edit_menu', array('related_object' => $product, 'forward_parameters' => $forward_parameters)); ?>
<?php st_include_partial('stAdminGenerator/message') ?>
<?php use_stylesheet('backend/appProductAttributeBackend.css') ?>
<?php if ($attributes): ?>
<form class="admin_form" action="<?php echo st_url_for('@appProductAttributesPlugin?action=productAttribute&product_id='.$product->getId().'&culture='.$product->getCulture()) ?>" method="post">
<fieldset>
<?php echo st_admin_get_form_field('app_product_attribute[label]', __('Tytuł'), appProductAttributeHelper::getAttributeLabel($product), 'input_tag', array(
'help' => __('Tytuł wyświetlany jest nad listą atrybutów na stronie karty produktu')
)) ?>
</fieldset>
<fieldset>
<h2><?php echo __('Atrybuty') ?></h2>
<?php foreach ($attributes as $attribute): ?>
<div class="row">
<label for="token-input-app_product_attribute_variant_<?php echo $attribute->getId() ?>"><?php echo $attribute->getName() ?>:</label>
<div class="field">
<?php echo app_product_attribute_variant_tokenizer($attribute, $product) ?>
</div>
<div class="clr"></div>
</div>
<?php endforeach ?>
</fieldset>
<div id="edit_actions"><?php echo st_get_admin_actions(array(array('type' => 'save', 'label' => __('Zapisz', null, 'stAdminGeneratorPlugin')))) ?></div>
</form>
<?php st_include_partial('stProduct/footer') ?>
<script type="text/javascript">
jQuery(function($) {
$(document).ready(function() {
$('#edit_actions').stickyBox();
});
});
</script>
<?php endif ?>