# firebox/1.0.13/Inc/Core/Admin/Includes/TopBarNavigation.php

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

- Page: https://pluginprobe.com/plugins/firebox/1.0.13/code/Inc/Core/Admin/Includes/TopBarNavigation.php
- Raw: https://pluginprobe.com/plugins/firebox/1.0.13/raw/Inc/Core/Admin/Includes/TopBarNavigation.php
- Modified: 2022-05-16T15:27:10+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.13/code/Inc/Core/Admin/Includes/TopBarNavigation.php#L10-L20`.

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

namespace FireBox\Core\Admin\Includes;

if (!defined('ABSPATH'))
{
	exit; // Exit if accessed directly.
}

class TopBarNavigation
{
	/**
	 * View Top Bar Items
	 * 
	 * @var  array
	 */
	private $top_bar_items = [];

	public function __construct()
	{
		if (!is_admin())
		{
			return;
		}
		
		// init default top bar items
		$this->initTopBarItems();

		// render top bar
		add_action('firebox/before_main_content', [$this, 'renderTopBar']);
	}

	/**
	 * Renders the Top Bar
	 * 
	 * @return  void
	 */
	public function renderTopBar()
	{
		$payload = [
			'top_bar_items' => $this->top_bar_items
		];

		firebox()->renderer->admin->render('dashboard/TopBarNavigation/top_bar', $payload);
	}

	/**
	 * Sets the top bar default items
	 */
	private function initTopBarItems()
	{
		$default_items = [
			'right' => [
				'items' => [
					[
						'label'	  => 'FPF_HELP',
						'icon'	  => 'dashicons-editor-help',
						'onclick' => 'FPF_Helper.popupWindow("' . FBOX_DOC_URL . '", "mywindow", 500, 650);return false;'
					],
					[
						'label'	  => 'FPF_SETTINGS',
						'icon'	  => 'dashicons-admin-generic',
						'url'	  => admin_url('admin.php?page=firebox-settings')
					]
				]
			]
		];

		$items = apply_filters( 'firebox/filter_top_bar_items', $default_items);

		$this->top_bar_items = $items;
	}
}
```
