This commit is contained in:
2024-12-31 11:07:09 +01:00
parent df7915205d
commit e089172b15
1916 changed files with 165422 additions and 271 deletions

View File

@ -0,0 +1,54 @@
<?php
/**
* @author Tassos Marinos <info@tassos.gr>
* @link https://www.tassos.gr
* @copyright Copyright © 2024 Tassos All Rights Reserved
* @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later
* @credits https://github.com/codeigniter4/CodeIgniter4/blob/develop/app/Config/Mimes.php
*/
namespace NRFramework\Notices;
// No direct access
defined('_JEXEC') or die;
use \NRFramework\Extension;
class Helper
{
/**
* Returns the extension details for given element.
*
* @param array $data
* @param string $element
*
* @return array
*/
public static function getExtensionDetails($data, $element)
{
// Return bundle only if its active
if (isset($data['bundle']) && $data['bundle']['active'])
{
return $data['bundle'];
}
$alias = Extension::getExtensionDataFileAlias($element);
// If no license data found for this extension
if (!isset($data[$alias]))
{
// Return the expired bundle information if it exists
if (isset($data['bundle']))
{
return $data['bundle'];
}
// No bundle exists, return nothing
return;
}
// Return the extension's license data details
return $data[$alias];
}
}