<?php
/*
 * Software Name: Eorisis Pixels
 * Software URI: https://eorisis.com/shop/software/joomla/pixels
 * Author: Eorisis
 * Author URI: https://eorisis.com
 * Copyright: Copyright (C) 2011-2025 EORISIS. All Rights Reserved.
 * License: GNU General Public License version 2; See https://eorisis.com/gpl
 * Terms of Service: https://eorisis.com/tos
 */
namespace com_eorisis_pixels\framework\lib\core\view;
\defined('_JEXEC') or die;

use com_eorisis_pixels\framework\lib\core\model\strip;
use com_eorisis_pixels\framework\lib\core\cms\language as cms_language;

class notifications
{
	public function __construct() {}

	// --------------------------------------------------

	public function get_html(array $notifications) : string
	{
		if (!$notifications)
		{
			return '';
		}

		$html = '<section id="notifications-banner">';
		foreach ($notifications as $key => $notice)
		{
			$html .= '<div id="notification-'.$key.'" class="notification-wrapper">';
			$html .=	'<div class="notification '.$notice['type'].'">';
			$html .=		'<span>'.strip::tags($notice['message'], ['<b>','<h3>','<a>','<br>','<br />']).'</span>';
			$html .=		$notice['show_close'] ? '<div class="close">'.cms_language::text('EO_CLOSE').'</div>' : '';
			$html .=	'</div>';
			$html .= '</div>';
		}
		$html .= '</section>';
		return $html;
	}
}
