TKSDRResourceResultSet Class Reference

A TK View to display an SDRServiceResult containing a Resource Result Set. More...

Inheritance diagram for TKSDRResourceResultSet:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 __construct ($result, $params=array())
 Create a TK object that displays a resource result set.
 bufferContributorIcons ()
 Look up the list of contributor icons and store their paths in $contributorIcons.
 contributorIconForURL ($url)
 Return a contributor icon that matches this item's URL (or no icon if no match).
 layoutNextPrev ()
 Return a table containing next/previous arrows to be shown with this result.
 layoutPage ()
 Call layout of all subcomponents, and add relevant ones to this component.
 layoutResult ($result, $i)
 Return a nullbox viewing one resource result.
 layoutResults ()
 Return a table containing the list of resource results.
 layoutSearchBox ()
 Return a table allowing the user to revise the search by posting a new search string.
 layoutStatsBox ()
 Return a table showing stats about the search (total num results, current range).
 render ()
 Converts this component (and any children) to HTML.


Detailed Description

A TK View to display an SDRServiceResult containing a Resource Result Set.

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

Constructor & Destructor Documentation

TKSDRResourceResultSet::__construct ( result,
params = array() 
)

Create a TK object that displays a resource result set.

Parameters:
$result [SDRServiceResult]: A result object generated by querying the SDR service using XSI (or a subclass of XSI)
$params [array]: Additional information about how to display this result set


Member Function Documentation

TKSDRResourceResultSet::bufferContributorIcons (  ) 

Look up the list of contributor icons and store their paths in $contributorIcons.

Look up the list of contributor icons in the file system (at the path specified by SConfig option hpcu.contributors). Icons are stored as <domainname.jpg>. Read in a list of these domain names and push them onto the contributorIcons array for use by contributorIconForURL().

TKSDRResourceResultSet::contributorIconForURL ( url  ) 

Return a contributor icon that matches this item's URL (or no icon if no match).

For a given URL, look to see if any of the contributorIcons (named by the domain name of the contributor's website) match part of this URL. If so, format a floating box containing that contributor's icon for display on the page next to the projectContext badge.

Returns:
[string]: The HTML for a right-floating div containing the correct contributor icon

TKSDRResourceResultSet::layoutNextPrev (  ) 

Return a table containing next/previous arrows to be shown with this result.

Returns:
[TKTable]: The TKTable containing next/previous arrows

TKSDRResourceResultSet::layoutResult ( result,
i 
)

Return a nullbox viewing one resource result.

Returns:
[TKNullBox]: The TKNullBox that views one resource result

TKSDRResourceResultSet::layoutResults (  ) 

Return a table containing the list of resource results.

Returns:
[TKTable]: The TKTable with one row for each resource result view

TKSDRResourceResultSet::layoutSearchBox (  ) 

Return a table allowing the user to revise the search by posting a new search string.

Returns:
[TKTable]: The TKTable showing a search box pre-filled with the current search string and assembles the table showing stats about the search (num results, cur range)

TKSDRResourceResultSet::layoutStatsBox (  ) 

Return a table showing stats about the search (total num results, current range).

Returns:
[TKTable]: The TKTable displaying stats about the search

TKSDRResourceResultSet::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.


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