Skip to content

Commit

Permalink
Remove perRow
Browse files Browse the repository at this point in the history
  • Loading branch information
hamidpeywasti committed Jul 29, 2017
1 parent 0fe0376 commit ee7d70e
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 61 deletions.
28 changes: 8 additions & 20 deletions dca/tl_module.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
$GLOBALS['TL_DCA']['tl_module']['palettes']['product_list'] = '{title_legend},name,headline,type;
{catalog_legend},product_catalogs,product_categories,product_featured,product_detailModule,product_sortBy,numberOfItems,perPage,skipFirst;
{template_legend},product_metaFields,customTpl;
{product_legend},product_template,imgSize,product_perRow,product_Class;
{product_legend},product_template,imgSize,product_list_Class,product_Class;
{protected_legend:hide},protected;
{expert_legend:hide},guests,cssID,space';
$GLOBALS['TL_DCA']['tl_module']['palettes']['product_detail'] = '{title_legend},name,headline,type;
{catalog_legend},product_catalogs;
{template_legend},product_metaFields,customTpl;
{product_legend},product_template;
{related_legend},related_show,related_template,related_imgSize,related_perRow,related_Class;
{related_legend},related_show,related_template,related_imgSize,product_list_Class,related_Class;
{protected_legend:hide},protected;
{expert_legend:hide},guests,cssID,space';

