Package: View\Helper
View Helper for displaying files through Omeka.
This will determine how to display any given file based on the MIME type(Internet media type) of that file. Individual rendering agents are definedby callbacks that are either contained within this class or defined byplugins. Callbacks defined by plugins will override native class methods ifdefined for existing MIME types. In order to define a rendering callback thatshould be in the core of Omeka, define a method in this class and then makesure that it responds to all the correct MIME types by modifying otherproperties in this class.
Array of MIME types and the callbacks that can process it.
Example:array(‘video/avi’=>’wmv’);
Array of file extensions and the callbacks that can process them.
Taken from http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
The array consists of the default options which are passed to the callback.
Add MIME types and/or file extensions and associated callbacks to the list.
This allows plugins to override/define ways of displaying specific files.The most obvious example of where this would come in handy is to defineways of displaying uncommon files, such as QTVR, or novel ways ofdisplaying more common files, such as using iPaper to display PDFs.
Parameters: |
|
---|---|
Returns: | void |
Default display for MIME types that do not have a valid rendering callback.
This wraps the original filename in a link to download that file, with aclass of “download-file”. Any behavior more complex than that should beprocessed with a valid callback.
Parameters: |
|
---|---|
Returns: | string HTML |
Add a link for the file based on the given set of options.
If the ‘linkToMetadata’ option is true, then link to the filemetadata page (files/show). If ‘linkToFile’ is true,link to the original file, and if ‘linkToFile’ is a string, tryto link to that specific derivative. Otherwise just return the$html without wrapping in a link.
The attributes for the link will be based off the ‘linkAttributes’ option, which should be an array.
If $html is null, it defaults to original filename of the file.
Parameters: |
|
---|---|
Returns: | string |
Retrieve valid XHTML for displaying a wmv video file or equivalent. Currently this loads the video inside of an <object> tag, but that provides less flexibility than a flash wrapper, which seems to be a standard Web2.0 practice for video sharing. This limitation can be overcome by a plugin that used a flash wrapper for displaying video.
Parameters: |
|
---|---|
Returns: | string |
Retrieve valid XHTML for displaying a wma audio file or equivalent. Currently this loads the video inside of an <object> tag, but that provides less flexibility than a flash wrapper, which seems to be a standard Web2.0 practice for video sharing. This limitation can be overcome by a plugin that used a flash wrapper for displaying video.
Parameters: |
|
---|---|
Returns: | string |
Retrieve valid XHTML for displaying Quicktime video files
Parameters: |
|
---|---|
Returns: | string |
Default display of audio files via <object> tags.
Parameters: |
|
---|---|
Returns: | string |
Display OGG audio files.
Parameters: |
|
---|---|
Returns: | string |
Display MP3/MPEG audio files.
Parameters: |
|
---|---|
Returns: | string |
Display AAC audio files.
Parameters: |
|
---|---|
Returns: | string |
Display AIFF audio files.
Parameters: |
|
---|---|
Returns: | string |
Display MIDI audio files.
Parameters: |
|
---|---|
Returns: | string |
Display MP4 audio files.
Parameters: |
|
---|---|
Returns: | string |
Display WAV audio files.
Parameters: |
|
---|---|
Returns: | string |
Default display of an icon to represent a file.
Example usage:
echo files_for_item(array(‘showFilename’=>false,’linkToFile’=>false,’linkAttributes’=>array(‘rel’=>’lightbox’),’filenameAttributes’=>array(‘class’=>’error’),’imgAttributes’=>array(‘id’=>’foobar’),’icons’ => array(‘audio/mpeg’=>img(‘audio.gif’))));
Parameters: |
|
---|---|
Returns: | string |
Returns valid XHTML markup for displaying an image that has been stored in Omeka.
Parameters: |
|
---|---|
Returns: | string HTML for display |
Parameters: |
|
---|
Parameters: |
|
---|---|
Returns: | array |
Retrieve the HTML for a given file from the callback.
Parameters: |
|
---|---|
Returns: | string HTML for displaying the file. |
Bootstrap for the helper class. This will retrieve the HTML for displaying the file and by default wrap it in a <div class=”item-file”>.
Parameters: |
|
---|---|
Returns: | string HTML |
Return a valid img tag for an image.
Parameters: |
|
---|---|
Returns: | string |
Get a string key to represent a given callback.
This key can be used to store and retrieve data about thecallback, like default options.
Parameters: |
|
---|---|
Returns: | string |