Files
shopPRO/autoload/front/view/class.ShopCategory.php
Jacek Pyziak 319491975d ver. 0.283: Legacy class cleanup — S, Html, Email, Image, Log, Mobile_Detect → Shared namespace
- Migrate class.S → Shared\Helpers\Helpers (140+ files), remove 12 unused methods
- Migrate class.Html → Shared\Html\Html
- Migrate class.Email → Shared\Email\Email
- Migrate class.Image → Shared\Image\ImageManipulator
- Delete class.Log (unused), class.Mobile_Detect (outdated UA detection)
- Remove grid library loading from admin (index.php, ajax.php)
- Replace gridEdit usage in 10 admin templates with grid-edit-replacement.php
- Fix grid-edit-replacement.php AJAX to send values as JSON (grid.js compat)
- Remove mobile layout conditionals (m_html/m_css/m_js) from Site + LayoutsRepository
- Remove \Log::save_log() calls from OrderAdminService, ShopOrder, Order

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 23:06:06 +01:00

57 lines
1.9 KiB
PHP

<?php
namespace front\view;
class ShopCategory
{
static public function category_description( $category )
{
return \Tpl::view( 'shop-category/category-description', [
'category' => $category
] );
}
static public function category_view( $category, $lang_id, $bs = 1 )
{
global $settings, $page;
if ( !$settings['infinitescroll'] )
{
$results = \front\factory\ShopCategory::category_products( $category, $lang_id, $bs );
if ( $results['ls'] > 1 )
{
$tpl = new \Tpl;
$tpl -> ls = $results['ls'];
$tpl -> bs = $bs ? $bs : 1;
$tpl -> page = $page;
$tpl -> link = $category['language']['seo_link'] ? $url = $category['language']['seo_link'] : $url = 'k-' . $category['id'] . '-' . \Shared\Helpers\Helpers::seo( $category['language']['title'] );
$pager = $tpl -> render( 'site/pager' );
}
return \Tpl::view( 'shop-category/category', [
'category' => $category,
'products' => $results['products'],
'pager' => $pager,
'category_description' => (int)$bs <= 1 ? true : false,
'category_additional_text' => true
] );
}
$products_count = \front\factory\ShopCategory::category_products_count( $category, $lang_id );
return \Tpl::view( 'shop-category/category-infinitescroll', [
'category' => $category,
'products_count' => $products_count,
'category_description' => (int)$bs <= 1 ? true : false,
'category_additional_text' => true
] );
}
public static function categories( $categories, $current_category = 0, $level = 0 )
{
$tpl = new \Tpl;
$tpl -> level = $level;
$tpl -> current_category = $current_category;
$tpl -> categories = $categories;
return $tpl -> render( 'shop-category/categories' );
}
}