Files
cmsPRO/autoload/front/view/class.Banners.php
2026-02-22 21:59:33 +01:00

36 lines
1.2 KiB
PHP

<?php
namespace front\view;
class Banners
{
public static function banners( $banners )
{
$tpl = new \Tpl;
$tpl -> banners = $banners;
return $tpl -> render( 'banner/banners' );
}
public static function main_banner( $banner )
{
if ( file_exists( 'templates/banner/draw.php' ) and !file_exists( 'templates/banner/main-banner.php' ) )
copy( 'templates/banner/draw.php', 'templates/banner/main-banner.php' );
if ( file_exists( 'templates/banner/draw.php' ) and file_exists( 'templates/banner/main-banner.php' ) )
unlink( 'templates/banner/draw.php' );
if ( file_exists( 'templates_user/banner/draw.php' ) and !file_exists( 'templates_user/banner/main-banner.php' ) )
copy( 'templates_user/banner/draw.php', 'templates_user/banner/main-banner.php' );
if ( file_exists( 'templates_user/banner/draw.php' ) and file_exists( 'templates_user/banner/main-banner.php' ) )
unlink( 'templates_user/banner/draw.php' );
if ( !\S::get_session( 'banner_close' ) && is_array( $banner ) )
{
$tpl = new \Tpl;
$tpl -> banner = $banner;
return $tpl -> render( 'banner/main-banner' );
}
}
}