Expand Down Expand Up @@ -103,15 +103,13 @@
'eval' => array('tl_class'=>'w50'),
'sql' => "varchar(64) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_module']['fields']['product_perRow'] = array
$GLOBALS['TL_DCA']['tl_module']['fields']['product_list_Class'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_module']['product_perRow'],
'default' => '4',
'exclude' => true,
'inputType' => 'select',
'options' => array('1','2','3','4','5','6','7','8','9','10','11','12'),
'eval' => array('tl_class'=>'w50'),
'sql' => "varchar(64) NOT NULL default ''"
'label' => &$GLOBALS['TL_LANG']['tl_module']['product_list_Class'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('maxlength'=>128, 'tl_class'=>'w50'),
'sql' => "varchar(255) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_module']['fields']['product_Class'] = array
(
Expand Down Expand Up @@ -148,16 +146,6 @@
'eval' => array('maxlength'=>128, 'tl_class'=>'w50'),
'sql' => "varchar(255) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_module']['fields']['related_perRow'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_module']['related_perRow'],
'default' => '4',
'exclude' => true,
'inputType' => 'select',
'options' => array('1','2','3','4','5','6','7','8','9','10','11','12'),
'eval' => array('tl_class'=>'w50'),
'sql' => "varchar(64) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_module']['fields']['related_imgSize'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_module']['related_imgSize'],
Expand Down
4 changes: 1 addition & 3 deletions languages/en/tl_module.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@
$GLOBALS['TL_LANG']['tl_module']['product_sortBy'] = array('Sort by','Here you can select the sorting fields.');
$GLOBALS['TL_LANG']['tl_module']['product_template'] = array('Product template','Here you can select the product template.');
$GLOBALS['TL_LANG']['tl_module']['product_Class'] = array('Product CSS class','Here you can set one or more classes for products.');
$GLOBALS['TL_LANG']['tl_module']['product_perRow'] = array('Product per row','Here you can set the image dimensions and the resize mode.');
$GLOBALS['TL_LANG']['tl_module']['product_list_Class'] = array('Product list class','Here you can set one or more classes for products list.');
$GLOBALS['TL_LANG']['tl_module']['related_show'] = array('Show related product','Here you can set one or more classes for types.');
$GLOBALS['TL_LANG']['tl_module']['related_template'] = array('Related product template','Here you can select the related product template.');
$GLOBALS['TL_LANG']['tl_module']['related_Class'] = array('Related product CSS class','Here you can set one or more classes for related products.');
$GLOBALS['TL_LANG']['tl_module']['related_imgSize'] = array('Related product image width and height','Here you can set the image dimensions and the resize mode.');
$GLOBALS['TL_LANG']['tl_module']['related_perRow'] = array('Type per row','The number of items per row.');



/**
Expand Down
19 changes: 3 additions & 16 deletions languages/fa/tl_module.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL
*
* last-updated: 2016-01-08T15:43:29+00:00
* last-updated: 2017-07-29T07:20:39+00:00
*/

$GLOBALS['TL_LANG']['tl_module']['all_product'] = 'همه محصولات';
Expand All @@ -24,16 +24,14 @@
$GLOBALS['TL_LANG']['tl_module']['catalogs']['0'] = 'کاتالوگ‌ها';
$GLOBALS['TL_LANG']['tl_module']['catalogs']['1'] = 'لطفا یک یا چند کاتالوگ را انتخاب نمایید.';
$GLOBALS['TL_LANG']['tl_module']['custom'] = 'ترتیب اختصاصی';
$GLOBALS['TL_LANG']['tl_module']['date_asc'] = 'تاریخ (قدیمی‌تر)';
$GLOBALS['TL_LANG']['tl_module']['date_desc'] = 'تاریخ (جدیدتر)';
$GLOBALS['TL_LANG']['tl_module']['date_asc'] = 'تاریخ (جدیدتر)';
$GLOBALS['TL_LANG']['tl_module']['date_desc'] = 'تاریخ (قدیمی‌تر)';
$GLOBALS['TL_LANG']['tl_module']['featured_product'] = 'محصولات ویژه';
$GLOBALS['TL_LANG']['tl_module']['product_Class']['0'] = 'کلاس سی‌اس‌اس محصول';
$GLOBALS['TL_LANG']['tl_module']['product_Class']['1'] = 'اینجا می‌توانید یک یا چند کلاس به محصولات تنظیم کنید.';
$GLOBALS['TL_LANG']['tl_module']['product_detailModule']['0'] = 'ماژول جزئیات محصول';
$GLOBALS['TL_LANG']['tl_module']['product_featured']['0'] = 'محصول ویژه';
$GLOBALS['TL_LANG']['tl_module']['product_legend'] = 'تنظیمات محصول';
$GLOBALS['TL_LANG']['tl_module']['product_perRow']['0'] = 'محصول در هر ردیف';
$GLOBALS['TL_LANG']['tl_module']['product_perRow']['1'] = 'اینجا می‌توانید ابعاد و حالت تغییر اندازه تصویر را تنظیم نمایید.';
$GLOBALS['TL_LANG']['tl_module']['product_sortBy']['0'] = 'مرتب‌سازی';
$GLOBALS['TL_LANG']['tl_module']['product_template']['0'] = 'قالب محصول';
$GLOBALS['TL_LANG']['tl_module']['product_template']['1'] = 'اینجا می‌توانید قالب محصول را انتخاب نمایید.';
Expand All @@ -51,16 +49,5 @@
$GLOBALS['TL_LANG']['tl_module']['related_template']['1'] = 'اینجا می‌توانید قالب محصول مرتبط را انتخاب نمایید.';
$GLOBALS['TL_LANG']['tl_module']['title_asc'] = 'عنوان (الف-ی)';
$GLOBALS['TL_LANG']['tl_module']['title_desc'] = 'عنوان (ی-الف)';
$GLOBALS['TL_LANG']['tl_module']['type_Class']['0'] = 'کلاس سی‌اس‌اس کالای مشابه';
$GLOBALS['TL_LANG']['tl_module']['type_Class']['1'] = 'اینجا می‌توانید یک یا چند کلاس برای کالای مشابه انتخاب نمایید.';
$GLOBALS['TL_LANG']['tl_module']['type_imgSize']['0'] = 'عرض و ارتفاع تصویر کالای مشابه';
$GLOBALS['TL_LANG']['tl_module']['type_imgSize']['1'] = 'اینجا می‌توانید ابعاد و حالت تغییر اندازه تصویر را تنظیم نمایید.';
$GLOBALS['TL_LANG']['tl_module']['type_legend'] = 'تنظیمات انواع کالا';
$GLOBALS['TL_LANG']['tl_module']['type_perRow']['0'] = 'کالای مشابه در هر ردیف';
$GLOBALS['TL_LANG']['tl_module']['type_perRow']['1'] = 'تعداد آیتم‌ها در هر ردیف.';
$GLOBALS['TL_LANG']['tl_module']['type_show']['0'] = 'نمایش کالاهای مشابه';
$GLOBALS['TL_LANG']['tl_module']['type_show']['1'] = 'اینجا می‌توانید یک یا چند کلاس برای کالاهای مشابه تنظیم نمایید.';
$GLOBALS['TL_LANG']['tl_module']['type_template']['0'] = 'قالب نوع‌ها';
$GLOBALS['TL_LANG']['tl_module']['type_template']['1'] = 'اینجا می‌توانید قالب کالای مشابه را انتخاب نمایید.';
$GLOBALS['TL_LANG']['tl_module']['unfeatured_product'] = 'محصولات غیرویژه';

8 changes: 2 additions & 6 deletions library/Respinar/Products/Frontend/Element/ContentProduct.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,9 @@ protected function parseProducts($objProducts, $blnAddCategory=false)
{
$objProduct = $objProducts->current();

$arrProducts[] = $this->parseProduct($objProduct, $blnAddCategory, ((++$count == 1) ? ' first' : '') . (($count == $limit) ? ' last' : '') . ((($count % $this->product_perRow) == 0) ? ' last_col' : '') . ((($count % $this->product_perRow) == 1) ? ' first_col' : ''), $count);
$arrProducts[] = $this->parseProduct($objProduct, $blnAddCategory, ((++$count == 1) ? ' first' : '') . (($count == $limit) ? ' last' : ''), $count);
}

$arrProducts = array_chunk($arrProducts,$this->product_perRow);

return $arrProducts;
}

Expand Down Expand Up @@ -411,11 +409,9 @@ protected function parseRelateds($objProducts, $blnAddCategory=false)
{
$objProduct = $objProducts->current();

$arrProducts[] = $this->parseRelated($objProduct, $blnAddCategory, ((++$count == 1) ? ' first' : '') . (($count == $limit) ? ' last' : '') . ((($count % $this->related_perRow) == 0) ? ' last_col' : '') . ((($count % $this->related_perRow) == 1) ? ' first_col' : ''), $count);
$arrProducts[] = $this->parseRelated($objProduct, $blnAddCategory, ((++$count == 1) ? ' first' : '') . (($count == $limit) ? ' last' : ''), $count);
}

$arrProducts = array_chunk($arrProducts,$this->related_perRow);

return $arrProducts;
}

Expand Down
8 changes: 2 additions & 6 deletions library/Respinar/Products/Frontend/Module/ModuleProduct.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,9 @@ protected function parseProducts($objProducts, $blnAddCategory=false)
{
$objProduct = $objProducts->current();

$arrProducts[] = $this->parseProduct($objProduct, $blnAddCategory, ((++$count == 1) ? ' first' : '') . (($count == $limit) ? ' last' : '') . ((($count % $this->product_perRow) == 0) ? ' last_col' : '') . ((($count % $this->product_perRow) == 1) ? ' first_col' : ''), $count);
$arrProducts[] = $this->parseProduct($objProduct, $blnAddCategory, ((++$count == 1) ? ' first' : '') . (($count == $limit) ? ' last' : ''), $count);
}

$arrProducts = array_chunk($arrProducts,$this->product_perRow);

return $arrProducts;
}

Expand Down Expand Up @@ -411,11 +409,9 @@ protected function parseRelateds($objProducts, $blnAddCategory=false)
{
$objProduct = $objProducts->current();

$arrProducts[] = $this->parseRelated($objProduct, $blnAddCategory, ((++$count == 1) ? ' first' : '') . (($count == $limit) ? ' last' : '') . ((($count % $this->related_perRow) == 0) ? ' last_col' : '') . ((($count % $this->related_perRow) == 1) ? ' first_col' : ''), $count);
$arrProducts[] = $this->parseRelated($objProduct, $blnAddCategory, ((++$count == 1) ? ' first' : '') . (($count == $limit) ? ' last' : ''), $count);
}

$arrProducts = array_chunk($arrProducts,$this->related_perRow);

return $arrProducts;
}

Expand Down
12 changes: 6 additions & 6 deletions templates/modules/mod_product_detail.html5
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

<?php $this->block('content'); ?>

<?php echo $this->product; ?>
<?= $this->product; ?>

<?php if (!empty($this->relateds)): ?>
<div class="relateds">
<h3><?php echo $this->relateds_headline; ?></h3>
<div class="related_list">
<?php foreach($this->relateds as $relateds) { echo '<div class="row">'.implode('', $relateds).'</div>'; } ?>
<div class="relateds_list">
<h3><?= $this->relateds_headline; ?></h3>
<div class="related_list <?= $this->product_list_Class ?>">
<?= implode('', $this->relateds) ?>
</div>
</div>
<?php endif; ?>


<!-- indexer::stop -->
<p class="back"><a href="<?php echo $this->referer; ?>" title="<?php echo $this->back; ?>"><?php echo $this->back; ?></a></p>
<p class="back"><a href="<?= $this->referer; ?>" title="<?= $this->back; ?>"><?= $this->back; ?></a></p>
<!-- indexer::continue -->

<?php $this->endblock(); ?>
8 changes: 4 additions & 4 deletions templates/modules/mod_product_list.html5
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<?php $this->block('content'); ?>

<?php if (empty($this->products)): ?>
<p class="empty"><?php echo $this->empty; ?></p>
<p class="empty"><?= $this->empty; ?></p>
<?php else: ?>
<div class="product_list">
<?php foreach($this->products as $products) { echo '<div class="row">'.implode('', $products).'</div>'; } ?>
<div class="product_list <?= $this->product_list_Class ?>">
<?= implode('', $this->products) ?>
</div>
<?php echo $this->pagination; ?>
<?= $this->pagination; ?>
<?php endif; ?>

<?php $this->endblock(); ?>

0 comments on commit ee7d70e

Please sign in to comment.