1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-11 00:54:49 +02:00
This commit is contained in:
camer0n
2025-04-01 12:00:58 -07:00
parent e96ccf7ced
commit a459332e10
3 changed files with 63 additions and 3 deletions

View File

@@ -1956,6 +1956,44 @@ class e107plugin
}
/**
* @TODO @see https://github.com/e107inc/e107/issues/5295
* @param $function
* @param $folder
* @param $tag
* @return array
*/
public function XmlAdminIcons($function, $folder, $tag)
{
$this->log("Running ".__FUNCTION__);
$iconTypes = ['icon', 'iconSmall', 'icon128'];
$ret = [];
if($function === 'install' || $function === 'update')
{
foreach ($tag['link'] as $link)
{
$attrib = $link['@attributes'];
foreach($iconTypes as $key)
{
if(!empty($attrib[$key]) && str_ends_with($attrib[$key], '.png'))
{
$path = e_PLUGIN.$folder."/".$attrib[$key];
$file = basename($path);
}
}
}
}
return $ret;
}
/**
* Returns details of a plugin from the plugin table from it's ID
* @deprecated
@@ -3004,6 +3042,7 @@ class e107plugin
if (varset($plug_vars['adminLinks']))
{
$this->XmlAdminLinks($function, $plug_vars['adminLinks']);
// $this->XmlAdminIcons($function, $plug_vars['adminLinks']); // @TODO
}
if (!empty($plug_vars['siteLinks']))