dmBridge PHP API
DMObjectTemplateHelper Class Reference
Inheritance diagram for DMObjectTemplateHelper:

Public Member Functions


Detailed Description

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

This class was called ObjectDraw 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 DMObjectTemplateHelper.php.


Member Function Documentation

DMObjectTemplateHelper::getHtmlAddFavoriteButton ( )
Returns:
string HTML <span> element
Since:
0.1

Definition at line 26 of file DMObjectTemplateHelper.php.

DMObjectTemplateHelper::getHtmlChildLinksAsList ( thumbs = false)

Returns a hyperlinked ordered list of each of the pages of the current object wrapped in <li> elements. The <li> element of the current page is of class dmCurrentPage, and the <ol> element itself is of class dmChildLinks.

For compound objects with more than a few pages, you may want to put this list inside of a div that has a fixed CSS height, and overflow set to "auto", which will cause it to appear with a scrollbar, like an iframe.

Parameters:
Booleanthumbs Whether or not to append thumbnails to the pages
Returns:
string (X)HTML ordered list element
See also:
getHtmlChildLinksAsPulldown()
Since:
0.1

Definition at line 68 of file DMObjectTemplateHelper.php.

DMObjectTemplateHelper::getHtmlChildLinksAsPulldown ( )

Returns a complete HTML form with a pulldown menu consisting of each of the pages of the current object as <option> elements.

Note: This method requires that JavaScript be enabled in the browser. Using drawChildLinksAsList() instead is preferred for usability.

Returns:
string HTML form element
See also:
getHtmlChildLinksAsList()
Since:
0.1

Definition at line 106 of file DMObjectTemplateHelper.php.

DMObjectTemplateHelper::getHtmlCommentsSection ( )

Draws the HTML for the comments section.

The HTML structure will vary depending on whether the object has any comments, and whether commenting is enabled.

Returns:
string HTML <form> element
Since:
0.1

Definition at line 144 of file DMObjectTemplateHelper.php.

DMObjectTemplateHelper::getHtmlCompoundObjectPageNumbersInSearchResultsAsString ( separator = ", ")
Parameters:
stringseparator
Returns:
string
Since:
0.1

Definition at line 284 of file DMObjectTemplateHelper.php.

DMObjectTemplateHelper::getHtmlCompoundObjectSearchForm ( button_text = "Search Object Text")
Parameters:
stringbutton_text
Returns:
An HTML form for searching the compound object, or false if the object is not a compound object; has no full text; or has no pages.
Since:
0.1

Definition at line 247 of file DMObjectTemplateHelper.php.

DMObjectTemplateHelper::getHtmlCompoundPageFlipLinks ( separator = " | ",
prev_page_link = "< Previous Page",
next_page_link = "Next Page >" 
)

Provides navigation links between compound object pages.

Parameters:
stringseparator
stringprev_page_link
stringnext_page_link
Returns:
string
Since:
0.1

Definition at line 319 of file DMObjectTemplateHelper.php.

DMObjectTemplateHelper::getHtmlDownloadImageLink ( resolutions = array(800, 1200, 1600),
separator = " | " 
)
Parameters:
DMObjectobj
arrayresolutions Indexed array of maximum pixel resolutions of the longest side of the image
stringseparator
Returns:
Series of HTML anchor tags of class "dmDownloadLink" if $obj is an image object; or an empty string if not
Since:
0.1

Definition at line 366 of file DMObjectTemplateHelper.php.

DMObjectTemplateHelper::getHtmlHighlightedFullText ( )

Outputs text with highlighted terms in <span> elements with class "dmHighlightedTerm".

Simply apply the CSS background-color property - or whatever other properties you like - to this class.

Returns:
string HTML-escaped string
Since:
0.1

Definition at line 386 of file DMObjectTemplateHelper.php.

DMObjectTemplateHelper::getHtmlMetadataAsDL ( ctrld_term_separator = null,
link_ctrld_terms_to_view = null,
add_link_to_feed = true,
omit_title = false,
DMObject object = null,
hyperlink_urls = true 
)

Returns object metadata in an HTML definition list, which is probably the most semantic way to mark it up using the HTML element set.

This list can be styled with CSS. Fields that are set as both searchable and controlled in CONTENTdm® are automatically hyperlinked to searches.

Parameters:
stringctrld_term_separator Character or character sequence that should separate controlled terms
[string|null|false]link_ctrld_terms_to_view One of 'grid', 'list', 'tile', null (use default view), or false (don't link them)
Booleanadd_link_to_feed
Booleanomit_title Whether to omit the title field
DMObjectAn optional DMObject whose metadata to display. If null or not provided, the current DMObject's metadata is displayed.
hyperlink_urlsWhether to add <a> tags around URLs in metadata
Returns:
string
Since:
0.1

Definition at line 416 of file DMObjectTemplateHelper.php.

DMObjectTemplateHelper::getHtmlMetadataAsMetaTags ( )

Returns object metadata as HTML meta tags.

Returns:
string
Since:
0.3

Definition at line 520 of file DMObjectTemplateHelper.php.

DMObjectTemplateHelper::getHtmlPreviousNextLinks ( separator = " | ",
prev_text = "< Previous",
next_text = "Next >" 
)
Parameters:
stringseparator
stringprev_text
stringnext_text
Returns:
string A set of HTML anchor elements separated by the $separator string.
Since:
0.1

Definition at line 552 of file DMObjectTemplateHelper.php.

DMObjectTemplateHelper::getHtmlRatingsSection ( min,
max,
multiple_of,
decimal_places = 2 
)
Parameters:
intmin
intmax
floatmultiple_of
intdecimal_places Ratings will be rounded to this many decimal places for display
Returns:
string HTML form element
Since:
0.1

Definition at line 596 of file DMObjectTemplateHelper.php.

DMObjectTemplateHelper::getHtmlResultsAsUL ( thumbs = false,
max = 5 
)

Returns an ordered list containing objects from the most recently viewed results list.

Parameters:
Booleanthumbs Whether or not to display object thumbnails
intmax If larger than the number of results appearing on the last results view page, that number will be used instead
Returns:
string HTML ordered list
Since:
0.3

Definition at line 653 of file DMObjectTemplateHelper.php.

DMObjectTemplateHelper::getHtmlTaggingSection ( )
Returns:
string HTML form element, or an HTML comment if a data store is not available
Since:
0.3

Definition at line 716 of file DMObjectTemplateHelper.php.

DMObjectTemplateHelper::getHtmlViewer ( width = null,
height = null,
js = true 
)
Parameters:
intwidth Width override (normally, width should be set in the Control Panel)
intheight Height override (normally, height should be set in the Control Panel)
booljs Whether to include required JavaScript code. If false, you must manually include the necessary code in the template.
Returns:
string HTML tag
Since:
0.1
Deprecated:
The js parameter is deprecated. Please avoid using it.

Definition at line 756 of file DMObjectTemplateHelper.php.


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