dmBridge PHP API
DMFileLinkViewer.php
00001 <?php
00002 #
00003 # dmBridge: a data access framework for CONTENTdm(R)
00004 #
00005 # Copyright © 2009, 2010, 2011 Board of Regents of the Nevada System of Higher
00006 # Education, on behalf of the University of Nevada, Las Vegas
00007 #
00008 
00016 class DMFileLinkViewer extends DMAbstractViewer
00017 implements DMObjectViewerDelegate {
00018 
00022    public function getHTMLTag() {
00023       $filesize = $this->getObject()->getFile()->getSize();
00024       return sprintf(
00025          '<div id="dmFileLinkViewer" style="width:%s; height:%s">
00026             <a href="%s">%s <span class="dmSize">(%s)</span></a>
00027          </div>',
00028          $this->getWidth(), $this->getHeight(),
00029          DMString::websafe($this->getObject()->getFileURL()),
00030          $this->getMediaType()->getName(),
00031          $this->getObject()->getFile()->getHumanReadableSize());
00032    }
00033 
00037    public function getHTMLTagNoJS() {
00038       return $this->getHTMLTag();
00039    }
00040 
00044    public function getName() {
00045       return "File Link Viewer";
00046    }
00047 
00048 }
 All Data Structures Functions Variables