FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
ajax-filelic.php
Go to the documentation of this file.
1 <?php
2 /***********************************************************
3  * Copyright (C) 2009-2013 Hewlett-Packard Development Company, L.P.
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * version 2 as published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 ***********************************************************/
18 
35 define("TITLE_AJAX_FILELIC", _("ajax find items by license"));
36 
41 class ajax_filelic extends FO_Plugin
42 {
47  var $Name = "ajax_filelic";
52  var $Title = TITLE_AJAX_FILELIC;
57  var $Version = "1.0";
62  var $Dependency = array();
72  var $NoHTML = 1;
77  var $LoginFlag = 0;
78 
82  function Output()
83  {
84  $nomosagent_pk = GetParm("napk", PARM_INTEGER);
85  $rf_shortname = GetParm("lic", PARM_RAW);
86  $uploadtree_pk = GetParm("item", PARM_INTEGER);
87  $uploadtree_tablename = GetParm("ut", PARM_RAW);
88 
89  $files = Level1WithLicense($nomosagent_pk, $rf_shortname, $uploadtree_pk,
90  false, $uploadtree_tablename);
91  $csv = (count($files) != 0) ? rawurlencode($rf_shortname) .
92  implode(',', array_keys($files)) : '';
93  return $csv;
94  }
95 }
96 $NewPlugin = new ajax_filelic();
97 $NewPlugin->Initialize();
const PARM_RAW
Definition: common-parm.php:33
#define PLUGIN_DB_READ
Plugin requires read permission on DB.
Definition: libfossology.h:49
GetParm($parameterName, $parameterType)
This function will retrieve the variables and check data types.
Definition: common-parm.php:57
const PARM_INTEGER
Definition: common-parm.php:25
This is the Plugin class. All plugins should:
Definition: FO_Plugin.php:67
Level1WithLicense($agent_pk, $rf_shortname, $uploadtree_pk, $PkgsOnly=false, $uploadtree_tablename)
Given an uploadtree_pk, find all the non-artifact, immediate children (uploadtree_pk&#39;s) that have lic...
Output()
Display the loaded menu and plugins.
Find uploadtree_pk for a given license.