FOSSology  4.4.0
Open Source License Compliance by Open Source Software
ui-buckets.php
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2010-2013 Hewlett-Packard Development Company, L.P.
4  SPDX-FileCopyrightText: © 2015 Siemens AG
5 
6  SPDX-License-Identifier: GPL-2.0-only
7 */
8 
12 
17 class ui_buckets extends FO_Plugin
18 {
21  function __construct()
22  {
23  $this->Name = "bucketbrowser";
24  $this->Title = _("Bucket Browser");
25  $this->Dependency = array("browse","view");
26  $this->DBaccess = PLUGIN_DB_READ;
27  $this->LoginFlag = 0;
28  parent::__construct();
29  }
30 
35  function Install()
36  {
37  global $PG_CONN;
38 
39  if (empty($PG_CONN)) {
40  return(1);
41  } /* No DB */
42 
54  /* Check if there is already a bucket pool, if there is
55  * then return because there is nothing to do.
56  */
57  $sql = "SELECT bucketpool_pk FROM bucketpool limit 1";
58  $result = pg_query($PG_CONN, $sql);
59  DBCheckResult($result, $sql, __FILE__, __LINE__);
60  if (pg_num_rows($result) > 0)
61  {
62  pg_free_result($result);
63  return;
64  }
65 
66  /* none exist so create the demo */
67  $DemoPoolName = "GPL Demo bucket pool";
68  $sql = "INSERT INTO bucketpool (bucketpool_name, version, active, description) VALUES ('$DemoPoolName', 1, 'Y', 'Demonstration of a very simple GPL/non-gpl bucket pool')";
69  $result = pg_query($PG_CONN, $sql);
70  DBCheckResult($result, $sql, __FILE__, __LINE__);
71  pg_free_result($result);
72 
73  /* get the bucketpool_pk of the newly inserted record */
74  $sql = "select bucketpool_pk from bucketpool
75  where bucketpool_name='$DemoPoolName' limit 1";
76  $result = pg_query($PG_CONN, $sql);
77  DBCheckResult($result, $sql, __FILE__, __LINE__);
78  $row = pg_fetch_assoc($result);
79  $bucketpool_pk = $row['bucketpool_pk'];
80  pg_free_result($result);
81 
82  /* Insert the bucket_def records */
83  $sql = "INSERT INTO bucketpool (bucketpool_name, version, active, description) VALUES ('$DemoPoolName', 1, 'Y', 'Demonstration of a very simple GPL/non-gpl bucket pool')";
84  $Columns = "bucket_name, bucket_color, bucket_reportorder, bucket_evalorder, bucketpool_fk, bucket_type, bucket_regex, stopon, applies_to";
85  $sql = "INSERT INTO bucket_def ($Columns) VALUES ('GPL Licenses (Demo)', 'orange', 50, 50, $bucketpool_pk, 3, '(affero|gpl)', 'N', 'f');
86  INSERT INTO bucket_def ($Columns) VALUES ('non-gpl (Demo)', 'yellow', 50, 1000, $bucketpool_pk, 99, NULL, 'N', 'f')";
87  $result = pg_query($PG_CONN, $sql);
88  DBCheckResult($result, $sql, __FILE__, __LINE__);
89  pg_free_result($result);
90 
91  return(0);
92  } // Install()
93 
97  function RegisterMenus()
98  {
99  // For all other menus, permit coming back here.
100  $Item = GetParm("item",PARM_INTEGER);
101  $Upload = GetParm("upload",PARM_INTEGER);
102  $bucketpool_pk = GetParm("bp",PARM_INTEGER);
103  if (!empty($Item) && !empty($Upload))
104  {
105  $menuText = "Bucket";
106  $menuPosition = 55;
107  $URI = $this->Name . Traceback_parm_keep(array("format","page","upload","item","bp"));
108  $tooltipText = _("Browse by buckets");
109  $this->microMenu->insert(array(MicroMenu::VIEW_META, MicroMenu::VIEW), $menuText, $menuPosition, $this->getName(), $URI, $tooltipText);
110  if (GetParm("mod",PARM_STRING) == $this->Name)
111  {
112  menu_insert("Browse::Bucket",0);
113  menu_insert("Browse::[BREAK]",100);
114  }
115  else
116  {
117  menu_insert("Browse::Bucket",0,$URI,$tooltipText);
118  }
119  }
120  } // RegisterMenus()
121 
122 
133  function Initialize()
134  {
135  global $_GET;
136 
137  if ($this->State != PLUGIN_STATE_INVALID) {
138  return(1);
139  } // don't re-run
140  if ($this->Name !== "") // Name must be defined
141  {
142  global $Plugins;
143  $this->State=PLUGIN_STATE_VALID;
144  $Plugins[] = $this;
145  }
146 
147  return($this->State == PLUGIN_STATE_VALID);
148  } // Initialize()
149 
150 
159  function ShowUploadHist($Uploadtree_pk,$Uri)
160  {
161  global $PG_CONN;
162 
163  $VF=""; // return values for file listing
164  $VLic=""; // return values for output
165  $V=""; // total return value
166  $UniqueTagArray = array();
167  global $Plugins;
168 
169  $ModLicView = &$Plugins[plugin_find_id("view-license")];
170 
171  /******* Get Bucket names and counts ******/
172  /* Find lft and rgt bounds for this $Uploadtree_pk */
173  $sql = "SELECT lft,rgt,upload_fk FROM $this->uploadtree_tablename
174  WHERE uploadtree_pk = $Uploadtree_pk";
175  $result = pg_query($PG_CONN, $sql);
176  DBCheckResult($result, $sql, __FILE__, __LINE__);
177  if (pg_num_rows($result) < 1)
178  {
179  pg_free_result($result);
180  $text = _("Invalid URL, nonexistant item");
181  return "<h2>$text $Uploadtree_pk</h2>";
182  }
183  $row = pg_fetch_assoc($result);
184  $lft = $row["lft"];
185  $rgt = $row["rgt"];
186  $upload_pk = $row["upload_fk"];
187  pg_free_result($result);
188 
189  /* Get the ars_pk of the scan to display, also the select list */
190  $ars_pk = GetArrayVal("ars", $_GET);
191  $BucketSelect = SelectBucketDataset($upload_pk, $ars_pk, "selectbdata",
192  "onchange=\"addArsGo('newds','selectbdata');\"");
193  if ($ars_pk == 0)
194  {
195  /* No bucket data for this upload */
196  return $BucketSelect;
197  }
198 
199  /* Get scan keys */
200  $sql = "select agent_fk, nomosagent_fk, bucketpool_fk from bucket_ars where ars_pk=$ars_pk";
201  $result = pg_query($PG_CONN, $sql);
202  DBCheckResult($result, $sql, __FILE__, __LINE__);
203  $row = pg_fetch_assoc($result);
204  $bucketagent_pk = $row["agent_fk"];
205  $nomosagent_pk = $row["nomosagent_fk"];
206  $bucketpool_pk = $row["bucketpool_fk"];
207  pg_free_result($result);
208 
209  /* Create bucketDefArray as individual query this is MUCH faster
210  than incorporating it with a join in the following queries.
211  */
212  $bucketDefArray = initBucketDefArray($bucketpool_pk);
213 
214  /*select all the buckets for entire tree for this bucketpool */
215  $sql = "SELECT distinct(bucket_fk) as bucket_pk,
216  count(bucket_fk) as bucketcount, bucket_reportorder
217  from bucket_file, bucket_def,
218  (SELECT distinct(pfile_fk) as PF from $this->uploadtree_tablename
219  where upload_fk=$upload_pk
220  and ((ufile_mode & (1<<28))=0)
221  and ((ufile_mode & (1<<29))=0)
222  and $this->uploadtree_tablename.lft BETWEEN $lft and $rgt) as SS
223  where PF=pfile_fk and agent_fk=$bucketagent_pk
224  and bucket_file.nomosagent_fk=$nomosagent_pk
225  and bucket_pk=bucket_fk
226  and bucketpool_fk=$bucketpool_pk
227  group by bucket_fk,bucket_reportorder
228  order by bucket_reportorder asc";
229  $result = pg_query($PG_CONN, $sql);
230  DBCheckResult($result, $sql, __FILE__, __LINE__);
231  $historows = pg_fetch_all($result);
232  pg_free_result($result);
233 
234  /* Show dataset list */
235  if (!empty($BucketSelect))
236  {
237  $action = Traceback_uri() . "?mod=bucketbrowser&upload=$upload_pk&item=$Uploadtree_pk";
238 
239  $VLic .= "<script type='text/javascript'>
240 function addArsGo(formid, selectid )
241 {
242 var selectobj = document.getElementById(selectid);
243 var ars_pk = selectobj.options[selectobj.selectedIndex].value;
244 document.getElementById(formid).action='$action'+'&ars='+ars_pk;
245 document.getElementById(formid).submit();
246 return;
247 }
248 </script>";
249 
250  /* form to select new dataset (ars_pk) */
251  $VLic .= "<form action='$action' id='newds' method='POST'>\n";
252  $VLic .= $BucketSelect;
253  $VLic .= "</form>";
254  }
255 
256  $sql = "select bucketpool_name, version from bucketpool where bucketpool_pk=$bucketpool_pk";
257  $result = pg_query($PG_CONN, $sql);
258  DBCheckResult($result, $sql, __FILE__, __LINE__);
259  $row = pg_fetch_assoc($result);
260  $bucketpool_name = $row['bucketpool_name'];
261  $bucketpool_version = $row['version'];
262  pg_free_result($result);
263 
264  /* Write bucket histogram to $VLic */
265  $bucketcount = 0;
266  $Uniquebucketcount = 0;
267  $NoLicFound = 0;
268  if (is_array($historows))
269  {
270  $text = _("Bucket Pool");
271  $VLic .= "$text: $bucketpool_name v$bucketpool_version<br>";
272  $VLic .= "<table border=1 width='100%'>\n";
273  $text = _("Count");
274  $VLic .= "<tr><th width='10%'>$text</th>";
275  $text = _("Files");
276  $VLic .= "<th width='10%'>$text</th>";
277  $text = _("Bucket");
278  $VLic .= "<th align='left'>$text</th></tr>\n";
279 
280  foreach($historows as $bucketrow)
281  {
282  $Uniquebucketcount++;
283  $bucket_pk = $bucketrow['bucket_pk'];
284  $bucketcount = $bucketrow['bucketcount'];
285  $bucket_name = $bucketDefArray[$bucket_pk]['bucket_name'];
286  $bucket_color = $bucketDefArray[$bucket_pk]['bucket_color'];
287 
288  /* Count */
289  $VLic .= "<tr><td align='right' style='background-color:$bucket_color'>$bucketcount</td>";
290 
291  /* Show */
292  $VLic .= "<td align='center'><a href='";
293  $VLic .= Traceback_uri();
294  $text = _("Show");
295  $VLic .= "?mod=list_bucket_files&bapk=$bucketagent_pk&item=$Uploadtree_pk&bpk=$bucket_pk&bp=$bucketpool_pk&napk=$nomosagent_pk" . "'>$text</a></td>";
296 
297  /* Bucket name */
298  $VLic .= "<td align='left'>";
299  $VLic .= "<a id='$bucket_pk' onclick='FileColor_Get(\"" . Traceback_uri() . "?mod=ajax_filebucket&bapk=$bucketagent_pk&item=$Uploadtree_pk&bucket_pk=$bucket_pk\")'";
300  $VLic .= ">$bucket_name </a>";
301 
302  /* Allow users to tag an entire bucket */
303 /* Future, maybe v 2.1
304  $TagHref = "<a href=" . Traceback_uri() . "?mod=bucketbrowser&upload=$upload_pk&item=$Uploadtree_pk&bapk=$bucketagent_pk&bpk=$bucket_pk&bp=$bucketpool_pk&napk=$nomosagent_pk&tagbucket=1>Tag</a>";
305  $VLic .= " [$TagHref]";
306 */
307 
308  $VLic .= "</td>";
309  $VLic .= "</tr>\n";
310  // if ($row['bucket_name'] == "No Buckets Found") $NoLicFound = $row['bucketcount'];
311  }
312  $VLic .= "</table>\n";
313  $VLic .= "<p>\n";
314  $text = _("Unique buckets");
315  $VLic .= "$text: $Uniquebucketcount<br>\n";
316  }
317 
318 
319  /******* File Listing ************/
320  /* Get ALL the items under this Uploadtree_pk */
321  $Children = GetNonArtifactChildren($Uploadtree_pk, $this->uploadtree_tablename);
322 
323  if (count($Children) == 0)
324  {
325  $sql = "SELECT * FROM $this->uploadtree_tablename WHERE uploadtree_pk = '$Uploadtree_pk'";
326  $result = pg_query($PG_CONN, $sql);
327  DBCheckResult($result, $sql, __FILE__, __LINE__);
328  $row = pg_fetch_assoc($result);
329  pg_free_result($result);
330  if (empty($row) || (IsDir($row['ufile_mode']))) {
331  return;
332  }
333  // $ModLicView = &$Plugins[plugin_find_id("view-license")];
334  // return($ModLicView->Output() );
335  }
336  $ChildCount=0;
337  $Childbucketcount=0;
338 
339  /* Countd disabled until we know we need them
340  $NumSrcPackages = 0;
341  $NumBinPackages = 0;
342  $NumBinNoSrcPackages = 0;
343  */
344 
345  /* get mimetypes for packages */
346  $MimetypeArray = GetPkgMimetypes();
347 
348  $VF .= "<table border=0>";
349  foreach($Children as $C)
350  {
351  if (empty($C)) {
352  continue;
353  }
354 
355  /* update package counts */
356  /* This is an expensive count. Comment out until we know we really need it
357  IncrSrcBinCounts($C, $MimetypeArray, $NumSrcPackages, $NumBinPackages, $NumBinNoSrcPackages);
358  */
359 
360  $IsDir = Isdir($C['ufile_mode']);
361  $IsContainer = Iscontainer($C['ufile_mode']);
362 
363  /* Determine the hyperlink for non-containers to view-license */
364  if (!empty($C['pfile_fk']) && !empty($ModLicView))
365  {
366  $LinkUri = Traceback_uri();
367  $LinkUri .= "?mod=view-license&napk=$nomosagent_pk&bapk=$bucketagent_pk&upload=$upload_pk&item=$C[uploadtree_pk]";
368  }
369  else
370  {
371  $LinkUri = NULL;
372  }
373 
374  /* Determine link for containers */
375  if (Iscontainer($C['ufile_mode']))
376  {
377  $uploadtree_pk = DirGetNonArtifact($C['uploadtree_pk'], $this->uploadtree_tablename);
378  $tmpuri = "?mod=" . $this->Name . Traceback_parm_keep(array("upload","folder","ars"));
379  $LicUri = "$tmpuri&item=" . $uploadtree_pk;
380  }
381  else
382  {
383  $LicUri = NULL;
384  }
385 
386  /* Populate the output ($VF) - file list */
387  /* id of each element is its uploadtree_pk */
388  $VF .= "<tr><td id='$C[uploadtree_pk]' align='left'>";
389  $HasHref=0;
390  $HasBold=0;
391  if ($IsContainer)
392  {
393  $VF .= "<a href='$LicUri'>"; $HasHref=1;
394  $VF .= "<b>"; $HasBold=1;
395  }
396  else if (!empty($LinkUri))
397  {
398  $VF .= "<a href='$LinkUri'>"; $HasHref=1;
399  }
400  $VF .= $C['ufile_name'];
401  if ($IsDir) {
402  $VF .= "/";
403  }
404  if ($HasBold) {
405  $VF .= "</b>";
406  }
407  if ($HasHref) {
408  $VF .= "</a>";
409  }
410 
411  /* print buckets */
412  $VF .= "<br>";
413  $VF .= "<span style='position:relative;left:1em'>";
414  /* get color coded string of bucket names */
415  $VF .= GetFileBuckets_string($nomosagent_pk, $bucketagent_pk, $C['uploadtree_pk'],
416  $bucketDefArray, ",", True);
417  $VF .= "</span>";
418  $VF .= "</td><td valign='top'>";
419 
420  /* display item links */
421  $VF .= FileListLinks($C['upload_fk'], $C['uploadtree_pk'], $nomosagent_pk, $C['pfile_fk'], True, $UniqueTagArray, $this->uploadtree_tablename);
422  $VF .= "</td>";
423  $VF .= "</tr>\n";
424 
425  $ChildCount++;
426  }
427  $VF .= "</table>\n";
428 
429  $V .= ActiveHTTPscript("FileColor");
430 
431  /* Add javascript for color highlighting
432  This is the response script needed by ActiveHTTPscript
433  responseText is bucket_pk',' followed by a comma seperated list of uploadtree_pk's */
434  $script = "
435  <script type=\"text/javascript\" charset=\"utf-8\">
436  var Lastutpks=''; /* save last list of uploadtree_pk's */
437  var Lastbupk=''; /* save last bucket_pk */
438  var color = '#4bfe78';
439  function FileColor_Reply()
440  {
441  if ((FileColor.readyState==4) && (FileColor.status==200))
442  {
443  /* remove previous highlighting */
444  var numpks = Lastutpks.length;
445  if (numpks > 0) document.getElementById(Lastbupk).style.backgroundColor='white';
446  while (numpks)
447  {
448  document.getElementById(Lastutpks[--numpks]).style.backgroundColor='white';
449  }
450 
451  utpklist = FileColor.responseText.split(',');
452  Lastbupk = utpklist.shift();
453  numpks = utpklist.length;
454  Lastutpks = utpklist;
455 
456  /* apply new highlighting */
457  elt = document.getElementById(Lastbupk);
458  if (elt != null) elt.style.backgroundColor=color;
459  while (numpks)
460  {
461  document.getElementById(utpklist[--numpks]).style.backgroundColor=color;
462  }
463  }
464  return;
465  }
466  </script>
467  ";
468  $V .= $script;
469 
470  /* Display source, binary, and binary missing source package counts */
471  /* Counts disabled above until we know we need these
472  $VLic .= "<ul>";
473  $text = _("source packages");
474  $VLic .= "<li> $NumSrcPackages $text";
475  $text = _("binary packages");
476  $VLic .= "<li> $NumBinPackages $text";
477  $text = _("binary packages with no source package");
478  $VLic .= "<li> $NumBinNoSrcPackages $text";
479  $VLic .= "</ul>";
480  */
481 
482  /* Combine VF and VLic */
483  $V .= "<table border=0 width='100%'>\n";
484  $V .= "<tr><td valign='top' width='50%'>$VLic</td><td valign='top'>$VF</td></tr>\n";
485  $V .= "</table>\n";
486  $V .= "<hr />\n";
487 
488  return($V);
489  } // ShowUploadHist()
490 
491 
501  function TagBucket($upload_pk, $uploadtree_pk, $bucketagent_pk, $bucket_pk, $bucketpool_pk, $nomosagent_pk)
502  {
503  } // TagBucket()
504 
505 
510  public function Output()
511  {
512  $uTime = microtime(true);
513  $V="";
514  $Upload = GetParm("upload",PARM_INTEGER);
516  $uploadDao = $GLOBALS['container']->get('dao.upload');
517  if ( !$uploadDao->isAccessible($Upload, Auth::getGroupId()) )
518  {
519  $text = _("Permission Denied");
520  return "<h2>$text</h2>";
521  }
522 
523  $Item = GetParm("item",PARM_INTEGER);
524  if ( !$Item)
525  {
526  return _('No item selected');
527  }
528  $updcache = GetParm("updcache",PARM_INTEGER);
529  $tagbucket = GetParm("tagbucket",PARM_INTEGER);
530 
532 
533  /* Remove "updcache" from the GET args and set $this->UpdCache
534  * This way all the url's based on the input args won't be
535  * polluted with updcache
536  * Use Traceback_parm_keep to ensure that all parameters are in order
537  */
538  $CacheKey = "?mod=" . $this->Name . Traceback_parm_keep(array("upload","item","folder","ars")) ;
539  if ($updcache)
540  {
541  $_SERVER['REQUEST_URI'] = preg_replace("/&updcache=[0-9]*/","",$_SERVER['REQUEST_URI']);
542  unset($_GET['updcache']);
543  $V = ReportCachePurgeByKey($CacheKey);
544  }
545  else
546  {
547  $V = ReportCacheGet($CacheKey);
548  }
549 
550  if (!empty($tagbucket))
551  {
552  $bucketagent_pk = GetParm("bapk",PARM_INTEGER);
553  $bucket_pk = GetParm("bpk",PARM_INTEGER);
554  $bucketpool_pk = GetParm("bp",PARM_INTEGER);
555  $nomosagent_pk = GetParm("napk",PARM_INTEGER);
556  $this->TagBucket($Upload, $Item, $bucketagent_pk, $bucket_pk, $bucketpool_pk, $nomosagent_pk);
557  }
558 
559  $Cached = !empty($V);
560  if(!$Cached)
561  {
562  $V .= "<font class='text'>\n";
563 
564  $Children = GetNonArtifactChildren($Item, $this->uploadtree_tablename);
565  if (count($Children) == 0) // no children, display View-Meta micromenu
566  $V .= Dir2Browse($this->Name,$Item,NULL,1,"View-Meta", -1, '', '', $this->uploadtree_tablename) . "<P />\n";
567  else // has children, display Browse micormenu
568  $V .= Dir2Browse($this->Name,$Item,NULL,1,"Browse", -1, '', '', $this->uploadtree_tablename) . "<P />\n";
569 
570  if (!empty($Upload))
571  {
572  $Uri = preg_replace("/&item=([0-9]*)/","",Traceback());
573  $V .= $this->ShowUploadHist($Item,$Uri);
574  }
575  $V .= "</font>\n";
576  $text = _("Loading...");
577  }
578 
579  $Time = microtime(true) - $uTime; // convert usecs to secs
580  $text = _("Elapsed time: %.2f seconds");
581  $V .= sprintf( "<p><small>$text</small>", $Time);
582 
583  if ($Cached){
584  $text = _("cached");
585  $text1 = _("Update");
586  echo " <i>$text</i> <a href=\"$_SERVER[REQUEST_URI]&updcache=1\"> $text1 </a>";
587  }
588  else if ($Time > 0.5)
589  {
590  ReportCachePut($CacheKey, $V);
591  }
592  return $V;
593  }
594 
595 }
596 
597 $NewPlugin = new ui_buckets;
598 $NewPlugin->Initialize();
char * uploadtree_tablename
upload.uploadtree_tablename
Definition: adj2nest.c:100
This is the Plugin class. All plugins should:
Definition: FO_Plugin.php:57
Output()
This function is called when user output is requested. This function is responsible for content....
Definition: FO_Plugin.php:399
Contains the constants and helpers for authentication of user.
Definition: Auth.php:24
Definition: state.hpp:16
$uploadtree_tablename
Definition: ui-buckets.php:19
TagBucket($upload_pk, $uploadtree_pk, $bucketagent_pk, $bucket_pk, $bucketpool_pk, $nomosagent_pk)
Tag a bucket.
Definition: ui-buckets.php:501
RegisterMenus()
Customize submenus.
Definition: ui-buckets.php:97
__construct()
base constructor. Most plugins will just use this
Definition: ui-buckets.php:21
Install()
Create and configure database tables.
Definition: ui-buckets.php:35
Initialize()
This is called before the plugin is used. It should assume that Install() was already run one time (p...
Definition: ui-buckets.php:133
ShowUploadHist($Uploadtree_pk, $Uri)
Definition: ui-buckets.php:159
ActiveHTTPscript($RequestName, $IncludeScriptTags=1)
Given a function name, create the JavaScript needed for doing the request.
initBucketDefArray($bucketpool_pk)
Initializes array of bucket_def records.
GetFileBuckets_string($nomosagent_pk, $bucketagent_pk, $uploadtree_pk, $bucketDefArray, $delimiter, $color)
Get string of $delimiter delimited bucket names for the given inputs. Args are same as GetFileBuckets...
SelectBucketDataset($upload_pk, &$ars_pk, $id="selectbucketdataset", $extra="")
Return a select list showing all the successful bucket runs on a particular $upload_pk.
ReportCacheGet($CacheKey)
This function is used by Output() to see if the requested report is in the report cache.
ReportCachePut($CacheKey, $CacheValue)
This function is used to write a record to the report cache. If the record already exists,...
ReportCachePurgeByKey($CacheKey)
Purge from the report cache the record with $CacheKey.
DBCheckResult($result, $sql, $filenm, $lineno)
Check the postgres result for unexpected errors. If found, treat them as fatal.
Definition: common-db.php:187
Isdir($mode)
Definition: common-dir.php:20
DirGetNonArtifact($UploadtreePk, $uploadtree_tablename='uploadtree')
Given an artifact directory (uploadtree_pk), return the first non-artifact directory (uploadtree_pk).
Definition: common-dir.php:158
Iscontainer($mode)
Definition: common-dir.php:38
Dir2Browse($Mod, $UploadtreePk, $LinkLast=NULL, $ShowBox=1, $ShowMicro=NULL, $Enumerate=-1, $PreText='', $PostText='', $uploadtree_tablename="uploadtree")
Get an html linked string of a file browse path.
Definition: common-dir.php:263
FileListLinks($upload_fk, $uploadtree_pk, $napk, $pfile_pk, $Recurse=True, &$UniqueTagArray=array(), $uploadtree_tablename="uploadtree", $wantTags=true)
Get list of links: [View][Info][Download]
menu_insert($Path, $LastOrder=0, $URI=NULL, $Title=NULL, $Target=NULL, $HTML=NULL)
Given a Path, order level for the last item, and optional plugin name, insert the menu item.
Traceback_uri()
Get the URI without query to this location.
Definition: common-parm.php:97
const PARM_INTEGER
Definition: common-parm.php:14
Traceback()
Get the URI + query to this location.
Definition: common-parm.php:89
const PARM_STRING
Definition: common-parm.php:18
GetParm($parameterName, $parameterType)
This function will retrieve the variables and check data types.
Definition: common-parm.php:46
Traceback_parm_keep($List)
Create a new URI, keeping only these items.
GetPkgMimetypes()
Get package mimetype.
Definition: common-pkg.php:22
GetArrayVal($Key, $Arr)
Get the value from a array(map)
Definition: common-ui.php:157
FUNCTION char * GetUploadtreeTableName(PGconn *pgConn, int upload_pk)
Get the uploadtree table name for this upload_pk If upload_pk does not exist, return "uploadtree".
Definition: libfossagent.c:414
#define PLUGIN_DB_READ
Plugin requires read permission on DB.
Definition: libfossology.h:37
foreach($Options as $Option=> $OptVal) if(0==$reference_flag &&0==$nomos_flag) $PG_CONN
int IsDir(char *Fname)
Given a filename, is it a directory?
Definition: utils.c:319