| Server IP : 130.225.57.55 / Your IP : 216.73.216.60 Web Server : Apache System : Linux wp-vhost07 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64 User : root ( 0) PHP Version : 8.1.2-1ubuntu2.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /srv/www/reco2st.eu/https/wp-content/themes/erc04961/components/ |
Upload File : |
<?php
class Component_Main_Content {
protected static $params = [
'key' => null
];
public static function get_render( $params = [] ) {
$options = wp_parse_args( $params, self::$params );
ob_start();
$content = $options['key']. '_content';
?>
<?php if (have_rows( $content )) : ?>
<?php while (have_rows( $content )) : the_row();
$vertical_title = get_sub_field('vertical_title');
$main_title = get_sub_field('main_title');
$main_content = get_sub_field('main_content');
$pdf = get_sub_field('pdf');
$selected_media = get_sub_field('video_images');
?>
<section class="main-content" data-animation>
<div class="site__container">
<div class="grid">
<div class="grid__item mob--seven-twelfths push--tab--one-twelfth tab--five-twelfths">
<div class="vertical-title"><?php MOZ_Utils::upper($vertical_title); ?></div>
<?php if ($main_title) : ?>
<h1 class="main-content__title fs-50"><?php echo $main_title; ?></h1>
<?php endif; ?>
</div>
<div class="grid__item mob--five-twelfths push--tab--one-twelfth tab--five-twelfths">
<?php if ($pdf) : ?>
<div class="main-content__pdf">
<a href="<?php echo $pdf; ?>" target="_blank"><?php echo __('Download PDF', ''); ?>
<span><?php MOZ_SVG::svg('arrow'); ?></span></a>
</div>
<?php endif; ?>
</div>
<div class="grid__item push--tab--two-twelfths tab--eight-twelfths">
<?php if ($main_content) : ?>
<div class="main-content__content"><?php echo $main_content; ?></div>
<?php endif; ?>
</div>
<div class="grid__item push--tab--one-twelfth tab--ten-twelfths">
<?php switch ($selected_media) {
case 'video' :
$video_url = get_sub_field('video');
$video_bg = get_sub_field('video_bg');
if ($video_url && $video_bg) : ?>
<div class="main-content__video">
<a class="main-content__video__link" href="<?php echo $video_url; ?>" data-trigger-video>
<span><?php MOZ_SVG::svg('play'); ?></span>
</a>
<div class="main-content__video__bg">
<?php MOZ_Image::background( $video_bg['id'], 'Medium', array(
'large' => '(min-width: 768px)'
), array( 'class' => '' ), array( 'lazy' => false ) ); ?>
</div>
<a href="<?php echo $video_url; ?>" data-trigger-video class="main-content__video__btn"><?php MOZ_Utils::upper(__('Play video', 'erc001')) ?></a>
</div>
<?php endif; ?>
<?php break ;
case 'slider' :
$slider = 'slider';
if (have_rows($slider)) :
$i = 0 ;?>
<div class="main-content__slider">
<div class="main-content__slider__inner" data-main-content-slider>
<?php while (have_rows( $slider )) : the_row();
$image = get_sub_field('image');
$caption = get_sub_field('caption'); ?>
<div class="main-content__slider__item">
<div class="main-content__slider__item__image">
<?php MOZ_Image::background( $image['id'], 'Medium', array(
'large' => '(min-width: 768px)'
), array( 'class' => '' ), array( 'lazy' => false ) ); ?>
<?php /* <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>"/> */ ?>
</div>
<?php if ($caption) : ?>
<div class="main-content__slider__item__caption"><?php echo $caption ?></div>
<?php endif; ?>
</div>
<?php $i++;
endwhile; ?>
</div>
<?php if ($i>1) : ?>
<div class="main-content__slider__controls">
<div class="main-content__slider__prev"><?php MOZ_SVG::svg('arrow'); ?></div>
<div class="main-content__slider__next"><?php MOZ_SVG::svg('arrow'); ?></div>
</div>
<?php endif; ?>
</div>
<?php endif;
break;
default :
break; ?>
<?php } ?>
</div>
</div>
</div>
</section>
<?php endwhile; ?>
<?php endif; ?>
<?php
return ob_get_clean();
}
public static function render( $params = [] ) {
echo self::get_render( $params );
}
}