----------------------------
Omeka_View_Helper_FileMarkup
----------------------------
.. php:class:: Omeka_View_Helper_FileMarkup
Package: :doc:`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.
.. php:attr:: _callbacks
Array of MIME types and the callbacks that can process it.
Example:array('video/avi'=>'wmv');
.. php:attr:: _fileExtensionCallbacks
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
.. php:attr:: _callbackOptions
The array consists of the default options which are passed to the
callback.
.. php:method:: addMimeTypes(array|string $fileIdentifiers, $callback, array $defaultOptions = Array)
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.
:param array|string $fileIdentifiers: Set of MIME types (Internet media types) and/or file extensions that this specific callback will respond to. Accepts the following:
.. raw:: html
A string containing one MIME type:
'application/msword'
A simple array containing MIME types:
array('application/msword', 'application/doc')
A keyed array containing MIME types:
array('mimeTypes' => array('application/msword', 'application/doc'))
Note that file extensions are case sensitive.
:param unknown $callback:
:param array $defaultOptions:
:returns: void
.. php:method:: defaultDisplay(File $file, array $options = Array)
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.
:param File $file:
:param array $options:
:returns: string HTML
.. php:method:: _linkToFile(File $file, array $options, 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.
:param File $file:
:param array $options:
:param string $html:
:returns: string
.. php:method:: wmv(File $file, array $options = Array)
Retrieve valid XHTML for displaying a wmv video file or equivalent.
Currently this loads the video inside of an