TKSDRResourceResultMetadata Class Reference

A TK View to display a SDRResourceResultMetadata object (metadata from the SDR service). More...

Inheritance diagram for TKSDRResourceResultMetadata:

Inheritance graph
[legend]

List of all members.

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.


Detailed Description

A TK View to display a SDRResourceResultMetadata object (metadata from the SDR service).

Author:
jwsm@shodor.org
Date:
2/25/09

Constructor & Destructor Documentation

TKSDRResourceResultMetadata::__construct ( metadata,
params = array() 
)

Constructor.

Parameters:
$metadata [SDRResourceResultMetadata]: The metadata object to be viewed


Member Function Documentation

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.

Parameters:
$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
Returns:
[string]: The string of imploded values or "none listed" text

TKSDRResourceResultMetadata::mdRow ( tbl,
metadata,
key 
) [protected]

Add one field/value row to the metadata table (display all values for one field).

Parameters:
$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.

Returns:
[string] HTML from rendering, or false if there was an error rendering

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.

Parameters:
$link [string]: The URL
Returns:
[string]: The URL surrounded in an anchor tag


The documentation for this class was generated from the following file:

Generated on Wed Nov 24 02:04:29 2010 for Common by  doxygen 1.5.6