public function hookInitialize() { add_translation_source(dirname(__FILE__) . '/languages'); $settings = unserialize(get_option('html5_media_settings')); $commonOptions = $settings['common']['options']; add_file_display_callback(array('mimeTypes' => $settings['audio']['types'], 'fileExtensions' => $settings['audio']['extensions']), 'Html5MediaPlugin::audio', $commonOptions + $settings['audio']['options']); add_file_display_callback(array('mimeTypes' => $settings['video']['types'], 'fileExtensions' => $settings['video']['extensions']), 'Html5MediaPlugin::video', $commonOptions + $settings['video']['options']); add_file_display_callback(array('mimeTypes' => $settings['text']['types'], 'fileExtensions' => $settings['text']['extensions']), 'Html5MediaPlugin::text'); }
public function testAddMimeTypes() { add_file_display_callback(array('image/jpeg'), array($this, 'mimeTypeCallback'), array('foo' => 'bar')); // File should be of the 'image/jpeg' type. $this->file->mime_type = 'image/jpeg'; $this->file->stored = '1'; $this->helper->fileMarkup($this->file); $this->assertTrue($this->mimeTypeCallbackFired, "MIME type callback should have been fired."); }
/** * Initiate this controller. */ public function init() { // Change the display strategy for certain files on the transcribe // action. if ('transcribe' == $this->getRequest()->getActionName()) { // Image viewers. switch (get_option('scripto_image_viewer')) { case 'openlayers': add_file_display_callback(ScriptoPlugin::$fileIdentifiersOpenLayers, 'ScriptoPlugin::openLayers'); break; case 'zoomit': add_file_display_callback(ScriptoPlugin::$fileIdentifiersZoomIt, 'ScriptoPlugin::zoomIt'); break; default: // Do nothing. Use Omeka default file display stategy. break; } // Google Docs viewer. if (get_option('scripto_use_google_docs_viewer')) { add_file_display_callback(ScriptoPlugin::$fileIdentifiersGoogleDocs, 'ScriptoPlugin::googleDocs'); } } }
public function hookInitialize() { add_file_display_callback(array('mimeTypes' => self::$types, 'fileExtensions' => self::$exts), 'ColorCodeSyntaxHighlighterPlugin::displayCode', self::_getSettings()); }
public function hookInitialize() { add_translation_source(dirname(__FILE__) . '/languages'); add_file_display_callback(array('mimeTypes' => self::$types, 'fileExtensions' => self::$exts), 'PdfEmbedPlugin::embedPdf', self::_getSettings()); }
<?php $pageTitle = metadata('item', array('Dublin Core', 'Title')); $style = (include __DIR__ . '/../style/' . get_theme_option('Style') . '.php'); $params = Zend_Controller_Front::getInstance()->getRequest()->getParams(); if (!empty($style['item']['show']['pictures'])) { add_file_display_callback('application/pdf', function ($file, $options) { return '<a href="' . $file->getWebPath('fullsize') . '">' . '<img src="' . $file->getWebPath('thumbnail') . '" alt="Cover"></a>' . '<div><a class="btn btn-default" href="' . $file->getWebPath('original') . '">' . __('Download PDF') . '</a></div>'; }); } if (!empty($item->collection_id)) { $collection = get_record_by_id('collection', $item->collection_id); } echo head(array('title' => $pageTitle, 'bodyclass' => 'item show', 'collection' => @$collection, 'exhibit' => @$exhibit)); ?> <?php if (!empty($exhibit)) { ?> <nav id="exhibit-pages" class="navbar navbar-default collapse navbar-collapse"> <?php echo include __DIR__ . '/../nav/exhibit-pages.php'; ?> </nav> <h1><?php echo $pageTitle; ?> </h1> <ol class="breadcrumb"> <li><?php echo exhibit_builder_link_to_exhibit();