FOSSology  4.4.0
Open Source License Compliance by Open Source Software
ajax-filelic.php
Go to the documentation of this file.
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2009-2013 Hewlett-Packard Development Company, L.P.
4 
5  SPDX-License-Identifier: GPL-2.0-only
6 */
23 define("TITLE_AJAX_FILELIC", _("ajax find items by license"));
24 
29 class ajax_filelic extends FO_Plugin
30 {
35  var $Name = "ajax_filelic";
40  var $Title = TITLE_AJAX_FILELIC;
45  var $Version = "1.0";
50  var $Dependency = array();
60  var $NoHTML = 1;
65  var $LoginFlag = 0;
66 
70  function Output()
71  {
72  $nomosagent_pk = GetParm("napk", PARM_INTEGER);
73  $rf_shortname = GetParm("lic", PARM_RAW);
74  $uploadtree_pk = GetParm("item", PARM_INTEGER);
75  $uploadtree_tablename = GetParm("ut", PARM_RAW);
76 
77  $files = Level1WithLicense($nomosagent_pk, $rf_shortname, $uploadtree_pk,
78  false, $uploadtree_tablename);
79  return (count($files) != 0) ? rawurlencode($rf_shortname) .
80  implode(',', array_keys($files)) : '';
81  }
82 }
83 $NewPlugin = new ajax_filelic();
84 $NewPlugin->Initialize();
This is the Plugin class. All plugins should:
Definition: FO_Plugin.php:57
Find uploadtree_pk for a given license.
Output()
Display the loaded menu and plugins.
Level1WithLicense($agent_pk, $rf_shortname, $uploadtree_pk, $PkgsOnly=false, $uploadtree_tablename="uploadtree")
Given an uploadtree_pk, find all the non-artifact, immediate children (uploadtree_pk's) that have lic...
const PARM_INTEGER
Definition: common-parm.php:14
const PARM_RAW
Definition: common-parm.php:22
GetParm($parameterName, $parameterType)
This function will retrieve the variables and check data types.
Definition: common-parm.php:46
#define PLUGIN_DB_READ
Plugin requires read permission on DB.
Definition: libfossology.h:37