FOSSology  4.4.0
Open Source License Compliance by Open Source Software
MenuHook.php
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2015 Siemens AG
4 
5  SPDX-License-Identifier: GPL-2.0-only
6 */
7 
8 namespace Fossology\Lib\UI;
9 
10 class MenuHook
11 {
16  public static function getAgentPluginNames($hook='Agents')
17  {
18  $maxDepth = 0;
19  $agentList = menu_find($hook, $maxDepth) ?: array();
20  $agentPluginNames = array();
21  if (is_array($agentList)) {
22  foreach ($agentList as $parmAgent) {
23  $agent = plugin_find_id($parmAgent->URI);
24  if (!empty($agent)) {
25  $agentPluginNames[] = $agent;
26  }
27  }
28  }
29  return $agentPluginNames;
30  }
31 }
static getAgentPluginNames($hook='Agents')
Definition: MenuHook.php:16
menu_find($Name, &$MaxDepth, $Menu=NULL)
Given a top-level menu name, find the list of sub-menus below it and max depth of menu.