FOSSology
4.4.0
Open Source License Compliance by Open Source Software
|
Common function for UI operations. More...
Go to the source code of this file.
Functions | |
Array2SingleSelect ($KeyValArray, $SLName="unnamed", $SelectedVal="", $FirstEmpty=false, $SelElt=true, $Options="", $ReturnKey=true) | |
Build a single choice select pulldown. More... | |
Fatal ($msg, $filenm, $lineno) | |
Write message to stdout and die. More... | |
debugbacktrace () | |
Debug back trace. | |
debugprint ($val, $title) | |
Print debug message. More... | |
HumanSize ( $bytes) | |
Translate a byte number to a proper type, xxx bytes to xxx B/KB/MB/GB/TB/PB. More... | |
HumanDuration (DateInterval $duration) | |
Convert DateInterval to Human readable format. More... | |
GetFileExt ($fname) | |
Get File Extension (text after last period) More... | |
GetArrayVal ($Key, $Arr) | |
Get the value from a array(map) More... | |
HostListOption () | |
Get host list. More... | |
DownloadString2File ($text, $name, $contentType) | |
Send a string to a user as a download file. More... | |
GetUploadtreeTableName ($upload_pk) | |
Get the uploadtree table name for this upload_pk If upload_pk does not exist, return "uploadtree". More... | |
GetUploadName ($upload_pk) | |
Get Upload Name through upload id. More... | |
GetUploadID ($uploadtreeid) | |
Get upload id through uploadtreeid. More... | |
Get1stUploadtreeID ($upload) | |
Get 1st uploadtree id through upload id. More... | |
Convert2BrowserTime ($server_time) | |
Convert the server time to browser time. More... | |
Common function for UI operations.
Definition in file common-ui.php.
Array2SingleSelect | ( | $KeyValArray, | |
$SLName = "unnamed" , |
|||
$SelectedVal = "" , |
|||
$FirstEmpty = false , |
|||
$SelElt = true , |
|||
$Options = "" , |
|||
$ReturnKey = true |
|||
) |
Build a single choice select pulldown.
array | $KeyValArray | Assoc array. Use key/val pairs for list |
string | $SLName | Select list name (default is "unnamed"), |
string | $SelectedVal | Initially selected value or key, depends on $SelElt |
bool | $FirstEmpty | True if the list starts off with an empty choice (default is false) |
bool | $SelElt | True (default) if $SelectedVal is a value False if $SelectedVal is a key |
string | $Options | Optional. Options to add to the select statement. For example, "id=myid onclick= ..." |
bool | $ReturnKey | True (default) return the Key as value, if False return the Value |
Definition at line 32 of file common-ui.php.
Convert2BrowserTime | ( | $server_time | ) |
Convert the server time to browser time.
time | $server_time | to be converted |
Definition at line 312 of file common-ui.php.
debugprint | ( | $val, | |
$title | |||
) |
Print debug message.
mixed | $val | Variable to be printed |
string | $title | Title of the variable |
Definition at line 89 of file common-ui.php.
DownloadString2File | ( | $text, | |
$name, | |||
$contentType | |||
) |
Send a string to a user as a download file.
string | $text | Text to download as file |
string | $name | File name |
string | $contentType | Download file Content-Type |
Definition at line 198 of file common-ui.php.
Fatal | ( | $msg, | |
$filenm, | |||
$lineno | |||
) |
Write message to stdout and die.
string | $msg | Message to write |
string | $filenm | File name (FILE) |
int | $lineno | Line number of the caller (LINE) |
Definition at line 66 of file common-ui.php.
Get1stUploadtreeID | ( | $upload | ) |
Get 1st uploadtree id through upload id.
int | $upload | Upload id |
Definition at line 293 of file common-ui.php.
GetArrayVal | ( | $Key, | |
$Arr | |||
) |
Get the value from a array(map)
mixed | $Key | Key to look |
array | $Arr | Within the Array, you can get value according to the key |
Definition at line 157 of file common-ui.php.
GetFileExt | ( | $fname | ) |
Get File Extension (text after last period)
string | $fname | File name |
Definition at line 142 of file common-ui.php.
GetUploadID | ( | $uploadtreeid | ) |
Get upload id through uploadtreeid.
int | $uploadtreeid | Uploadtree id |
Definition at line 272 of file common-ui.php.
GetUploadName | ( | $upload_pk | ) |
Get Upload Name through upload id.
int | $upload_id | Upload ID |
Definition at line 251 of file common-ui.php.
GetUploadtreeTableName | ( | $upload_pk | ) |
Get the uploadtree table name for this upload_pk If upload_pk does not exist, return "uploadtree".
int | $upload_pk |
Definition at line 233 of file common-ui.php.
HostListOption | ( | ) |
Get host list.
Definition at line 174 of file common-ui.php.
HumanDuration | ( | DateInterval | $duration | ) |
Convert DateInterval to Human readable format.
If DateInterval is more than 1 year, then return years, else return months, else return days. If duration is less than 1 day, then return hours and minutes.
DateInterval | $duration | Duration to convert |
Definition at line 120 of file common-ui.php.
HumanSize | ( | $bytes | ) |
Translate a byte number to a proper type, xxx bytes to xxx B/KB/MB/GB/TB/PB.
int | $bytes | Bytes to be converted |
Definition at line 100 of file common-ui.php.