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

Common functions for tag. More...

Go to the source code of this file.

Functions

 GetAllTags ($Item, $Recurse=true, $uploadtree_tablename="uploadtree")
 Get all Tags of this uploadtree_pk. More...
 
 Array2SingleSelectTag ($KeyValArray, $SLName="unnamed", $SelectedVal="", $FirstEmpty=false, $SelElt=true, $Options="")
 Build a single choice select pull-down for tagging. More...
 
 TagSelect ($SLName="unnamed", $SelectedVal="", $FirstEmpty=false, $SelElt=true)
 Build a single choice select pulldown for the user to select both a tag. More...
 
 TagFilter (&$UploadtreeRows, $tag_pk, $uploadtree_tablename)
 Given a list of uploadtree recs, remove recs that do not have $tag_pk. More...
 

Detailed Description

Common functions for tag.

Definition in file common-tags.php.

Function Documentation

◆ Array2SingleSelectTag()

Array2SingleSelectTag (   $KeyValArray,
  $SLName = "unnamed",
  $SelectedVal = "",
  $FirstEmpty = false,
  $SelElt = true,
  $Options = "" 
)

Build a single choice select pull-down for tagging.

Parameters
array$KeyValArrayAssoc array. Use key/val pairs for list
string$SLNameSelect list name (default is "unnamed")
string$SelectedValInitially selected value or key, depends on $SelElt
bool$FirstEmptyTrue if the list starts off with an empty choice (default is false)
bool$SelEltTrue (default) if $SelectedVal is a value False if $SelectedVal is a key
string$OptionsOptional select element options
Returns
String of HTML select
Todo:
GetTaggingPerms is commented out due to bug in it

Definition at line 85 of file common-tags.php.

◆ GetAllTags()

GetAllTags (   $Item,
  $Recurse = true,
  $uploadtree_tablename = "uploadtree" 
)

Get all Tags of this uploadtree_pk.

Parameters
int$ItemThe uploadtree_pk
bool$RecurseTo recurse or not
string$uploadtree_tablename
Returns
An array of: tag_pk and tag_name; return empty array: disable tagging on this upload

Definition at line 26 of file common-tags.php.

◆ TagFilter()

TagFilter ( $UploadtreeRows,
  $tag_pk,
  $uploadtree_tablename 
)

Given a list of uploadtree recs, remove recs that do not have $tag_pk.

Parameters
[in,out]array&$UploadtreeRowsThis array may be modified by this function.
int$tag_pk
string$uploadtree_tablename

Definition at line 158 of file common-tags.php.

◆ TagSelect()

TagSelect (   $SLName = "unnamed",
  $SelectedVal = "",
  $FirstEmpty = false,
  $SelElt = true 
)

Build a single choice select pulldown for the user to select both a tag.

Parameters
string$SL_NameSelect list name (default is "unnamed")
string$SL_IDSelect list ID (default is $SL_Name)
bool$SelectedValInitially selected value or key, depends on $SelElt
bool$FirstEmptyTrue if the list starts off with an empty choice (default is false)
Returns
String of html select

Definition at line 119 of file common-tags.php.