# firebox/1.0.2/Inc/Core/Layouts/public/box.php

FireBox – WooCommerce Popup Builder, Exit Intent Popup, Email Optin &amp; Cart Abandonment, version 1.0.2. 85 lines.

- Page: https://pluginprobe.com/plugins/firebox/1.0.2/code/Inc/Core/Layouts/public/box.php
- Raw: https://pluginprobe.com/plugins/firebox/1.0.2/raw/Inc/Core/Layouts/public/box.php
- Modified: 2021-04-15T09:59:50+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/firebox/1.0.2/code/Inc/Core/Layouts/public/box.php#L10-L20`.

```php
<?php
/**
 * @package         FireBox
 * @version         1.0.2 Free
 * 
 * @author          FirePlugins <info@fireplugins.com>
 * @link            https://www.fireplugins.com
 * @copyright       Copyright © 2021 FirePlugins All Rights Reserved
 * @license         GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later
*/

if (!defined('ABSPATH'))
{
	exit; // Exit if accessed directly.
}
$box = $this->data->get('box', []);
$box = new \FPFramework\Libs\Registry($box);
$params = $this->data->get('params', []);
$params = new \FPFramework\Libs\Registry($params);

$custom_code = $box->get('params.data.customcode', '');
if (is_string($custom_code))
{
	$custom_code = stripslashes($custom_code);
	$custom_code = html_entity_decode($custom_code);
}

$close_button = (int) $box->get('params.data.closebutton.show', '');

$rtl = (int) $box->get('params.data.rtl', 0);

$css = is_string($box->get('params.data.customcss')) ? $box->get('params.data.customcss') : '';

// add responsive CSS
if ($responsive_css = $box->get('params.data.responsive_css', []))
{
	if (isset($responsive_css->tablet) && !empty($responsive_css->tablet))
	{
		$css .= '
@media only screen and (max-width: 768px) {
	.fb-' . esc_attr($box->get('ID')) . ' .fb-dialog { ' . esc_html($responsive_css->tablet) . ' }
}';
	}
	if (isset($responsive_css->mobile) && !empty($responsive_css->mobile))
	{
		$css .= '
@media only screen and (max-width: 468px) {
	.fb-' . esc_attr($box->get('ID')) . ' .fb-dialog { ' . esc_html($responsive_css->mobile) . ' }
}';
	}
}

// render box css at the bottom of the page
if (!empty($css))
{
	add_action( 'wp_footer', function() use ($css, $box) {
		echo '<style type="text/css" class="fb-' . esc_attr($box->get('ID')) . '-style fb-responsive-style">' . wp_strip_all_tags($css) . '</style>';
	}, 100);
}
?>
<div data-id="<?php echo esc_attr($box->get('ID')); ?>" 
	class="fb-inst fb-hide <?php echo esc_attr(implode(' ', (array) $box->get('classes'))); ?>"
	data-options='<?php echo json_encode($box->get('settings')) ?>'
	data-type='<?php echo esc_attr($box->get('params.data.mode')); ?>'
	<?php if (!empty($box->get('styles_container'))) { ?>style="<?php echo esc_attr($box->get('styles_container')); ?>"<?php } ?>
	<?php if ($rtl == 1) { ?>dir="rtl"<?php } ?>>

	<?php if ($close_button == 2) { firebox()->renderer->public->render('closebutton', ['box' => $this->data->get('box', [])]); } ?>

	<div class="fb-dialog <?php echo esc_attr(implode(' ', (array) $box->get('dialog_classes', []))); ?>" style="<?php echo esc_attr($box->get('style')); ?>" role="dialog" tabindex="-1">
		
		<?php if ($close_button == 1) { firebox()->renderer->public->render('closebutton', ['box' => $this->data->get('box', [])]); } ?>

		<div class="fb-container">
			<div class="fb-content">
				<?php
					echo $box->get('post_content');
				?>
			</div>
		</div>
		<?php if (!empty($custom_code)): ?>
		<script type="text/javascript" class="fb-<?php echo esc_attr($box->get('ID')); ?>-custom-code"><?php echo $custom_code; ?></script>
		<?php endif; ?>
	</div>
</div>
```
