<?php

$data = flo_get_global_option_arr('fgt_options');

if (gettype($data) === 'string') {
	$data = json_decode($data, TRUE);
}
//var_dump($data);

$flo_credits_plugin_activated = in_array(
	'flo-footer-credits/flo_footer_credits.php',
	apply_filters('active_plugins', get_option('active_plugins'))
) || is_plugin_active_for_network('flo-footer-credits/flo_footer_credits.php');
$show_copyright_icon = $flo_credits_plugin_activated ? $data['copyrightsShowIcon'] : TRUE;
$show_area = $flo_credits_plugin_activated ? $data['copyrightsAreaShow'] : TRUE;

$copyright_text = flo_get_copyright_year($data['copyrightsNotice']);

?>

<?php if ($show_area) : ?>
	<div class="fgt-copyright" style="
			background-color: <?php echo getStyleKitColor($data['copyrightsBackgroundColor']); ?>;
			color: <?php echo getStyleKitColor($data['copyrightsElementsColor']); ?>;
		">
		<div class="fgt-copyright__notice" data-font="<?php echo $data['copyrightsNoticeFont']; ?>">
			<?php _e($copyright_text, 'flex_gutenberg_theme'); ?>
		</div>


		<?php if ($show_copyright_icon && !$flo_credits_plugin_activated) : ?>
			<a class="fgt-copyright__icon" href="https://flothemes.com" aria-label="Copyright" rel="noreferrer" target="_blank">
				<i class="fgt-icon-flo"></i>
			</a>
			
		<?php endif; ?>
		<?php if ($show_copyright_icon && $flo_credits_plugin_activated) : ?>
			<div class="flo-credits-removal">	
				<?php do_action("flo_footer_credits"); ?>
			</div>
		<?php endif; ?>

		<?php if ($data['copyrightsDisplayScrollToTop']) { ?>
			<div class="fgt-copyright__scroll-to-top">
				<?php if ($data['copyrightsScrollToTopLabel'] !== '') : ?>
					<div class="fgt-copyright__scroll-to-top-label" data-font="<?php echo $data['copyrightsScrollToTopFont']; ?>">
						<?php echo $data['copyrightsScrollToTopLabel']; ?>
					</div>
				<?php endif; ?>
				<i class="fgt-icon-arrow-up"></i>
			</div>
		<?php } ?>
	</div>
<?php endif; ?>