dmBridge PHP API
DMResultsTemplateHelper Class Reference
Inheritance diagram for DMResultsTemplateHelper:

Public Member Functions

Protected Member Functions


Detailed Description

A class consisting of helper methods to assist in creating web page templates. These methods are specific to results view and are neither guaranteed nor expected to work in any other view.

This class was called ResultsDraw in dmBridge 1.x.

Author:
Alex Dolski <alex.dolski@unlv.edu> http://www.opensource.org/licenses/mit-license.php

Definition at line 19 of file DMResultsTemplateHelper.php.


Member Function Documentation

DMResultsTemplateHelper::getHtmlFacetsAsUL ( term_cutoff = 0)

Returns an HTML unordered list of facets.

The outer <ul> element has class dmFacetList; the inner <ul> elements have class dmFacet; the facet term <li> elements have class dmFacetTerm; and the facet term count <span> elements have class dmFacetTermCount. If no facets are available, returns null.

Parameters:
intterm_cutoff Omit any more than this number of terms within a facet; 0 = disable
Returns:
string

Definition at line 34 of file DMResultsTemplateHelper.php.

DMResultsTemplateHelper::getHtmlLinkedSuggestion ( )

Returns a search suggestion (e.g.

"Did you mean...") hyperlinked to a search for that suggestion.

Returns:
string|null
Since:
0.5

Definition at line 125 of file DMResultsTemplateHelper.php.

DMResultsTemplateHelper::getHtmlPageLinks ( max_page_links = 10,
page_list_separator = ' ',
current_page_element = 'strong',
first_symbol = '<<', $prev_symbol = '<', $next_symbol = '>', $last_symbol = '>>' 
)
Parameters:
intmax_page_links The maximum number of links (not numbers) allowed
stringpage_list_separator A string that should separate the page links
stringcurrent_page_element The name of the HTML element that should wrap the current page number (without angle brackets)
stringfirst_symbol
stringprev_symbol
stringnext_symbol
stringlast_symbol
Returns:
string
Since:
0.1

Definition at line 153 of file DMResultsTemplateHelper.php.

DMResultsTemplateHelper::getHtmlResults ( view = "grid")

Returns an HTML table element corresponding to the requested results view, specified first by the "view" query string parameter, and last by the $view parameter.

If neither are present, defaults to grid view.

Parameters:
stringview One of "grid," "list," or "tile"
Returns:
string
See also:
getHtmlViewLinks()

Reimplemented in DMObjectResultsTemplateHelper.

Definition at line 272 of file DMResultsTemplateHelper.php.

DMResultsTemplateHelper::getHtmlResultsAsGrid ( )
Since:
0.1

Definition at line 296 of file DMResultsTemplateHelper.php.

Referenced by getHtmlResults().

DMResultsTemplateHelper::getHtmlResultsAsList ( )
Since:
0.1

Definition at line 407 of file DMResultsTemplateHelper.php.

Referenced by getHtmlResults().

DMResultsTemplateHelper::getHtmlResultsAsTiles ( )
Since:
0.1

Definition at line 538 of file DMResultsTemplateHelper.php.

Referenced by getHtmlResults().

DMResultsTemplateHelper::getHtmlSearchTerms ( )
Returns:
Comma-separated, HTML-escaped list of search terms
Since:
0.1

Definition at line 696 of file DMResultsTemplateHelper.php.

DMResultsTemplateHelper::getHtmlSortLinksAsUL ( current_sort_tag = 'strong')

Returns null if fewer than two fields are sortable.

Parameters:
stringcurrent_sort_tag HTML tag without the angle brackets
Returns:
string
Since:
0.4

Definition at line 739 of file DMResultsTemplateHelper.php.

DMResultsTemplateHelper::getHtmlViewLinks ( default_view = "grid",
separator = " | ",
array $  views = array() 
)

Renders the view toggle links that allow selection of different results view styles.

Built-in views include grid, list, and tile. It is possible to override this by overriding getHtmlResults() in a custom template helper.

Parameters:
stringdefault_view
stringseparator
arrayviews Array of arrays with "name" and "url" keys corresponding to the name of the view and the URL query string value ("?view=X") respectively (see $views as defined in the method)
Returns:
string
Since:
0.1

Definition at line 805 of file DMResultsTemplateHelper.php.

DMResultsTemplateHelper::getResultsForm ( ) [protected]
Returns:
DOMDocument

Reimplemented in DMFavoritesTemplateHelper.

Definition at line 855 of file DMResultsTemplateHelper.php.

Referenced by getHtmlResultsAsGrid(), getHtmlResultsAsList(), and getHtmlResultsAsTiles().


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables