ver. 0.293: front\controls\Site + front\view\Site → front\App + front\LayoutEngine

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-17 22:21:44 +01:00
parent d14018a5f3
commit 3fd59ffa0d
13 changed files with 83 additions and 38 deletions

View File

@@ -1,9 +1,9 @@
<?php
namespace front\controls;
namespace front;
class Site
class App
{
static public function page_title()
static public function pageTitle()
{
$moduleName = implode( '', array_map( 'ucfirst', explode( '_', \Shared\Helpers\Helpers::get( 'module' ) ) ) );
$action = \Shared\Helpers\Helpers::get( 'action' );
@@ -122,14 +122,14 @@ class Site
/* strona kontaktu */
case 4:
$out = \front\Views\Articles::fullArticlesList( $articlesForPage, $pageArticlesResult['ls'], $bs ?: 1, $page );
$out .= \front\view\Site::contact();
$out .= \front\LayoutEngine::contact();
return $out;
break;
}
}
}
public static function check_url_params()
public static function checkUrlParams()
{
global $lang, $config;
@@ -207,4 +207,3 @@ class Site
];
}
}
?>

View File

@@ -1,8 +1,8 @@
<?php
namespace front\view;
namespace front;
use shop\Product;
class Site
class LayoutEngine
{
const menu_pattern = '/MENU:[0-9]*/';
const menu_main_pattern = '/MENU_GLOWNE:[0-9]*/';
@@ -56,10 +56,10 @@ class Site
}
if ( $settings['facebook_link'] )
$html = str_replace( '</body>', \front\view\Site::facebook( $settings['facebook_link'] ) . '</body>', $html );
$html = str_replace( '</body>', self::facebook( $settings['facebook_link'] ) . '</body>', $html );
$html = str_replace( '[COPYRIGHT]',
\front\view\Site::copyright(),
self::copyright(),
$html );
$html = str_replace( '[BANER_STRONA_GLOWNA]', \front\Views\Banners::mainBanner( $bannerRepo->mainBanner( $lang_id ) ), $html );
@@ -233,7 +233,7 @@ class Site
}
$html = str_replace( '[CANONICAL]', '', $html );
$html = str_replace( '[ZAWARTOSC]', \front\controls\Site::route( $product, $category ), $html );
$html = str_replace( '[ZAWARTOSC]', \front\App::route( $product, $category ), $html );
/* pojedynczy produkt */
preg_match_all( self::single_product_pattern, $html, $single_product_array );
@@ -315,7 +315,7 @@ class Site
$products_id_arr = ( new \Domain\Product\ProductRepository( $GLOBALS['mdb'] ) )->newProductIds( $limit );
foreach ( $products_id_arr as $product_id ){
$top_products_arr[] = Product::getFromCache( (int)$product_id, $lang_id );
}
@@ -412,7 +412,7 @@ class Site
$html = str_replace( $pattern, \front\Views\Articles::newsList( $topArticles ), $html );
}
$html = str_replace( '[ALERT]', \front\view\Site::alert(), $html );
$html = str_replace( '[ALERT]', self::alert(), $html );
preg_match_all( self::container_pattern, $html, $container_list );
if ( is_array( $container_list[0] ) ) foreach( $container_list[0] as $container_list_tmp )
@@ -473,10 +473,9 @@ class Site
return $tpl -> render( 'site/contact' );
}
public static function cookie_information()
public static function cookieInformation()
{
$tpl = new \Shared\Tpl\Tpl;
return $tpl -> render( 'site/cookie-information' );
}
}
?>