dmBridge PHP API
DMGenericImageViewer.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 
00019 class DMGenericImageViewer extends DMAbstractViewer
00020       implements DMObjectViewerDelegate {
00021 
00025    public function getHTMLTag() {
00026       $alt = "Object image";
00027       if ($this->getObject()->getField("title") instanceof DMDCElement) {
00028          $alt = $this->getObject()->getField("title")->getValue();
00029       }
00030 
00031       return sprintf(
00032          '<img src="%s" class="dmGenericImageViewer" alt="%s" />',
00033          DMString::websafe(
00034             $this->getObject()->getImageURL(
00035                $this->getWidth(), $this->getHeight())),
00036          DMString::websafe($alt));
00037    }
00038 
00042    public function getHTMLTagNoJS() {
00043       return $this->getHTMLTag();
00044    }
00045 
00049    public function getName() {
00050       return "Generic Image Viewer";
00051    }
00052 
00053 }
 All Data Structures Functions Variables