FOSSology  4.4.0
Open Source License Compliance by Open Source Software
common-buckets.php File Reference

These are common bucket functions. More...

Go to the source code of this file.

Functions

 SelectBucketDataset ($upload_pk, &$ars_pk, $id="selectbucketdataset", $extra="")
 Return a select list showing all the successful bucket runs on a particular $upload_pk. More...
 
 SelectBucketPool ($selected, $active='Y')
 Return a select list containing all the active bucketpool's. More...
 
 GetFileBuckets ($nomosagent_pk, $bucketagent_pk, $uploadtree_pk, $bucketpool_pk)
 Get all the unique bucket_pk's for a given uploadtree_pk and for a given nomos and bucket agent. More...
 
 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(). More...
 
 BucketInTree ($bucket_pk, $uploadtree_pk)
 Check if a bucket_pk is found in a tree for a given nomos and bucket agent. More...
 
 initBucketDefArray ($bucketpool_pk)
 Initializes array of bucket_def records. More...
 

Detailed Description

These are common bucket functions.


Definition in file common-buckets.php.

Function Documentation

◆ BucketInTree()

BucketInTree (   $bucket_pk,
  $uploadtree_pk 
)

Check if a bucket_pk is found in a tree for a given nomos and bucket agent.

Parameters
int$bucket_pk
int$uploadtree_pk
Returns
True if bucket_pk is found in the tree, false if not

Definition at line 279 of file common-buckets.php.

◆ GetFileBuckets()

GetFileBuckets (   $nomosagent_pk,
  $bucketagent_pk,
  $uploadtree_pk,
  $bucketpool_pk 
)

Get all the unique bucket_pk's for a given uploadtree_pk and for a given nomos and bucket agent.

Parameters
int$nomosagent_pkNomos agent id
int$bucketagent_pkBucket agent id
int$uploadtree_pkFile id in upload tree
int$bucketpool_pkBucket pool id
Returns
Array of unique bucket_pk's, may be empty if no buckets. FATAL if any input is missing

Definition at line 162 of file common-buckets.php.

◆ GetFileBuckets_string()

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().

Parameters
int$nomosagent_pk
int$bucketagent_pk
int$uploadtree_pk
array$bucketDefArrayArray of bucket_def records indexed by bucket_pk see initBucketDefArray().
string$delimiterDelimiter string to use to separate bucket names.
boolean$colorif True, the string is returned as HTML with bucket names color coded.
Returns
string of $delimiter delimited bucket names for the given inputs.

Definition at line 226 of file common-buckets.php.

◆ initBucketDefArray()

initBucketDefArray (   $bucketpool_pk)

Initializes array of bucket_def records.

Parameters
int$bucketpool_pkBucketpool id
Returns
List of bucket def records.

Definition at line 330 of file common-buckets.php.

◆ SelectBucketDataset()

SelectBucketDataset (   $upload_pk,
$ars_pk,
  $id = "selectbucketdataset",
  $extra = "" 
)

Return a select list showing all the successful bucket runs on a particular $upload_pk.

This list can be included in UI's to let the user select which data they wish to view. The most recent results are the default selection.

Parameters
string$upload_pk
string&$ars_pkReturn ars_pk of the selected element, may be zero if there are no data. This is also used to pass in the selected ars_pk.
string$idHTML element id
string$extraExtra info for the select element, e.g. "onclick=..."
Returns
Select string, select value is $ars_pk
If there are no rows to select, $ars_pk is returned 0 and a simple string $NoData is returned;
If there are only 1 row, an empty string is returned, and $ars_pk is set to that row.

Definition at line 34 of file common-buckets.php.

◆ SelectBucketPool()

SelectBucketPool (   $selected,
  $active = 'Y' 
)

Return a select list containing all the active bucketpool's.

Parameters
string$selectedSelected bucketpool_pk
string$active'Y' (default) or 'all'
Returns
String select list
Note
list uses static element id="default_bucketpool_fk" the element name is the same as the id.

Definition at line 121 of file common-buckets.php.