Public Member Functions | |
__construct ($metadata, $params=array()) | |
Constructor. | |
render () | |
Converts this component (and any children) to HTML. | |
Protected Member Functions | |
formatValues ($key, $values) | |
Convert to string (implode arrays with commas), show "none listed" if empty, or wrap in link if it's a URL. | |
layoutMetadata () | |
Add the TKTable displaying metadata field/value pairs to this object. | |
mdRow ($tbl, $metadata, $key) | |
Add one field/value row to the metadata table (display all values for one field). | |
wrapLink ($link) | |
Turn a URL string into an active link. |
TKSDRResourceResultMetadata::__construct | ( | $ | metadata, | |
$ | params = array() | |||
) |
Constructor.
$metadata | [SDRResourceResultMetadata]: The metadata object to be viewed |
TKSDRResourceResultMetadata::formatValues | ( | $ | key, | |
$ | values | |||
) | [protected] |
Convert to string (implode arrays with commas), show "none listed" if empty, or wrap in link if it's a URL.
This is used to generate the values part of the metadata field/values table.
$key | [string]: The name of the key (so we can act on special types like Urls) | |
$values | [mixed]: A value or list of values (strings) to be formatted |
TKSDRResourceResultMetadata::mdRow | ( | $ | tbl, | |
$ | metadata, | |||
$ | key | |||
) | [protected] |
Add one field/value row to the metadata table (display all values for one field).
$tbl | [TKTable]: The table onto which the row should be added | |
$metadata | [SDRMetadataObj]: The object containing the metadata | |
$key | [string]: The name of the metadata field |
TKSDRResourceResultMetadata::render | ( | ) |
Converts this component (and any children) to HTML.
This will only actually generate the HTML once. If render() has been called before, this will only return the results of the previous render operation.
Reimplemented from TKComponent.
TKSDRResourceResultMetadata::wrapLink | ( | $ | link | ) | [protected] |
Turn a URL string into an active link.
formatValues() calls this if the key is "Url" to make a link. If the class constant NEWTAB is true, the window will open in a new tab.
$link | [string]: The URL |