dmBridge PHP API
SampleCustomViewer.php
00001 <?php
00002 
00009 class SampleCustomViewer extends DMAbstractViewer
00010 implements DMObjectViewerDelegate {
00011 
00017    public function viewerWillRender() {
00018       $this->getHelper()->addBodyScriptTag(
00019             dirname($_SERVER['PHP_SELF'])
00020             . "/extensions/viewers/SampleCustomViewer/myscript.js");
00021       $this->getHelper()->addStylesheetTag(
00022             dirname($_SERVER['PHP_SELF'])
00023             . "/extensions/viewers/SampleCustomViewer/mystyles.css");
00024    }
00025 
00032    public function getHTMLTag() {
00033       return sprintf(
00034          '<a href="%s">As you can see, this simple example does the same
00035             thing as DMFileLinkViewer!</a>',
00036          DMString::websafe($this->getObject()->getFileURL()));
00037    }
00038 
00042    public function getHTMLTagNoJS() {
00043       return $this->getHTMLTag();
00044    }
00045 
00049    public function getName() {
00050       return "Sample Custom Viewer";
00051    }
00052 
00053 }
 All Data Structures Functions Variables